@dcl/shop 0.7.2 → 0.7.3-30998099552.commit-f7fa6e3

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 (174) hide show
  1. package/_assets/{Activity-Jc4Ww2Np.js → Activity-CcCu8Od6.js} +3 -3
  2. package/_assets/{AnimatedBackground-Be3B4ztI.js → AnimatedBackground-xf-j6J30.js} +1 -1
  3. package/_assets/{Assets-DoF0RVFp.js → Assets-B9oJjG4n.js} +2 -2
  4. package/_assets/{Assets.styles-IIy06Oye.js → Assets.styles-BYFeJKPe.js} +1 -1
  5. package/_assets/{Authorizations-b9znutOi.js → Authorizations-D5dl-34t.js} +1 -1
  6. package/_assets/{Cart-CFsD5IlH.js → Cart-BU0E1kp3.js} +2 -2
  7. package/_assets/{CircularProgress-wU--wY5P.js → CircularProgress-ogI8F2v0.js} +1 -1
  8. package/_assets/{Collection-CsVwPele.js → Collection--mvsoerx.js} +1 -1
  9. package/_assets/{CollectionCarousel-DelfAKnZ.js → CollectionCarousel-DVB8xJEb.js} +1 -1
  10. package/_assets/{Creator-CJuvJbZ7.js → Creator-BuMUJ_0H.js} +1 -1
  11. package/_assets/{ErrorNotice-3r5bQgT2.js → ErrorNotice-CmE8Bw2a.js} +1 -1
  12. package/_assets/{ExchangeController-CxfrLhaH.js → ExchangeController-ptA9AGiC.js} +1 -1
  13. package/_assets/Faq-mPkwptjW.js +168 -0
  14. package/_assets/{GetCredits-Dn-IHOnM.js → GetCredits-kPP7odsJ.js} +87 -68
  15. package/_assets/{Grow-BmECuNyH.js → Grow-2tBlbsbN.js} +1 -1
  16. package/_assets/{HelpersUtil-Bvk_vk1Y.js → HelpersUtil-BhMvvX5p.js} +1 -1
  17. package/_assets/{ItemDetail-ByHvYOS_.js → ItemDetail-BBfILay8.js} +1 -1
  18. package/_assets/LazyEmoteControls-8b5UZhSs.js +2 -0
  19. package/_assets/{LoadMore-CymwFW-m.js → LoadMore-CPMkfBBp.js} +1 -1
  20. package/_assets/{ManaPricingBanner.styles-B36mIGF3.js → ManaPricingBanner.styles-C9hjNdio.js} +1 -1
  21. package/_assets/{MyAssets-CE5nGbGF.js → MyAssets-CkicCdty.js} +1 -1
  22. package/_assets/{MyFavorites-Bk3TaFpw.js → MyFavorites-CRs6BUTO.js} +1 -1
  23. package/_assets/{NotFound-DtwVRkn9.js → NotFound-DbXDxLPP.js} +1 -1
  24. package/_assets/{NotificationsBell-CayuJgBV.js → NotificationsBell-CeytqPp_.js} +1 -1
  25. package/_assets/{OutfitDetail-CYCbMvMy.js → OutfitDetail-DhAPMkez.js} +1 -1
  26. package/_assets/{OutfitPreview-4ZQworXq.js → OutfitPreview-C08Jf7mn.js} +1 -1
  27. package/_assets/{OutfitStudio-B7JjH_OJ.js → OutfitStudio-Bpg_2rBv.js} +1 -1
  28. package/_assets/{StoreSettings-DZqto59M.js → StoreSettings-CkHNFMS9.js} +1 -1
  29. package/_assets/{Success-BXd4vOmE.js → Success-CXkJDsIM.js} +1 -1
  30. package/_assets/{SwapController-D_HE5-4t.js → SwapController-CNP2nUqB.js} +1 -1
  31. package/_assets/{Tooltip-CH3i2AZ8.js → Tooltip-Ca1xi18J.js} +1 -1
  32. package/_assets/{TradeService-8wrIkkCU.js → TradeService-pK5iIjeI.js} +1 -1
  33. package/_assets/{W3MFrameProviderSingleton-hR4mAmko.js → W3MFrameProviderSingleton-FyX1W-1Y.js} +3 -3
  34. package/_assets/{WebCryptoP256-CUVz0sT-.js → WebCryptoP256-lGIWaHSV.js} +1 -1
  35. package/_assets/{authorizations-CkEL0cRE.js → authorizations-C776tgTp.js} +1 -1
  36. package/_assets/{basic-CjxOIetC.js → basic-B5CZMUy4.js} +1 -1
  37. package/_assets/{biconomy-8Mii_u_D.js → biconomy-BcosBJNp.js} +1 -1
  38. package/_assets/{builder-BoC6pJY-.js → builder-CsxZ_GQ8.js} +1 -1
  39. package/_assets/{buy-C5VKib6d.js → buy-BZ3zKYDO.js} +1 -1
  40. package/_assets/{buy-gasless-CtdtD4yw.js → buy-gasless-eYZufj8D.js} +1 -1
  41. package/_assets/{categories-N60mkQ85.js → categories-Bhx5AiD0.js} +1 -1
  42. package/_assets/{ccip-CkHWEn4N.js → ccip-DmdM_5D9.js} +1 -1
  43. package/_assets/{ccip-BfABfKqd.js → ccip-DrUklMi-.js} +1 -1
  44. package/_assets/{collectionPage.styles-BWGZLOL_.js → collectionPage.styles-CJq9b5Dn.js} +1 -1
  45. package/_assets/{controller-bg1czStV.js → controller-C-sKqF34.js} +2 -2
  46. package/_assets/{core-CI81_wqW.js → core-CriR9cGd.js} +4 -4
  47. package/_assets/{createSvgIcon-BG_h01sL.js → createSvgIcon-BntPICgm.js} +1 -1
  48. package/_assets/{custom-BNXh19kf.js → custom-FzLs4-KY.js} +1 -1
  49. package/_assets/{data-capture-Gwo_M6sW.js → data-capture-Du1PLWpA.js} +1 -1
  50. package/_assets/{email-Bnr-9hTW.js → email-C0nzy1sI.js} +1 -1
  51. package/_assets/{embedded-wallet-D4jo3k6W.js → embedded-wallet-CVZ_vFlC.js} +1 -1
  52. package/_assets/{emotion-styled.browser.esm-Bd2qjAcz.js → emotion-styled.browser.esm-CJtlF7Gn.js} +1 -1
  53. package/_assets/{engine-C--F6ENC.js → engine-Cn3nxRwN.js} +1 -1
  54. package/_assets/{errors-Du3dWMbd.js → errors-C-i7myPZ.js} +1 -1
  55. package/_assets/{estimate-l1-fee-DtQQVymm.js → estimate-l1-fee-Dpb0Bl0S.js} +1 -1
  56. package/_assets/{execute-DbnGyz94.js → execute-wHrMFCta.js} +2 -2
  57. package/_assets/{features-BkFSf-iq.js → features-5HsC8l6J.js} +1 -1
  58. package/_assets/{fetchTokenMetadata-DFggI2iY.js → fetchTokenMetadata-MnlAMPaL.js} +2 -2
  59. package/_assets/{field.styles-D3cOLW18.js → field.styles-BIjk7dlh.js} +1 -1
  60. package/_assets/{get-ecosystem-wallet-info-11sCnJ-7.js → get-ecosystem-wallet-info-BtHiGyT4.js} +1 -1
  61. package/_assets/{getBalance-QGjDk77O.js → getBalance-BFjfr7yO.js} +1 -1
  62. package/_assets/{getNFT-BVVv_-0Y.js → getNFT-T59O6JYG.js} +1 -1
  63. package/_assets/{getNFT-BJ8yr01Z.js → getNFT-zUEFFArE.js} +1 -1
  64. package/_assets/{grid.styles-CFQtLncp.js → grid.styles-CKmGs0rK.js} +1 -1
  65. package/_assets/{hashTypedData-gN3c95l4.js → hashTypedData-CCw0LbC7.js} +1 -1
  66. package/_assets/{hashTypedData-BXX-P_dP.js → hashTypedData-EoQ_H9e4.js} +1 -1
  67. package/_assets/{in-app-kBwlyl-f.js → in-app-BpY0Ul44.js} +1 -1
  68. package/_assets/{in-app-wallet-calls-BN8r6OBs.js → in-app-wallet-calls-_O1gpzp1.js} +1 -1
  69. package/_assets/{index-Bakfg_1g.js → index-0HOZkX4v.js} +1 -1
  70. package/_assets/{index-C4Ua5jGw.js → index-51jxmcXj.js} +1 -1
  71. package/_assets/{index-DLzdQycs.js → index-B5t_uF6K.js} +1 -1
  72. package/_assets/{index-CKac0RNB.js → index-B64uIzbz.js} +1 -1
  73. package/_assets/{index-Bm7j_2aS.js → index-B9oBk5HA.js} +1 -1
  74. package/_assets/{index-B4M8sJUj.js → index-BB2qMLiD.js} +1 -1
  75. package/_assets/{index-DxojTLnQ.js → index-BCeaifQW.js} +1 -1
  76. package/_assets/{index-YZKg7WM1.js → index-BF0Lz5Vl.js} +3 -3
  77. package/_assets/{index-C786VheW.js → index-BRr_EKCC.js} +1 -1
  78. package/_assets/{index-CMeSxiXG.js → index-BmNvCSoW.js} +1 -1
  79. package/_assets/{index-DDc9MCuJ.js → index-BqhVw7jY.js} +56 -54
  80. package/_assets/{index-cvhPRrXA.js → index-BuJNwdV6.js} +1 -1
  81. package/_assets/{index-TTZwY716.js → index-C2wq-XJv.js} +1 -1
  82. package/_assets/{index-CzYiATyr.js → index-C7-Ojv7c.js} +1 -1
  83. package/_assets/{index-CqVxBPGc.js → index-CME7Vo6o.js} +1 -1
  84. package/_assets/{index-kPR91X9E.js → index-CQi6H5fT.js} +1 -1
  85. package/_assets/{index-Dyh7pyxx.js → index-CS3o6W8g.js} +1 -1
  86. package/_assets/{index-DInQ5jG-.js → index-Ca53lSVK.js} +1 -1
  87. package/_assets/{index-B4bQ_g5A.js → index-Cc8-wJI-.js} +1 -1
  88. package/_assets/{index-DN1pJSb7.js → index-CdmR3BSr.js} +1 -1
  89. package/_assets/{index-xPEXNMYS.js → index-CfiGBXge.js} +1 -1
  90. package/_assets/{index-DrqL3wnf.js → index-ClfJzt8j.js} +1 -1
  91. package/_assets/{index-BtNS6Sv0.js → index-CoGa5SSH.js} +1 -1
  92. package/_assets/{index-tpmZJbVV.js → index-CrkAzP5M.js} +1 -1
  93. package/_assets/{index-zQ8cxU2G.js → index-CsqetYWp.js} +1 -1
  94. package/_assets/index-CzGc0rp2.js +3386 -0
  95. package/_assets/{index-D9xYIYaf.js → index-D7izat5n.js} +1 -1
  96. package/_assets/{index-I2lMQseb.js → index-D9BXwvii.js} +1 -1
  97. package/_assets/{index-Cxw303yv.js → index-DGpSfYbI.js} +1 -1
  98. package/_assets/{index-BUvdjpLN.js → index-DM4Lw-b2.js} +1 -1
  99. package/_assets/{index-CkItaod2.js → index-DPS0nlZt.js} +1 -1
  100. package/_assets/{index-B0ryoW8w.js → index-DQOXE4dt.js} +1 -1
  101. package/_assets/{index-CQdN8SI1.js → index-DUGnqqvn.js} +1 -1
  102. package/_assets/{index-DoRhx_He.js → index-DV8-2bkd.js} +1 -1
  103. package/_assets/{index-O0VpavwW.js → index-DYmEn4kI.js} +1 -1
  104. package/_assets/{index-CVQ8oHkh.js → index-DZMkGxa1.js} +2 -2
  105. package/_assets/{index-Dl0ZUNWk.js → index-D_vtI9c4.js} +1 -1
  106. package/_assets/{index-C36oVpEk.js → index-Dg35ZiF4.js} +1 -1
  107. package/_assets/{index-B_HYDEtX.js → index-DlNMwZA0.js} +1 -1
  108. package/_assets/{index-CvxViQFA.js → index-DlhjzwF5.js} +1 -1
  109. package/_assets/{index-CIyes5rm.js → index-DnlGx8cM.js} +1 -1
  110. package/_assets/{index-D7zzleDp.js → index-DqNNmcTE.js} +1 -1
  111. package/_assets/{index-DOlLnnbN.js → index-Dv_iHgrg.js} +1 -1
  112. package/_assets/{index-CblEnpzL.js → index-GFGo0kL7.js} +2 -2
  113. package/_assets/{index-CrvRYFHR.js → index-GWS5y9G8.js} +3 -3
  114. package/_assets/{index-BwWxHd9J.js → index-JQtE4iI3.js} +1 -1
  115. package/_assets/{index-DjPyQFXF.js → index-i1mgkVNo.js} +1 -1
  116. package/_assets/{index-DDiCv4U4.js → index-jOzdgfRR.js} +3 -3
  117. package/_assets/{index-EXLD54jH.js → index-kGUEZDex.js} +2 -2
  118. package/_assets/{index-BLrPav1T.js → index-sTbvrDBI.js} +1 -1
  119. package/_assets/{index-DvkSTulM.js → index-vw2DCGCa.js} +1 -1
  120. package/_assets/{index-DyxpPyVg.js → index-yDlokE4U.js} +1 -1
  121. package/_assets/{index.es-5JavRckI.js → index.es-B7FTFVs9.js} +1 -1
  122. package/_assets/{index.es-Bl2PbxJr.js → index.es-D3zyWO6O.js} +4 -4
  123. package/_assets/{index.es-EFLDV9YI.js → index.es-Wz_yp4qN.js} +1 -1
  124. package/_assets/{localBatchGatewayRequest-BWsIaDIE.js → localBatchGatewayRequest-IY4oys4m.js} +1 -1
  125. package/_assets/{networks--rzHY8zY.js → networks-BebUw28a.js} +1 -1
  126. package/_assets/{onramp-IBGbKthf.js → onramp-D2PuULiP.js} +1 -1
  127. package/_assets/{openzeppelin-CteHZYAE.js → openzeppelin-BtInW1Ne.js} +1 -1
  128. package/_assets/{parseNft-CjJbs0kN.js → parseNft-BbiDwhFE.js} +2 -2
  129. package/_assets/{parseSignature-DgP8I4s-.js → parseSignature-CZ5Ggg8p.js} +3 -3
  130. package/_assets/{parseSignature-BZS2g2Jp.js → parseSignature-VUChb_Hq.js} +1 -1
  131. package/_assets/{passkeys-2GYfrIW-.js → passkeys-CrgnuTyv.js} +1 -1
  132. package/_assets/{pay-with-exchange-CFDPj_Ci.js → pay-with-exchange-DUrkH5ym.js} +1 -1
  133. package/_assets/{qr-overlay-Ds7Fr0lF.js → qr-overlay-ijYN5Vs4.js} +1 -1
  134. package/_assets/{receive-DI-hDZuo.js → receive-Df4kzGm0.js} +1 -1
  135. package/_assets/{resolveImplementation-BtX-ARKv.js → resolveImplementation-DoFz-4vS.js} +1 -1
  136. package/_assets/{rpc-CpuwTu3M.js → rpc-BiHC0M3Z.js} +1 -1
  137. package/_assets/{secp256k1-BMmzDgZw.js → secp256k1-Ba1R5SHp.js} +1 -1
  138. package/_assets/{secp256k1-DT8TtWA2.js → secp256k1-CqT0-B8H.js} +1 -1
  139. package/_assets/{secp256k1-B3lQnF4x.js → secp256k1-Hu9Q-jih.js} +1 -1
  140. package/_assets/{send-lqB2NsIP.js → send-Ca_D-CGF.js} +1 -1
  141. package/_assets/{send-batch-transaction-CshATiqB.js → send-batch-transaction-D5lSDwIa.js} +1 -1
  142. package/_assets/{send-eip712-transaction-B_yd_Ph2.js → send-eip712-transaction-BsmSzzO5.js} +2 -2
  143. package/_assets/{send-gasless-transaction-Ot1v7swm.js → send-gasless-transaction-DzCl7yj5.js} +2 -2
  144. package/_assets/{send-transaction-Bbb8MiYz.js → send-transaction-D_KZubhG.js} +2 -2
  145. package/_assets/{sendMetaTransaction-B8QarnGW.js → sendMetaTransaction-DcJMER59.js} +1 -1
  146. package/_assets/{sendRawTransaction-CdbKO36d.js → sendRawTransaction-5I-l2w6Z.js} +3 -3
  147. package/_assets/{serializeTransaction-qj2kvULH.js → serializeTransaction-a4pMp0ix.js} +1 -1
  148. package/_assets/{session-proposal-Bjh7TDS3.js → session-proposal-CjeffhTm.js} +1 -1
  149. package/_assets/{session-request-BWLuJcL4.js → session-request-KYwaaBai.js} +2 -2
  150. package/_assets/{signing-CssxZ7kf.js → signing-BPM_yuD2.js} +3 -3
  151. package/_assets/{socials-91-QTc9v.js → socials-CyoLEAYb.js} +1 -1
  152. package/_assets/{styled-CjUv0U3K.js → styled-DxV2l543.js} +1 -1
  153. package/_assets/{swaps-CT9j7o9y.js → swaps-CHWvOItb.js} +1 -1
  154. package/_assets/{thirdweb-6YwgkX44.js → thirdweb-B3GtfZBZ.js} +3 -3
  155. package/_assets/{to-serializable-transaction-Cwp0L3ww.js → to-serializable-transaction-BCzBTrGx.js} +2 -2
  156. package/_assets/{trade-encoding-CxvKGx0_.js → trade-encoding-Dg6aX8Te.js} +1 -1
  157. package/_assets/{transactionReceipt-CYYXW47r.js → transactionReceipt-9LyDGJEz.js} +1 -1
  158. package/_assets/{transactions-Yy0hGtH3.js → transactions-YKwAIvIG.js} +1 -1
  159. package/_assets/{useCreditPacks-eXmbKxJO.js → useCreditPacks-DsT6A2e-.js} +1 -1
  160. package/_assets/{useImportable-1wgCIPJI.js → useImportable-CvtcuX0v.js} +1 -1
  161. package/_assets/{useInfiniteGrid-IXSEUDfN.js → useInfiniteGrid-BiMca1S0.js} +1 -1
  162. package/_assets/{useTheme-DDHPP1hV.js → useTheme-BI7R38Jr.js} +1 -1
  163. package/_assets/{verifyHash-UQQpWRKz.js → verifyHash-BsfyvwnN.js} +1 -1
  164. package/_assets/{w3m-modal-R-xHgcLx.js → w3m-modal-Dv-jrE6G.js} +1 -1
  165. package/_assets/{w3m-modal-uZlen5oK.js → w3m-modal-OMDv8WwL.js} +1 -1
  166. package/_assets/{wait-for-tx-receipt-Be-DMOgp.js → wait-for-tx-receipt-D5ZFHFzh.js} +1 -1
  167. package/_assets/{wallets-XOlHe2ld.js → wallets-NAyG3Q1E.js} +5 -5
  168. package/_assets/{web-connector-msoNVD8s.js → web-connector-5UlEROZA.js} +3 -3
  169. package/_assets/{writeContract-8MHZT7h2.js → writeContract-BOezSMv9.js} +1 -1
  170. package/_assets/{zoraTestnet-HwyYvSRG.js → zoraTestnet-CsqEhrXT.js} +1 -1
  171. package/index.html +11 -11
  172. package/package.json +2 -2
  173. package/_assets/LazyEmoteControls-DBetyXKO.js +0 -2
  174. package/_assets/index-B1DCMe50.js +0 -3378
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-DDc9MCuJ.js","_assets/react-DehiWSvs.js","_assets/index-B1DCMe50.js","_assets/sentry-973sfbO9.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/ethers-CtNGBird.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/useImportable-1wgCIPJI.js","_assets/buy-C5VKib6d.js","_assets/authorizations-CkEL0cRE.js","_assets/sendMetaTransaction-B8QarnGW.js","_assets/trade-encoding-CxvKGx0_.js","_assets/ManaPricingBanner.styles-B36mIGF3.js","_assets/field.styles-D3cOLW18.js"])))=>i.map(i=>d[i]);
2
- import{m as ye,bz as ve,s as l,t as s,o as we,B as je,k as te,q as ke,d as c,n as $,ai as Ie,I as j,bA as Z,bB as J,bC as Ae,_ as $e,w as P,bD as Pe,x as Le,bb as z,az as Ne,bE as Ee,z as Te,bF as Ce,bG as H}from"./index-B1DCMe50.js";import{r as g,e as Se,j as t,L as ie,a as Fe}from"./react-DehiWSvs.js";import{u as De}from"./useImportable-1wgCIPJI.js";import{L as Me}from"./LoadMore-CymwFW-m.js";import{u as I}from"./useInfiniteGrid-IXSEUDfN.js";import{m as ae}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./buy-C5VKib6d.js";import"./authorizations-CkEL0cRE.js";import"./sendMetaTransaction-B8QarnGW.js";import"./trade-encoding-CxvKGx0_.js";const ze=15e3;function He(e,a){return e.txHash&&a.txHash?e.txHash===a.txHash:e.txHash||a.txHash?!1:e.status===a.status&&Math.abs(e.createdAt-a.createdAt)<=ze}function qe(e){const a=[...e].sort((i,o)=>o.createdAt-i.createdAt),n=[];for(const i of a){const o=n[n.length-1];o&&He(o[o.length-1],i)?o.push(i):n.push([i])}return n.map(i=>{var o;return{id:((o=i.find(r=>r.txHash))==null?void 0:o.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(r=>r.createdAt)),status:i.some(r=>r.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((r,u)=>r+u.credits,0),lines:i}})}function Oe(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Re(e){const a=[],n=new Map;for(const i of e){const o=Oe(i);if(!o){a.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const r=n.get(o);if(r){r.quantity+=1,r.credits+=i.credits;continue}const u={key:o,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};n.set(o,u),a.push(u)}return a}function We(e,a){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:a?ye(e.manaWei,a):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function _e(e){const n=qe(e.purchases.filter(d=>d.status!=="EXPIRED")).map(d=>({kind:"purchase",id:`purchase:${d.id}`,createdAt:d.createdAt,order:d})),i=e.sales.map(d=>{const p=We(d,e.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),o=(e.creditOrders??[]).filter(d=>d.status!=="failed"&&d.status!=="abandoned").map(d=>({kind:"credit",id:`credit:${d.id}`,createdAt:d.createdAt,order:d})),r=new Set(e.purchases.filter(d=>d.txHash).map(d=>d.txHash.toLowerCase())),u=(e.manaPurchases??[]).filter(d=>!r.has(d.txHash.toLowerCase())).map(d=>({kind:"mana-purchase",id:`mana-purchase:${d.id}`,createdAt:d.createdAt,sale:d}));return[...n,...i,...o,...u].sort((d,p)=>p.createdAt-d.createdAt||(d.id<p.id?-1:1))}function Be(e,a){return a==="all"?e:a==="sales"?e.filter(n=>n.kind==="sale"):e.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const se=e=>e.trim().toLowerCase();function Ge(e){const a=new Map;for(const n of e??[]){const i=se(n.txHash??"");if(!i)continue;const o=a.get(i);o?o.push(n):a.set(i,[n])}return a}function Ue(e,a,n=Date.now()){const i=a.txHash?e.get(se(a.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const o=i.length===1?Ke(i[0].netCents):null,r=i.filter(d=>!d.available&&d.availableAt>n);if(r.length===0)return{kind:"credited",credits:o};const u=r.reduce((d,p)=>Math.max(d,p.availableAt),0);return{kind:"pending",credits:o,availableAt:u}}function Ke(e){return ve(e)}const Qe="https://cdn.decentraland.org/@dcl/shop/0.7.2/_assets/credits-product-vs4Q6u6l.svg",q=we`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-BqhVw7jY.js","_assets/react-DehiWSvs.js","_assets/index-CzGc0rp2.js","_assets/sentry-973sfbO9.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/ethers-CtNGBird.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/useImportable-CvtcuX0v.js","_assets/buy-BZ3zKYDO.js","_assets/authorizations-C776tgTp.js","_assets/sendMetaTransaction-DcJMER59.js","_assets/trade-encoding-Dg6aX8Te.js","_assets/ManaPricingBanner.styles-C9hjNdio.js","_assets/Faq-mPkwptjW.js","_assets/field.styles-BIjk7dlh.js"])))=>i.map(i=>d[i]);
2
+ import{m as ye,bz as ve,s as l,t as s,o as we,B as je,k as te,q as ke,d as c,n as $,ai as Ie,I as j,bA as Z,bB as J,bC as Ae,_ as $e,w as P,bD as Pe,x as Le,bb as z,az as Ne,bE as Ee,z as Te,bF as Ce,bG as H}from"./index-CzGc0rp2.js";import{r as g,e as Se,j as t,L as ie,a as Fe}from"./react-DehiWSvs.js";import{u as De}from"./useImportable-CvtcuX0v.js";import{L as Me}from"./LoadMore-CPMkfBBp.js";import{u as I}from"./useInfiniteGrid-BiMca1S0.js";import{m as ae}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./buy-BZ3zKYDO.js";import"./authorizations-C776tgTp.js";import"./sendMetaTransaction-DcJMER59.js";import"./trade-encoding-Dg6aX8Te.js";const ze=15e3;function He(e,a){return e.txHash&&a.txHash?e.txHash===a.txHash:e.txHash||a.txHash?!1:e.status===a.status&&Math.abs(e.createdAt-a.createdAt)<=ze}function qe(e){const a=[...e].sort((i,o)=>o.createdAt-i.createdAt),n=[];for(const i of a){const o=n[n.length-1];o&&He(o[o.length-1],i)?o.push(i):n.push([i])}return n.map(i=>{var o;return{id:((o=i.find(r=>r.txHash))==null?void 0:o.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(r=>r.createdAt)),status:i.some(r=>r.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((r,u)=>r+u.credits,0),lines:i}})}function Oe(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Re(e){const a=[],n=new Map;for(const i of e){const o=Oe(i);if(!o){a.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const r=n.get(o);if(r){r.quantity+=1,r.credits+=i.credits;continue}const u={key:o,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};n.set(o,u),a.push(u)}return a}function We(e,a){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:a?ye(e.manaWei,a):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function _e(e){const n=qe(e.purchases.filter(d=>d.status!=="EXPIRED")).map(d=>({kind:"purchase",id:`purchase:${d.id}`,createdAt:d.createdAt,order:d})),i=e.sales.map(d=>{const p=We(d,e.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),o=(e.creditOrders??[]).filter(d=>d.status!=="failed"&&d.status!=="abandoned").map(d=>({kind:"credit",id:`credit:${d.id}`,createdAt:d.createdAt,order:d})),r=new Set(e.purchases.filter(d=>d.txHash).map(d=>d.txHash.toLowerCase())),u=(e.manaPurchases??[]).filter(d=>!r.has(d.txHash.toLowerCase())).map(d=>({kind:"mana-purchase",id:`mana-purchase:${d.id}`,createdAt:d.createdAt,sale:d}));return[...n,...i,...o,...u].sort((d,p)=>p.createdAt-d.createdAt||(d.id<p.id?-1:1))}function Be(e,a){return a==="all"?e:a==="sales"?e.filter(n=>n.kind==="sale"):e.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const se=e=>e.trim().toLowerCase();function Ge(e){const a=new Map;for(const n of e??[]){const i=se(n.txHash??"");if(!i)continue;const o=a.get(i);o?o.push(n):a.set(i,[n])}return a}function Ue(e,a,n=Date.now()){const i=a.txHash?e.get(se(a.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const o=i.length===1?Ke(i[0].netCents):null,r=i.filter(d=>!d.available&&d.availableAt>n);if(r.length===0)return{kind:"credited",credits:o};const u=r.reduce((d,p)=>Math.max(d,p.availableAt),0);return{kind:"pending",credits:o,availableAt:u}}function Ke(e){return ve(e)}const Qe="https://cdn.decentraland.org/@dcl/shop/0.7.3-30998099552.commit-f7fa6e3/_assets/credits-product-vs4Q6u6l.svg",q=we`
3
3
  0% { background-position: 200% 0; }
4
4
  100% { background-position: -200% 0; }
5
5
  `,Ve=l.section`
@@ -381,4 +381,4 @@ import{m as ye,bz as ve,s as l,t as s,o as we,B as je,k as te,q as ke,d as c,n a
381
381
  margin: 6px 0 0;
382
382
  `,ot=l(je)`
383
383
  margin-top: 12px;
384
- `,K=D.withComponent(ie),dt=g.lazy(()=>$e(()=>import("./index-DDc9MCuJ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.ImportListings}))),A=24,ct=["all","purchases","sales"],M="migrate";function w(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ce(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function le(e){const a=Number(e)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function he({children:e}){const a=g.useRef(null),[n,i]=g.useState(null),o=()=>{var u;const r=(u=a.current)==null?void 0:u.getBoundingClientRect();r&&i({top:r.bottom+8,left:r.left+r.width/2})};return t.jsxs(st,{ref:a,tabIndex:0,onMouseEnter:o,onMouseLeave:()=>i(null),onFocus:o,onBlur:()=>i(null),children:[e,n?Fe.createPortal(t.jsx(nt,{style:{top:n.top,left:n.left},role:"tooltip",children:c("activity.polygonMana")}),document.body):null]})}function lt({item:e}){const a=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||a,{data:i,isLoading:o}=$({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Ce(e.tradeId):H(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),r=n&&o,u=(i==null?void 0:i.name)??c("activity.itemFallback"),d=(i==null?void 0:i.thumbnail)??"",p=z({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,x=t.jsxs(t.Fragment,{children:[r?t.jsx(W,{}):t.jsx(R,{children:d?t.jsx("img",{src:d,alt:u}):t.jsx(j,{name:"cart",size:20})}),t.jsxs(_,{children:[r?t.jsx(G,{}):t.jsx(B,{title:u,children:u}),e.quantity>1?t.jsx(U,{children:c("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(rt,{children:[t.jsx(P,{className:"ccy-mark"})," ",e.credits]})]});return p?t.jsx(K,{to:p,"data-link":"true",children:x}):t.jsx(D,{children:x})}function ht({order:e}){const a=Re(e.lines),n=a.reduce((i,o)=>i+o.quantity,0);return t.jsxs(L,{"data-testid":"purchase-order",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsxs(C,{children:[c("activity.purchaseLabel")," · ",c("activity.itemCount",{count:n})]})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":e.status,children:e.status==="PENDING"?c("activity.processing"):c("activity.completed")}),t.jsxs(v,{children:[t.jsx(P,{className:"ccy-mark"})," ",e.totalCredits]})]})]}),t.jsx(O,{children:a.map(i=>t.jsx(lt,{item:i},i.key))})]})}function ut({sale:e}){const{data:a,isLoading:n}=$({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>H(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??c("activity.itemFallback"),o=(a==null?void 0:a.thumbnail)??"",r=z({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,u=t.jsxs(t.Fragment,{children:[n?t.jsx(W,{}):t.jsx(R,{children:o?t.jsx("img",{src:o,alt:i}):t.jsx(j,{name:"offer",size:20})}),t.jsxs(_,{children:[n?t.jsx(G,{}):t.jsx(B,{title:i,children:i}),t.jsx(U,{children:c("activity.boughtFrom",{account:ce(e.seller)})})]})]});return t.jsxs(L,{"data-testid":"activity-mana-purchase",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsx(C,{children:c("activity.paidWithMana")})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":"SETTLED",children:c("activity.completed")}),t.jsxs(v,{children:[le(e.manaWei)," ",t.jsx(he,{children:t.jsx(re,{src:ae,alt:"MANA"})})]})]})]}),t.jsx(O,{children:r?t.jsx(K,{to:r,"data-link":"true",children:u}):t.jsx(D,{children:u})})]})}function pt({sale:e,payout:a}){const{data:n,isLoading:i}=$({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>H(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),o=(n==null?void 0:n.name)??c("activity.itemFallback"),r=(n==null?void 0:n.thumbnail)??"",u=z({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,d=t.jsxs(t.Fragment,{children:[i?t.jsx(W,{}):t.jsx(R,{children:r?t.jsx("img",{src:r,alt:o}):t.jsx(j,{name:"offer",size:20})}),t.jsxs(_,{children:[i?t.jsx(G,{}):t.jsx(B,{title:o,children:o}),t.jsxs(U,{children:[c("activity.soldTo",{account:ce(e.counterparty)}),a.kind==="pending"?` · ${c("activity.payoutPendingOn",{date:w(a.availableAt)})}`:""]})]})]});return t.jsxs(L,{"data-testid":"activity-sale",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsx(C,{children:c("activity.saleLabel")})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?c("activity.payoutPending"):c("activity.sold")}),a.kind==="direct"?t.jsxs(v,{"data-kind":"income",children:["+",le(e.manaWei)," ",t.jsx(he,{children:t.jsx(re,{src:ae,alt:"MANA"})})]}):a.credits!==null?t.jsxs(v,{"data-kind":"income",children:[t.jsx(P,{className:"ccy-mark"})," +",Ne(a.credits)]}):t.jsx(v,{"data-kind":"income",children:c("activity.payoutCredited")})]})]}),t.jsx(O,{children:u?t.jsx(K,{to:u,"data-link":"true",children:d}):t.jsx(D,{children:d})})]})}function xt({order:e}){const a=`$${(e.usdCents/100).toFixed(2)}`,n=Pe(e.status),i=n==="SETTLED"?c("activity.completed"):n==="FAILED"?c("activity.failed"):n==="UNFINISHED"?c("activity.unfinished"):c("activity.processing"),o=te(m=>m.session),r=Le(),[u,d]=g.useState(!1),p=e.status==="initiated"&&!!o;async function x(){if(!(!o||u)){d(!0);try{const m=await Ee(e.id,o.identity);if(m){window.location.href=m;return}Te.info(c("activity.resumeExpired")),r.invalidateQueries({queryKey:["credit-orders"]})}finally{d(!1)}}}return t.jsx(L,{"data-testid":"credit-order",children:t.jsxs(N,{children:[t.jsx(it,{children:t.jsx("img",{src:Qe,alt:"","aria-hidden":!0})}),t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsxs(C,{children:[c("activity.creditPurchaseLabel")," · ",c("activity.creditPaid",{usd:a})]})]}),t.jsxs(S,{children:[p?t.jsx(at,{type:"button",onClick:()=>void x(),disabled:u,"data-testid":"resume-order",children:u?c("activity.resuming"):c("activity.resume")}):null,t.jsx(F,{"data-status":n,children:i}),t.jsxs(v,{"data-kind":"income",children:["+",t.jsx(P,{className:"ccy-mark"})," ",e.credits]})]})]})})}function mt({filter:e}){const a={all:{icon:"clock",title:c("activity.emptyAllTitle"),body:c("activity.emptyAllBody")},purchases:{icon:"cart",title:c("activity.emptyPurchasesTitle"),body:c("activity.emptyPurchasesBody")},sales:{icon:"offer",title:c("activity.emptySalesTitle"),body:c("activity.emptySalesBody")}}[e];return t.jsxs(oe,{children:[t.jsx(j,{name:a.icon,size:40,color:s.colors.muted2}),t.jsx(de,{children:a.title}),t.jsx("p",{className:"muted",children:a.body}),e!=="sales"?t.jsx(ot,{as:ie,to:"/items",variant:"purple",children:c("notFound.cta")}):null]})}function Et(){const{session:e}=te(),[a,n]=g.useState("all"),[i,o]=Se(),r=i.get("view")===M;ke({title:r?c("seo.import.title"):c("nav.activity"),noindex:!0});const{count:u}=De(),d=u!==void 0&&(u>0||r),p=!!e&&!r&&a!=="sales",x=!!e&&!r&&a!=="purchases",m=I(["purchases",e==null?void 0:e.address],h=>Ae(e.address,e.identity,{first:A,skip:h}),{enabled:p}),f=I(["sales",e==null?void 0:e.address],h=>Z(e.address,{role:"seller",first:A,skip:h}),{enabled:x}),b=I(["credit-orders",e==null?void 0:e.address],h=>J(e.address,e.identity,{first:A,skip:h}),{enabled:p}),y=I(["mana-purchases",e==null?void 0:e.address],h=>Z(e.address,{role:"buyer",first:A,skip:h}),{enabled:p}),{data:Q}=$({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>J(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:x,staleTime:6e4}),ue=g.useMemo(()=>Ge(Q),[Q]),{data:pe}=Ie(x);if(!e)return t.jsxs(oe,{children:[t.jsx(j,{name:"clock",size:40,color:s.colors.muted2}),t.jsx(de,{children:c("activity.signInTitle")}),t.jsx("p",{className:"muted",children:c("activity.signInBody")})]});const V=Be(_e({purchases:p?m.items:[],sales:x?f.items:[],creditOrders:p?b.items:[],manaPurchases:p?y.items:[],rate:pe}),a),xe=p&&(m.isLoading||b.isLoading||y.isLoading)||x&&f.isLoading,X=p&&(m.isFetchingNextPage||b.isFetchingNextPage||y.isFetchingNextPage)||x&&f.isFetchingNextPage,me=p&&(m.hasNextPage||b.hasNextPage||y.hasNextPage)||x&&f.hasNextPage;function ge(){p&&m.hasNextPage&&m.fetchNextPage(),p&&b.hasNextPage&&b.fetchNextPage(),p&&y.hasNextPage&&y.fetchNextPage(),x&&f.hasNextPage&&f.fetchNextPage()}function fe(h){if(n(h),!r)return;const k=new URLSearchParams(i);k.delete("view"),o(k,{replace:!0})}function be(){const h=new URLSearchParams(i);h.set("view",M),o(h,{replace:!0})}return t.jsxs(Ve,{"data-view":r?M:"feed",children:[t.jsx(Xe,{children:t.jsx(Ze,{children:c("nav.activity")})}),t.jsxs(Je,{role:"tablist","aria-label":c("nav.activity"),children:[ct.map(h=>t.jsx(ne,{type:"button",role:"tab","aria-selected":!r&&a===h,"data-active":!r&&a===h,"data-testid":`activity-filter-${h}`,onClick:()=>fe(h),children:c(`activity.filter.${h}`)},h)),d?t.jsxs(Ye,{type:"button",role:"tab","aria-selected":r,"data-active":r,"data-testid":"activity-filter-migrate","aria-label":u?c("activity.migrate.chipAria",{count:u}):void 0,onClick:be,children:[c("activity.migrate.chip"),u?t.jsx(et,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:u}):null]}):null]}),r?t.jsx(g.Suspense,{fallback:t.jsx(tt,{"aria-busy":"true"}),children:t.jsx(dt,{})}):xe?t.jsx(Y,{children:Array.from({length:5}).map((h,k)=>t.jsx(ee,{},k))}):V.length===0?t.jsx(mt,{filter:a}):t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[V.map(h=>h.kind==="purchase"?t.jsx(ht,{order:h.order},h.id):h.kind==="credit"?t.jsx(xt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx(ut,{sale:h.sale},h.id):t.jsx(pt,{sale:h.sale,payout:Ue(ue,h.sale)},h.id)),X?t.jsx(ee,{}):null]}),t.jsx(Me,{hasNextPage:me,isFetching:X,onLoadMore:ge})]})]})}export{Et as Activity};
384
+ `,K=D.withComponent(ie),dt=g.lazy(()=>$e(()=>import("./index-BqhVw7jY.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])).then(e=>({default:e.ImportListings}))),A=24,ct=["all","purchases","sales"],M="migrate";function w(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ce(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function le(e){const a=Number(e)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function he({children:e}){const a=g.useRef(null),[n,i]=g.useState(null),o=()=>{var u;const r=(u=a.current)==null?void 0:u.getBoundingClientRect();r&&i({top:r.bottom+8,left:r.left+r.width/2})};return t.jsxs(st,{ref:a,tabIndex:0,onMouseEnter:o,onMouseLeave:()=>i(null),onFocus:o,onBlur:()=>i(null),children:[e,n?Fe.createPortal(t.jsx(nt,{style:{top:n.top,left:n.left},role:"tooltip",children:c("activity.polygonMana")}),document.body):null]})}function lt({item:e}){const a=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||a,{data:i,isLoading:o}=$({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Ce(e.tradeId):H(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),r=n&&o,u=(i==null?void 0:i.name)??c("activity.itemFallback"),d=(i==null?void 0:i.thumbnail)??"",p=z({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,x=t.jsxs(t.Fragment,{children:[r?t.jsx(W,{}):t.jsx(R,{children:d?t.jsx("img",{src:d,alt:u}):t.jsx(j,{name:"cart",size:20})}),t.jsxs(_,{children:[r?t.jsx(G,{}):t.jsx(B,{title:u,children:u}),e.quantity>1?t.jsx(U,{children:c("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(rt,{children:[t.jsx(P,{className:"ccy-mark"})," ",e.credits]})]});return p?t.jsx(K,{to:p,"data-link":"true",children:x}):t.jsx(D,{children:x})}function ht({order:e}){const a=Re(e.lines),n=a.reduce((i,o)=>i+o.quantity,0);return t.jsxs(L,{"data-testid":"purchase-order",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsxs(C,{children:[c("activity.purchaseLabel")," · ",c("activity.itemCount",{count:n})]})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":e.status,children:e.status==="PENDING"?c("activity.processing"):c("activity.completed")}),t.jsxs(v,{children:[t.jsx(P,{className:"ccy-mark"})," ",e.totalCredits]})]})]}),t.jsx(O,{children:a.map(i=>t.jsx(lt,{item:i},i.key))})]})}function ut({sale:e}){const{data:a,isLoading:n}=$({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>H(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??c("activity.itemFallback"),o=(a==null?void 0:a.thumbnail)??"",r=z({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,u=t.jsxs(t.Fragment,{children:[n?t.jsx(W,{}):t.jsx(R,{children:o?t.jsx("img",{src:o,alt:i}):t.jsx(j,{name:"offer",size:20})}),t.jsxs(_,{children:[n?t.jsx(G,{}):t.jsx(B,{title:i,children:i}),t.jsx(U,{children:c("activity.boughtFrom",{account:ce(e.seller)})})]})]});return t.jsxs(L,{"data-testid":"activity-mana-purchase",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsx(C,{children:c("activity.paidWithMana")})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":"SETTLED",children:c("activity.completed")}),t.jsxs(v,{children:[le(e.manaWei)," ",t.jsx(he,{children:t.jsx(re,{src:ae,alt:"MANA"})})]})]})]}),t.jsx(O,{children:r?t.jsx(K,{to:r,"data-link":"true",children:u}):t.jsx(D,{children:u})})]})}function pt({sale:e,payout:a}){const{data:n,isLoading:i}=$({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>H(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),o=(n==null?void 0:n.name)??c("activity.itemFallback"),r=(n==null?void 0:n.thumbnail)??"",u=z({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,d=t.jsxs(t.Fragment,{children:[i?t.jsx(W,{}):t.jsx(R,{children:r?t.jsx("img",{src:r,alt:o}):t.jsx(j,{name:"offer",size:20})}),t.jsxs(_,{children:[i?t.jsx(G,{}):t.jsx(B,{title:o,children:o}),t.jsxs(U,{children:[c("activity.soldTo",{account:ce(e.counterparty)}),a.kind==="pending"?` · ${c("activity.payoutPendingOn",{date:w(a.availableAt)})}`:""]})]})]});return t.jsxs(L,{"data-testid":"activity-sale",children:[t.jsxs(N,{children:[t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsx(C,{children:c("activity.saleLabel")})]}),t.jsxs(S,{children:[t.jsx(F,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?c("activity.payoutPending"):c("activity.sold")}),a.kind==="direct"?t.jsxs(v,{"data-kind":"income",children:["+",le(e.manaWei)," ",t.jsx(he,{children:t.jsx(re,{src:ae,alt:"MANA"})})]}):a.credits!==null?t.jsxs(v,{"data-kind":"income",children:[t.jsx(P,{className:"ccy-mark"})," +",Ne(a.credits)]}):t.jsx(v,{"data-kind":"income",children:c("activity.payoutCredited")})]})]}),t.jsx(O,{children:u?t.jsx(K,{to:u,"data-link":"true",children:d}):t.jsx(D,{children:d})})]})}function xt({order:e}){const a=`$${(e.usdCents/100).toFixed(2)}`,n=Pe(e.status),i=n==="SETTLED"?c("activity.completed"):n==="FAILED"?c("activity.failed"):n==="UNFINISHED"?c("activity.unfinished"):c("activity.processing"),o=te(m=>m.session),r=Le(),[u,d]=g.useState(!1),p=e.status==="initiated"&&!!o;async function x(){if(!(!o||u)){d(!0);try{const m=await Ee(e.id,o.identity);if(m){window.location.href=m;return}Te.info(c("activity.resumeExpired")),r.invalidateQueries({queryKey:["credit-orders"]})}finally{d(!1)}}}return t.jsx(L,{"data-testid":"credit-order",children:t.jsxs(N,{children:[t.jsx(it,{children:t.jsx("img",{src:Qe,alt:"","aria-hidden":!0})}),t.jsxs(E,{children:[t.jsx(T,{children:w(e.createdAt)}),t.jsxs(C,{children:[c("activity.creditPurchaseLabel")," · ",c("activity.creditPaid",{usd:a})]})]}),t.jsxs(S,{children:[p?t.jsx(at,{type:"button",onClick:()=>void x(),disabled:u,"data-testid":"resume-order",children:u?c("activity.resuming"):c("activity.resume")}):null,t.jsx(F,{"data-status":n,children:i}),t.jsxs(v,{"data-kind":"income",children:["+",t.jsx(P,{className:"ccy-mark"})," ",e.credits]})]})]})})}function mt({filter:e}){const a={all:{icon:"clock",title:c("activity.emptyAllTitle"),body:c("activity.emptyAllBody")},purchases:{icon:"cart",title:c("activity.emptyPurchasesTitle"),body:c("activity.emptyPurchasesBody")},sales:{icon:"offer",title:c("activity.emptySalesTitle"),body:c("activity.emptySalesBody")}}[e];return t.jsxs(oe,{children:[t.jsx(j,{name:a.icon,size:40,color:s.colors.muted2}),t.jsx(de,{children:a.title}),t.jsx("p",{className:"muted",children:a.body}),e!=="sales"?t.jsx(ot,{as:ie,to:"/items",variant:"purple",children:c("notFound.cta")}):null]})}function Et(){const{session:e}=te(),[a,n]=g.useState("all"),[i,o]=Se(),r=i.get("view")===M;ke({title:r?c("seo.import.title"):c("nav.activity"),noindex:!0});const{count:u}=De(),d=u!==void 0&&(u>0||r),p=!!e&&!r&&a!=="sales",x=!!e&&!r&&a!=="purchases",m=I(["purchases",e==null?void 0:e.address],h=>Ae(e.address,e.identity,{first:A,skip:h}),{enabled:p}),f=I(["sales",e==null?void 0:e.address],h=>Z(e.address,{role:"seller",first:A,skip:h}),{enabled:x}),b=I(["credit-orders",e==null?void 0:e.address],h=>J(e.address,e.identity,{first:A,skip:h}),{enabled:p}),y=I(["mana-purchases",e==null?void 0:e.address],h=>Z(e.address,{role:"buyer",first:A,skip:h}),{enabled:p}),{data:Q}=$({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>J(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:x,staleTime:6e4}),ue=g.useMemo(()=>Ge(Q),[Q]),{data:pe}=Ie(x);if(!e)return t.jsxs(oe,{children:[t.jsx(j,{name:"clock",size:40,color:s.colors.muted2}),t.jsx(de,{children:c("activity.signInTitle")}),t.jsx("p",{className:"muted",children:c("activity.signInBody")})]});const V=Be(_e({purchases:p?m.items:[],sales:x?f.items:[],creditOrders:p?b.items:[],manaPurchases:p?y.items:[],rate:pe}),a),xe=p&&(m.isLoading||b.isLoading||y.isLoading)||x&&f.isLoading,X=p&&(m.isFetchingNextPage||b.isFetchingNextPage||y.isFetchingNextPage)||x&&f.isFetchingNextPage,me=p&&(m.hasNextPage||b.hasNextPage||y.hasNextPage)||x&&f.hasNextPage;function ge(){p&&m.hasNextPage&&m.fetchNextPage(),p&&b.hasNextPage&&b.fetchNextPage(),p&&y.hasNextPage&&y.fetchNextPage(),x&&f.hasNextPage&&f.fetchNextPage()}function fe(h){if(n(h),!r)return;const k=new URLSearchParams(i);k.delete("view"),o(k,{replace:!0})}function be(){const h=new URLSearchParams(i);h.set("view",M),o(h,{replace:!0})}return t.jsxs(Ve,{"data-view":r?M:"feed",children:[t.jsx(Xe,{children:t.jsx(Ze,{children:c("nav.activity")})}),t.jsxs(Je,{role:"tablist","aria-label":c("nav.activity"),children:[ct.map(h=>t.jsx(ne,{type:"button",role:"tab","aria-selected":!r&&a===h,"data-active":!r&&a===h,"data-testid":`activity-filter-${h}`,onClick:()=>fe(h),children:c(`activity.filter.${h}`)},h)),d?t.jsxs(Ye,{type:"button",role:"tab","aria-selected":r,"data-active":r,"data-testid":"activity-filter-migrate","aria-label":u?c("activity.migrate.chipAria",{count:u}):void 0,onClick:be,children:[c("activity.migrate.chip"),u?t.jsx(et,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:u}):null]}):null]}),r?t.jsx(g.Suspense,{fallback:t.jsx(tt,{"aria-busy":"true"}),children:t.jsx(dt,{})}):xe?t.jsx(Y,{children:Array.from({length:5}).map((h,k)=>t.jsx(ee,{},k))}):V.length===0?t.jsx(mt,{filter:a}):t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[V.map(h=>h.kind==="purchase"?t.jsx(ht,{order:h.order},h.id):h.kind==="credit"?t.jsx(xt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx(ut,{sale:h.sale},h.id):t.jsx(pt,{sale:h.sale,payout:Ue(ue,h.sale)},h.id)),X?t.jsx(ee,{}):null]}),t.jsx(Me,{hasNextPage:me,isFetching:X,onLoadMore:ge})]})]})}export{Et as Activity};
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-B1DCMe50.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.7.2/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.7.2/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-CzGc0rp2.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.7.3-30998099552.commit-f7fa6e3/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.7.3-30998099552.commit-f7fa6e3/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -1,4 +1,4 @@
1
- import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r as st,bg as rt,bh as ot,au as it,b as at,s,t,k as Ue,b6 as lt,x as ct,az as be,d as n,v as dt,I as R,w as M,bQ as se,b5 as pt,S as ee,bk as ht,bj as xt,q as He,ai as Oe,m as Ge,l as ft,ag as mt,ak as Ie,al as V,aB as ut,bM as gt}from"./index-B1DCMe50.js";import{g as bt,h as yt,i as wt,j as jt,k as vt,C as $t,l as Ct,o as kt,m as St,n as Et,M as Rt,u as _t,E as Tt,v as zt,p as It,q as At,r as Nt,s as Pt,t as Mt}from"./Assets.styles-IIy06Oye.js";import{S as Ae,R as Bt,F as Wt,e as Ft}from"./categories-N60mkQ85.js";import{L as Lt}from"./LoadMore-CymwFW-m.js";import{u as Ut}from"./useInfiniteGrid-IXSEUDfN.js";import{E as Ht}from"./ErrorNotice-3r5bQgT2.js";import{d as Ot}from"./dcl-schemas-Dr9BTjb7.js";import{s as Gt,G as Dt,w as qt,S as Vt}from"./buy-gasless-CtdtD4yw.js";import{s as Zt}from"./buy-C5VKib6d.js";import{j as Kt}from"./trade-encoding-CxvKGx0_.js";import{f as Qt}from"./errors-Du3dWMbd.js";import{J as Jt,C as Xt,B as ye}from"./ethers-CtNGBird.js";import{n as Yt}from"./Tooltip-CH3i2AZ8.js";import{G as en}from"./grid.styles-CFQtLncp.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-CkEL0cRE.js";import"./sendMetaTransaction-B8QarnGW.js";function Z(r){const i=r.source??"item",h=r.tradeId||`${r.contractAddress}-${r.tokenId??r.itemId??""}`;return`${i}:${h}`}const H="100000000000000000000",De=2,te=15,tn=/^[a-zA-Z0-9]+$/;function Ne(r){const i=r.trim();return i.length===0?{ok:!1,reason:"empty"}:tn.test(i)?i.length<De?{ok:!1,reason:"too-short"}:i.length>te?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function nn(r){return r.replace(/[^a-zA-Z0-9]/g,"").slice(0,te)}const sn=["function available(string _subdomain) view returns (bool)"],Pe={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function rn(){return U.chainId===Number(Ot.ChainId.MATIC_MAINNET)?Pe.mainnet:Pe.sepolia}async function on(r,i={}){var l;const{rpc:h,address:c}=rn(),d=new Jt(h),a=new Xt(c,sn,d);console.info(`[names] availability check → DCLRegistrar(${c}).available("${r}") on ${h}`);const f=await a.available(r);if((l=i.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${r}" available=${f}`),f?"available":"taken"}const an="https://app.across.to/api";class we extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function ln(r){return it(H,r)}async function cn(r,i,h={}){var l;const c=h.chainId??U.chainId,d=h.provider??"across",a=`${U.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${c}&provider=${d}`,f=await at(a,{method:"GET",identity:r,metadata:{}});if(!f.ok){let p;try{p=(l=await f.json())==null?void 0:l.code}catch{}throw p==="ROUTE_COST_TOO_HIGH"?new we:new Error(`fetchNameCreditRoute ${f.status}`)}return f.json()}function dn(r,i){const h=ye.from(r.availableAmount),d=ye.from(H).sub(h);return{credits:[{value:r.amount,expiresAt:Number(r.expiresAt),salt:Kt(r.id)}],creditsSignatures:[r.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:H}}async function pn(r,i={}){const h=an,c=i.intervalMs??1e4,d=i.maxAttempts??60;let a={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let f=0;f<d;f++){try{const l=await fetch(`${h}/deposit/status?originChainId=137&depositTxHash=${r}`);if(l.ok){const p=await l.json(),x=(p.status??"pending").toLowerCase(),y=p.fillTx??p.fillTxnRef??null,m=p.actionsSucceeded!==!1;if(x==="filled")return{status:"filled",destinationTxHash:y,actionsSucceeded:m};if(x==="refunded"||x==="expired")return{status:x,destinationTxHash:null,actionsSucceeded:!1};a={status:"pending",destinationTxHash:y,actionsSucceeded:m}}}catch{}f<d-1&&await new Promise(l=>setTimeout(l,c))}return a}async function hn(r){const{name:i,identity:h,signer:c}=r,d=r.chainId??U.chainId,a=r.provider??"across",f=(r.beneficiary??await c.getAddress()).toLowerCase();let l=null,p=!1;console.info("[names] register start",{name:i,buyer:f,chainId:d,provider:a});try{const x=await st(d),y=ln(x);console.info("[names] step 1/6 sized reservation",{usdCents:y,manaRate:x});const m=await cn(h,i,{chainId:d,provider:a});console.info("[names] step 2/6 route fetched",{target:m.externalCall.target,selector:m.externalCall.selector,provider:m.provider,quoteId:m.quoteId});const C=await rt(h,y);if(l=C.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:C.credit.id,maxCreditedValue:C.maxCreditedValue}),ye.from(C.maxCreditedValue).lt(H))throw new Error("Credit under-sized for the name price");const k=dn(C.credit,m);let g;try{g=await Gt({chainId:d,buyer:f,signer:c,args:k})}catch(b){if(!(b instanceof Dt))throw b;g=await Zt(d,k,c)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:g}),await qt(g),p=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:g}),a==="across"){const b=await pn(g,r.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:g};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:g,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:g}}catch(x){if(console.error("[names] register failed — raw error:",x,{name:i,buyer:f,originConfirmed:p}),x instanceof Vt)return{status:"pending",originTxHash:x.txHash};if(l&&!p&&await ot(h,[l]).catch(()=>{}),x instanceof we)throw x;const y=new Error(Qt(x,"Couldn't register the name. Please try again.",{sale:!0}));throw y.cause=x,y}}const xn=s.div`
1
+ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r as st,bg as rt,bh as ot,au as it,b as at,s,t,k as Ue,b6 as lt,x as ct,az as be,d as n,v as dt,I as R,w as M,bQ as se,b5 as pt,S as ee,bk as ht,bj as xt,q as He,ai as Oe,m as Ge,l as ft,ag as mt,ak as Ie,al as V,aB as ut,bM as gt}from"./index-CzGc0rp2.js";import{g as bt,h as yt,i as wt,j as jt,k as vt,C as $t,l as Ct,o as kt,m as St,n as Et,M as Rt,u as _t,E as Tt,v as zt,p as It,q as At,r as Nt,s as Pt,t as Mt}from"./Assets.styles-BYFeJKPe.js";import{S as Ae,R as Bt,F as Wt,e as Ft}from"./categories-Bhx5AiD0.js";import{L as Lt}from"./LoadMore-CPMkfBBp.js";import{u as Ut}from"./useInfiniteGrid-BiMca1S0.js";import{E as Ht}from"./ErrorNotice-CmE8Bw2a.js";import{d as Ot}from"./dcl-schemas-Dr9BTjb7.js";import{s as Gt,G as Dt,w as qt,S as Vt}from"./buy-gasless-eYZufj8D.js";import{s as Zt}from"./buy-BZ3zKYDO.js";import{j as Kt}from"./trade-encoding-Dg6aX8Te.js";import{f as Qt}from"./errors-C-i7myPZ.js";import{J as Jt,C as Xt,B as ye}from"./ethers-CtNGBird.js";import{n as Yt}from"./Tooltip-Ca1xi18J.js";import{G as en}from"./grid.styles-CKmGs0rK.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-C776tgTp.js";import"./sendMetaTransaction-DcJMER59.js";function Z(r){const i=r.source??"item",h=r.tradeId||`${r.contractAddress}-${r.tokenId??r.itemId??""}`;return`${i}:${h}`}const H="100000000000000000000",De=2,te=15,tn=/^[a-zA-Z0-9]+$/;function Ne(r){const i=r.trim();return i.length===0?{ok:!1,reason:"empty"}:tn.test(i)?i.length<De?{ok:!1,reason:"too-short"}:i.length>te?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function nn(r){return r.replace(/[^a-zA-Z0-9]/g,"").slice(0,te)}const sn=["function available(string _subdomain) view returns (bool)"],Pe={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function rn(){return U.chainId===Number(Ot.ChainId.MATIC_MAINNET)?Pe.mainnet:Pe.sepolia}async function on(r,i={}){var l;const{rpc:h,address:c}=rn(),d=new Jt(h),a=new Xt(c,sn,d);console.info(`[names] availability check → DCLRegistrar(${c}).available("${r}") on ${h}`);const f=await a.available(r);if((l=i.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${r}" available=${f}`),f?"available":"taken"}const an="https://app.across.to/api";class we extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function ln(r){return it(H,r)}async function cn(r,i,h={}){var l;const c=h.chainId??U.chainId,d=h.provider??"across",a=`${U.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${c}&provider=${d}`,f=await at(a,{method:"GET",identity:r,metadata:{}});if(!f.ok){let p;try{p=(l=await f.json())==null?void 0:l.code}catch{}throw p==="ROUTE_COST_TOO_HIGH"?new we:new Error(`fetchNameCreditRoute ${f.status}`)}return f.json()}function dn(r,i){const h=ye.from(r.availableAmount),d=ye.from(H).sub(h);return{credits:[{value:r.amount,expiresAt:Number(r.expiresAt),salt:Kt(r.id)}],creditsSignatures:[r.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:H}}async function pn(r,i={}){const h=an,c=i.intervalMs??1e4,d=i.maxAttempts??60;let a={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let f=0;f<d;f++){try{const l=await fetch(`${h}/deposit/status?originChainId=137&depositTxHash=${r}`);if(l.ok){const p=await l.json(),x=(p.status??"pending").toLowerCase(),y=p.fillTx??p.fillTxnRef??null,m=p.actionsSucceeded!==!1;if(x==="filled")return{status:"filled",destinationTxHash:y,actionsSucceeded:m};if(x==="refunded"||x==="expired")return{status:x,destinationTxHash:null,actionsSucceeded:!1};a={status:"pending",destinationTxHash:y,actionsSucceeded:m}}}catch{}f<d-1&&await new Promise(l=>setTimeout(l,c))}return a}async function hn(r){const{name:i,identity:h,signer:c}=r,d=r.chainId??U.chainId,a=r.provider??"across",f=(r.beneficiary??await c.getAddress()).toLowerCase();let l=null,p=!1;console.info("[names] register start",{name:i,buyer:f,chainId:d,provider:a});try{const x=await st(d),y=ln(x);console.info("[names] step 1/6 sized reservation",{usdCents:y,manaRate:x});const m=await cn(h,i,{chainId:d,provider:a});console.info("[names] step 2/6 route fetched",{target:m.externalCall.target,selector:m.externalCall.selector,provider:m.provider,quoteId:m.quoteId});const C=await rt(h,y);if(l=C.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:C.credit.id,maxCreditedValue:C.maxCreditedValue}),ye.from(C.maxCreditedValue).lt(H))throw new Error("Credit under-sized for the name price");const k=dn(C.credit,m);let g;try{g=await Gt({chainId:d,buyer:f,signer:c,args:k})}catch(b){if(!(b instanceof Dt))throw b;g=await Zt(d,k,c)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:g}),await qt(g),p=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:g}),a==="across"){const b=await pn(g,r.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:g};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:g,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:g}}catch(x){if(console.error("[names] register failed — raw error:",x,{name:i,buyer:f,originConfirmed:p}),x instanceof Vt)return{status:"pending",originTxHash:x.txHash};if(l&&!p&&await ot(h,[l]).catch(()=>{}),x instanceof we)throw x;const y=new Error(Qt(x,"Couldn't register the name. Please try again.",{sale:!0}));throw y.cause=x,y}}const xn=s.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -379,7 +379,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,r a
379
379
  color: ${t.colors.accent};
380
380
  }
381
381
  }
382
- `;function In({name:r,priceCredits:i,onClose:h}){const{session:c}=Ue(),{data:d,isError:a}=lt(c),f=ct(),l=Le(),[p,x]=u.useState("confirm"),[y,m]=u.useState(""),[C,k]=u.useState(null),g=u.useRef(!1),b=y.trim().toLowerCase()===r.toLowerCase(),S=p==="completing",v=i!=null?be(i):"—",_=i==null,E=d==null?void 0:d.credits,B=i!=null&&E!=null?i-E:0,$=B>0,T=_?n("names.priceUnavailable"):$?n("names.insufficientCredits",{credits:be(B)}):null;u.useEffect(()=>{const w=G=>{G.key==="Escape"&&!S&&h()};document.addEventListener("keydown",w);const O=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",w),document.body.style.overflow=O}},[S,h]);async function I(){if(!(!c||!b||_||$||g.current)){g.current=!0,x("completing"),k(null);try{const w=await hn({name:r,identity:c.identity,signer:c.signer});ee("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null,settlement:w.status}),f.invalidateQueries({queryKey:["usd-balance"]}),f.invalidateQueries({queryKey:["my-assets"]}),x(w.status==="registered"?"success":"pending")}catch(w){ee(xt(w)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:ht(w),purchase_type:"name"}),k(w instanceof we?n("names.errorRouteCost"):(w==null?void 0:w.message)||n("names.errorGeneric")),x("error")}finally{g.current=!1}}}const A=p!=="success"&&p!=="pending",N=dt(c==null?void 0:c.providerType);return e.jsx(xn,{onClick:S?void 0:h,role:"presentation",children:e.jsxs(fn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:w=>w.stopPropagation(),children:[A&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:p==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ie,{onClick:h,disabled:S,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{})]}),(p==="confirm"||p==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(fe,{children:[e.jsx(M,{}),v]})]}),p==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(me,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),e.jsx(Me,{onClick:()=>x("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(mn,{children:[e.jsx(un,{children:n("names.confirmTitle")}),e.jsx(gn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${An(r)}</b>`})}}),e.jsxs(bn,{children:[e.jsx(yn,{"aria-hidden":!0,children:"@"}),e.jsx(wn,{value:y,onChange:w=>m(w.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(y.length,8)}ch`}}),e.jsx(jn,{children:".dcl.eth"})]})]}),T?e.jsxs(me,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:T})]}):null,e.jsx(Me,{onClick:()=>void I(),disabled:!b||!c||_||$,children:n("names.buyCta")})]})]}),p==="completing"&&e.jsxs(vn,{children:[e.jsx($n,{src:pt,alt:"",width:56,height:56}),e.jsx(Cn,{children:N?n("names.confirming"):n("names.completing")}),e.jsxs(kn,{children:[e.jsx(Sn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(En,{children:"1/1"})]})]}),p==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:n("names.pendingHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(me,{"data-tone":"info",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(fe,{children:[e.jsx(M,{}),v]})]}),e.jsx(Be,{children:e.jsx(We,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")})})]}),p==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:n("names.successHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(Rn,{children:[e.jsx(_n,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(Tn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(fe,{children:[e.jsx(M,{}),v]})]}),e.jsxs(Be,{children:[e.jsx(We,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")}),e.jsx(zn,{href:U.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function An(r){return r.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Nn="https://cdn.decentraland.org/@dcl/shop/0.7.2/_assets/identity-B4DXDuJP.webp",Pn="https://cdn.decentraland.org/@dcl/shop/0.7.2/_assets/world-B-9aPlxu.webp",Mn="https://cdn.decentraland.org/@dcl/shop/0.7.2/_assets/invite-BfwIhP2C.webp",Bn="https://cdn.decentraland.org/@dcl/shop/0.7.2/_assets/governance-DnazlIjy.webp",Wn=s.div`
382
+ `;function In({name:r,priceCredits:i,onClose:h}){const{session:c}=Ue(),{data:d,isError:a}=lt(c),f=ct(),l=Le(),[p,x]=u.useState("confirm"),[y,m]=u.useState(""),[C,k]=u.useState(null),g=u.useRef(!1),b=y.trim().toLowerCase()===r.toLowerCase(),S=p==="completing",v=i!=null?be(i):"—",_=i==null,E=d==null?void 0:d.credits,B=i!=null&&E!=null?i-E:0,$=B>0,T=_?n("names.priceUnavailable"):$?n("names.insufficientCredits",{credits:be(B)}):null;u.useEffect(()=>{const w=G=>{G.key==="Escape"&&!S&&h()};document.addEventListener("keydown",w);const O=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",w),document.body.style.overflow=O}},[S,h]);async function I(){if(!(!c||!b||_||$||g.current)){g.current=!0,x("completing"),k(null);try{const w=await hn({name:r,identity:c.identity,signer:c.signer});ee("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null,settlement:w.status}),f.invalidateQueries({queryKey:["usd-balance"]}),f.invalidateQueries({queryKey:["my-assets"]}),x(w.status==="registered"?"success":"pending")}catch(w){ee(xt(w)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:ht(w),purchase_type:"name"}),k(w instanceof we?n("names.errorRouteCost"):(w==null?void 0:w.message)||n("names.errorGeneric")),x("error")}finally{g.current=!1}}}const A=p!=="success"&&p!=="pending",N=dt(c==null?void 0:c.providerType);return e.jsx(xn,{onClick:S?void 0:h,role:"presentation",children:e.jsxs(fn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:w=>w.stopPropagation(),children:[A&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:p==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ie,{onClick:h,disabled:S,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{})]}),(p==="confirm"||p==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(fe,{children:[e.jsx(M,{}),v]})]}),p==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(me,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),e.jsx(Me,{onClick:()=>x("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(mn,{children:[e.jsx(un,{children:n("names.confirmTitle")}),e.jsx(gn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${An(r)}</b>`})}}),e.jsxs(bn,{children:[e.jsx(yn,{"aria-hidden":!0,children:"@"}),e.jsx(wn,{value:y,onChange:w=>m(w.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(y.length,8)}ch`}}),e.jsx(jn,{children:".dcl.eth"})]})]}),T?e.jsxs(me,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:T})]}):null,e.jsx(Me,{onClick:()=>void I(),disabled:!b||!c||_||$,children:n("names.buyCta")})]})]}),p==="completing"&&e.jsxs(vn,{children:[e.jsx($n,{src:pt,alt:"",width:56,height:56}),e.jsx(Cn,{children:N?n("names.confirming"):n("names.completing")}),e.jsxs(kn,{children:[e.jsx(Sn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(En,{children:"1/1"})]})]}),p==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:n("names.pendingHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(me,{"data-tone":"info",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(fe,{children:[e.jsx(M,{}),v]})]}),e.jsx(Be,{children:e.jsx(We,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")})})]}),p==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:n("names.successHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(Rn,{children:[e.jsx(_n,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(Tn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(fe,{children:[e.jsx(M,{}),v]})]}),e.jsxs(Be,{children:[e.jsx(We,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")}),e.jsx(zn,{href:U.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function An(r){return r.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Nn="https://cdn.decentraland.org/@dcl/shop/0.7.3-30998099552.commit-f7fa6e3/_assets/identity-B4DXDuJP.webp",Pn="https://cdn.decentraland.org/@dcl/shop/0.7.3-30998099552.commit-f7fa6e3/_assets/world-B-9aPlxu.webp",Mn="https://cdn.decentraland.org/@dcl/shop/0.7.3-30998099552.commit-f7fa6e3/_assets/invite-BfwIhP2C.webp",Bn="https://cdn.decentraland.org/@dcl/shop/0.7.3-30998099552.commit-f7fa6e3/_assets/governance-DnazlIjy.webp",Wn=s.div`
383
383
  width: 100%;
384
384
  min-width: 0;
385
385
  `,Fn=s.nav`
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-DehiWSvs.js";import{R as T,C as se,a as ae,b as re}from"./categories-N60mkQ85.js";import{n as c,T as le}from"./Tooltip-CH3i2AZ8.js";import{t as e,s as o,I as g,d as s,ag as ce,e as v}from"./index-B1DCMe50.js";const de=o.div`
1
+ import{r as $,j as t}from"./react-DehiWSvs.js";import{R as T,C as se,a as ae,b as re}from"./categories-Bhx5AiD0.js";import{n as c,T as le}from"./Tooltip-Ca1xi18J.js";import{t as e,s as o,I as g,d as s,ag as ce,e as v}from"./index-CzGc0rp2.js";const de=o.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -1,4 +1,4 @@
1
- import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as a,o as D,q as F,d as e,k as G,v as O,I as b,w as B,n as w,x as K,c as Q,y as H,z as A,A as X,D as Z,E}from"./index-B1DCMe50.js";import{d as J,f as U,b as V,h as Y,s as tt,a as it}from"./authorizations-CkEL0cRE.js";import{f as et}from"./builder-BoC6pJY-.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-Du3dWMbd.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-B8QarnGW.js";const nt=D`
1
+ import{j as i,L as _,r as P}from"./react-DehiWSvs.js";import{s as n,B as W,t as a,o as D,q as F,d as e,k as G,v as O,I as b,w as B,n as w,x as K,c as Q,y as H,z as A,A as X,D as Z,E}from"./index-CzGc0rp2.js";import{d as J,f as U,b as V,h as Y,s as tt,a as it}from"./authorizations-C776tgTp.js";import{f as et}from"./builder-CsxZ_GQ8.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-C-i7myPZ.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DcJMER59.js";const nt=D`
2
2
  to { transform: rotate(360deg); }
3
3
  `,st=D`
4
4
  to { background-position: -200% 0; }
@@ -1,4 +1,4 @@
1
- import{j as e,L as $e,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as ue,s as i,d as a,az as le,b5 as sa,ay as na,I as H,w as Mt,af as Ue,q as ia,Q as N,ah as dt,k as ra,l as oa,n as ca,b6 as da,x as la,b7 as ua,ai as ha,b8 as pa,b9 as lt,ba as ga,bb as xa,v as ma,bc as ut,S as G,bd as ht,be as fa,A as ae,r as ya,c as pt,bf as ba,e as va,bg as gt,bh as _e,bi as ye,bj as be,bk as xt,g as ve,a as wa,C as We,bl as Ca}from"./index-B1DCMe50.js";import{M as ja,S as ka,C as Sa,H as $a,a as Ma,T as Ta,X as Ia,b as Pa,B as za,c as Aa,d as mt,e as Ea,f as ke,P as Tt,m as qa,g as Ba,h as Ra,i as _a,j as It,k as Se,L as Wa,l as Fa,n as ft,o as yt,W as La,p as Ka,q as Qa,A as Ua,r as Na,s as Ha,t as Oa,u as Va,v as Ga,w as Da,x as Ya,y as Ja,z as Xa,D as Za,E as es,F as ts,G as as,I as ss,J as ns,K as Fe,N as is,O as rs,Q as os,R as cs,U as bt,V as vt,Y as ds,Z as ls,_ as us}from"./CollectionCarousel-DelfAKnZ.js";import{j as hs,k as ps,a as gs,n as xs,i as ms,A as fs}from"./authorizations-CkEL0cRE.js";import{g as ys,b as Le}from"./buy-C5VKib6d.js";import{b as bs,w as vs,S as wt,G as ws}from"./buy-gasless-CtdtD4yw.js";import{u as Cs,M as js,R as we,r as ks,c as Ss,p as Ct}from"./useCreditPacks-eXmbKxJO.js";import{i as $s,a as Ms}from"./errors-Du3dWMbd.js";import{E as Ts}from"./ErrorNotice-3r5bQgT2.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-CxvKGx0_.js";import"./sendMetaTransaction-B8QarnGW.js";const{colors:se,radius:Is}=ue,Ps=i.div`
1
+ import{j as e,L as $e,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as ue,s as i,d as a,az as le,b5 as sa,ay as na,I as H,w as Mt,af as Ue,q as ia,Q as N,ah as dt,k as ra,l as oa,n as ca,b6 as da,x as la,b7 as ua,ai as ha,b8 as pa,b9 as lt,ba as ga,bb as xa,v as ma,bc as ut,S as G,bd as ht,be as fa,A as ae,r as ya,c as pt,bf as ba,e as va,bg as gt,bh as _e,bi as ye,bj as be,bk as xt,g as ve,a as wa,C as We,bl as Ca}from"./index-CzGc0rp2.js";import{M as ja,S as ka,C as Sa,H as $a,a as Ma,T as Ta,X as Ia,b as Pa,B as za,c as Aa,d as mt,e as Ea,f as ke,P as Tt,m as qa,g as Ba,h as Ra,i as _a,j as It,k as Se,L as Wa,l as Fa,n as ft,o as yt,W as La,p as Ka,q as Qa,A as Ua,r as Na,s as Ha,t as Oa,u as Va,v as Ga,w as Da,x as Ya,y as Ja,z as Xa,D as Za,E as es,F as ts,G as as,I as ss,J as ns,K as Fe,N as is,O as rs,Q as os,R as cs,U as bt,V as vt,Y as ds,Z as ls,_ as us}from"./CollectionCarousel-DVB8xJEb.js";import{j as hs,k as ps,a as gs,n as xs,i as ms,A as fs}from"./authorizations-C776tgTp.js";import{g as ys,b as Le}from"./buy-BZ3zKYDO.js";import{b as bs,w as vs,S as wt,G as ws}from"./buy-gasless-eYZufj8D.js";import{u as Cs,M as js,R as we,r as ks,c as Ss,p as Ct}from"./useCreditPacks-DsT6A2e-.js";import{i as $s,a as Ms}from"./errors-C-i7myPZ.js";import{E as Ts}from"./ErrorNotice-CmE8Bw2a.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-Dg6aX8Te.js";import"./sendMetaTransaction-DcJMER59.js";const{colors:se,radius:Is}=ue,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 $e,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
- `,Bs="https://cdn.decentraland.org/@dcl/shop/0.7.2/_assets/buy-error-22UunaPC.png";function Rs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(ja,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ka,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Sa,{"data-tall":Y||void 0,children:[e.jsxs($a,{children:[e.jsxs(Ma,{children:[e.jsx(Ta,{children:D}),!W&&e.jsx(Ia,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Pa,{})})]}),e.jsxs(za,{children:[e.jsx(Aa,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(mt,{}),e.jsx(Ea,{children:le(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(mt,{}),le(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=qa(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{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(Ba,{"data-testid":"buy-error",children:[e.jsx(Ra,{src:Bs,alt:"",width:64,height:80}),e.jsxs(_a,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(Wa,{src:sa,alt:"",width:61,height:61}),e.jsx(Fa,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}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(La,{"data-testid":"nofunds-warning",children:[e.jsx(Ka,{}),e.jsxs(Qa,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Ua,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ha,{children:[e.jsxs("div",{children:[e.jsxs(Oa,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(Es,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Va,{address:n.item.creator}):null]}),e.jsxs(Ga,{children:[e.jsx(Da,{}),e.jsx("span",{children:le(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ya,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ja,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Xa,{}),e.jsx(Za,{children:le(n.credits)}),e.jsxs(es,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(ts,{children:[e.jsxs(as,{children:[e.jsx(ss,{}),e.jsx("span",{children:le((A==null?void 0:A.credits)??0)})]}),e.jsxs(ns,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=ue,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
61
+ `,Bs="https://cdn.decentraland.org/@dcl/shop/0.7.3-30998099552.commit-f7fa6e3/_assets/buy-error-22UunaPC.png";function Rs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(ja,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ka,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Sa,{"data-tall":Y||void 0,children:[e.jsxs($a,{children:[e.jsxs(Ma,{children:[e.jsx(Ta,{children:D}),!W&&e.jsx(Ia,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Pa,{})})]}),e.jsxs(za,{children:[e.jsx(Aa,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(mt,{}),e.jsx(Ea,{children:le(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(mt,{}),le(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=qa(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{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(Ba,{"data-testid":"buy-error",children:[e.jsx(Ra,{src:Bs,alt:"",width:64,height:80}),e.jsxs(_a,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(ke,{"data-processing":!0,children:[e.jsx(Wa,{src:sa,alt:"",width:61,height:61}),e.jsx(Fa,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}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(La,{"data-testid":"nofunds-warning",children:[e.jsx(Ka,{}),e.jsxs(Qa,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Ua,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ha,{children:[e.jsxs("div",{children:[e.jsxs(Oa,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(Es,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Va,{address:n.item.creator}):null]}),e.jsxs(Ga,{children:[e.jsx(Da,{}),e.jsx("span",{children:le(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ya,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ja,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Xa,{}),e.jsx(Za,{children:le(n.credits)}),e.jsxs(es,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(ts,{children:[e.jsxs(as,{children:[e.jsx(ss,{}),e.jsx("span",{children:le((A==null?void 0:A.credits)??0)})]}),e.jsxs(ns,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=ue,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
@@ -1,4 +1,4 @@
1
- import{ab as N,ac as U,ad as o,ae as n,af as D,o as M}from"./index-B1DCMe50.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-CjUv0U3K.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
1
+ import{ab as N,ac as U,ad as o,ae as n,af as D,o as M}from"./index-CzGc0rp2.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-DxV2l543.js";function K(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bm as ee,W as te,y as z,bn as ae,bo as oe,I as ie,d as a,c as re,A as se,n as ne,q as ce,e as le,ak as F,al as de,bp as pe,bq as xe}from"./index-B1DCMe50.js";import{E as me}from"./ErrorNotice-3r5bQgT2.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-BWGZLOL_.js";import{S as L,C as ye,F as je,c as we,P as Ce,d as $e,H as ke,e as Ne}from"./categories-N60mkQ85.js";import{L as Ae}from"./LoadMore-CymwFW-m.js";import{u as Pe}from"./useInfiniteGrid-IXSEUDfN.js";import{G as Se}from"./grid.styles-CFQtLncp.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Me=s.section`
1
+ import{j as e,r as h,u as J,d as X}from"./react-DehiWSvs.js";import{t as b,s,bm as ee,W as te,y as z,bn as ae,bo as oe,I as ie,d as a,c as re,A as se,n as ne,q as ce,e as le,ak as F,al as de,bp as pe,bq as xe}from"./index-CzGc0rp2.js";import{E as me}from"./ErrorNotice-CmE8Bw2a.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-CJq9b5Dn.js";import{S as L,C as ye,F as je,c as we,P as Ce,d as $e,H as ke,e as Ne}from"./categories-Bhx5AiD0.js";import{L as Ae}from"./LoadMore-CPMkfBBp.js";import{u as Pe}from"./useInfiniteGrid-BiMca1S0.js";import{G as Se}from"./grid.styles-CKmGs0rK.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Me=s.section`
2
2
  position: relative;
3
3
  border-radius: ${b.radius.card};
4
4
  overflow: hidden;
@@ -1,4 +1,4 @@
1
- import{j as t,r as v}from"./react-DehiWSvs.js";import{s as e,t as o,d as f,w as k,az as j,bH as C,e as G,o as Y,I as Q,A as X,g as W,C as B,a as Z,a3 as J,bR as F,al as q}from"./index-B1DCMe50.js";import{s as ee,i as H,A as U,g as K,r as te,m as ne,c as ae,M as ie,e as oe}from"./authorizations-CkEL0cRE.js";import{i as se}from"./errors-Du3dWMbd.js";import{E as re}from"./ErrorNotice-3r5bQgT2.js";import{a as ce}from"./buy-C5VKib6d.js";import{g as de,a as le}from"./trade-encoding-CxvKGx0_.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-B8QarnGW.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,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function 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,d as f,w as k,az as j,bH as C,e as G,o as Y,I as Q,A as X,g as W,C as B,a as Z,a3 as J,bR as F,al as q}from"./index-CzGc0rp2.js";import{s as ee,i as H,A as U,g as K,r as te,m as ne,c as ae,M as ie,e as oe}from"./authorizations-C776tgTp.js";import{i as se}from"./errors-C-i7myPZ.js";import{E as re}from"./ErrorNotice-CmE8Bw2a.js";import{a as ce}from"./buy-BZ3zKYDO.js";import{g as de,a as le}from"./trade-encoding-Dg6aX8Te.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-DcJMER59.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,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function 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;
@@ -1,4 +1,4 @@
1
- import{d as pe,j as e,L as Re,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";import{t as ge,G as Be,J as re,H as se,s as i,bI as We,ay as _e,bJ as Te,d as o,bK as De,bL as ie,B as Ge,af as fe,W as be,bm as Oe,k as Ke,y as we,bt as He,bn as Ue,bo as qe,I as ae,c as Ve,q as Je,n as Qe,ag as Ye,ai as Ze,aj as Xe,ak as A,al as ne,bM as le,bN as et}from"./index-B1DCMe50.js";import{d as tt,P as ot,C as rt,a as st,b as it,A as at,c as nt,e as lt}from"./collectionPage.styles-BWGZLOL_.js";import{g as ct,h as dt,i as ht,j as mt,k as ut,C as xt,l as pt,o as gt,m as ft,n as bt,M as wt,E as jt,p as vt,q as yt,r as Ct,s as kt,t as $t}from"./Assets.styles-IIy06Oye.js";import{S as ce,R as St,F as Nt,e as Pt}from"./categories-N60mkQ85.js";import{L as de}from"./LoadMore-CymwFW-m.js";import{u as he}from"./useInfiniteGrid-IXSEUDfN.js";import{E as T}from"./ErrorNotice-3r5bQgT2.js";import{G as me}from"./grid.styles-CFQtLncp.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./Tooltip-CH3i2AZ8.js";function Et(r){const{gridLoading:s,gridError:a,gridCount:n,baselinePending:l,baselineError:c,baselineCount:m}=r;return s?"skeletons":a?"error":n>0?"items":l?"skeletons":c?"error":m===0?"no-creations":"filters"}const{colors:b,radius:je,media:Ft}=ge,Lt=i.article`
1
+ import{d as pe,j as e,L as Re,u as Me,e as ze,r as g}from"./react-DehiWSvs.js";import{t as ge,G as Be,J as re,H as se,s as i,bI as We,ay as _e,bJ as Te,d as o,bK as De,bL as ie,B as Ge,af as fe,W as be,bm as Oe,k as Ke,y as we,bt as He,bn as Ue,bo as qe,I as ae,c as Ve,q as Je,n as Qe,ag as Ye,ai as Ze,aj as Xe,ak as A,al as ne,bM as le,bN as et}from"./index-CzGc0rp2.js";import{d as tt,P as ot,C as rt,a as st,b as it,A as at,c as nt,e as lt}from"./collectionPage.styles-CJq9b5Dn.js";import{g as ct,h as dt,i as ht,j as mt,k as ut,C as xt,l as pt,o as gt,m as ft,n as bt,M as wt,E as jt,p as vt,q as yt,r as Ct,s as kt,t as $t}from"./Assets.styles-BYFeJKPe.js";import{S as ce,R as St,F as Nt,e as Pt}from"./categories-Bhx5AiD0.js";import{L as de}from"./LoadMore-CPMkfBBp.js";import{u as he}from"./useInfiniteGrid-BiMca1S0.js";import{E as T}from"./ErrorNotice-CmE8Bw2a.js";import{G as me}from"./grid.styles-CKmGs0rK.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./Tooltip-Ca1xi18J.js";function Et(r){const{gridLoading:s,gridError:a,gridCount:n,baselinePending:l,baselineError:c,baselineCount:m}=r;return s?"skeletons":a?"error":n>0?"items":l?"skeletons":c?"error":m===0?"no-creations":"filters"}const{colors:b,radius:je,media:Ft}=ge,Lt=i.article`
2
2
  height: 300px;
3
3
  background: ${b.bg};
4
4
  border-radius: ${je.card};
@@ -1 +1 @@
1
- import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-B1DCMe50.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-CzGc0rp2.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-hR4mAmko.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-DDiCv4U4.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-FyX1W-1Y.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-jOzdgfRR.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};
@@ -0,0 +1,168 @@
1
+ import{r as h,j as o}from"./react-DehiWSvs.js";import{t as e,s as a,d as r,I as w}from"./index-CzGc0rp2.js";const b=a.section`
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 36px;
5
+ font-family: ${e.font.sans};
6
+
7
+ &[data-tone='on-dark'] {
8
+ align-items: center;
9
+ }
10
+
11
+ ${e.media.maxWidth("mobile")} {
12
+ gap: 24px;
13
+ }
14
+ `,m=a.h2`
15
+ margin: 0;
16
+ font-size: 20px;
17
+ font-weight: 700;
18
+ line-height: 1.167;
19
+ color: ${e.colors.text2};
20
+
21
+ [data-tone='on-dark'] & {
22
+ font-size: 32px;
23
+ color: ${e.colors.white};
24
+ text-align: center;
25
+ }
26
+
27
+ ${e.media.maxWidth("mobile")} {
28
+ font-size: 18px;
29
+
30
+ [data-tone='on-dark'] & {
31
+ font-size: 24px;
32
+ }
33
+ }
34
+ `,k=a.div`
35
+ display: flex;
36
+ flex-direction: column;
37
+ gap: 24px;
38
+ width: 100%;
39
+ `,v=a.div`
40
+ border-radius: ${e.radius.pill};
41
+
42
+ &[data-open='true'] {
43
+ border-radius: 42px;
44
+ overflow: hidden;
45
+ border: 0.5px solid ${e.colors.text2};
46
+ }
47
+
48
+ [data-tone='on-dark'] &[data-open='true'] {
49
+ background: rgba(0, 0, 0, 0.1);
50
+ /* 1px when open, 0.5px closed — the design thickens the outline as the row takes over the page. */
51
+ border: 1px solid ${e.colors.white};
52
+ }
53
+ `,$=a.button`
54
+ appearance: none;
55
+ width: 100%;
56
+ display: flex;
57
+ align-items: center;
58
+ gap: 2px;
59
+ padding: 24px;
60
+ border: none;
61
+ border-radius: inherit;
62
+ background: rgba(0, 0, 0, 0.05);
63
+ font-family: inherit;
64
+ font-size: 20px;
65
+ font-weight: 600;
66
+ line-height: 1.43;
67
+ /* Gray 0 closed, Soft Black 2 open: the question darkens as it becomes the heading of a section. */
68
+ color: ${e.colors.gray0};
69
+ text-align: left;
70
+ cursor: pointer;
71
+ transition:
72
+ background-color 120ms ease,
73
+ box-shadow 120ms ease,
74
+ color 120ms ease;
75
+
76
+ &[data-open='true'] {
77
+ color: ${e.colors.text2};
78
+ /* The header keeps square bottom corners while the answer sits under it. */
79
+ border-radius: 42px 42px 0 0;
80
+ }
81
+
82
+ /* No hover variant exists for the light mode in the design, so this is the smallest honest reading of
83
+ one: the same fill, a step darker. Inventing the dark mode's 3px white ring here would have put a
84
+ border on a row that has none. */
85
+ &:hover {
86
+ background: rgba(0, 0, 0, 0.08);
87
+ }
88
+
89
+ &:focus-visible {
90
+ outline: 2px solid ${e.colors.text2};
91
+ outline-offset: 2px;
92
+ }
93
+
94
+ [data-tone='on-dark'] & {
95
+ background: rgba(0, 0, 0, 0.1);
96
+ border: 0.5px solid ${e.colors.white};
97
+ color: ${e.colors.white};
98
+ }
99
+
100
+ /* On hover the dark skin deepens its fill and takes its outline from 0.5px to 3px.
101
+ The extra 2.5px is an INSET SHADOW, not a fatter border. border-box keeps the outer box fixed, but
102
+ height here is auto — content + padding + BORDER — so growing the border 0.5px → 3px added 5px of
103
+ height and shoved every row below it down as the pointer crossed. A box-shadow takes no part in
104
+ layout, so the stroke thickens inward from the same outer edge and nothing moves. (The pack cards
105
+ hit this same trap and solve it with a masked pseudo-element; they need one because their stroke is a
106
+ gradient, which a border cannot paint. This one is flat white, so the shadow is enough.)
107
+ 0.5 + 2.5 = the designed 3px. */
108
+ [data-tone='on-dark'] &:hover {
109
+ background: rgba(0, 0, 0, 0.3);
110
+ box-shadow: inset 0 0 0 2.5px ${e.colors.white};
111
+ }
112
+
113
+ /* border-color, not "border: none": dropping the border outright would take its 0.5px out of the
114
+ height as well, so opening a row would nudge it by 1px on top of the answer appearing. The background
115
+ paints under the border area (background-clip defaults to border-box), so the transparent hairline
116
+ shows this header's own fill, not the shell behind it. */
117
+ [data-tone='on-dark'] &[data-open='true'] {
118
+ background: rgba(255, 255, 255, 0.2);
119
+ border-color: transparent;
120
+ box-shadow: none;
121
+ }
122
+
123
+ [data-tone='on-dark'] &:focus-visible {
124
+ outline-color: ${e.colors.white};
125
+ }
126
+
127
+ ${e.media.maxWidth("mobile")} {
128
+ padding: 16px;
129
+ font-size: 16px;
130
+ }
131
+ `,q=a.span`
132
+ flex: 1 0 0;
133
+ min-width: 0;
134
+ /* The design sets the question nowrap at 1423px, where every one of them fits on a line. At the Shop's
135
+ widths they do not, so wrapping is the faithful reading of the intent — a clipped question is not. */
136
+ overflow-wrap: break-word;
137
+ `,j=a.span`
138
+ flex-shrink: 0;
139
+ display: flex;
140
+ transition: transform 160ms ease;
141
+
142
+ &[data-open='false'] {
143
+ transform: rotate(180deg);
144
+ }
145
+
146
+ @media (prefers-reduced-motion: reduce) {
147
+ transition: none;
148
+ }
149
+ `,y=a.div`
150
+ padding: 32px 24px;
151
+ font-size: 20px;
152
+ font-weight: 400;
153
+ line-height: 1.5;
154
+ color: ${e.colors.text2};
155
+ /* The answers are authored as one string with a newline where the design breaks the line. Two <p>s with
156
+ no margin between them render as two lines, which is what this is — keeping it one translatable string
157
+ rather than splitting every answer into numbered halves. */
158
+ white-space: pre-line;
159
+
160
+ [data-tone='on-dark'] & {
161
+ color: ${e.colors.white};
162
+ }
163
+
164
+ ${e.media.maxWidth("mobile")} {
165
+ padding: 20px 16px;
166
+ font-size: 16px;
167
+ }
168
+ `;function I({title:l,entries:p,tone:c="light",className:x}){const[u,g]=h.useState(()=>new Set),s=h.useId();function f(t){g(n=>{const i=new Set(n);return i.delete(t)||i.add(t),i})}return o.jsxs(b,{className:x,"data-tone":c,"data-testid":"faq",children:[o.jsx(m,{children:r(l)}),o.jsx(k,{children:p.map(t=>{const n=u.has(t.question),i=`${s}-panel-${t.question}`,d=`${s}-header-${t.question}`;return o.jsxs(v,{"data-open":n,"data-testid":"faq-item",children:[o.jsxs($,{type:"button",onClick:()=>f(t.question),id:d,"aria-expanded":n,"aria-controls":n?i:void 0,"data-open":n,"data-testid":"faq-question",children:[o.jsx(q,{children:r(t.question)}),o.jsx(j,{"data-open":n,"aria-hidden":!0,children:o.jsx(w,{name:"chevron-up-line",size:36})})]}),n&&o.jsx(y,{id:i,role:"region","aria-labelledby":d,"data-testid":"faq-answer",children:r(t.answer)})]},t.question)})})]})}export{I as F};