@dcl/shop 0.5.0 → 0.5.1-30936450524.commit-699b9ba

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 (185) hide show
  1. package/_assets/Activity-BNdtDMvf.js +336 -0
  2. package/_assets/{AnimatedBackground-C4vGO85y.js → AnimatedBackground-DtccR1Yr.js} +2 -2
  3. package/_assets/{Assets-DUB4VCUr.js → Assets-BPmdORes.js} +11 -11
  4. package/_assets/{Assets.styles-DIh1hG4_.js → Assets.styles-DGFYQnxw.js} +1 -1
  5. package/_assets/{Authorizations-gse9z0i5.js → Authorizations-DxyGJ4g6.js} +3 -3
  6. package/_assets/{Cart-xOvVoYwp.js → Cart-BK5UrFhK.js} +6 -6
  7. package/_assets/{CircularProgress-BZT_u7sL.js → CircularProgress-DdEjsaZL.js} +1 -1
  8. package/_assets/{Collection-DkMWDyM9.js → Collection-DqFConie.js} +7 -7
  9. package/_assets/{CollectionCarousel-D-7TqEHy.js → CollectionCarousel-ChFXFBmM.js} +7 -7
  10. package/_assets/{Creator-CIj-i2cJ.js → Creator-DrGLyYfy.js} +9 -9
  11. package/_assets/{ErrorNotice-qXSCgBBe.js → ErrorNotice-BCKaFzga.js} +1 -1
  12. package/_assets/{ExchangeController-CoWk4iJ_.js → ExchangeController-CvylFMia.js} +1 -1
  13. package/_assets/{GetCredits-91dR46BQ.js → GetCredits-Dw4w8acm.js} +7 -7
  14. package/_assets/{HelpersUtil-B_EI8lTR.js → HelpersUtil-_HSkzV2T.js} +1 -1
  15. package/_assets/{ItemDetail-DneK31a0.js → ItemDetail-Dxa9T_S-.js} +489 -324
  16. package/_assets/{LoadMore-CPg41rwp.js → LoadMore-D8E5F-8f.js} +1 -1
  17. package/_assets/ManaPricingBanner.styles-DTnTTvyO.js +74 -0
  18. package/_assets/{MenuList-D5E4Wrvx.js → MenuList-Jtp545Fi.js} +1 -1
  19. package/_assets/MyAssets-Db0d2mYm.js +381 -0
  20. package/_assets/{MyFavorites-CfsWFXpI.js → MyFavorites-B581Hpf-.js} +2 -2
  21. package/_assets/{NotFound-DVmSPOa9.js → NotFound-B5YyPIK4.js} +1 -1
  22. package/_assets/{NotificationsBell-C_HZmA4_.js → NotificationsBell-8HxMRP0q.js} +1 -1
  23. package/_assets/OutfitDetail-cz6cQtz6.js +326 -0
  24. package/_assets/OutfitPreview-CU2mgvnt.js +6 -0
  25. package/_assets/{OutfitStudio-D6HxPa0M.js → OutfitStudio-_HyedkEg.js} +50 -50
  26. package/_assets/{StoreSettings-CmI6OJyt.js → StoreSettings-BGKiUIzy.js} +9 -9
  27. package/_assets/{Success-CILFVgai.js → Success-RigWZOgD.js} +6 -6
  28. package/_assets/{SwapController-BtZYC1DC.js → SwapController-BivMb2kn.js} +1 -1
  29. package/_assets/{Tooltip-D-dOz9cj.js → Tooltip-BFF2_vlu.js} +1 -1
  30. package/_assets/{TradeService-DFGHQuam.js → TradeService-0TCYki7R.js} +1 -1
  31. package/_assets/{W3MFrameProviderSingleton-Dd3fipah.js → W3MFrameProviderSingleton-B0Higky5.js} +3 -3
  32. package/_assets/{WebCryptoP256-83ZQlmY9.js → WebCryptoP256-CGkaFniB.js} +1 -1
  33. package/_assets/{authorizations-3-Mq1Ehl.js → authorizations-zc6Rq7Wn.js} +1 -1
  34. package/_assets/{basic-BndfWYou.js → basic-DttMuloT.js} +1 -1
  35. package/_assets/{biconomy-UoaVnBXL.js → biconomy-D4i00Lfc.js} +1 -1
  36. package/_assets/{browseLayout.styles-C2XsX59Z.js → browseLayout.styles-BdkLZM96.js} +4 -4
  37. package/_assets/{builder-BCsqID1m.js → builder-D5fMO9fl.js} +1 -1
  38. package/_assets/{buy-gasless-Cf6hPQpJ.js → buy-gasless-e__YZBZy.js} +1 -1
  39. package/_assets/buy-hkJbpiOY.js +1 -0
  40. package/_assets/{categories-CJDomWri.js → categories-B569rNQU.js} +1 -1
  41. package/_assets/{ccip-DL1ik4S_.js → ccip-CCidJiYF.js} +1 -1
  42. package/_assets/{ccip-LyTNGN_g.js → ccip-CJTcr6Ak.js} +1 -1
  43. package/_assets/{clsx-CbhzNwHc.js → clsx-DSmAtJIx.js} +2 -2
  44. package/_assets/{controller-DI4T8YXU.js → controller-CMLpEAq8.js} +2 -2
  45. package/_assets/{core-DLkqCpDz.js → core-BIMKRKLD.js} +4 -4
  46. package/_assets/{createSvgIcon-BdIjzl8A.js → createSvgIcon-mO6bQXvS.js} +1 -1
  47. package/_assets/{custom-DjHlYa2L.js → custom-VPCzWEDJ.js} +1 -1
  48. package/_assets/{data-capture-CCEqsOVC.js → data-capture-NhUWYbV9.js} +1 -1
  49. package/_assets/{email-MyVfElwc.js → email-Clto1rbh.js} +1 -1
  50. package/_assets/{embedded-wallet-DGKPNmRz.js → embedded-wallet-t8b4yu9z.js} +1 -1
  51. package/_assets/{emotion-styled.browser.esm-B-KYMSCc.js → emotion-styled.browser.esm-DnvNBX1u.js} +1 -1
  52. package/_assets/{engine-P4mrsX3-.js → engine-DLv8fLGx.js} +1 -1
  53. package/_assets/{errors-B5G852-H.js → errors-CZnCfZdx.js} +1 -1
  54. package/_assets/{estimate-l1-fee-CZTQo2Yh.js → estimate-l1-fee-CJ4pO8UF.js} +1 -1
  55. package/_assets/{execute-CqlntYG8.js → execute-DlPcikaV.js} +2 -2
  56. package/_assets/{features-BstqY0d8.js → features-BxKqKAM5.js} +1 -1
  57. package/_assets/{fetchTokenMetadata-wr3bODuw.js → fetchTokenMetadata-w38JAtHF.js} +2 -2
  58. package/_assets/{field.styles-CeFk4Y5o.js → field.styles-CFlKswg7.js} +1 -1
  59. package/_assets/{get-ecosystem-wallet-info-BmrdD1ZM.js → get-ecosystem-wallet-info-VnVOeJ1z.js} +1 -1
  60. package/_assets/{getBalance-CGp1VbNi.js → getBalance-on_xo7HU.js} +1 -1
  61. package/_assets/{getNFT-BATtEfMr.js → getNFT-CRTR8WTI.js} +1 -1
  62. package/_assets/{getNFT-Bc7mOqON.js → getNFT-CWzo03nA.js} +1 -1
  63. package/_assets/{getThemeProps-Cj1ePFOP.js → getThemeProps-B8B_-Rbo.js} +1 -1
  64. package/_assets/{grid.styles-4uR2Oqak.js → grid.styles-BZkFiBLS.js} +1 -1
  65. package/_assets/{hashTypedData-DmaIP4Ta.js → hashTypedData-BH6OTW-d.js} +1 -1
  66. package/_assets/{hashTypedData--isNjJrk.js → hashTypedData-DRMGHRZ0.js} +1 -1
  67. package/_assets/{in-app-DkfGauuN.js → in-app-Vc6OIIzS.js} +1 -1
  68. package/_assets/{in-app-wallet-calls-_oAp4gRk.js → in-app-wallet-calls-KLGGFOPI.js} +1 -1
  69. package/_assets/{index-Jw4WyTL7.js → index-0nqA1JJF.js} +1 -1
  70. package/_assets/{index-hxv9huma.js → index-4zQsq3fd.js} +1 -1
  71. package/_assets/{index-B4VZ6oCr.js → index-5ACH-P5G.js} +1 -1
  72. package/_assets/{index-CNLdKmSV.js → index-6yxWjL1L.js} +2 -2
  73. package/_assets/{index-B0XZJoRs.js → index-8RpSVOTx.js} +3 -3
  74. package/_assets/{index-UOqdWcGo.js → index-B-wQ0paE.js} +1 -1
  75. package/_assets/{index-B08mxqyH.js → index-BCJi5oKJ.js} +1 -1
  76. package/_assets/{index-DwhWwt0R.js → index-BKEDzKNY.js} +1 -1
  77. package/_assets/{index-TXpJyzEO.js → index-BPaO_ntB.js} +1 -1
  78. package/_assets/{index-DCcvZO5Y.js → index-BQwGj32K.js} +1 -1
  79. package/_assets/{index-pUOx764A.js → index-BS6iKClO.js} +1 -1
  80. package/_assets/{index-Rzy39Nn7.js → index-BhObZWWG.js} +1 -1
  81. package/_assets/{index-B3qntzSb.js → index-BkDkQWWI.js} +1 -1
  82. package/_assets/{index-B9aCuD80.js → index-BqF97xZA.js} +1 -1
  83. package/_assets/{index-CAtB_PCp.js → index-C-amGj-7.js} +2 -2
  84. package/_assets/{index-BYndrnYs.js → index-C1U7eBbq.js} +1 -1
  85. package/_assets/{index-DA6dfZrr.js → index-C2GPCavy.js} +1 -1
  86. package/_assets/{index-BHPckyG6.js → index-C2q4KTdy.js} +1 -1
  87. package/_assets/{index-DYIatsEA.js → index-C7ek7oob.js} +1 -1
  88. package/_assets/{index-qOIpyDqw.js → index-CI0UD5dV.js} +3 -3
  89. package/_assets/{index-DYJqGaxj.js → index-CJLFJ36W.js} +2 -2
  90. package/_assets/{index-DG2jERXm.js → index-CNboH-3O.js} +1 -1
  91. package/_assets/{index-g7yoq537.js → index-Cdvi3pNM.js} +2 -2
  92. package/_assets/{index-DMfeEICj.js → index-Ceegzko5.js} +1 -1
  93. package/_assets/{index-CwgAx_D_.js → index-CgA-OcG0.js} +1 -1
  94. package/_assets/{index-DiwV8Pqc.js → index-Ch8J3QK6.js} +1 -1
  95. package/_assets/{index-CKuDkHtx.js → index-Cmdx7DKx.js} +1 -1
  96. package/_assets/{index-9uXo0dDW.js → index-CqPO5kHJ.js} +1 -1
  97. package/_assets/{index-D-cwjSAX.js → index-CuziOquE.js} +3 -3
  98. package/_assets/{index-6-oWZZKk.js → index-CzmJnQZH.js} +1 -1
  99. package/_assets/index-D-7WCtxn.js +3482 -0
  100. package/_assets/{index-GIpFWU31.js → index-D5RD0vxf.js} +1 -1
  101. package/_assets/{index-COG_bMzA.js → index-DBZVIZHo.js} +1 -1
  102. package/_assets/{index-BQJhzjgB.js → index-DHBnEMAt.js} +1 -1
  103. package/_assets/{index-bI7YB81Q.js → index-DOPFlRgN.js} +1 -1
  104. package/_assets/{index-wLhUVrXT.js → index-DYWfNXUa.js} +1 -1
  105. package/_assets/{index-BlqD0sjz.js → index-DkuxSwEU.js} +1 -1
  106. package/_assets/{index-TyIfm5pC.js → index-DmTmwD6t.js} +1 -1
  107. package/_assets/{index-Df_MtlRn.js → index-DtsO_iTE.js} +1 -1
  108. package/_assets/{index-DARDndd8.js → index-DxHGh86B.js} +1 -1
  109. package/_assets/{index-DXe6U5Nd.js → index-GDLtMazN.js} +1 -1
  110. package/_assets/{index-BQEMTtHk.js → index-Te89Gq1W.js} +1 -1
  111. package/_assets/{index-Bq3RaeMg.js → index-Umj2Vke8.js} +1 -1
  112. package/_assets/{index-6TyUCKeH.js → index-WAyEz3yq.js} +1 -1
  113. package/_assets/{index-BmlqG1wa.js → index-_KNtvZ03.js} +1 -1
  114. package/_assets/{index-hFWlaYZc.js → index-cz6Rqk8W.js} +1 -1
  115. package/_assets/{index-DA_UmuJW.js → index-eog29CgL.js} +2 -2
  116. package/_assets/{index-CVTYXB-H.js → index-irGTnSKf.js} +1 -1
  117. package/_assets/{index-a7lLIynB.js → index-jHpuKYUW.js} +1 -1
  118. package/_assets/{index-DI6mFHN_.js → index-oBbODxgD.js} +1 -1
  119. package/_assets/index-vsp2ePXO.js +472 -0
  120. package/_assets/{index-BF4F4-es.js → index-xtIMpr9r.js} +1 -1
  121. package/_assets/{index.es-DSBJgnik.js → index.es-B7JVZeTo.js} +4 -4
  122. package/_assets/{index.es-CleSpdBe.js → index.es-CGbqEV93.js} +1 -1
  123. package/_assets/{index.es-DcH5dh4Z.js → index.es-ClM1Q4-S.js} +1 -1
  124. package/_assets/{localBatchGatewayRequest-BQaanzyf.js → localBatchGatewayRequest-CKHM638r.js} +1 -1
  125. package/_assets/{mana-convert-gdOzEDdP.js → mana-convert-dJqmfJfM.js} +1 -1
  126. package/_assets/{networks-DweEIHqd.js → networks-D4B8rcMf.js} +1 -1
  127. package/_assets/{onramp-CQin_sc0.js → onramp-BAAYO5Xz.js} +1 -1
  128. package/_assets/{openzeppelin-aL0pLCk3.js → openzeppelin-tyZlnFgc.js} +1 -1
  129. package/_assets/{parseNft-C3_Nz5T-.js → parseNft-DmVgwo4R.js} +2 -2
  130. package/_assets/{parseSignature-DbUWX_0J.js → parseSignature-CCUgv0Xf.js} +1 -1
  131. package/_assets/{parseSignature-CaUNRWNX.js → parseSignature-Cz4DXMg4.js} +3 -3
  132. package/_assets/{passkeys-ErJmNcK7.js → passkeys-B-SLcTQC.js} +1 -1
  133. package/_assets/{pay-with-exchange-IR4P3LG2.js → pay-with-exchange-CPF4Xyar.js} +1 -1
  134. package/_assets/{qr-overlay-CdnDwp_H.js → qr-overlay-CCgl-rQv.js} +1 -1
  135. package/_assets/{receive-zGMAuzLF.js → receive-CtyJrIps.js} +1 -1
  136. package/_assets/{resolveImplementation-DBCwfUsj.js → resolveImplementation-BWEbVpHA.js} +1 -1
  137. package/_assets/{rpc-DcBDiZd9.js → rpc-9WGO6xiN.js} +1 -1
  138. package/_assets/{secp256k1-Dw0WpBX5.js → secp256k1-2RfA0szs.js} +1 -1
  139. package/_assets/{secp256k1-Dewsd8iM.js → secp256k1-CFrW1Y2s.js} +1 -1
  140. package/_assets/{secp256k1-B-E-jiWl.js → secp256k1-pmcASsb-.js} +1 -1
  141. package/_assets/{send-DDT-5Y8C.js → send-CMNbsrhM.js} +1 -1
  142. package/_assets/{send-batch-transaction-BurBPeh7.js → send-batch-transaction-D75RDx36.js} +1 -1
  143. package/_assets/{send-eip712-transaction-D77WUDwd.js → send-eip712-transaction-BQazlaNl.js} +2 -2
  144. package/_assets/{send-gasless-transaction-CIWAOyRc.js → send-gasless-transaction-DjoFh0d8.js} +2 -2
  145. package/_assets/{send-transaction-BXhwaD9S.js → send-transaction-CVFVkU0Z.js} +2 -2
  146. package/_assets/{sendMetaTransaction-CrIt0KCG.js → sendMetaTransaction-BAlAehuy.js} +1 -1
  147. package/_assets/{sendRawTransaction-DNK5LA13.js → sendRawTransaction-C4U7kCvT.js} +3 -3
  148. package/_assets/{serializeTransaction-D3WekrgC.js → serializeTransaction-DaaHRnn4.js} +1 -1
  149. package/_assets/{session-proposal-BlosSPbJ.js → session-proposal-B8JSXkYh.js} +1 -1
  150. package/_assets/{session-request-C8iYxI6j.js → session-request-CVuIL0x8.js} +2 -2
  151. package/_assets/{signing-Bx48W7O-.js → signing-CoqvM4v0.js} +3 -3
  152. package/_assets/{socials-BSmNv258.js → socials-Ci3QFil3.js} +1 -1
  153. package/_assets/{swaps-DyNopWtM.js → swaps-Bk85njMT.js} +1 -1
  154. package/_assets/{thirdweb-Bc1voIUm.js → thirdweb-CTwUbVaf.js} +3 -3
  155. package/_assets/{to-serializable-transaction-BXY289Ul.js → to-serializable-transaction-BHWda6_Z.js} +2 -2
  156. package/_assets/{trade-encoding-B7y8VfDo.js → trade-encoding-BDt5HS0k.js} +1 -1
  157. package/_assets/{transactionReceipt-DLzKebEg.js → transactionReceipt-DVIb0l0k.js} +1 -1
  158. package/_assets/{transactions-BWXAu1Vp.js → transactions-Dk1TKJgv.js} +1 -1
  159. package/_assets/{useCreditPacks-CYnMKZmp.js → useCreditPacks-BM-De58w.js} +1 -1
  160. package/_assets/useImportable-Ce98Ar0U.js +1 -0
  161. package/_assets/{useInfiniteGrid-ottWIC3k.js → useInfiniteGrid-_3YA45kU.js} +1 -1
  162. package/_assets/useManaRate-Co5_bB5U.js +1 -0
  163. package/_assets/{useStore-DC77ufHd.js → useStore-DYpF-pdm.js} +1 -1
  164. package/_assets/{useTheme-BOb3XgSe.js → useTheme-Br5XE3ab.js} +1 -1
  165. package/_assets/{verifyHash-B6wVUzvm.js → verifyHash-CJn902Qe.js} +1 -1
  166. package/_assets/{w3m-modal-CYIABu52.js → w3m-modal-Bq4uD3cn.js} +1 -1
  167. package/_assets/{w3m-modal-D0DQYwij.js → w3m-modal-iwn664AW.js} +1 -1
  168. package/_assets/{wait-for-tx-receipt-CzEApn7N.js → wait-for-tx-receipt-mVLKSavl.js} +1 -1
  169. package/_assets/{wallets-CQPQ_gpR.js → wallets-CUhTDJCi.js} +5 -5
  170. package/_assets/{web-connector-B5U5FrL8.js → web-connector-1E0uyUrr.js} +3 -3
  171. package/_assets/{writeContract-CGlJd1QG.js → writeContract-DDr9VQLH.js} +1 -1
  172. package/_assets/{zoraTestnet-pKTbhMUO.js → zoraTestnet-JZ6ZNHig.js} +1 -1
  173. package/index.html +11 -11
  174. package/package.json +2 -2
  175. package/_assets/Activity-GNtRBDkH.js +0 -291
  176. package/_assets/ImportListings-DrIx4tN-.js +0 -472
  177. package/_assets/ItemPreview.styles--MP-O7tE.js +0 -166
  178. package/_assets/ManaPricingBanner.styles-4CDYw79q.js +0 -74
  179. package/_assets/MyAssets-C29gKaZs.js +0 -381
  180. package/_assets/OutfitDetail-BCkHFvPX.js +0 -357
  181. package/_assets/OutfitPreview-XyEsGBYa.js +0 -6
  182. package/_assets/buy-Bs_G6nfA.js +0 -1
  183. package/_assets/index-CEec1iYe.js +0 -3476
  184. package/_assets/mana-rate-DFh9C_O1.js +0 -1
  185. package/_assets/useManaRate-CPn6JNFj.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as le,s as i,b as s,ao as de,aZ as sa,an as na,I as O,p as Mt,a9 as Ne,m as ia,L as Q,ab as dt,n as ra,u as oa,a_ as ca,q as da,a$ as la,b0 as ua,b1 as ha,b2 as pa,o as ga,b3 as lt,O as G,b4 as ut,b5 as xa,j as ae,c as ht,b6 as ma,d as fa,b7 as pt,b8 as Re,b9 as ye,ba as be,bb as gt,g as ve,e as ya,C as We,bc as ba}from"./index-CEec1iYe.js";import{M as va,S as wa,C as Ca,H as ja,a as ka,T as $a,X as Sa,b as Ma,B as Ta,c as Ia,d as xt,e as Pa,f as ke,P as Tt,m as za,g as Aa,h as Ea,i as qa,j as It,k as $e,L as _a,l as Ba,n as mt,o as ft,W as Ra,p as Wa,q as Fa,A as La,r as Ka,s as Ua,t as Na,u as Qa,v as Oa,w as Ha,x as Va,y as Ga,z as Da,D as Ya,E as Ja,F as Xa,G as Za,I as es,J as ts,K as Fe,N as as,O as ss,Q as ns,R as is,U as yt,V as bt,Y as rs,Z as os,_ as cs}from"./CollectionCarousel-D-7TqEHy.js";import{u as ds}from"./useManaRate-CPn6JNFj.js";import{r as ls}from"./mana-rate-DFh9C_O1.js";import{j as us,k as hs,h as ps,n as gs,i as xs,A as ms}from"./authorizations-3-Mq1Ehl.js";import{u as fs,g as ys,b as Le}from"./buy-Bs_G6nfA.js";import{b as bs,w as vs,S as vt,G as ws}from"./buy-gasless-Cf6hPQpJ.js";import{u as Cs,M as js,R as we,r as ks,c as $s,p as wt}from"./useCreditPacks-CYnMKZmp.js";import{i as Ss,a as Ms}from"./errors-B5G852-H.js";import{E as Ts}from"./ErrorNotice-qXSCgBBe.js";import{u as Ct}from"./mana-convert-gdOzEDdP.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-B7y8VfDo.js";import"./sendMetaTransaction-CrIt0KCG.js";const{colors:se,radius:Is}=le,Ps=i.div`
1
+ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as le,s as i,b as s,ar as de,a_ as sa,aq as na,I as O,w as Mt,ac as Ne,q as ia,O as Q,ae as dt,n as ra,u as oa,a$ as ca,x as da,b0 as la,b1 as ua,b2 as ha,b3 as pa,v as ga,b4 as lt,R as G,b5 as ut,b6 as xa,j as ae,c as ht,b7 as ma,C as fa,b8 as pt,b9 as Be,ba as ye,bb as be,bc as gt,g as ve,d as ya,e as We,bd as ba}from"./index-D-7WCtxn.js";import{M as va,S as wa,C as Ca,H as ja,a as ka,T as $a,X as Sa,b as Ma,B as Ta,c as Ia,d as xt,e as Pa,f as ke,P as Tt,m as za,g as Aa,h as Ea,i as qa,j as It,k as $e,L as Ra,l as _a,n as mt,o as ft,W as Ba,p as Wa,q as Fa,A as La,r as Ka,s as Ua,t as Na,u as Qa,v as Oa,w as Ha,x as Va,y as Ga,z as Da,D as Ya,E as Ja,F as Xa,G as Za,I as es,J as ts,K as Fe,N as as,O as ss,Q as ns,R as is,U as yt,V as bt,Y as rs,Z as os,_ as cs}from"./CollectionCarousel-ChFXFBmM.js";import{u as ds}from"./useManaRate-Co5_bB5U.js";import{u as ls,r as us,g as hs,b as Le}from"./buy-hkJbpiOY.js";import{j as ps,k as gs,e as xs,n as ms,f as fs,A as ys}from"./authorizations-zc6Rq7Wn.js";import{b as bs,w as vs,S as vt,G as ws}from"./buy-gasless-e__YZBZy.js";import{u as Cs,M as js,R as we,r as ks,c as $s,p as wt}from"./useCreditPacks-BM-De58w.js";import{i as Ss,a as Ms}from"./errors-CZnCfZdx.js";import{E as Ts}from"./ErrorNotice-BCKaFzga.js";import{u as Ct}from"./mana-convert-dJqmfJfM.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BDt5HS0k.js";import"./sendMetaTransaction-BAlAehuy.js";const{colors:se,radius:Is}=le,Ps=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 ta,b as aa}from"./react-DehiWSvs.js";import{t
58
58
  font-weight: 700;
59
59
  color: ${se.text};
60
60
  }
61
- `,_s="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/buy-error-22UunaPC.png";function Bs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(va,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(wa,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Ca,{"data-tall":Y||void 0,children:[e.jsxs(ja,{children:[e.jsxs(ka,{children:[e.jsx($a,{children:D}),!W&&e.jsx(Sa,{onClick:z,"aria-label":s("buyModal.close"),children:e.jsx(Ma,{})})]}),e.jsxs(Ta,{children:[e.jsx(Ia,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Pa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),de(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=za(o.totalCents??0,o.totalManaWei??0n);return A!=null?s("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(Ws,{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(ke,{children:[e.jsxs(Aa,{"data-testid":"buy-error",children:[e.jsx(Ea,{src:_s,alt:"",width:64,height:80}),e.jsxs(qa,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:z,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"purple",onClick:o.onRetry??z,children:s("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?s("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(_a,{src:sa,alt:"",width:61,height:61}),e.jsx(Ba,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{})})]})}function Ws({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(ke,{children:[e.jsxs(Ra,{"data-testid":"nofunds-warning",children:[e.jsx(Wa,{}),e.jsxs(Fa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",s("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(La,{children:[e.jsx(Ka,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ua,{children:[e.jsxs("div",{children:[e.jsxs(Na,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(Es,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Qa,{address:n.item.creator}):null]}),e.jsxs(Oa,{children:[e.jsx(Ha,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Va,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ga,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Da,{}),e.jsx(Ya,{children:de(n.credits)}),e.jsxs(Ja,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Xa,{children:[e.jsxs(Za,{children:[e.jsx(es,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ts,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:Y,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:D,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=le,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
61
+ `,Rs="https://cdn.decentraland.org/@dcl/shop/0.5.1-30936450524.commit-699b9ba/_assets/buy-error-22UunaPC.png";function _s(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?s("cartCheckout.errorTitle"):l==="nofunds"?s("cartCheckout.titleNoFunds"):l==="choose"?s("buyModal.choosePayment"):s("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(va,{role:"dialog","aria-modal":"true","aria-label":s("cartCheckout.dialogAria"),children:[e.jsx(wa,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Ca,{"data-tall":Y||void 0,children:[e.jsxs(ja,{children:[e.jsxs(ka,{children:[e.jsx($a,{children:D}),!W&&e.jsx(Sa,{onClick:z,"aria-label":s("buyModal.close"),children:e.jsx(Ma,{})})]}),e.jsxs(Ta,{children:[e.jsx(Ia,{children:l==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(xt,{}),e.jsx(Pa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:s("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(xt,{}),de(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=za(o.totalCents??0,o.totalManaWei??0n);return A!=null?s("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(Ws,{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(ke,{children:[e.jsxs(Aa,{"data-testid":"buy-error",children:[e.jsx(Ea,{src:Rs,alt:"",width:64,height:80}),e.jsxs(qa,{children:[e.jsx("b",{children:s("cartCheckout.errorHeadline")})," ",o.message??s("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:z,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"purple",onClick:o.onRetry??z,children:s("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?s("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):s("buyModal.confirmToContinue"):s("buyModal.completingTransaction"):o==="settling"?s("buyModal.completingTransaction"):s("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(Ra,{src:sa,alt:"",width:61,height:61}),e.jsx(_a,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(mt,{"aria-hidden":!0,children:e.jsx(ft,{})})]})}function Ws({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(ke,{children:[e.jsxs(Ba,{"data-testid":"nofunds-warning",children:[e.jsx(Wa,{}),e.jsxs(Fa,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",s("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(La,{children:[e.jsx(Ka,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ua,{children:[e.jsxs("div",{children:[e.jsxs(Na,{title:n.item.name,children:[n.item.name||s("buyModal.itemFallback"),L>1?e.jsx(Es,{children:s("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Qa,{address:n.item.creator}):null]}),e.jsxs(Oa,{children:[e.jsx(Ha,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Va,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ga,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Da,{}),e.jsx(Ya,{children:de(n.credits)}),e.jsxs(Ja,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(Xa,{children:[e.jsxs(Za,{children:[e.jsx(es,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ts,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx($e,{"data-variant":"outline",onClick:Y,children:s("buyModal.cancel")}),e.jsx($e,{"data-variant":"gradient",onClick:D,children:s("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=le,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=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
@@ -658,13 +658,13 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
658
658
  opacity: 0.6;
659
659
  cursor: default;
660
660
  }
661
- `,_t=Ne`
661
+ `,Rt=Ne`
662
662
  margin: 0;
663
663
  font-size: 13px;
664
664
  `,Ce=i.p`
665
- ${_t};
665
+ ${Rt};
666
666
  `,zn=i(Ts)`
667
- ${_t};
667
+ ${Rt};
668
668
  `,An=i.div`
669
669
  position: relative;
670
670
  /* Takes the leftover height so its white ::before covers it — see .page[data-route="/cart"]. */
@@ -692,4 +692,4 @@ import{j as e,L as Se,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
692
692
  & section {
693
693
  margin-top: 0;
694
694
  }
695
- `;function Ke(o){if(Ss(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:fa.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const En=12e4;function qn(o){const l=[];return o.unavailable.length&&l.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:l.join(` ${s("cart.drop.and")} `)})}const Ue=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Zn(){ia({title:s("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=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ra(),Bt=fs(),ue=Cs().packs.slice(0,js);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:Me}=oa({queryKey:["upsell-listings"],queryFn:()=>ba({first:40}),staleTime:6e4}),{data:$}=ca(n),b=da(),ee=ta(),{state:J}=aa(),[Wt,ie]=P.useState(null),[Qe,he]=P.useState(null),[Ft,_]=P.useState(!1),[B,H]=P.useState(null),Oe=P.useRef(0),[p,j]=P.useState(null),{data:pe}=la(n),{data:re}=ds(!0),[Te,He]=P.useState(""),oe=P.useRef(null),Ve=ua(o),Ge=t=>lt(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Lt=Ie.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Kt=o.reduce((t,a)=>t+a.quantity,0),Ut=Ie.reduce((t,a)=>t+a.quantity,0),De=B?B.liveTotalCredits:Lt,Nt=new Set(o.map(t=>t.id)),Ye=((Me==null?void 0:Me.items)??[]).filter(t=>!Nt.has(t.id)).slice(0,12),Qt=new Map(B==null?void 0:B.buyable.map(t=>[t.item.id,t])),ge=($==null?void 0:$.credits)??0,ze=De*10,Ot=re?Ct(ze,re):0n,xe=Fe({priceCents:ze,priceManaWei:Ot,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),Ht=t=>t.some(a=>a.acquisition==="store"),Ae=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Vt=xa,Gt=t=>ma(t.contractAddress,String(t.itemId));function me(t){t(),H(null),he(null),ie(null)}function Dt(){j(null),_(!1)}function Je(t){const a=Ue(t),d=Math.max(0,a-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];He(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,credits_balance:ge,shortfall:d}),j({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:d}),_(!1)}async function Ee(t){if(!n||t.length===0)return;const a=je(t),d=a.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,S=new Set,R=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const y=[];for(let m=0;m<a.length;m++){const x=a[m];j({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await pt(n.identity,x.usdCents,M,C);u.push({salt:N.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[N],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[N],maxCreditedValue:X})}catch(M){if(Ms(M)){if(u.length){try{await Re(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=ys(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:a.length,total:a.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),U=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(us()&&!v)try{const m=new Map;f=await bs({purchases:U,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>vs(C)));x.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(Be=>S.add(Be)),E.push(f[N])):C.reason instanceof vt||X.forEach(Be=>R.add(Be))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof vt))throw M[0];q=!0}catch(m){if(!(m instanceof ws))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>S.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>R.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>S.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>R.add(x))});t.forEach(m=>l(m.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(b);const ce=oe.current;oe.current=null,j(null),_(!1);const _e={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...ce?{creditsAdded:ce}:{}};ee("/success",{state:_e,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!R.has(v))),{toRelease:k,boughtItemIds:F}=wt({reservations:u,spent:g,settled:S}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((v,U)=>v+U.priceCredits,0)),cart_size:a.length,partial:K.length>0}),k.length)try{await Re(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),H(null),bt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),_(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,a){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),_(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,a){be(t)||ae(t,{flow:a,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(t)}),j({phase:"error",message:Ke(t)}),_(!1)}async function Yt(t,a){const d=ve(We.MANAToken,a),c=ve(We.CreditsManager,a);await xs({auth:{kind:ms.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>ls(ht.chainId),staleTime:6e4})}catch{return}}async function Jt(t){const a=je(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await et():re,u=c?Ct(a,c):0n;return{totalCents:a,manaWei:u}}async function tt(t,a){const d=Ue(t),{totalCents:c,manaWei:u}=await Jt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),w=Ht(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(a&&w.options.some(S=>S.method===a)){if(a==="credits"){Ee(t);return}const{spender:S,chainId:R}=at(a,t);await st(S,R,()=>a==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),_(!1);return}if($!=null&&$.credits<d){Je(t);return}Ee(t)}function Xt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n})}const[qe,fe]=P.useState(null);function at(t,a){const d=Ae(a)[0].trade;return{spender:t==="mana"?ve(ya(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,a,d){const c=hs(a,t),u=n?await ps(c,n.address).catch(()=>!0):!0;if(gs(n==null?void 0:n.providerType,u)){_(!1),fe({auth:c,run:d});return}d()}function Zt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(a);return}const{spender:u,chainId:h}=at(t,a);st(u,h,()=>t==="mana"?void nt(a):void it(a,d,c))}async function nt(t){if(!n||t.length===0)return;const a=je(t),d=a.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:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await rs({trades:Ae(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,a,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=os(c.map(g=>g.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((g,k)=>g+k,0),R=cs(Math.max(0,a-S),a,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const U=g[f].item,{credit:ce,maxCreditedValue:_e}=await pt(n.identity,v,g[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:ce.id,itemId:U.id}),k.push({kind:"trade",trade:g[f].trade,credits:[ce],maxCreditedValue:_e})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+R).toString()},await Yt(n.signer,g[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 Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),H(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=wt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&Re(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){yt({type:"cart-checkout"}),L();return}const a=Q.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),_(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:ge>=d});try{const c=await ks(a,n.address,Vt,await et(),Gt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(qn(c))),c.buyable.length===0){ie(s("cart.error.noneAvailable")),H(null);return}if(c.orderChanged){H(c),Oe.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(Ke(c))}finally{_(!1)}}async function rt(){if(B){if(!n){yt({type:"cart-checkout"}),L();return}if(Date.now()-Oe.current>En){H(null),he(null),await te();return}ie(null),tt(B.buyable)}}async function ea(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(Q.getState().items))}catch{}_(!0);try{const t=await $s(Te,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(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{_(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!as("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const a=sessionStorage.getItem(we);if(a){sessionStorage.removeItem(we);const d=JSON.parse(a);Array.isArray(d)&&d.length&&D(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Ft||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Us,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Ns,{children:[e.jsx(Qs,{children:s("cart.empty.title")}),e.jsx(Os,{children:s("cart.empty.body")})]}),e.jsx(Hs,{to:"/items",children:s("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsxs(Ks,{children:[e.jsx(Vs,{onClick:()=>ee(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(Gs,{children:s("cart.panelTitle",{count:Kt})}),Rt?e.jsxs(Ds,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(O,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Ys,{children:o.map(t=>{const a=Qt.get(t.id),d=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,S=d*h,R=ha(t),E=!!R&&!!A[R],q=pa(t),y=Ve[t.id],g=!lt(y),k=y==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Js,{"data-unavailable":g||void 0,children:[e.jsxs(Xs,{"data-thumb":!0,children:[q?e.jsx(Zs,{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(en,{"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(tn,{children:[e.jsxs(an,{"data-desc":!0,children:[q?e.jsx(nn,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(sn,{title:t.name,children:t.name}),t.creator?e.jsx(rn,{address:t.creator,linkToProfile:!0}):null,Bt&&u?e.jsxs(fn,{"data-testid":"cart-creator-tag",children:[e.jsx(yn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(on,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(gn,{children:[e.jsx(xn,{name:"warning-fill",size:24}),k]}),q?e.jsx(mn,{to:q,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(cn,{children:[e.jsx(St,{onClick:()=>me(()=>z(t.id)),disabled:V||h<=1,"aria-label":s("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(dn,{children:h}),e.jsx(St,{onClick:()=>me(()=>I(t.id)),disabled:V||w,"aria-label":s("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(ln,{children:[e.jsx(un,{})," ",S,c?e.jsx(hn,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(pn,{children:[R?e.jsx(bn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(O,{name:E?"heart-solid":"heart"})}):null,e.jsx(vn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(wn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:s("cart.clearCart")})})]})]}),e.jsxs(Cn,{children:[e.jsx(jn,{children:s("cart.purchaseSummary")}),e.jsxs(kn,{children:[e.jsxs($n,{children:[e.jsx(Sn,{children:s("cart.totalItems",{count:Ut})}),e.jsx(Tn,{children:e.jsxs(Mn,{children:[e.jsx(In,{})," ",De]})})]}),xe.options.length>0||xe.manaShortfall?e.jsx(Tt,{options:xe.options,totalCents:ze,shortfall:xe.manaShortfall,creditsLabel:B?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:V||Pe,onPay:t=>void(B?rt():te(t))}):e.jsx(Pn,{onClick:()=>void(B?rt():te()),disabled:V||Pe,children:V?s("cart.working"):B?s("marketCheckout.confirmPurchase"):s("cart.checkout")}),Pe?e.jsx(Ce,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:s("cart.signInHint")}),B?e.jsx(Ce,{className:"muted",children:s("cart.priceChanged")}):null,Qe?e.jsx(Ce,{className:"muted",children:Qe}):null,e.jsx(zn,{message:Wt})]})]})]})]}),Ye.length>0?e.jsx(An,{children:e.jsx(ss,{title:s("cart.youMightAlsoLike"),items:Ye})}):null,qe&&n?e.jsx(ns,{auth:qe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:is,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(Bs,{phase:p.phase,balanceCredits:ge,onClose:Dt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:ga(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Xt(p).options:void 0,onPay:Zt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ue(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:Te,onSelectPack:He,onBuyPacks:()=>void ea(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Zn as Cart};
695
+ `;function Ke(o){if(Ss(o))return s("errors.rejected");const l=(o.message??"").toLowerCase();return l.includes("insufficient")?s("cart.error.insufficient",{currency:fa.name}):l.includes("no active listing")||l.includes("your own listing")?s("cart.error.listingChanged"):s("marketCheckout.error.generic")}const En=12e4;function qn(o){const l=[];return o.unavailable.length&&l.push(s("cart.drop.unavailable",{count:o.unavailable.length})),o.own.length&&l.push(s("cart.drop.own",{count:o.own.length})),s("cart.drop.removed",{items:l.join(` ${s("cart.drop.and")} `)})}const Ue=o=>o.reduce((l,I)=>l+I.priceCredits*I.quantity,0),je=o=>o.flatMap(l=>Array.from({length:l.quantity},()=>({...l,quantity:1})));function Xn(){ia({title:s("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=dt(t=>t.items),ne=dt(t=>t.toggle),{session:n,signIn:L}=ra(),_t=ls(),ue=Cs().packs.slice(0,js);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:Me}=oa({queryKey:["upsell-listings"],queryFn:()=>ba({first:40}),staleTime:6e4}),{data:$}=ca(n),b=da(),ee=ta(),{state:J}=aa(),[Wt,ie]=P.useState(null),[Qe,he]=P.useState(null),[Ft,R]=P.useState(!1),[_,H]=P.useState(null),Oe=P.useRef(0),[p,j]=P.useState(null),{data:pe}=la(n),{data:re}=ds(!0),[Te,He]=P.useState(""),oe=P.useRef(null),Ve=ua(o),Ge=t=>lt(Ve[t.id]),Ie=o.filter(Ge),Pe=o.length>0&&Ie.length===0,Lt=Ie.reduce((t,a)=>t+a.priceCredits*a.quantity,0),Kt=o.reduce((t,a)=>t+a.quantity,0),Ut=Ie.reduce((t,a)=>t+a.quantity,0),De=_?_.liveTotalCredits:Lt,Nt=new Set(o.map(t=>t.id)),Ye=((Me==null?void 0:Me.items)??[]).filter(t=>!Nt.has(t.id)).slice(0,12),Qt=new Map(_==null?void 0:_.buyable.map(t=>[t.item.id,t])),ge=($==null?void 0:$.credits)??0,ze=De*10,Ot=re?Ct(ze,re):0n,xe=Fe({priceCents:ze,priceManaWei:Ot,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),Ht=t=>t.some(a=>a.acquisition==="store"),Ae=t=>t.flatMap(a=>a.acquisition==="trade"?[a]:[]),Vt=xa,Gt=t=>ma(t.contractAddress,String(t.itemId));function me(t){t(),H(null),he(null),ie(null)}function Dt(){j(null),R(!1)}function Je(t){const a=Ue(t),d=Math.max(0,a-ge),c=ue.find(u=>u.credits>=d)??ue[ue.length-1];He(c.id),G("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:a,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 Ee(t){if(!n||t.length===0)return;const a=je(t),d=a.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,S=new Set,B=new Set,E=[];let q=!1;j({phase:"processing",stage:"reserving",step:1,total:a.length});try{const y=[];for(let m=0;m<a.length;m++){const x=a[m];j({phase:"processing",stage:"reserving",step:m+1,total:a.length});try{const M=x.acquisition==="trade"?x.trade.id:void 0,C=x.item.contractAddress&&x.item.itemId!=null?{contractAddress:x.item.contractAddress,itemId:String(x.item.itemId)}:void 0,{credit:N,maxCreditedValue:X}=await pt(n.identity,x.usdCents,M,C);u.push({salt:N.id,itemId:x.item.id}),y.push(x.acquisition==="store"?{kind:"store",item:{collection:x.item.contractAddress,itemId:String(x.item.itemId),priceWei:x.priceWei},credits:[N],maxCreditedValue:X,chainId:x.item.chainId}:{kind:"trade",trade:x.trade,credits:[N],maxCreditedValue:X})}catch(M){if(Ms(M)){if(u.length){try{await Be(n.identity,u.map(C=>C.salt))}catch(C){ae(C,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}Je(t);return}throw M}}h="submit";const g=hs(y).length,k=m=>g>1?{current:m,total:g}:void 0,F=(m,x)=>j({phase:"processing",stage:m,step:a.length,total:a.length,signatures:k(x)}),K=m=>m<g?F("awaiting-signature",m+1):F("settling",g);F("awaiting-signature",1);let f=[];const v=y.some(m=>m.kind==="store"),U=y.flatMap(m=>m.kind==="trade"?[m]:[]);if(ps()&&!v)try{const m=new Map;f=await bs({purchases:U,buyer:n.address,signer:n.signer,onSigned:()=>K(g),onBroadcast:({txHash:C,salts:N})=>{m.set(C,N),N.forEach(X=>w.add(X))}});const x=await Promise.allSettled(f.map(C=>vs(C)));x.forEach((C,N)=>{const X=m.get(f[N])??[];C.status==="fulfilled"?(X.forEach(_e=>S.add(_e)),E.push(f[N])):C.reason instanceof vt||X.forEach(_e=>B.add(_e))});const M=x.flatMap(C=>C.status==="rejected"?[C.reason]:[]);if(M.length&&!M.some(C=>C instanceof vt))throw M[0];q=!0}catch(m){if(!(m instanceof ws))throw m;f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:x})=>x.forEach(M=>w.add(M)),onSettled:({txHash:x,salts:M})=>{M.forEach(C=>S.add(C)),E.push(x)},onReverted:({salts:x})=>x.forEach(M=>B.add(M))})}else f=await Le({purchases:y,buyer:n.address,signer:n.signer,onSigned:K,onBroadcast:({salts:m})=>m.forEach(x=>w.add(x)),onSettled:({txHash:m,salts:x})=>{x.forEach(M=>S.add(M)),E.push(m)},onReverted:({salts:m})=>m.forEach(x=>B.add(x))});t.forEach(m=>l(m.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"credits",no_crypto_step:q,transaction_hash:f[0]??null}),bt(b);const ce=oe.current;oe.current=null,j(null),R(!1);const Re={items:c,txHash:f[0]??void 0,txHashes:f,settled:!0,...ce?{creditsAdded:ce}:{}};ee("/success",{state:Re,replace:!0})}catch(y){be(y)||ae(y,{flow:"cart_checkout",step:h,cart_size:t.length});const g=new Set([...w].filter(v=>!B.has(v))),{toRelease:k,boughtItemIds:F}=wt({reservations:u,spent:g,settled:S}),K=d.filter(v=>F.includes(v.id)),f=d.filter(v=>!F.includes(v.id));if(G(be(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:gt(y),value_usd:ut(f.reduce((v,U)=>v+U.priceCredits,0)),cart_size:a.length,partial:K.length>0}),k.length)try{await Be(n.identity,k)}catch(v){ae(v,{flow:"cart_checkout",step:"release"})}if(b.invalidateQueries({queryKey:["usd-balance"]}),K.length>0){F.forEach(v=>l(v)),H(null),bt(b),G("Shop Completed Purchase",{...ye(K),payment_type:"credits",no_crypto_step:q,transaction_hash:E[0]??null,partial:!0}),j({phase:"error",message:s("cart.error.partiallyBought")}),R(!1);return}j({phase:"error",message:Ke(y)})}}function Xe(t,a){b.invalidateQueries({queryKey:["usd-balance"]}),b.invalidateQueries({queryKey:["detail-trade"]}),b.invalidateQueries({queryKey:["shop-item"]}),b.invalidateQueries({queryKey:["owned-token"]}),b.invalidateQueries({queryKey:["public-token"]}),b.invalidateQueries({queryKey:["item-resales"]}),b.invalidateQueries({queryKey:["shop-items"]}),b.invalidateQueries({queryKey:["catalog-items"]}),b.invalidateQueries({queryKey:["my-assets"]}),b.invalidateQueries({queryKey:["purchases"]}),b.invalidateQueries({queryKey:["owned-item-count"]}),b.invalidateQueries({queryKey:["overview-listings"]}),b.invalidateQueries({queryKey:["upsell-listings"]});const d=oe.current;oe.current=null,j(null),R(!1);const c={items:t,txHash:a[0]??void 0,txHashes:a,settled:!0,...d?{creditsAdded:d}:{}};ee("/success",{state:c,replace:!0})}function Ze(t,a){be(t)||ae(t,{flow:a,step:"submit"}),G(be(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:gt(t)}),j({phase:"error",message:Ke(t)}),R(!1)}async function Yt(t,a){const d=ve(We.MANAToken,a),c=ve(We.CreditsManager,a);await fs({auth:{kind:ys.Allowance,contractAddress:d.address,spenderAddress:c.address,chainId:a},signer:t})}async function et(){if(re)return re;try{return await b.fetchQuery({queryKey:["mana-rate",ht.chainId],queryFn:()=>us(ht.chainId),staleTime:6e4})}catch{return}}async function Jt(t){const a=je(t).reduce((h,w)=>h+w.usdCents,0),c=(pe??0n)>0n?await et():re,u=c?Ct(a,c):0n;return{totalCents:a,manaWei:u}}async function tt(t,a){const d=Ue(t),{totalCents:c,manaWei:u}=await Jt(t),h=Fe({priceCents:c,priceManaWei:u,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n}),w=Ht(t)?{...h,options:h.options.filter(S=>S.method==="credits")}:h;if(a&&w.options.some(S=>S.method===a)){if(a==="credits"){Ee(t);return}const{spender:S,chainId:B}=at(a,t);await st(S,B,()=>a==="mana"?void nt(t):void it(t,c,u));return}if(w.options.some(S=>S.method==="mana"||S.method==="combined")){j({phase:"choose",lines:t,totalCents:c,manaWei:u}),R(!1);return}if($!=null&&$.credits<d){Je(t);return}Ee(t)}function Xt(t){return Fe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:($==null?void 0:$.balanceCents)??0,manaBalanceWei:pe??0n})}const[qe,fe]=P.useState(null);function at(t,a){const d=Ae(a)[0].trade;return{spender:t==="mana"?ve(ya(d.contract),d.chainId).address:ve(We.CreditsManager,d.chainId).address,chainId:d.chainId}}async function st(t,a,d){const c=gs(a,t),u=n?await xs(c,n.address).catch(()=>!0):!0;if(ms(n==null?void 0:n.providerType,u)){R(!1),fe({auth:c,run:d});return}d()}function Zt(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:a,totalCents:d,manaWei:c}=p;if(t==="credits"){Ee(a);return}const{spender:u,chainId:h}=at(t,a);st(u,h,()=>t==="mana"?void nt(a):void it(a,d,c))}async function nt(t){if(!n||t.length===0)return;const a=je(t),d=a.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:a.length,total:a.length});j({phase:"processing",stage:"awaiting-signature",step:a.length,total:a.length});try{const h=await rs({trades:Ae(a).map(w=>w.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(w=>l(w.item.id)),H(null),G("Shop Completed Purchase",{...ye(d),payment_type:"mana",transaction_hash:h[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(c,h)}catch(h){Ze(h,"buy_cart_mana")}}async function it(t,a,d){if(!n||t.length===0)return;const c=je(t),u=c.map(g=>({...g.item,priceCredits:g.priceCredits})),h=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),w=os(c.map(g=>g.usdCents),($==null?void 0:$.balanceCents)??0),S=w.reduce((g,k)=>g+k,0),B=cs(Math.max(0,a-S),a,d),E=[],q=new Set,y=new Set;j({phase:"processing",stage:"reserving",step:1,total:c.length});try{const g=Ae(c),k=[];for(let f=0;f<g.length;f++){const v=w[f];if(v<=0)continue;j({phase:"processing",stage:"reserving",step:f+1,total:g.length});const U=g[f].item,{credit:ce,maxCreditedValue:Re}=await pt(n.identity,v,g[f].trade.id,U.contractAddress&&U.itemId!=null?{contractAddress:U.contractAddress,itemId:String(U.itemId)}:void 0);E.push({salt:ce.id,itemId:U.id}),k.push({kind:"trade",trade:g[f].trade,credits:[ce],maxCreditedValue:Re})}g.forEach((f,v)=>{w[v]<=0&&k.push({kind:"trade",trade:f.trade,credits:[],maxCreditedValue:"0"})}),k[0]={...k[0],maxCreditedValue:(BigInt(k[0].maxCreditedValue)+B).toString()},await Yt(n.signer,g[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 Le({purchases:k,buyer:n.address,signer:n.signer,onSigned:F,onBroadcast:({salts:f})=>f.forEach(v=>q.add(v)),onReverted:({salts:f})=>f.forEach(v=>y.add(v))});t.forEach(f=>l(f.item.id)),H(null),G("Shop Completed Purchase",{...ye(u),payment_type:"credits_and_mana",transaction_hash:K[0]??null}),b.invalidateQueries({queryKey:["mana-balance"]}),Xe(h,K)}catch(g){const{toRelease:k}=wt({reservations:E,spent:new Set([...q].filter(F=>!y.has(F))),settled:new Set});k.length&&Be(n.identity,k).catch(()=>{}),E.length&&b.invalidateQueries({queryKey:["usd-balance"]}),Ze(g,"buy_cart_combined")}}async function te(t){if(!n){yt({type:"cart-checkout"}),L();return}const a=Q.getState().items.filter(Ge);if(a.length===0)return;ie(null),he(null),R(!0);const d=a.reduce((c,u)=>c+u.priceCredits*u.quantity,0);G("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:ut(d),has_sufficient_credits:ge>=d});try{const c=await ks(a,n.address,Vt,await et(),Gt),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(h=>l(h.id)),he(qn(c))),c.buyable.length===0){ie(s("cart.error.noneAvailable")),H(null);return}if(c.orderChanged){H(c),Oe.current=Date.now();return}await tt(c.buyable,t)}catch(c){ae(c,{flow:"cart_checkout",step:"review",cart_size:a.length}),ie(Ke(c))}finally{R(!1)}}async function rt(){if(_){if(!n){yt({type:"cart-checkout"}),L();return}if(Date.now()-Oe.current>En){H(null),he(null),await te();return}ie(null),tt(_.buyable)}}async function ea(){if(Te){try{sessionStorage.setItem(we,JSON.stringify(Q.getState().items))}catch{}R(!0);try{const t=await $s(Te,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(we)}catch{}ae(t,{flow:"cart_buy_credits"}),j({phase:"error",message:s("buyModal.error.creditsCheckout")})}finally{R(!1)}}}const ot=P.useRef(!1);P.useEffect(()=>{if(!n||ot.current||!as("cart-checkout"))return;ot.current=!0;const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[n]);const ct=P.useRef(!1);P.useEffect(()=>{if(!(J!=null&&J.resumeCheckout)||ct.current)return;ct.current=!0,oe.current=J.creditsAdded??null;try{const a=sessionStorage.getItem(we);if(a){sessionStorage.removeItem(we);const d=JSON.parse(a);Array.isArray(d)&&d.length&&D(d)}}catch{}b.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void te(),0);return()=>clearTimeout(t)},[J==null?void 0:J.resumeCheckout]);const V=Ft||(p==null?void 0:p.phase)==="processing";return o.length===0&&!p?e.jsx(jt,{children:e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Us,{"data-testid":"cart-empty",children:[e.jsx(O,{name:"cart-plus",size:110}),e.jsxs(Ns,{children:[e.jsx(Qs,{children:s("cart.empty.title")}),e.jsx(Os,{children:s("cart.empty.body")})]}),e.jsx(Hs,{to:"/items",children:s("cart.empty.cta")})]})]})}):e.jsxs(jt,{children:[e.jsxs($t,{children:[e.jsxs(kt,{onClick:()=>ee(-1),type:"button",children:[e.jsx(O,{name:"arrow-left"}),s("nav.cart")]}),e.jsxs(Fs,{children:[e.jsxs(Ls,{children:[e.jsxs(Ks,{children:[e.jsx(Vs,{onClick:()=>ee(-1),type:"button","aria-label":s("cart.goBack"),children:e.jsx(O,{name:"arrow-left"})}),e.jsx(Gs,{children:s("cart.panelTitle",{count:Kt})}),Bt?e.jsxs(Ds,{onClick:()=>Y(!0),disabled:V,children:[e.jsx(O,{name:"fitting-room"}),s("cart.fittingRoom")]}):null]}),e.jsxs(At,{children:[e.jsx(Ys,{children:o.map(t=>{const a=Qt.get(t.id),d=a?a.priceCredits:t.priceCredits,c=!!a&&a.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,w=typeof t.available=="number"&&h>=t.available,S=d*h,B=ha(t),E=!!B&&!!A[B],q=pa(t),y=Ve[t.id],g=!lt(y),k=y==="sold-out"?s("cart.availability.soldOut"):s("cart.availability.unavailable");return e.jsxs(Js,{"data-unavailable":g||void 0,children:[e.jsxs(Xs,{"data-thumb":!0,children:[q?e.jsx(Zs,{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(en,{"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(tn,{children:[e.jsxs(an,{"data-desc":!0,children:[q?e.jsx(nn,{to:q,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(sn,{title:t.name,children:t.name}),t.creator?e.jsx(rn,{address:t.creator,linkToProfile:!0}):null,_t&&u?e.jsxs(fn,{"data-testid":"cart-creator-tag",children:[e.jsx(yn,{name:"buy-from-creator"}),s("cart.creatorTag")]}):null]}),e.jsx(on,{children:g?e.jsxs(e.Fragment,{children:[e.jsxs(gn,{children:[e.jsx(xn,{name:"warning-fill",size:24}),k]}),q?e.jsx(mn,{to:q,state:{item:t,tradeId:t.tradeId},children:s("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(cn,{children:[e.jsx(St,{onClick:()=>me(()=>z(t.id)),disabled:V||h<=1,"aria-label":s("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(dn,{children:h}),e.jsx(St,{onClick:()=>me(()=>I(t.id)),disabled:V||w,"aria-label":s("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(ln,{children:[e.jsx(un,{})," ",S,c?e.jsx(hn,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(pn,{children:[B?e.jsx(bn,{"data-on":E||void 0,onClick:()=>ne(t),"aria-label":E?s("cart.removeFromFavorites",{name:t.name}):s("cart.addToFavorites",{name:t.name}),title:E?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx(O,{name:E?"heart-solid":"heart"})}):null,e.jsx(vn,{onClick:()=>me(()=>l(t.id)),disabled:V,"aria-label":s("cart.remove",{name:t.name}),title:s("cart.removeTitle"),children:e.jsx(O,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(wn,{children:e.jsx("button",{className:"link",onClick:()=>me(W),disabled:V,children:s("cart.clearCart")})})]})]}),e.jsxs(Cn,{children:[e.jsx(jn,{children:s("cart.purchaseSummary")}),e.jsxs(kn,{children:[e.jsxs($n,{children:[e.jsx(Sn,{children:s("cart.totalItems",{count:Ut})}),e.jsx(Tn,{children:e.jsxs(Mn,{children:[e.jsx(In,{})," ",De]})})]}),xe.options.length>0||xe.manaShortfall?e.jsx(Tt,{options:xe.options,totalCents:ze,shortfall:xe.manaShortfall,creditsLabel:_?s("marketCheckout.confirmPurchase"):s("cart.buyWithCredits"),busy:V||Pe,onPay:t=>void(_?rt():te(t))}):e.jsx(Pn,{onClick:()=>void(_?rt():te()),disabled:V||Pe,children:V?s("cart.working"):_?s("marketCheckout.confirmPurchase"):s("cart.checkout")}),Pe?e.jsx(Ce,{className:"muted",children:s("cart.allUnavailable")}):null,n?null:e.jsx(Ce,{className:"muted",children:s("cart.signInHint")}),_?e.jsx(Ce,{className:"muted",children:s("cart.priceChanged")}):null,Qe?e.jsx(Ce,{className:"muted",children:Qe}):null,e.jsx(zn,{message:Wt})]})]})]})]}),Ye.length>0?e.jsx(An,{children:e.jsx(ss,{title:s("cart.youMightAlsoLike"),items:Ye})}):null,qe&&n?e.jsx(ns,{auth:qe.auth,signer:n.signer,title:s("authorizeStep.manaTitle"),name:s("authorizeStep.manaName"),reason:s("authorizeStep.manaReason"),icon:e.jsx("img",{src:is,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=qe;fe(null),t()},onCancel:()=>fe(null),onClose:()=>fe(null)}):null,p?e.jsx(_s,{phase:p.phase,balanceCredits:ge,onClose:Dt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:ga(n==null?void 0:n.providerType),signatures:p.phase==="processing"?p.signatures:void 0,options:p.phase==="choose"?Xt(p).options:void 0,onPay:Zt,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Ue(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:ue,selectedPack:Te,onSelectPack:He,onBuyPacks:()=>void ea(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void te()}):null]})}export{Xn as Cart};
@@ -1,4 +1,4 @@
1
- import{a5 as N,a6 as U,a7 as o,a8 as n,a9 as D,k as M}from"./index-CEec1iYe.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,s as v}from"./clsx-CbhzNwHc.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{a8 as N,a9 as U,aa as o,ab as n,ac as D,o as M}from"./index-D-7WCtxn.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,s as v}from"./clsx-DSmAtJIx.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`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,r as m,u as Z,d as J}from"./react-DehiWSvs.js";import{t as v,s as c,R as X,v as E,I as ee,b as a,c as te,j as ae,u as re,m as oe,d as ie,ac as F,ad as se,aT as ne,aU as ce}from"./index-CEec1iYe.js";import{E as le}from"./ErrorNotice-qXSCgBBe.js";import{d as de,g as pe,a as xe,P as ue,C as me,b as ge,c as he,B as be,S as fe,M as je,A as ve}from"./browseLayout.styles-C2XsX59Z.js";import{u as ye}from"./useStore-DC77ufHd.js";import{S as z,C as Ce,F as we,c as Ne,P as Se,d as ke,H as Pe,e as $e}from"./categories-CJDomWri.js";import{L as Ae}from"./LoadMore-CPg41rwp.js";import{u as Me}from"./useInfiniteGrid-ottWIC3k.js";import{G as Re}from"./grid.styles-4uR2Oqak.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Te=c.section`
1
+ import{j as e,r as m,u as V,d as J}from"./react-DehiWSvs.js";import{t as v,s as c,W as X,y as T,I as ee,b as a,c as te,j as ae,u as re,q as oe,C as ie,af as F,ag as se,aY as ne,aZ as ce}from"./index-D-7WCtxn.js";import{E as le}from"./ErrorNotice-BCKaFzga.js";import{d as de,g as pe,a as xe,P as ue,C as me,b as ge,c as he,B as be,S as fe,M as je,A as ve}from"./browseLayout.styles-BdkLZM96.js";import{u as ye}from"./useStore-DYpF-pdm.js";import{S as z,C as Ce,F as we,c as Ne,P as Se,d as ke,H as Pe,e as $e}from"./categories-B569rNQU.js";import{L as Ae}from"./LoadMore-D8E5F-8f.js";import{u as Me}from"./useInfiniteGrid-_3YA45kU.js";import{G as Ee}from"./grid.styles-BZkFiBLS.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Re=c.section`
2
2
  position: relative;
3
3
  border-radius: ${v.radius.card};
4
4
  overflow: hidden;
@@ -11,7 +11,7 @@ import{j as e,r as m,u as Z,d as J}from"./react-DehiWSvs.js";import{t as v,s as
11
11
  ${v.media.maxWidth("mobile")} {
12
12
  min-height: 140px;
13
13
  }
14
- `,Ee=c.div`
14
+ `,Te=c.div`
15
15
  position: absolute;
16
16
  inset: 0;
17
17
  z-index: 0;
@@ -42,7 +42,7 @@ import{j as e,r as m,u as Z,d as J}from"./react-DehiWSvs.js";import{t as v,s as
42
42
  padding: 24px 16px;
43
43
  font-size: 26px;
44
44
  }
45
- `;function Le({name:r,creator:t}){const{data:s}=ye(t),d=(s==null?void 0:s.cover)||de;return e.jsxs(Te,{"data-testid":"collection-hero","aria-label":r,children:[e.jsxs(Ee,{children:[e.jsx(Fe,{src:d,alt:"",loading:"eager"}),e.jsx(ze,{"aria-hidden":!0})]}),e.jsx(Be,{"data-testid":"collection-hero-title",children:r})]})}const{colors:n,radius:L}=v,Ie=c.div`
45
+ `;function Le({name:r,creator:t}){const{data:s}=ye(t),d=(s==null?void 0:s.cover)||de;return e.jsxs(Re,{"data-testid":"collection-hero","aria-label":r,children:[e.jsxs(Te,{children:[e.jsx(Fe,{src:d,alt:"",loading:"eager"}),e.jsx(ze,{"aria-hidden":!0})]}),e.jsx(Be,{"data-testid":"collection-hero-title",children:r})]})}const{colors:n,radius:L}=v,Ie=c.div`
46
46
  display: flex;
47
47
  flex-direction: column;
48
48
  align-items: center;
@@ -62,7 +62,7 @@ import{j as e,r as m,u as Z,d as J}from"./react-DehiWSvs.js";import{t as v,s as
62
62
  border: 5px solid ${n.white};
63
63
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
64
64
  background: #ff4bed;
65
- `,Ue=c.h2`
65
+ `,_e=c.h2`
66
66
  margin: 0;
67
67
  font-size: 20px;
68
68
  font-weight: 700;
@@ -72,7 +72,7 @@ import{j as e,r as m,u as Z,d as J}from"./react-DehiWSvs.js";import{t as v,s as
72
72
  overflow: hidden;
73
73
  text-overflow: ellipsis;
74
74
  white-space: nowrap;
75
- `,_e=c.button`
75
+ `,Ge=c.button`
76
76
  display: inline-flex;
77
77
  align-items: center;
78
78
  gap: 8px;
@@ -92,7 +92,7 @@ import{j as e,r as m,u as Z,d as J}from"./react-DehiWSvs.js";import{t as v,s as
92
92
  color: ${n.text};
93
93
  background: ${n.media};
94
94
  }
95
- `,Ge=c.a`
95
+ `,He=c.a`
96
96
  display: inline-flex;
97
97
  align-items: center;
98
98
  justify-content: center;
@@ -116,4 +116,4 @@ import{j as e,r as m,u as Z,d as J}from"./react-DehiWSvs.js";import{t as v,s as
116
116
  background: ${n.accent};
117
117
  color: ${n.white};
118
118
  }
119
- `;function He({address:r}){var f,l;const{data:t}=X(r),[s,d]=m.useState(!1);if(!r)return null;const p=(t==null?void 0:t.name)||E(r),g=(l=(f=t==null?void 0:t.avatar)==null?void 0:f.snapshots)==null?void 0:l.face256,h=`${te.profileUrl}/${r}`,b=pe(xe({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??r}));async function x(){try{await navigator.clipboard.writeText(r),d(!0),window.setTimeout(()=>d(!1),1500)}catch(y){ae(y,{flow:"copy_creator_address"})}}return e.jsxs(Ie,{"data-testid":"creator-card",children:[g?e.jsx(B,{src:g,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(B,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsx(Ue,{title:p,children:p}),e.jsxs(_e,{type:"button",onClick:()=>void x(),title:s?a("collection.copied"):a("collection.copyAddress"),"aria-label":s?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:E(r)}),e.jsx(ee,{name:"copy",size:16})]}),e.jsx(Ge,{"data-testid":"creator-card-view",href:h,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const qe=48;function rt(){var T;const{contractAddress:r}=Z(),t=J(),[s,d]=m.useState("wearable"),[p,g]=m.useState(null),[h,b]=m.useState([]),[x,f]=m.useState(""),[l,y]=m.useState(""),[N,I]=m.useState("newest"),S=x&&!Number.isNaN(Number(x))?Number(x):void 0,k=l&&!Number.isNaN(Number(l))?Number(l):void 0,U=p?$e[p]:void 0,_=(z.find(o=>o.key===N)??z[0]).server,P={category:s,rarities:h.length?h:void 0,wearableCategories:U,minPriceCredits:S,maxPriceCredits:k,sortBy:_},{items:j,total:G,isLoading:C,error:$,hasNextPage:H,isFetchingNextPage:A,isFetchNextPageError:q,fetchNextPage:K}=Me(["collection-page",r,P],o=>ne(r,{...P,first:qe,skip:o}),{enabled:!!r}),{data:i}=re({queryKey:["collection-meta",r],queryFn:()=>ce(r),enabled:!!r,staleTime:5*6e4}),M=(i==null?void 0:i.name)||a("collection.fallbackTitle");oe({title:i==null?void 0:i.name,description:i!=null&&i.name?a("seo.collection.description",{name:i.name}):void 0});const R=(i==null?void 0:i.creator)||((T=j[0])==null?void 0:T.creator);function W(o){d(o),g(null)}function D(o){b(u=>u.includes(o)?u.filter(Y=>Y!==o):[...u,o])}function O(){d("wearable"),g(null),b([]),f(""),y("")}const w=!!(S||k),Q=w?`${x||"0"}–${l||"∞"}`:a("filter.price"),V=s!=="wearable"||!!p||h.length>0||w;return e.jsxs(ue,{"data-testid":"collection-page",children:[e.jsxs(me,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(ge,{onClick:()=>t("/items"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(he,{children:M})]}),e.jsx(Le,{name:M,creator:R}),e.jsxs(be,{"data-testid":"browse",children:[e.jsxs(fe,{"data-testid":"browse-sidebar",children:[e.jsx(He,{address:R}),e.jsx(Ce,{category:s,subCategory:p,onCategory:W,onSub:g,title:a("collection.category"),flat:!0})]}),e.jsxs(je,{children:[!C&&j.length>0?e.jsx(ve,{items:j,source:"collection"}):null,e.jsx(we,{rarities:h,onToggleRarity:D,sort:N,onSort:I,total:G,loading:C,anyActive:V,onClear:O,renderTrailing:o=>e.jsx(Ne,{panelKey:"price",label:Q,active:w,panel:o,children:e.jsxs(Se,{"data-variant":"price",children:[e.jsxs(ke,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:u=>f(u.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:u=>y(u.target.value)})]}),e.jsx(Pe,{children:a("collection.priceHint",{currency:ie.name})})]})})}),$?e.jsx(le,{message:a("collection.error")}):null,e.jsx(Re,{"data-testid":"grid",children:C?e.jsx(F,{count:15}):e.jsxs(e.Fragment,{children:[j.map(o=>e.jsx(se,{item:o},o.id)),A?e.jsx(F,{count:6}):null]})}),e.jsx(Ae,{hasNextPage:H,isFetching:A,isError:q,onLoadMore:()=>void K()}),!C&&!$&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{rt as Collection,rt as default};
119
+ `;function Ue({address:r}){var f,l;const{data:t}=X(r),[s,d]=m.useState(!1);if(!r)return null;const p=(t==null?void 0:t.name)||T(r),g=(l=(f=t==null?void 0:t.avatar)==null?void 0:f.snapshots)==null?void 0:l.face256,h=`${te.profileUrl}/${r}`,b=pe(xe({name:t==null?void 0:t.name,hasClaimedName:t==null?void 0:t.hasClaimedName,ethAddress:(t==null?void 0:t.ethAddress)??r}));async function x(){try{await navigator.clipboard.writeText(r),d(!0),window.setTimeout(()=>d(!1),1500)}catch(y){ae(y,{flow:"copy_creator_address"})}}return e.jsxs(Ie,{"data-testid":"creator-card",children:[g?e.jsx(B,{src:g,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(B,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsx(_e,{title:p,children:p}),e.jsxs(Ge,{type:"button",onClick:()=>void x(),title:s?a("collection.copied"):a("collection.copyAddress"),"aria-label":s?a("collection.copied"):a("collection.copyAddress"),children:[e.jsx("span",{children:T(r)}),e.jsx(ee,{name:"copy",size:16})]}),e.jsx(He,{"data-testid":"creator-card-view",href:h,target:"_blank",rel:"noopener noreferrer",children:a("collection.viewProfile")})]})}const qe=48;function rt(){var R;const{contractAddress:r}=V(),t=J(),[s,d]=m.useState("wearable"),[p,g]=m.useState(null),[h,b]=m.useState([]),[x,f]=m.useState(""),[l,y]=m.useState(""),[N,I]=m.useState("newest"),S=x&&!Number.isNaN(Number(x))?Number(x):void 0,k=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=p?$e[p]:void 0,G=(z.find(o=>o.key===N)??z[0]).server,P={category:s,rarities:h.length?h:void 0,wearableCategories:_,minPriceCredits:S,maxPriceCredits:k,sortBy:G},{items:j,total:H,isLoading:C,error:$,hasNextPage:U,isFetchingNextPage:A,isFetchNextPageError:q,fetchNextPage:W}=Me(["collection-page",r,P],o=>ne(r,{...P,first:qe,skip:o}),{enabled:!!r}),{data:i}=re({queryKey:["collection-meta",r],queryFn:()=>ce(r),enabled:!!r,staleTime:5*6e4}),M=(i==null?void 0:i.name)||a("collection.fallbackTitle");oe({title:i==null?void 0:i.name,description:i!=null&&i.name?a("seo.collection.description",{name:i.name}):void 0});const E=(i==null?void 0:i.creator)||((R=j[0])==null?void 0:R.creator);function K(o){d(o),g(null)}function Y(o){b(u=>u.includes(o)?u.filter(Q=>Q!==o):[...u,o])}function Z(){d("wearable"),g(null),b([]),f(""),y("")}const w=!!(S||k),D=w?`${x||"0"}–${l||"∞"}`:a("filter.price"),O=s!=="wearable"||!!p||h.length>0||w;return e.jsxs(ue,{"data-testid":"collection-page",children:[e.jsxs(me,{"aria-label":a("collection.breadcrumbAria"),children:[e.jsx(ge,{onClick:()=>t("/items"),children:a("collection.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(he,{children:M})]}),e.jsx(Le,{name:M,creator:E}),e.jsxs(be,{"data-testid":"browse",children:[e.jsxs(fe,{"data-testid":"browse-sidebar",children:[e.jsx(Ue,{address:E}),e.jsx(Ce,{category:s,subCategory:p,onCategory:K,onSub:g,title:a("collection.category"),flat:!0})]}),e.jsxs(je,{children:[!C&&j.length>0?e.jsx(ve,{items:j,source:"collection"}):null,e.jsx(we,{rarities:h,onToggleRarity:Y,sort:N,onSort:I,total:H,loading:C,anyActive:O,onClear:Z,renderTrailing:o=>e.jsx(Ne,{panelKey:"price",label:D,active:w,panel:o,children:e.jsxs(Se,{"data-variant":"price",children:[e.jsxs(ke,{children:[e.jsx("input",{type:"number",min:"0","aria-label":a("collection.priceMin"),placeholder:a("collection.priceMinPlaceholder"),value:x,onChange:u=>f(u.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:u=>y(u.target.value)})]}),e.jsx(Pe,{children:a("collection.priceHint",{currency:ie.name})})]})})}),$?e.jsx(le,{message:a("collection.error")}):null,e.jsx(Ee,{"data-testid":"grid",children:C?e.jsx(F,{count:15}):e.jsxs(e.Fragment,{children:[j.map(o=>e.jsx(se,{item:o},o.id)),A?e.jsx(F,{count:6}):null]})}),e.jsx(Ae,{hasNextPage:U,isFetching:A,isError:q,onLoadMore:()=>void W()}),!C&&!$&&j.length===0?e.jsx("p",{className:"muted",children:a("collection.empty")}):null]})]})]})}export{rt as Collection,rt 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 g,p as k,ao as j,bt as C,d as Y,k as G,I as Q,j as X,g as W,C as B,e as Z,Y as J,bR as F,ad as q}from"./index-CEec1iYe.js";import{s as ee,i as U,A as H,g as K,r as te,m as ne,c as ae,M as ie,e as oe}from"./authorizations-3-Mq1Ehl.js";import{i as se}from"./errors-B5G852-H.js";import{E as re}from"./ErrorNotice-qXSCgBBe.js";import{a as ce}from"./buy-Bs_G6nfA.js";import{g as de,a as le}from"./trade-encoding-B7y8VfDo.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-CrIt0KCG.js";import{I as xe,C as ge}from"./ethers-CtNGBird.js";const R="shop:resume_after_signin",fe=900*1e3;function dt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function lt(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 pt(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,f=be(d,n,s);l>=f&&c.push({method:"combined",creditsCents:i,manaWei:f})}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,m=!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:m}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function ht(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 M(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ut(a,n){return a.options.find(i=>i.method===n)??null}function xt(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-DehiWSvs.js";import{s as e,t as o,b as g,w as k,ar as j,bu as C,C as G,o as Y,I as Q,j as X,g as W,e as B,d as Z,a0 as J,bS as F,ag as q}from"./index-D-7WCtxn.js";import{s as ee,f as U,A as H,g as K,r as te,m as ne,i as ae,M as ie,h as oe}from"./authorizations-zc6Rq7Wn.js";import{i as se}from"./errors-CZnCfZdx.js";import{E as re}from"./ErrorNotice-BCKaFzga.js";import{a as ce}from"./buy-hkJbpiOY.js";import{g as de,f as le}from"./trade-encoding-BDt5HS0k.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-BAlAehuy.js";import{I as xe,C as ge}from"./ethers-CtNGBird.js";const R="shop:resume_after_signin",fe=900*1e3;function dt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function lt(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 pt(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,f=be(d,n,s);l>=f&&c.push({method:"combined",creditsCents:i,manaWei:f})}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,m=!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:m}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function ht(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 M(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ut(a,n){return a.options.find(i=>i.method===n)??null}function xt(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 g,p as
109
109
  line-height: 1.4;
110
110
  color: ${o.colors.muted};
111
111
  text-align: center;
112
- `;function gt({options:a,totalCents:n,onPay:i,busy:s=!1,rateNote:l,creditsLabel:c,shortfall:p}){return t.jsxs(we,{children:[a.map(h=>h.method==="credits"?t.jsxs(ve,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:s,children:[t.jsx("span",{children:c??g("buyModal.buy")}),t.jsxs(z,{children:[t.jsx(k,{}),t.jsx("span",{children:j(M(h.creditsCents))})]})]},"credits"):h.method==="mana"?t.jsxs(N,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWithMana")}),t.jsxs(z,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.manaWei)})]})]},"mana"):t.jsxs(N,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWith")}),t.jsxs(z,{children:[t.jsx(k,{}),t.jsx("span",{children:j(M(h.creditsCents))}),t.jsx($e,{children:"+"}),t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.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:g("buyModal.buyWithMana")}),t.jsxs(z,{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:g("buyModal.manaWorth",{mana:C(p.manaWei),credits:j(M(p.manaCents)),price:j(M(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 ft(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 Me=G`
112
+ `;function gt({options:a,totalCents:n,onPay:i,busy:s=!1,rateNote:l,creditsLabel:c,shortfall:p}){return t.jsxs(we,{children:[a.map(h=>h.method==="credits"?t.jsxs(ve,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:s,children:[t.jsx("span",{children:c??g("buyModal.buy")}),t.jsxs(z,{children:[t.jsx(k,{}),t.jsx("span",{children:j(M(h.creditsCents))})]})]},"credits"):h.method==="mana"?t.jsxs(N,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWithMana")}),t.jsxs(z,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.manaWei)})]})]},"mana"):t.jsxs(N,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWith")}),t.jsxs(z,{children:[t.jsx(k,{}),t.jsx("span",{children:j(M(h.creditsCents))}),t.jsx($e,{children:"+"}),t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.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:g("buyModal.buyWithMana")}),t.jsxs(z,{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:g("buyModal.manaWorth",{mana:C(p.manaWei),credits:j(M(p.manaCents)),price:j(M(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 ft(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 Me=Y`
113
113
  to { transform: rotate(360deg); }
114
114
  `,ze=e.div`
115
115
  position: fixed;
@@ -488,13 +488,13 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,p as
488
488
  `,Vt=e.span`
489
489
  font-size: 14px;
490
490
  color: ${r.text};
491
- `,Yt=e.div`
491
+ `,Gt=e.div`
492
492
  display: flex;
493
493
  align-items: center;
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;
@@ -676,7 +676,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,p as
676
676
  font-size: 22px;
677
677
  font-weight: 700;
678
678
  color: ${I.text};
679
- `,Ye=e.button`
679
+ `,Ge=e.button`
680
680
  display: inline-flex;
681
681
  align-items: center;
682
682
  gap: 4px;
@@ -694,7 +694,7 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,p as
694
694
  &:hover {
695
695
  text-decoration: underline;
696
696
  }
697
- `,Ge=e(Q)`
697
+ `,Ye=e(Q)`
698
698
  transform: rotate(-90deg);
699
699
  `,Xe=e.div`
700
700
  position: relative;
@@ -801,4 +801,4 @@ import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,b as g,p as
801
801
  opacity: 1;
802
802
  transform: scale(1.1);
803
803
  }
804
- `;function ln({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,h]=v.useState(0),[m,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:L,clientWidth:S}=u,P=Math.max(1,Math.ceil(L/S));c(P),h(Math.min(P-1,Math.round(x/S))),b(x<=1),w(x+S>=L-1)},[]);if(v.useEffect(()=>{d();const u=s.current;if(u)return u.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{u.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function f(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(_e,{children:[t.jsxs(Oe,{children:[t.jsx(Ve,{children:a}),i?t.jsxs(Ye,{onClick:i,children:[g("collectionCarousel.viewAll"),t.jsx(Ge,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(D,{"data-side":"left",onClick:()=>f(-1),"aria-label":g("collectionCarousel.scrollLeft"),disabled:m,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ze,{ref:s,children:n.map(u=>t.jsx(q,{item:u},u.id))}),t.jsx(D,{"data-side":"right",onClick:()=>f(1),"aria-label":g("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(Je,{"aria-label":g("collectionCarousel.pages"),children:Array.from({length:l}).map((u,x)=>t.jsx(qe,{"data-active":x===p||void 0,"aria-label":g("collectionCarousel.goToPage",{page:x+1}),"aria-current":x===p?"true":void 0,onClick:()=>$(x)},x))}):null]})}export{M as $,Et as A,Wt as B,jt as C,Ot as D,Vt as E,Yt as F,Gt as G,Ct as H,Xt as I,Zt as J,pt as K,en as L,kt as M,lt as N,ln as O,gt as P,mt as Q,T as R,$t as S,zt as T,dt as U,ft as V,Dt as W,At as X,Qe as Y,ht as Z,be as _,Mt as a,cn as a0,dn as a1,bt as a2,ut as a3,yt as a4,wt as b,It as c,St as d,Tt as e,Nt as f,tn as g,nn as h,an as i,Jt as j,qt as k,on as l,xt as m,sn as n,rn as o,vt as p,Qt as q,Bt as r,Rt as s,Lt as t,Pt as u,Ft as v,Kt as w,Ut as x,Ht as y,_t as z};
804
+ `;function ln({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[l,c]=v.useState(1),[p,h]=v.useState(0),[m,b]=v.useState(!0),[y,w]=v.useState(!1),d=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:L,clientWidth:S}=u,P=Math.max(1,Math.ceil(L/S));c(P),h(Math.min(P-1,Math.round(x/S))),b(x<=1),w(x+S>=L-1)},[]);if(v.useEffect(()=>{d();const u=s.current;if(u)return u.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{u.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[d,n.length]),n.length===0)return null;function f(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(_e,{children:[t.jsxs(Oe,{children:[t.jsx(Ve,{children:a}),i?t.jsxs(Ge,{onClick:i,children:[g("collectionCarousel.viewAll"),t.jsx(Ye,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Xe,{children:[t.jsx(D,{"data-side":"left",onClick:()=>f(-1),"aria-label":g("collectionCarousel.scrollLeft"),disabled:m,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ze,{ref:s,children:n.map(u=>t.jsx(q,{item:u},u.id))}),t.jsx(D,{"data-side":"right",onClick:()=>f(1),"aria-label":g("collectionCarousel.scrollRight"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),l>1?t.jsx(Je,{"aria-label":g("collectionCarousel.pages"),children:Array.from({length:l}).map((u,x)=>t.jsx(qe,{"data-active":x===p||void 0,"aria-label":g("collectionCarousel.goToPage",{page:x+1}),"aria-current":x===p?"true":void 0,onClick:()=>$(x)},x))}):null]})}export{M as $,Et as A,Wt as B,jt as C,Ot as D,Vt as E,Gt as F,Yt as G,Ct as H,Xt as I,Zt as J,pt as K,en as L,kt as M,lt as N,ln as O,gt as P,mt as Q,T as R,$t as S,zt as T,dt as U,ft as V,Dt as W,At as X,Qe as Y,ht as Z,be as _,Mt as a,cn as a0,dn as a1,bt as a2,ut as a3,yt as a4,wt as b,It as c,St as d,Tt as e,Nt as f,tn as g,nn as h,an as i,Jt as j,qt as k,on as l,xt as m,sn as n,rn as o,vt as p,Qt as q,Bt as r,Rt as s,Lt as t,Pt as u,Ft as v,Kt as w,Ut as x,Ht as y,_t as z};
@@ -1,4 +1,4 @@
1
- import{d as Y,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";import{t as Z,A as je,E as I,D as _,s as r,bd as ve,an as Ce,be as ye,b as t,bf as $e,bg as W,B as ke,a9 as q,R as J,n as Ne,v as Q,I as T,c as Pe,m as Se,ac as S,d as Le,ad as Ae,bc as Ee,bh as Fe}from"./index-CEec1iYe.js";import{d as Me,g as ze,a as Be,P as Re,C as Ie,b as _e,c as We,A as Te,B as He,S as Ue,M as De,e as Ge,f as Ke}from"./browseLayout.styles-C2XsX59Z.js";import{u as Oe,L as Ve}from"./useStore-DC77ufHd.js";import{S as H,C as Ye,F as Ze,c as qe,P as Je,d as Qe,H as Xe,e as et}from"./categories-CJDomWri.js";import{L as U}from"./LoadMore-CPg41rwp.js";import{u as D}from"./useInfiniteGrid-ottWIC3k.js";import{E as G}from"./ErrorNotice-qXSCgBBe.js";import{G as K}from"./grid.styles-4uR2Oqak.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const{colors:u,radius:X,media:tt}=Z,it=r.article`
1
+ import{d as V,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";import{t as Y,F as je,H as R,G as W,s as r,be as ve,aq as Ce,bf as ye,b as t,bg as $e,bh as _,B as ke,ac as Z,W as J,n as Ne,y as Q,I as T,c as Pe,q as Se,af as S,C as Le,ag as Ae,bd as Fe,bi as Ee}from"./index-D-7WCtxn.js";import{d as Me,g as ze,a as Be,P as Ie,C as Re,b as We,c as _e,A as Te,B as He,S as Ge,M as Ue,e as De,f as Ke}from"./browseLayout.styles-BdkLZM96.js";import{u as Oe,L as qe}from"./useStore-DYpF-pdm.js";import{S as H,C as Ve,F as Ye,c as Ze,P as Je,d as Qe,H as Xe,e as et}from"./categories-B569rNQU.js";import{L as G}from"./LoadMore-D8E5F-8f.js";import{u as U}from"./useInfiniteGrid-_3YA45kU.js";import{E as D}from"./ErrorNotice-BCKaFzga.js";import{G as K}from"./grid.styles-BZkFiBLS.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const{colors:u,radius:X,media:tt}=Y,it=r.article`
2
2
  height: 300px;
3
3
  background: ${u.bg};
4
4
  border-radius: ${X.card};
@@ -15,10 +15,10 @@ import{d as Y,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";im
15
15
  }
16
16
 
17
17
  &:focus-visible {
18
- ${I};
18
+ ${R};
19
19
  }
20
20
  &:focus-visible::after {
21
- ${_};
21
+ ${W};
22
22
  }
23
23
 
24
24
  // The swap is a pointer affordance only: keyboard focus must not hide the creator row, whose profile
@@ -26,10 +26,10 @@ import{d as Y,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";im
26
26
  // already opens the collection.
27
27
  @media (hover: hover) {
28
28
  &:hover {
29
- ${I};
29
+ ${R};
30
30
  }
31
31
  &:hover::after {
32
- ${_};
32
+ ${W};
33
33
  }
34
34
  &:hover [data-view] {
35
35
  visibility: visible;
@@ -112,7 +112,7 @@ import{d as Y,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";im
112
112
  font-weight: 600;
113
113
  font-size: 14px;
114
114
  white-space: nowrap;
115
- `,pt=r.button`
115
+ `,gt=r.button`
116
116
  visibility: hidden;
117
117
  width: 100%;
118
118
  height: 44px;
@@ -135,7 +135,7 @@ import{d as Y,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";im
135
135
  &:active {
136
136
  background: ${u.accentActive};
137
137
  }
138
- `;function gt({collection:a,cover:i,itemCount:s}){const n=Y(),{contractAddress:g,name:x,creator:b}=a,C=i==null||s==null,{data:d}=ye(g,C),w=i==null?(d==null?void 0:d.items)??[]:[],m=s??(d==null?void 0:d.total);function f(){n(`/collection/${g}`)}return e.jsxs(it,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:f,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f())},children:[e.jsx(ot,{children:i?e.jsx(rt,{"data-testid":"coll-card-img",src:i,alt:"",loading:"lazy"}):w.length>0?e.jsx(at,{items:w,tinted:!1}):null}),e.jsxs(st,{children:[e.jsx(nt,{title:x,children:x}),e.jsxs(ct,{children:[e.jsxs(lt,{"data-meta":!0,"data-testid":"coll-card-meta",children:[b?e.jsx(dt,{address:b,linkToProfile:!0}):e.jsx(ht,{children:" "}),e.jsx(xt,{children:m==null?"…":t("collectionCard.itemCount",{count:m})})]}),e.jsx(pt,{"data-view":!0,"data-testid":"coll-card-view",onClick:h=>{h.stopPropagation(),f()},tabIndex:-1,children:t("collectionCard.viewCollection")})]})]})]})}function mt({address:a,className:i=""}){const s=$e(),n=W(x=>x.followed.includes(a.toLowerCase())),g=W(x=>x.toggle);return!s||!a?null:e.jsx(ke,{type:"button",size:"sm",variant:n?"ghost":"outline",className:i||void 0,"aria-pressed":n,title:n?t("creator.unfollowTitle"):t("creator.followTitle"),onClick:()=>g(a),children:n?t("creator.following"):t("creator.follow")})}const{colors:v,radius:ee,media:j}=Z,te=q`
138
+ `;function pt({collection:a,cover:i,itemCount:s}){const n=V(),{contractAddress:p,name:x,creator:b}=a,C=i==null||s==null,{data:d}=ye(p,C),w=i==null?(d==null?void 0:d.items)??[]:[],m=s??(d==null?void 0:d.total);function f(){n(`/collection/${p}`)}return e.jsxs(it,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:f,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f())},children:[e.jsx(ot,{children:i?e.jsx(rt,{"data-testid":"coll-card-img",src:i,alt:"",loading:"lazy"}):w.length>0?e.jsx(at,{items:w,tinted:!1}):null}),e.jsxs(st,{children:[e.jsx(nt,{title:x,children:x}),e.jsxs(ct,{children:[e.jsxs(lt,{"data-meta":!0,"data-testid":"coll-card-meta",children:[b?e.jsx(dt,{address:b,linkToProfile:!0}):e.jsx(ht,{children:" "}),e.jsx(xt,{children:m==null?"…":t("collectionCard.itemCount",{count:m})})]}),e.jsx(gt,{"data-view":!0,"data-testid":"coll-card-view",onClick:h=>{h.stopPropagation(),f()},tabIndex:-1,children:t("collectionCard.viewCollection")})]})]})]})}function mt({address:a,className:i=""}){const s=$e(),n=_(x=>x.followed.includes(a.toLowerCase())),p=_(x=>x.toggle);return!s||!a?null:e.jsx(ke,{type:"button",size:"sm",variant:n?"ghost":"outline",className:i||void 0,"aria-pressed":n,title:n?t("creator.unfollowTitle"):t("creator.followTitle"),onClick:()=>p(a),children:n?t("creator.following"):t("creator.follow")})}const{colors:v,radius:ee,media:j}=Y,te=Z`
139
139
  display: inline-flex;
140
140
  align-items: center;
141
141
  justify-content: center;
@@ -197,7 +197,7 @@ import{d as Y,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";im
197
197
  right: 12px;
198
198
  gap: 6px;
199
199
  }
200
- `,ie=q`
200
+ `,ie=Z`
201
201
  display: flex;
202
202
  align-items: center;
203
203
  justify-content: center;
@@ -303,4 +303,4 @@ import{d as Y,j as e,L as be,u as fe,e as we,r as y}from"./react-DehiWSvs.js";im
303
303
  &:hover {
304
304
  background: rgba(255, 255, 255, 0.14);
305
305
  }
306
- `,St={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Lt({address:a}){var h,$;const{data:i}=J(a),{data:s}=Oe(a),n=Ne(l=>{var k;return(k=l.session)==null?void 0:k.address}),g=!!n&&n.toLowerCase()===a.toLowerCase(),x=(i==null?void 0:i.name)||Q(a),b=($=(h=i==null?void 0:i.avatar)==null?void 0:h.snapshots)==null?void 0:$.face256,C=(s==null?void 0:s.cover)||Me,d=s==null?void 0:s.description,w=`${Pe.profileUrl}/${a}`,m=Ve.filter(l=>s==null?void 0:s.links[l]),f=ze(Be({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??a}));return e.jsxs(ut,{"aria-label":`${x} storefront`,children:[e.jsxs(bt,{children:[e.jsx(ft,{src:C,alt:"",loading:"eager"}),e.jsx(wt,{"aria-hidden":!0})]}),(m.length>0||g)&&e.jsxs(jt,{children:[m.map(l=>e.jsx(vt,{"data-testid":"creator-hero-link",href:(s==null?void 0:s.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:t(`creator.link.${l}`),"aria-label":t(`creator.link.${l}`),children:e.jsx(T,{name:St[l]})},l)),g&&e.jsx(Ct,{to:"/store-settings",title:t("creator.editStore"),"aria-label":t("creator.editStore"),children:e.jsx(T,{name:"pen"})})]}),e.jsxs(yt,{children:[b?e.jsx(O,{src:b,alt:"",loading:"eager",style:{backgroundColor:f}}):e.jsx(O,{as:"span","aria-hidden":!0,style:{backgroundColor:f}}),e.jsxs("div",{children:[e.jsx($t,{children:x}),d?e.jsx(kt,{children:d}):null]}),e.jsxs(Nt,{children:[e.jsx(Pt,{"data-testid":"creator-hero-view",href:w,target:"_blank",rel:"noopener noreferrer",children:t("creator.viewProfile")}),e.jsx(mt,{address:a,className:"creator-hero__follow"})]})]})]})}const V=48;function Dt(){const{address:a}=fe(),i=Y(),[s]=we(),n=s.has("collections"),{data:g}=J(a),x=(g==null?void 0:g.name)||(a?Q(a):t("creator.fallbackName"));Se({title:x,description:t("seo.creator.description",{name:x})});const[b,C]=y.useState("wearable"),[d,w]=y.useState(null),[m,f]=y.useState([]),[h,$]=y.useState(""),[l,k]=y.useState(""),[A,oe]=y.useState("newest"),E=h&&!Number.isNaN(Number(h))?Number(h):void 0,F=l&&!Number.isNaN(Number(l))?Number(l):void 0,re=d?et[d]:void 0,ae=(H.find(o=>o.key===A)??H[0]).server,M={creator:a,category:b,rarities:m.length?m:void 0,wearableCategories:re,minPriceCredits:E,maxPriceCredits:F,sortBy:ae},{items:N,total:se,isLoading:P,error:z,hasNextPage:ne,isFetchingNextPage:B,isFetchNextPageError:ce,fetchNextPage:le}=D(["creator-listings",M],o=>Ee({...M,first:V,skip:o}),{enabled:!!a&&!n}),p=D(["creator-collections",a],o=>Fe(a,{first:V,skip:o}).then(c=>({items:c.collections,total:c.total})),{enabled:!!a&&n});function de(o){C(o),w(null),n&&R()}function R(){const o=new URLSearchParams(s);o.delete("collections");const c=o.toString();i({search:c?`?${c}`:""},{replace:!0})}function he(){if(n){R();return}const o=new URLSearchParams(s);o.delete("collections");const c=o.toString();i({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function xe(o){f(c=>c.includes(o)?c.filter(ue=>ue!==o):[...c,o])}function pe(){C("wearable"),w(null),f([]),$(""),k("")}const L=!!(E||F),ge=L?`${h||"0"}–${l||"∞"}`:t("filter.price"),me=b!=="wearable"||!!d||m.length>0||L;return e.jsxs(Re,{children:[e.jsxs(Ie,{"aria-label":t("creator.breadcrumbAria"),children:[e.jsx(_e,{onClick:()=>i("/items"),children:t("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(We,{children:x})]}),a?e.jsx(Lt,{address:a}):null,!n&&!P&&N.length>0?e.jsx(Te,{items:N,source:"creator"}):null,e.jsxs(He,{children:[e.jsx(Ue,{children:e.jsx(Ye,{category:b,subCategory:d,onCategory:de,onSub:w,title:t("creator.category"),flat:!0,collections:n,onCollections:he})}),e.jsx(De,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{children:e.jsx(Ke,{children:p.isLoading?"…":t("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(G,{message:t("creator.error")}):null,e.jsx(K,{"data-variant":"collections",children:p.isLoading?e.jsx(S,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(o=>e.jsx(gt,{collection:o,itemCount:o.itemCount},o.contractAddress)),p.isFetchingNextPage?e.jsx(S,{count:6}):null]})}),e.jsx(U,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,isError:p.isFetchNextPageError,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:t("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ze,{rarities:m,onToggleRarity:xe,sort:A,onSort:oe,total:se,loading:P,anyActive:me,onClear:pe,renderTrailing:o=>e.jsx(qe,{panelKey:"price",label:ge,active:L,panel:o,children:e.jsxs(Je,{"data-variant":"price",children:[e.jsxs(Qe,{children:[e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMin"),placeholder:t("creator.priceMinPlaceholder"),value:h,onChange:c=>$(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMax"),placeholder:t("creator.priceMaxPlaceholder"),value:l,onChange:c=>k(c.target.value)})]}),e.jsx(Xe,{children:t("creator.priceHint",{currency:Le.name})})]})})}),z?e.jsx(G,{message:t("creator.error")}):null,e.jsx(K,{children:P?e.jsx(S,{count:15}):e.jsxs(e.Fragment,{children:[N.map(o=>e.jsx(Ae,{item:o},o.id)),B?e.jsx(S,{count:6}):null]})}),e.jsx(U,{hasNextPage:ne,isFetching:B,isError:ce,onLoadMore:()=>void le()}),!P&&!z&&N.length===0?e.jsx("p",{className:"muted",children:t("creator.empty")}):null]})})]})]})}export{Dt as Creator,Dt as default};
306
+ `,St={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Lt({address:a}){var h,$;const{data:i}=J(a),{data:s}=Oe(a),n=Ne(l=>{var k;return(k=l.session)==null?void 0:k.address}),p=!!n&&n.toLowerCase()===a.toLowerCase(),x=(i==null?void 0:i.name)||Q(a),b=($=(h=i==null?void 0:i.avatar)==null?void 0:h.snapshots)==null?void 0:$.face256,C=(s==null?void 0:s.cover)||Me,d=s==null?void 0:s.description,w=`${Pe.profileUrl}/${a}`,m=qe.filter(l=>s==null?void 0:s.links[l]),f=ze(Be({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??a}));return e.jsxs(ut,{"aria-label":`${x} storefront`,children:[e.jsxs(bt,{children:[e.jsx(ft,{src:C,alt:"",loading:"eager"}),e.jsx(wt,{"aria-hidden":!0})]}),(m.length>0||p)&&e.jsxs(jt,{children:[m.map(l=>e.jsx(vt,{"data-testid":"creator-hero-link",href:(s==null?void 0:s.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:t(`creator.link.${l}`),"aria-label":t(`creator.link.${l}`),children:e.jsx(T,{name:St[l]})},l)),p&&e.jsx(Ct,{to:"/store-settings",title:t("creator.editStore"),"aria-label":t("creator.editStore"),children:e.jsx(T,{name:"pen"})})]}),e.jsxs(yt,{children:[b?e.jsx(O,{src:b,alt:"",loading:"eager",style:{backgroundColor:f}}):e.jsx(O,{as:"span","aria-hidden":!0,style:{backgroundColor:f}}),e.jsxs("div",{children:[e.jsx($t,{children:x}),d?e.jsx(kt,{children:d}):null]}),e.jsxs(Nt,{children:[e.jsx(Pt,{"data-testid":"creator-hero-view",href:w,target:"_blank",rel:"noopener noreferrer",children:t("creator.viewProfile")}),e.jsx(mt,{address:a,className:"creator-hero__follow"})]})]})]})}const q=48;function Ut(){const{address:a}=fe(),i=V(),[s]=we(),n=s.has("collections"),{data:p}=J(a),x=(p==null?void 0:p.name)||(a?Q(a):t("creator.fallbackName"));Se({title:x,description:t("seo.creator.description",{name:x})});const[b,C]=y.useState("wearable"),[d,w]=y.useState(null),[m,f]=y.useState([]),[h,$]=y.useState(""),[l,k]=y.useState(""),[A,oe]=y.useState("newest"),F=h&&!Number.isNaN(Number(h))?Number(h):void 0,E=l&&!Number.isNaN(Number(l))?Number(l):void 0,re=d?et[d]:void 0,ae=(H.find(o=>o.key===A)??H[0]).server,M={creator:a,category:b,rarities:m.length?m:void 0,wearableCategories:re,minPriceCredits:F,maxPriceCredits:E,sortBy:ae},{items:N,total:se,isLoading:P,error:z,hasNextPage:ne,isFetchingNextPage:B,isFetchNextPageError:ce,fetchNextPage:le}=U(["creator-listings",M],o=>Fe({...M,first:q,skip:o}),{enabled:!!a&&!n}),g=U(["creator-collections",a],o=>Ee(a,{first:q,skip:o}).then(c=>({items:c.collections,total:c.total})),{enabled:!!a&&n});function de(o){C(o),w(null),n&&I()}function I(){const o=new URLSearchParams(s);o.delete("collections");const c=o.toString();i({search:c?`?${c}`:""},{replace:!0})}function he(){if(n){I();return}const o=new URLSearchParams(s);o.delete("collections");const c=o.toString();i({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function xe(o){f(c=>c.includes(o)?c.filter(ue=>ue!==o):[...c,o])}function ge(){C("wearable"),w(null),f([]),$(""),k("")}const L=!!(F||E),pe=L?`${h||"0"}–${l||"∞"}`:t("filter.price"),me=b!=="wearable"||!!d||m.length>0||L;return e.jsxs(Ie,{children:[e.jsxs(Re,{"aria-label":t("creator.breadcrumbAria"),children:[e.jsx(We,{onClick:()=>i("/items"),children:t("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(_e,{children:x})]}),a?e.jsx(Lt,{address:a}):null,!n&&!P&&N.length>0?e.jsx(Te,{items:N,source:"creator"}):null,e.jsxs(He,{children:[e.jsx(Ge,{children:e.jsx(Ve,{category:b,subCategory:d,onCategory:de,onSub:w,title:t("creator.category"),flat:!0,collections:n,onCollections:he})}),e.jsx(Ue,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(De,{children:e.jsx(Ke,{children:g.isLoading?"…":t("creator.collectionsCount",{count:g.total})})}),g.error?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{"data-variant":"collections",children:g.isLoading?e.jsx(S,{count:9}):e.jsxs(e.Fragment,{children:[g.items.map(o=>e.jsx(pt,{collection:o,itemCount:o.itemCount},o.contractAddress)),g.isFetchingNextPage?e.jsx(S,{count:6}):null]})}),e.jsx(G,{hasNextPage:g.hasNextPage,isFetching:g.isFetchingNextPage,isError:g.isFetchNextPageError,onLoadMore:()=>void g.fetchNextPage()}),!g.isLoading&&!g.error&&g.items.length===0?e.jsx("p",{className:"muted",children:t("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ye,{rarities:m,onToggleRarity:xe,sort:A,onSort:oe,total:se,loading:P,anyActive:me,onClear:ge,renderTrailing:o=>e.jsx(Ze,{panelKey:"price",label:pe,active:L,panel:o,children:e.jsxs(Je,{"data-variant":"price",children:[e.jsxs(Qe,{children:[e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMin"),placeholder:t("creator.priceMinPlaceholder"),value:h,onChange:c=>$(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMax"),placeholder:t("creator.priceMaxPlaceholder"),value:l,onChange:c=>k(c.target.value)})]}),e.jsx(Xe,{children:t("creator.priceHint",{currency:Le.name})})]})})}),z?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{children:P?e.jsx(S,{count:15}):e.jsxs(e.Fragment,{children:[N.map(o=>e.jsx(Ae,{item:o},o.id)),B?e.jsx(S,{count:6}):null]})}),e.jsx(G,{hasNextPage:ne,isFetching:B,isError:ce,onLoadMore:()=>void le()}),!P&&!z&&N.length===0?e.jsx("p",{className:"muted",children:t("creator.empty")}):null]})})]})]})}export{Ut as Creator,Ut as default};
@@ -1 +1 @@
1
- import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-CEec1iYe.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
1
+ import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-D-7WCtxn.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
@@ -1 +1 @@
1
- import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-Dd3fipah.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-qOIpyDqw.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
1
+ import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-B0Higky5.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-CI0UD5dV.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
@@ -1,4 +1,4 @@
1
- import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,k as B,m as ue,b as r,d as p,n as ge,q as fe,O as g,b2 as me,j as N,bb as U,I as ie,aZ as H,p as re,bu as O}from"./index-CEec1iYe.js";import{R as D}from"./resume-buy-Bf0zIH7y.js";import{u as be,a as we,R as ye,c as ke,i as Ce,b as ve}from"./useCreditPacks-CYnMKZmp.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./mana-convert-gdOzEDdP.js";const P="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/pack-stacks-D-V2jSHW.webp",oe="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/pack-chest-BX_j84xW.webp",$e="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/credit-coin-CmcTCd5i.webp",je="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",Se="https://cdn.decentraland.org/@dcl/shop/0.5.0/_assets/packs-backdrop-BcXiUPeP.webp",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Pe=i.div`
1
+ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,o as B,q as ue,b as r,C as p,n as ge,x as fe,R as g,b3 as me,j as N,bc as U,I as ie,a_ as H,w as re,bv as D}from"./index-D-7WCtxn.js";import{R as K}from"./resume-buy-Bf0zIH7y.js";import{u as be,a as we,R as ye,c as ke,i as Ce,b as ve}from"./useCreditPacks-BM-De58w.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./mana-convert-dJqmfJfM.js";const P="https://cdn.decentraland.org/@dcl/shop/0.5.1-30936450524.commit-699b9ba/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.5.1-30936450524.commit-699b9ba/_assets/pack-stacks-D-V2jSHW.webp",oe="https://cdn.decentraland.org/@dcl/shop/0.5.1-30936450524.commit-699b9ba/_assets/pack-chest-BX_j84xW.webp",$e="https://cdn.decentraland.org/@dcl/shop/0.5.1-30936450524.commit-699b9ba/_assets/credit-coin-CmcTCd5i.webp",je="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",Se="https://cdn.decentraland.org/@dcl/shop/0.5.1-30936450524.commit-699b9ba/_assets/packs-backdrop-BcXiUPeP.webp",O="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Pe=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 24px;
@@ -175,9 +175,9 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
175
175
  inset: 0;
176
176
  border-radius: inherit;
177
177
  pointer-events: none;
178
- -webkit-mask: ${K};
178
+ -webkit-mask: ${O};
179
179
  -webkit-mask-composite: xor;
180
- mask: ${K};
180
+ mask: ${O};
181
181
  mask-composite: exclude;
182
182
  transition: opacity 0.15s ease;
183
183
  }
@@ -383,16 +383,16 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
383
383
  @media (prefers-reduced-motion: reduce) {
384
384
  animation: none;
385
385
  }
386
- `,Oe=i(E)`
386
+ `,De=i(E)`
387
387
  width: 60%;
388
388
  height: 30px;
389
389
  border-radius: ${e.radius.chip};
390
- `,De=i(E)`
390
+ `,Ke=i(E)`
391
391
  width: 253.5px;
392
392
  max-width: 100%;
393
393
  aspect-ratio: 1;
394
394
  border-radius: 16px;
395
- `,Ke=i(E)`
395
+ `,Oe=i(E)`
396
396
  width: 100%;
397
397
  height: 48px;
398
398
  border-radius: ${e.radius.card};
@@ -668,4 +668,4 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
668
668
  margin: 0;
669
669
  font-family: ${e.font.sans};
670
670
  color: ${e.colors.err};
671
- `,v=Ce()?"mock":"stripe",ee=[P,P,ne,oe],bt={pack_5:P,pack_10:P,pack_25:ne,pack_50:oe};function ae(a,o){return bt[a.id]??ee[o%ee.length]}function wt(a,o){return a.artUrl??ae(a,o)}const yt="https://docs.decentraland.org";function te(a){const o=a;if((o==null?void 0:o.name)==="AbortError")return r("getCredits.errorCanceled");const f=((o==null?void 0:o.message)??"").toLowerCase();return f.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function At(){var W;ue({title:r("nav.getCredits",{currency:p.name}),noindex:!0});const a=he(),{session:o,signIn:f}=ge(),s=fe(),[m,b]=xe(),{packs:$,isLoading:y}=be(),[x,h]=l.useState("select"),[c,F]=l.useState(null),[j,L]=l.useState(null),de=(j!=null?(W=$.find(n=>n.credits===j))==null?void 0:W.artUrl:void 0)??$e,[ce,k]=l.useState(null),[le,_]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var n;return(n=R.current)==null?void 0:n.abort()},[]);const I=l.useCallback(()=>{b(n=>{const d=new URLSearchParams(n);return d.delete("order"),d.delete("canceled"),d},{replace:!0})},[b]),T=l.useCallback(async n=>{h("processing");const d=new AbortController;R.current=d;try{const u=await we(n,{signal:d.signal,address:o==null?void 0:o.address,identity:o==null?void 0:o.identity});if(u.status==="credited"){const w=u.creditsGranted??(c==null?void 0:c.credits)??0;L(w>0?w:null),h("success"),g("Shop Completed Buy Credits",{order_id:n,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:v}),s.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ye)){const S={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:S});return}}catch{}try{const S=sessionStorage.getItem(D);if(S){sessionStorage.removeItem(D);const M=JSON.parse(S),G=me(M);if(G){a(G,{state:{item:M,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),s.invalidateQueries({queryKey:["usd-balance"]}),h("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),k(u.error??r("getCredits.errorGrant",{currency:p.name})),h("error"))}catch(u){N(u,{flow:"get_credits",step:"grant",order_id:n}),g("Shop Buy Credits Failed",{step:"grant",error_code:U(u),pack_usd:(c==null?void 0:c.usd)??null}),k(te(u)),h("error")}},[c,o,s,a]),pe=l.useCallback(async n=>{if(!o){f();return}k(null),_(!1),F(n),h(v==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:v});try{const d=await ke(n.id,{address:o.address,identity:o.identity});if(d.mock)T(d.orderId);else if(d.url)g("Shop Redirected To Stripe",{order_id:d.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=d.url;else throw new Error("Checkout did not return a redirect url")}catch(d){N(d,{flow:"get_credits",step:"checkout",provider:v}),g("Shop Buy Credits Failed",{step:"checkout",error_code:U(d),pack_usd:n.usd}),k(te(d)),h("error")}},[o,f,T]),A=l.useRef(!1);l.useEffect(()=>{if(A.current)return;const n=m.get("order");if(m.get("canceled")!=null){A.current=!0,g("Shop Buy Credits Cancelled",{order_id:n,provider:v}),I(),_(!0),h("select");return}n&&(h("processing"),o&&(A.current=!0,I(),T(n)))},[m,o]);function z(){var n;(n=R.current)==null||n.abort(),h("select"),F(null),L(null),k(null),_(!1)}return t.jsxs(Pe,{children:[(x==="select"||x==="redirecting")&&t.jsxs(_e,{"data-testid":"credits-hero",children:[t.jsx(Re,{"aria-hidden":!0}),t.jsxs(Te,{$hidden:x==="redirecting",children:[t.jsxs(Ae,{children:[t.jsx(ze,{children:r("getCredits.title",{currency:p.name})}),t.jsxs(Be,{children:[t.jsx(Ee,{children:r("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Fe,{href:yt,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(ie,{name:"link-out"})]})]})]}),le&&t.jsx(Le,{role:"status",children:r("getCredits.canceledNote")}),t.jsx(kt,{packs:$,loading:y,onSelect:n=>void pe(n)})]}),x==="redirecting"&&t.jsxs(Ve,{role:"status","aria-live":"polite",children:[t.jsx(Ze,{src:H,alt:"",width:72,height:72}),t.jsx(qe,{children:r("getCredits.redirecting")})]})]}),x==="processing"&&t.jsxs(Qe,{role:"status","aria-live":"polite",children:[t.jsx(se,{src:H,alt:"",width:61,height:61}),t.jsxs(Je,{children:[t.jsxs(et,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(tt,{"aria-hidden":!0,children:[t.jsx(rt,{children:t.jsx(nt,{})}),t.jsx(ot,{children:"1/1"})]})]})]}),x==="success"&&t.jsxs(st,{role:"status","aria-live":"polite",children:[t.jsxs(at,{children:[t.jsx(dt,{src:je,alt:"",width:60,height:60}),t.jsxs(ct,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:p.name})]})]}),j!=null&&t.jsx(lt,{children:t.jsxs(pt,{children:[t.jsx(ht,{src:de,alt:"",width:93,height:93}),t.jsxs(xt,{children:[t.jsx(re,{}),t.jsxs("span",{children:[t.jsx(ut,{children:r("getCredits.creditsAmount",{credits:j,currency:p.name})})," ",t.jsx(gt,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(ft,{children:[t.jsx(C,{"data-variant":"outline",onClick:z,children:r("getCredits.buyMore",{currency:p.name})}),t.jsx(C,{onClick:()=>a("/items"),children:r("getCredits.startShopping")})]})]}),x==="pending"&&t.jsxs(Q,{role:"status","aria-live":"polite",children:[t.jsx(Z,{children:r("getCredits.pendingTitle",{currency:p.name})}),t.jsx(Ye,{children:r("getCredits.pendingBody")}),t.jsxs(J,{children:[t.jsx(C,{onClick:()=>a("/items"),children:r("getCredits.startShopping")}),t.jsx(C,{"data-variant":"outline",onClick:z,children:r("getCredits.done")})]})]}),x==="error"&&t.jsxs(Q,{role:"alert",children:[t.jsx(Z,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(mt,{children:ce}),t.jsx(J,{children:t.jsx(C,{onClick:z,children:r("getCredits.tryAgain")})})]})]})}function kt({packs:a,loading:o,onSelect:f}){return o?t.jsx(Y,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(s=>t.jsxs(V,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(q,{children:[t.jsx(X,{children:t.jsx(Oe,{})}),t.jsx(De,{})]}),t.jsx(Ke,{})]},s))}):t.jsx(Y,{children:a.map((s,m)=>{const b=ve(s,a);return t.jsxs(V,{type:"button","data-testid":"pack","data-best":s.bestValue?"true":void 0,onClick:()=>f(s),"aria-label":b?r("getCredits.packAriaBonus",{amount:O(s.credits),usd:s.usd,bonus:b.bonus,baseline:b.baseline}):r("getCredits.packAria",{amount:O(s.credits),usd:s.usd}),children:[s.bestValue&&t.jsxs(Ie,{children:[t.jsx(ie,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(q,{children:[t.jsxs(X,{children:[t.jsxs(We,{children:[t.jsx(re,{}),t.jsx(Me,{children:s.credits})]}),t.jsx(Ge,{children:r("getCredits.packUnit",{currency:p.name})})]}),t.jsx(Ne,{children:t.jsx("img",{src:wt(s,m),alt:"",loading:"lazy",width:507,height:507,onError:$=>{const y=$.currentTarget;y.dataset.artFallback||(y.dataset.artFallback="done",y.src=ae(s,m))}})})]}),t.jsxs(Ue,{children:["$",s.usd.toFixed(2)]})]},s.id)})})}export{At as GetCredits,At as default};
671
+ `,v=Ce()?"mock":"stripe",ee=[P,P,ne,oe],bt={pack_5:P,pack_10:P,pack_25:ne,pack_50:oe};function ae(a,o){return bt[a.id]??ee[o%ee.length]}function wt(a,o){return a.artUrl??ae(a,o)}const yt="https://docs.decentraland.org";function te(a){const o=a;if((o==null?void 0:o.name)==="AbortError")return r("getCredits.errorCanceled");const f=((o==null?void 0:o.message)??"").toLowerCase();return f.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function At(){var W;ue({title:r("nav.getCredits",{currency:p.name}),noindex:!0});const a=he(),{session:o,signIn:f}=ge(),s=fe(),[m,b]=xe(),{packs:$,isLoading:y}=be(),[x,h]=l.useState("select"),[c,F]=l.useState(null),[j,L]=l.useState(null),de=(j!=null?(W=$.find(n=>n.credits===j))==null?void 0:W.artUrl:void 0)??$e,[ce,k]=l.useState(null),[le,_]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var n;return(n=R.current)==null?void 0:n.abort()},[]);const I=l.useCallback(()=>{b(n=>{const d=new URLSearchParams(n);return d.delete("order"),d.delete("canceled"),d},{replace:!0})},[b]),T=l.useCallback(async n=>{h("processing");const d=new AbortController;R.current=d;try{const u=await we(n,{signal:d.signal,address:o==null?void 0:o.address,identity:o==null?void 0:o.identity});if(u.status==="credited"){const w=u.creditsGranted??(c==null?void 0:c.credits)??0;L(w>0?w:null),h("success"),g("Shop Completed Buy Credits",{order_id:n,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:v}),s.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ye)){const S={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:S});return}}catch{}try{const S=sessionStorage.getItem(K);if(S){sessionStorage.removeItem(K);const M=JSON.parse(S),G=me(M);if(G){a(G,{state:{item:M,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),s.invalidateQueries({queryKey:["usd-balance"]}),h("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),k(u.error??r("getCredits.errorGrant",{currency:p.name})),h("error"))}catch(u){N(u,{flow:"get_credits",step:"grant",order_id:n}),g("Shop Buy Credits Failed",{step:"grant",error_code:U(u),pack_usd:(c==null?void 0:c.usd)??null}),k(te(u)),h("error")}},[c,o,s,a]),pe=l.useCallback(async n=>{if(!o){f();return}k(null),_(!1),F(n),h(v==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:v});try{const d=await ke(n.id,{address:o.address,identity:o.identity});if(d.mock)T(d.orderId);else if(d.url)g("Shop Redirected To Stripe",{order_id:d.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=d.url;else throw new Error("Checkout did not return a redirect url")}catch(d){N(d,{flow:"get_credits",step:"checkout",provider:v}),g("Shop Buy Credits Failed",{step:"checkout",error_code:U(d),pack_usd:n.usd}),k(te(d)),h("error")}},[o,f,T]),A=l.useRef(!1);l.useEffect(()=>{if(A.current)return;const n=m.get("order");if(m.get("canceled")!=null){A.current=!0,g("Shop Buy Credits Cancelled",{order_id:n,provider:v}),I(),_(!0),h("select");return}n&&(h("processing"),o&&(A.current=!0,I(),T(n)))},[m,o]);function z(){var n;(n=R.current)==null||n.abort(),h("select"),F(null),L(null),k(null),_(!1)}return t.jsxs(Pe,{children:[(x==="select"||x==="redirecting")&&t.jsxs(_e,{"data-testid":"credits-hero",children:[t.jsx(Re,{"aria-hidden":!0}),t.jsxs(Te,{$hidden:x==="redirecting",children:[t.jsxs(Ae,{children:[t.jsx(ze,{children:r("getCredits.title",{currency:p.name})}),t.jsxs(Be,{children:[t.jsx(Ee,{children:r("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Fe,{href:yt,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(ie,{name:"link-out"})]})]})]}),le&&t.jsx(Le,{role:"status",children:r("getCredits.canceledNote")}),t.jsx(kt,{packs:$,loading:y,onSelect:n=>void pe(n)})]}),x==="redirecting"&&t.jsxs(Ve,{role:"status","aria-live":"polite",children:[t.jsx(Ze,{src:H,alt:"",width:72,height:72}),t.jsx(qe,{children:r("getCredits.redirecting")})]})]}),x==="processing"&&t.jsxs(Qe,{role:"status","aria-live":"polite",children:[t.jsx(se,{src:H,alt:"",width:61,height:61}),t.jsxs(Je,{children:[t.jsxs(et,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(tt,{"aria-hidden":!0,children:[t.jsx(rt,{children:t.jsx(nt,{})}),t.jsx(ot,{children:"1/1"})]})]})]}),x==="success"&&t.jsxs(st,{role:"status","aria-live":"polite",children:[t.jsxs(at,{children:[t.jsx(dt,{src:je,alt:"",width:60,height:60}),t.jsxs(ct,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:p.name})]})]}),j!=null&&t.jsx(lt,{children:t.jsxs(pt,{children:[t.jsx(ht,{src:de,alt:"",width:93,height:93}),t.jsxs(xt,{children:[t.jsx(re,{}),t.jsxs("span",{children:[t.jsx(ut,{children:r("getCredits.creditsAmount",{credits:j,currency:p.name})})," ",t.jsx(gt,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(ft,{children:[t.jsx(C,{"data-variant":"outline",onClick:z,children:r("getCredits.buyMore",{currency:p.name})}),t.jsx(C,{onClick:()=>a("/items"),children:r("getCredits.startShopping")})]})]}),x==="pending"&&t.jsxs(Q,{role:"status","aria-live":"polite",children:[t.jsx(Z,{children:r("getCredits.pendingTitle",{currency:p.name})}),t.jsx(Ye,{children:r("getCredits.pendingBody")}),t.jsxs(J,{children:[t.jsx(C,{onClick:()=>a("/items"),children:r("getCredits.startShopping")}),t.jsx(C,{"data-variant":"outline",onClick:z,children:r("getCredits.done")})]})]}),x==="error"&&t.jsxs(Q,{role:"alert",children:[t.jsx(Z,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(mt,{children:ce}),t.jsx(J,{children:t.jsx(C,{onClick:z,children:r("getCredits.tryAgain")})})]})]})}function kt({packs:a,loading:o,onSelect:f}){return o?t.jsx(Y,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(s=>t.jsxs(V,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(q,{children:[t.jsx(X,{children:t.jsx(De,{})}),t.jsx(Ke,{})]}),t.jsx(Oe,{})]},s))}):t.jsx(Y,{children:a.map((s,m)=>{const b=ve(s,a);return t.jsxs(V,{type:"button","data-testid":"pack","data-best":s.bestValue?"true":void 0,onClick:()=>f(s),"aria-label":b?r("getCredits.packAriaBonus",{amount:D(s.credits),usd:s.usd,bonus:b.bonus,baseline:b.baseline}):r("getCredits.packAria",{amount:D(s.credits),usd:s.usd}),children:[s.bestValue&&t.jsxs(Ie,{children:[t.jsx(ie,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(q,{children:[t.jsxs(X,{children:[t.jsxs(We,{children:[t.jsx(re,{}),t.jsx(Me,{children:s.credits})]}),t.jsx(Ge,{children:r("getCredits.packUnit",{currency:p.name})})]}),t.jsx(Ne,{children:t.jsx("img",{src:wt(s,m),alt:"",loading:"lazy",width:507,height:507,onError:$=>{const y=$.currentTarget;y.dataset.artFallback||(y.dataset.artFallback="done",y.src=ae(s,m))}})})]}),t.jsxs(Ue,{children:["$",s.usd.toFixed(2)]})]},s.id)})})}export{At as GetCredits,At as default};
@@ -1,4 +1,4 @@
1
- import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-TXpJyzEO.js";import{d as g,r as v}from"./index-qOIpyDqw.js";import{C as c}from"./ConstantsUtil-Di3dRDAF.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-Dd3fipah.js";import{au as y}from"./NetworkUtil-EoWQDMpU.js";const b=g`
1
+ import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-BPaO_ntB.js";import{d as g,r as v}from"./index-CI0UD5dV.js";import{C as c}from"./ConstantsUtil-Di3dRDAF.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-B0Higky5.js";import{au as y}from"./NetworkUtil-EoWQDMpU.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;