@dcl/shop 0.1.0-29820315471.commit-e34db25 → 0.1.0-29820418604.commit-45fc148

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 (175) hide show
  1. package/assets/{AnimatedBackground-DQ46urVV.js → AnimatedBackground-CLVd407x.js} +3 -3
  2. package/assets/{Assets-5wZu90xj.js → Assets-CeamphU4.js} +1 -1
  3. package/assets/Cart-CpqxTUEQ.js +3 -0
  4. package/assets/{CircularProgress-CfcEerVP.js → CircularProgress-pGkqbXc8.js} +5 -5
  5. package/assets/{Collection-Bi7w1GKJ.js → Collection-Djh5yx-V.js} +1 -1
  6. package/assets/{CollectionCarousel-Bu8qPKKJ.js → CollectionCarousel-D-AQXiSI.js} +1 -1
  7. package/assets/{Creator-B13Gi9z4.js → Creator-eej8kLdE.js} +1 -1
  8. package/assets/{CssVarsProvider-CvtfLfCd.js → CssVarsProvider-wQmSi_2B.js} +3 -3
  9. package/assets/{ExchangeController-B9D_7PXu.js → ExchangeController-xwl8Mauh.js} +1 -1
  10. package/assets/GetCredits-BarLHOMT.js +1 -0
  11. package/assets/{HelpersUtil-CNtn9Kzj.js → HelpersUtil-CtK6l89Q.js} +1 -1
  12. package/assets/{ImportListings-hNp1sEuT.js → ImportListings-D0cnF4v2.js} +1 -1
  13. package/assets/ItemDetail-DKATNTJH.js +29 -0
  14. package/assets/{LoadMore-CwKrPv19.js → LoadMore-CUcfUpuY.js} +1 -1
  15. package/assets/{MarketCheckout-D-VQDb7F.js → MarketCheckout-CUVL7ePz.js} +1 -1
  16. package/assets/MyAssets-DZ21drOF.js +7 -0
  17. package/assets/{MyFavorites-CdAcz-wK.js → MyFavorites-CcpfBMUQ.js} +1 -1
  18. package/assets/{MyPurchases-Bw8Lb-63.js → MyPurchases-DrCQpnOc.js} +1 -1
  19. package/assets/{NotFound-C3wbCG4q.js → NotFound-Bib2meoR.js} +1 -1
  20. package/assets/{StoreSettings-BhJ4tKkZ.js → StoreSettings-BdWy5pLg.js} +2 -2
  21. package/assets/{Success-CiXoIPVr.js → Success-DoHr_e0L.js} +2 -2
  22. package/assets/{SwapController-53Vi_fXW.js → SwapController-NRXxMYwH.js} +1 -1
  23. package/assets/{TradeService-C8gY38rG.js → TradeService-Ci94LS1z.js} +1 -1
  24. package/assets/{W3MFrameProviderSingleton-CaYG210l.js → W3MFrameProviderSingleton-DC5YSqzl.js} +3 -3
  25. package/assets/{WebCryptoP256-DtgFm5FB.js → WebCryptoP256-CObxbTd2.js} +1 -1
  26. package/assets/{basic-Ch9NQwrH.js → basic-B4Dxarc6.js} +1 -1
  27. package/assets/{biconomy-TNDCvsRI.js → biconomy-4lG-30OY.js} +1 -1
  28. package/assets/{buy-BPkraJ17.js → buy-D-vBFkG6.js} +1 -1
  29. package/assets/{buy-gasless-uVyAhlxN.js → buy-gasless-BGON-kY0.js} +1 -1
  30. package/assets/{cart-checkout-Co7t_k8J.js → cart-checkout-BCBPBbFe.js} +1 -1
  31. package/assets/{categories-pY-U0UXm.js → categories-C4HyTLUC.js} +1 -1
  32. package/assets/{ccip-scmwpqQC.js → ccip-B6_7LF7S.js} +1 -1
  33. package/assets/{ccip-BAHa2VFa.js → ccip-PshQmxYU.js} +1 -1
  34. package/assets/{collection-BdgBOuhz.js → collection-WFDCerhK.js} +1 -1
  35. package/assets/{controller-DGvMtERc.js → controller-Bld6UUhD.js} +2 -2
  36. package/assets/{core-DflkIDmd.js → core-D3jzt6RC.js} +4 -4
  37. package/assets/{custom-DclbkPm_.js → custom-BQ1uOClq.js} +1 -1
  38. package/assets/{data-capture-D7FmI-WY.js → data-capture-CxB5Hizu.js} +1 -1
  39. package/assets/{decimals-Cd90iC1A.js → decimals-BaxHo7kp.js} +1 -1
  40. package/assets/{decimals-B34hEReu.js → decimals-G1SKj7ht.js} +1 -1
  41. package/assets/{detectExtension-BCqIz4gv.js → detectExtension-Cx9Ff7Bn.js} +1 -1
  42. package/assets/{email-B6HsCs0u.js → email-CiACGjjn.js} +1 -1
  43. package/assets/{embedded-wallet-cye2mSzK.js → embedded-wallet-BEct5rXi.js} +1 -1
  44. package/assets/emotion-styled.browser.esm-CfHtORSh.js +1 -0
  45. package/assets/{engine-CMumcr4T.js → engine-BnuPVhdn.js} +1 -1
  46. package/assets/{errors-qUwGIanA.js → errors-fv83sI_L.js} +1 -1
  47. package/assets/{estimate-l1-fee-DebL8v3Z.js → estimate-l1-fee-DcaMKCM5.js} +1 -1
  48. package/assets/{eth_estimateGas-2pKUTcbV.js → eth_estimateGas-DsaLLOsg.js} +1 -1
  49. package/assets/{eth_getStorageAt-CFTZVftG.js → eth_getStorageAt-BOEHlFPR.js} +1 -1
  50. package/assets/{eth_getTransactionCount-39Gh8JUo.js → eth_getTransactionCount-BAMNiMAi.js} +1 -1
  51. package/assets/{extractIPFS-PVH2EVQE.js → extractIPFS-CU6BCutm.js} +1 -1
  52. package/assets/{features-D9Taji2F.js → features-DAf222uj.js} +1 -1
  53. package/assets/{fetchTokenMetadata-DM2B3NZz.js → fetchTokenMetadata-6BMd1rXE.js} +2 -2
  54. package/assets/{get-ecosystem-wallet-info-kEbf8Llc.js → get-ecosystem-wallet-info-BUdWoGAu.js} +1 -1
  55. package/assets/{getBalance-B4GGi_h8.js → getBalance-BkD4yHvZ.js} +1 -1
  56. package/assets/{getInstalledModules-W39oQBw8.js → getInstalledModules-kilR2NiC.js} +1 -1
  57. package/assets/{getNFT-_ore7rdY.js → getNFT-CG0EByli.js} +2 -2
  58. package/assets/{getNFT-COMLY0k-.js → getNFT-DsaU7OtJ.js} +1 -1
  59. package/assets/{getOverlayAlpha-BX66SxOu.js → getOverlayAlpha-Bem9pjlW.js} +1 -1
  60. package/assets/{hashTypedData-C9Vn70Lp.js → hashTypedData-BbixXf0N.js} +1 -1
  61. package/assets/{hashTypedData-CxL0SEsX.js → hashTypedData-dr6mz0oK.js} +1 -1
  62. package/assets/{import-C7kEB_S5.js → import-Dnrd3Gn7.js} +1 -1
  63. package/assets/{in-app-wallet-calls-Dv5D-qmW.js → in-app-wallet-calls-DSLZE4sI.js} +1 -1
  64. package/assets/{index-BdsoQlUk.js → index-4F2JbvKd.js} +1 -1
  65. package/assets/{index-VhulZp0_.js → index-B2q3D1lR.js} +1 -1
  66. package/assets/{index-CF-ZZ_LW.js → index-BD7WiVfO.js} +1 -1
  67. package/assets/{index-CkezkMvS.js → index-BElm_Aqs.js} +2 -2
  68. package/assets/{index-DuRVCvRc.js → index-BKSzZVMV.js} +1 -1
  69. package/assets/{index-BznxuYKb.js → index-BMIGlv_0.js} +1 -1
  70. package/assets/{index-nyWvMhrR.js → index-BSGkpOHC.js} +1 -1
  71. package/assets/{index-txCoS8XJ.js → index-BUA7Fo9c.js} +1 -1
  72. package/assets/{index-BmTc8K12.js → index-BWzLtPgA.js} +1 -1
  73. package/assets/{index-DEN3gLrI.js → index-BZn-NUpA.js} +1 -1
  74. package/assets/{index-C-PXxORu.js → index-BdBKp-gy.js} +1 -1
  75. package/assets/{index-Tvwwbs5L.js → index-BdC3pzaB.js} +1 -1
  76. package/assets/{index-CcSs3xun.js → index-Bhvth4PE.js} +1 -1
  77. package/assets/{index-BhokrOsa.js → index-BnXCD78m.js} +1 -1
  78. package/assets/{index-xAQNqr4T.js → index-BvsXWKoe.js} +1 -1
  79. package/assets/{index-DCPsmlPD.js → index-ByFxL6ea.js} +1 -1
  80. package/assets/{index-D1hhOo8i.js → index-C-tV2998.js} +1 -1
  81. package/assets/{index-CigjJrdx.js → index-C6phI6Xb.js} +1 -1
  82. package/assets/{index-d4x-ttpO.js → index-CAAtcdsn.js} +10 -10
  83. package/assets/{index-D5DA5XrX.js → index-CAu040IR.js} +1 -1
  84. package/assets/{index-CzWl3qk_.js → index-CFR1oUCh.js} +1 -1
  85. package/assets/{index-BPURGbOI.js → index-CFbKC0wF.js} +2 -2
  86. package/assets/{index-BXG5dCKJ.js → index-CLRDpRJ0.js} +1 -1
  87. package/assets/{index-CTJrkNxC.js → index-CLs-5OTo.js} +1 -1
  88. package/assets/{index-vqW6dFQp.js → index-CQbwl1Yh.js} +2 -2
  89. package/assets/{index-D9VTjnkt.js → index-CUwqmyAE.js} +1 -1
  90. package/assets/{index-BHvu7he_.js → index-CW-V6qwJ.js} +1 -1
  91. package/assets/{index-B1ztebBZ.js → index-Cd-ELKZF.js} +1 -1
  92. package/assets/{index-BNabonCc.js → index-CiLCqE0-.js} +1 -1
  93. package/assets/{index-sBxcn5Yg.js → index-D-nBPOn3.js} +1 -1
  94. package/assets/{index-BZ2A41zN.js → index-D8JS2oIs.js} +1 -1
  95. package/assets/{index-3j2VRNSj.js → index-DBkoTlqr.js} +2 -2
  96. package/assets/{index-BoB0Y302.js → index-DC_sK6HG.js} +1 -1
  97. package/assets/{index-I594L5Wd.js → index-DF0VFAJK.js} +1 -1
  98. package/assets/{index-CFcehHl6.js → index-DGZmaPQV.js} +1 -1
  99. package/assets/{index-B6A_pOmU.js → index-DKeIDnI0.js} +1 -1
  100. package/assets/{index-BvjAr8nY.js → index-DN6MO7gI.js} +1 -1
  101. package/assets/{index-BbQ0ahsR.css → index-DPHDecnV.css} +1 -1
  102. package/assets/{index-Dc1jVnMf.js → index-DfxDdXux.js} +3 -3
  103. package/assets/{index-BB3seE1H.js → index-DhkXiUFl.js} +1 -1
  104. package/assets/{index--KLajle8.js → index-DmHcRWCn.js} +1 -1
  105. package/assets/{index-DTSgeQ5D.js → index-H_uGpjuP.js} +1 -1
  106. package/assets/{index-W7cyhQOk.js → index-IVWbWFyL.js} +1 -1
  107. package/assets/{index-DpRVy6UQ.js → index-L10sBItl.js} +1 -1
  108. package/assets/{index-CobH2y5K.js → index-LjtWVpTQ.js} +1 -1
  109. package/assets/{index-boL29_Yj.js → index-SopsxUjz.js} +1 -1
  110. package/assets/{index-BtOJu30H.js → index-TtcxtMr2.js} +1 -1
  111. package/assets/{index-CcFuTBt3.js → index-UYXDkjPb.js} +1 -1
  112. package/assets/{index-Bbub8cs6.js → index-a_jQVeYW.js} +3 -3
  113. package/assets/{index-DXDtFVPs.js → index-poWb9pgr.js} +1 -1
  114. package/assets/{index-CUImhRoy.js → index-xCs0crJs.js} +1 -1
  115. package/assets/{index-DbYRql_-.js → index-xldgn9I8.js} +1 -1
  116. package/assets/{index.es-DHRIRbEx.js → index.es-BqrOK7eY.js} +1 -1
  117. package/assets/{index.es-Dzc3VMLo.js → index.es-Db7EjNIB.js} +1 -1
  118. package/assets/{index.es-CX7mxtcH.js → index.es-VDMDPGEf.js} +4 -4
  119. package/assets/{localBatchGatewayRequest-DPQULVCl.js → localBatchGatewayRequest-CTitzrQj.js} +1 -1
  120. package/assets/{mana-rate-BWFOkvpC.js → mana-rate-B9WM_wra.js} +1 -1
  121. package/assets/{networks-h2z6LNz5.js → networks-DaswSlZt.js} +1 -1
  122. package/assets/{onramp-DkkFwfD-.js → onramp-xkeXvCaA.js} +1 -1
  123. package/assets/{openzeppelin-Dt8oZ76u.js → openzeppelin-Cvvs9IJh.js} +1 -1
  124. package/assets/{ownerOf-D61ptJju.js → ownerOf-CoLVd6Bo.js} +1 -1
  125. package/assets/{parseNft-DF9_xc-W.js → parseNft-CXI7pMpx.js} +2 -2
  126. package/assets/{parseSignature-CoN-flwV.js → parseSignature-DYZh-ocN.js} +3 -3
  127. package/assets/{parseSignature-BGy6ebQm.js → parseSignature-F_ud8fII.js} +1 -1
  128. package/assets/{pay-with-exchange-CrvAas-k.js → pay-with-exchange-DvxmW09T.js} +1 -1
  129. package/assets/{qr-overlay-_AYDDd2P.js → qr-overlay-BBvKBjTt.js} +1 -1
  130. package/assets/{receive-BikF2OCK.js → receive-DswDLHVt.js} +1 -1
  131. package/assets/{resolveImplementation-CyERb8Bt.js → resolveImplementation-BNT1AXUm.js} +1 -1
  132. package/assets/{rpc-Bj2mehcE.js → rpc-KT1pZ07O.js} +1 -1
  133. package/assets/{secp256k1-4S_gx5U_.js → secp256k1-B9LFhz8-.js} +1 -1
  134. package/assets/{secp256k1-BwiABSKe.js → secp256k1-CaLQACD2.js} +1 -1
  135. package/assets/{secp256k1-BlXhQE61.js → secp256k1-sH0IQLpr.js} +1 -1
  136. package/assets/{send-B7leZ2sF.js → send-DMQpd0xN.js} +1 -1
  137. package/assets/{send-batch-transaction-NCJfUQmg.js → send-batch-transaction-Bjx4TPU7.js} +1 -1
  138. package/assets/{send-eip712-transaction-DyB2yZtW.js → send-eip712-transaction-Bhyo5mJD.js} +2 -2
  139. package/assets/{send-gasless-transaction-DxbiAsWR.js → send-gasless-transaction-X-ayhziV.js} +2 -2
  140. package/assets/{sendRawTransaction-CXnui5Km.js → sendRawTransaction-BWFwBY9N.js} +3 -3
  141. package/assets/{serializeTransaction-BA8Lx_h7.js → serializeTransaction-BiJ9trpW.js} +1 -1
  142. package/assets/{session-proposal-ZPunDXaI.js → session-proposal-DF0C5j1r.js} +1 -1
  143. package/assets/{session-request-D_b2ouvA.js → session-request-DkiybRpS.js} +2 -2
  144. package/assets/{sha256-D2Fo41ck.js → sha256-D19Qvf5p.js} +1 -1
  145. package/assets/{signing-CP2v_dlr.js → signing-B7Xgt3VD.js} +4 -4
  146. package/assets/{socials-xqF7U9Yn.js → socials-D3OOLxHa.js} +1 -1
  147. package/assets/{swaps-B3ujQJZz.js → swaps-UK0-24rq.js} +1 -1
  148. package/assets/{thirdweb-B7ea2PEt.js → thirdweb-BlBLiS5O.js} +3 -3
  149. package/assets/{totalSupply-D22_m4j2.js → totalSupply-CuciM66j.js} +1 -1
  150. package/assets/{trade-encoding-cvcruSuW.js → trade-encoding-Dr2besxr.js} +1 -1
  151. package/assets/{transactionReceipt-9wnHZrRL.js → transactionReceipt-D_l0_P3M.js} +1 -1
  152. package/assets/{transactions-Nu8-9WNT.js → transactions-HpO-uP9c.js} +1 -1
  153. package/assets/useCreditPacks-jF-_aYkt.js +1 -0
  154. package/assets/{useInfiniteGrid-ClIfwXAY.js → useInfiniteGrid-DmEa4Rj6.js} +1 -1
  155. package/assets/{useStore-BPgnQXlK.js → useStore-BDGgQjbV.js} +1 -1
  156. package/assets/useTheme-DR6D7MpO.js +1 -0
  157. package/assets/useTheme-DpFmSKCC.js +1 -0
  158. package/assets/{verifyHash-DMHtO2BR.js → verifyHash-CFbVV67B.js} +1 -1
  159. package/assets/{w3m-modal-wqk18fis.js → w3m-modal-DG3fBPEn.js} +1 -1
  160. package/assets/{w3m-modal-Cx_nmtny.js → w3m-modal-o13KrB6a.js} +1 -1
  161. package/assets/{wait-for-tx-receipt-BPkFazzP.js → wait-for-tx-receipt-CEcDL_4s.js} +1 -1
  162. package/assets/{wallets-CmM_4Vm-.js → wallets-Bxi0qfe_.js} +6 -6
  163. package/assets/{web-connector-B01y8d6Z.js → web-connector-Djulx7DD.js} +3 -3
  164. package/assets/{writeContract-BTRFLrl9.js → writeContract-ld1yjWET.js} +1 -1
  165. package/assets/{zoraTestnet-Bq4RAmQw.js → zoraTestnet-DuoJupX5.js} +1 -1
  166. package/index.html +11 -11
  167. package/package.json +2 -2
  168. package/assets/Cart-DDgcOTzw.js +0 -3
  169. package/assets/GetCredits-C3rj35ez.js +0 -1
  170. package/assets/ItemDetail-BqrPvIRT.js +0 -29
  171. package/assets/MyAssets-CzmZ_l10.js +0 -7
  172. package/assets/emotion-styled.browser.esm-B-hzcBrK.js +0 -1
  173. package/assets/payments-DEbBixXM.js +0 -1
  174. package/assets/useTheme-BwxUDr5G.js +0 -1
  175. package/assets/useTheme-HWLX9NSW.js +0 -1
@@ -1,11 +1,11 @@
1
- import{r as l,j as v}from"./react-yytiy0wi.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820315471.commit-e34db25/assets/DCL_LogoPattern-BryBPc3d.png",b=`
1
+ import{r as l,j as v}from"./react-yytiy0wi.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/assets/DCL_LogoPattern-BryBPc3d.png",U=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
5
5
  v_uv = a_position * 0.5 + 0.5;
6
6
  gl_Position = vec4(a_position, 0.0, 1.0);
7
7
  }
8
- `,U=`
8
+ `,b=`
9
9
  precision highp float;
10
10
 
11
11
  uniform float u_time;
@@ -77,4 +77,4 @@ void main() {
77
77
 
78
78
  gl_FragColor = result;
79
79
  }
80
- `;function g(t,a,r){const e=t.createShader(a);return e?(t.shaderSource(e,r),t.compileShader(e),t.getShaderParameter(e,t.COMPILE_STATUS)?e:(console.error("Shader compile error:",t.getShaderInfoLog(e)),t.deleteShader(e),null)):null}function P(t,a,r){const e=t.createProgram();return e?(t.attachShader(e,a),t.attachShader(e,r),t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS)?e:(console.error("Program link error:",t.getProgramInfoLog(e)),t.deleteProgram(e),null)):null}function D(t,a,r){const e=t.createTexture();if(!e)return null;t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([128,128,128,255]));const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{r!=null&&r()||(t.bindTexture(t.TEXTURE_2D,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.generateMipmap(t.TEXTURE_2D))},o.src=a,e}function L(){const t=l.useRef(null),a=l.useRef(0);return l.useEffect(()=>{var h;const r=t.current;if(!r||(h=window.matchMedia)!=null&&h.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=g(e,e.VERTEX_SHADER,b),c=g(e,e.FRAGMENT_SHADER,U);if(!o||!c){o&&e.deleteShader(o),c&&e.deleteShader(c);return}const n=P(e,o,c);if(!n){e.deleteShader(o),e.deleteShader(c);return}const u=e.getAttribLocation(n,"a_position"),_=e.getUniformLocation(n,"u_time"),R=e.getUniformLocation(n,"u_resolution"),y=e.getUniformLocation(n,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let m=!1;const d=D(e,S,()=>m),A=()=>{const i=window.devicePixelRatio||1,x=r.clientWidth*i,E=r.clientHeight*i;(r.width!==x||r.height!==E)&&(r.width=x,r.height=E)},p=performance.now()/1e3,f=()=>{A(),e.viewport(0,0,r.width,r.height),e.useProgram(n),e.uniform1f(_,performance.now()/1e3-p),e.uniform2f(R,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,d),e.uniform1i(y,0),e.enableVertexAttribArray(u),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),a.current=requestAnimationFrame(f)},T=i=>{i.preventDefault(),cancelAnimationFrame(a.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),a.current=requestAnimationFrame(f),()=>{m=!0,cancelAnimationFrame(a.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(n),e.deleteShader(o),e.deleteShader(c),e.deleteBuffer(s),e.deleteTexture(d)}},[]),v.jsxs("div",{className:"AnimatedBackground","aria-hidden":!0,children:[v.jsx("div",{className:"AnimatedBackground__fallback",style:{backgroundImage:`url(${w})`}}),v.jsx("canvas",{ref:t,className:"AnimatedBackground__canvas"})]})}export{L as default};
80
+ `;function g(t,a,r){const e=t.createShader(a);return e?(t.shaderSource(e,r),t.compileShader(e),t.getShaderParameter(e,t.COMPILE_STATUS)?e:(console.error("Shader compile error:",t.getShaderInfoLog(e)),t.deleteShader(e),null)):null}function P(t,a,r){const e=t.createProgram();return e?(t.attachShader(e,a),t.attachShader(e,r),t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS)?e:(console.error("Program link error:",t.getProgramInfoLog(e)),t.deleteProgram(e),null)):null}function D(t,a,r){const e=t.createTexture();if(!e)return null;t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([128,128,128,255]));const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{r!=null&&r()||(t.bindTexture(t.TEXTURE_2D,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.generateMipmap(t.TEXTURE_2D))},o.src=a,e}function L(){const t=l.useRef(null),a=l.useRef(0);return l.useEffect(()=>{var h;const r=t.current;if(!r||(h=window.matchMedia)!=null&&h.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=g(e,e.VERTEX_SHADER,U),c=g(e,e.FRAGMENT_SHADER,b);if(!o||!c){o&&e.deleteShader(o),c&&e.deleteShader(c);return}const n=P(e,o,c);if(!n){e.deleteShader(o),e.deleteShader(c);return}const u=e.getAttribLocation(n,"a_position"),_=e.getUniformLocation(n,"u_time"),R=e.getUniformLocation(n,"u_resolution"),y=e.getUniformLocation(n,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let m=!1;const d=D(e,S,()=>m),A=()=>{const i=window.devicePixelRatio||1,x=r.clientWidth*i,E=r.clientHeight*i;(r.width!==x||r.height!==E)&&(r.width=x,r.height=E)},p=performance.now()/1e3,f=()=>{A(),e.viewport(0,0,r.width,r.height),e.useProgram(n),e.uniform1f(_,performance.now()/1e3-p),e.uniform2f(R,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,d),e.uniform1i(y,0),e.enableVertexAttribArray(u),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),a.current=requestAnimationFrame(f)},T=i=>{i.preventDefault(),cancelAnimationFrame(a.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),a.current=requestAnimationFrame(f),()=>{m=!0,cancelAnimationFrame(a.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(n),e.deleteShader(o),e.deleteShader(c),e.deleteBuffer(s),e.deleteTexture(d)}},[]),v.jsxs("div",{className:"AnimatedBackground","aria-hidden":!0,children:[v.jsx("div",{className:"AnimatedBackground__fallback",style:{backgroundImage:`url(${w})`}}),v.jsx("canvas",{ref:t,className:"AnimatedBackground__canvas"})]})}export{L as default};
@@ -1 +1 @@
1
- import{u as oe,r as i,j as e}from"./react-yytiy0wi.js";import{u as de,a as ue,t as a,b as B,C as S,A as $,f as me}from"./index-d4x-ttpO.js";import{S as G,C as pe,a as _e,R as fe,F as xe,b as Q,c as be}from"./categories-pY-U0UXm.js";import{m as he}from"./mana-rate-BWFOkvpC.js";import{u as ge,M as je}from"./MarketCheckout-D-VQDb7F.js";import{L as Ne}from"./LoadMore-CwKrPv19.js";import{u as ye}from"./useInfiniteGrid-ClIfwXAY.js";import{E as ve}from"./ErrorNotice-CKeOu_Oi.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./buy-BPkraJ17.js";import"./trade-encoding-cvcruSuW.js";import"./buy-gasless-uVyAhlxN.js";import"./errors-qUwGIanA.js";const Ce=48,n=1e5;function Se(r){return{tradeId:r.tradeId??r.id,listingType:"primary",contractAddress:r.contractAddress,itemId:r.itemId??"",name:r.name,thumbnail:r.thumbnail,rarity:r.rarity,category:r.category,wearableCategory:r.wearableCategory??null,creator:r.creator,manaWei:r.manaWei??"0",available:1,network:r.network,chainId:r.chainId,createdAt:0}}function Qe(){const[r]=oe(),l=(r.get("q")??"").trim().toLowerCase(),U=de(),I=(r.get("q")??"").trim();ue({title:I?a("seo.collectibles.searchTitle",{query:I}):a("seo.collectibles.title"),description:a("seo.collectibles.description")});const[p,F]=i.useState("wearable"),[d,k]=i.useState(null),[c,R]=i.useState([]),[x,w]=i.useState(""),[b,M]=i.useState(""),[_,K]=i.useState("newest"),[P,z]=i.useState(!1),[h,f]=i.useState(!1),[L,E]=i.useState(null);i.useEffect(()=>{if(!h)return;const s=t=>{t.key==="Escape"&&f(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[h]);const u=x&&!Number.isNaN(Number(x))?Number(x):void 0,m=b&&!Number.isNaN(Number(b))?Number(b):void 0,D=d?be[d]:void 0,J=(G.find(s=>s.key===_)??G[0]).server,q={category:p,rarities:c.length?c:void 0,wearableCategories:D,minPriceCredits:u,maxPriceCredits:m,search:l||void 0,sortBy:J},{items:g,total:O,isLoading:o,error:X,hasNextPage:Z,isFetchingNextPage:T,fetchNextPage:H}=ye(["unified-listings",q],s=>me({...q,first:Ce,skip:s})),j=O,{data:N,isError:V}=ge(),Y=s=>N&&s.manaWei?he(s.manaWei,N):null,W=i.useRef(null);i.useEffect(()=>{o||!l||W.current===l||(W.current=l,B("Shop Searched",{query:l,result_count:j}))},[l,o,j]);const y=i.useRef("__init__");i.useEffect(()=>{if(o)return;const s=JSON.stringify({category:p,subCategory:d,rarities:c,min:u,max:m,sort:_});if(y.current==="__init__"||y.current===s){y.current=s;return}y.current=s,B("Shop Applied Filter",{filters:{category:p,sub_category:d,rarities:c,min_price_credits:u??null,max_price_credits:m??null,sort:_},result_count:j})},[p,d,c,u,m,_,o,j]);function ee(s){F(s),k(null)}function se(s){R(t=>t.includes(s)?t.filter(A=>A!==s):[...t,s])}function ae(){F("wearable"),k(null),R([]),w(""),M("")}function re(s){const t=g.find(A=>A.id===s.id);t&&t.source==="legacy"&&t.manaWei&&E(Se(t))}function te(){U.invalidateQueries({queryKey:["unified-listings"]})}const v=u!=null?Math.min(u,n):0,C=m!=null?Math.min(m,n):n,ie=v/n*100,ne=C/n*100;function le(s){const t=Math.min(s,C);w(t<=0?"":String(t))}function ce(s){const t=Math.max(s,v);M(t>=n?"":String(t))}return e.jsxs("div",{className:"browse browse--sidebar","data-testid":"browse",children:[h?e.jsx("div",{className:"browse__scrim",onClick:()=>f(!1),"aria-hidden":!0}):null,e.jsxs("aside",{className:`browse__sidebar${h?" is-open":""}`,"data-testid":"browse-sidebar",children:[e.jsxs("div",{className:"browse__sidebar-head",children:[e.jsx("span",{className:"browse__sidebar-title",children:a("assets.filters")}),e.jsx("button",{className:"browse__sidebar-close",onClick:()=>f(!1),"aria-label":a("assets.closeFilters"),children:"✕"})]}),e.jsx("div",{className:"sidebar__section-label",children:a("assets.category")}),e.jsx(pe,{category:p,subCategory:d,onCategory:ee,onSub:k}),e.jsx("div",{className:"sidebar__divider"}),e.jsx("div",{className:"sidebar__section-label",children:a("filter.price")}),e.jsxs("div",{className:"price-filter",children:[e.jsxs("div",{className:"price-filter__inputs",children:[e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:a("assets.min")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(S,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.minPriceAria"),placeholder:"0",value:x,onChange:s=>w(s.target.value)})]})]}),e.jsx("span",{className:"price-filter__to",children:a("assets.priceTo")}),e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:a("assets.max")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(S,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.maxPriceAria"),placeholder:"0",value:b,onChange:s=>M(s.target.value)})]})]})]}),e.jsxs("div",{className:"price-filter__slider",style:{"--min-pct":`${ie}%`,"--max-pct":`${ne}%`},children:[e.jsx("div",{className:"price-filter__track","aria-hidden":!0}),e.jsx("div",{className:"price-filter__fill","aria-hidden":!0}),e.jsx("input",{type:"range",min:0,max:n,value:v,"aria-label":a("assets.minPriceSliderAria"),onChange:s=>le(Number(s.target.value))}),e.jsx("input",{type:"range",min:0,max:n,value:C,"aria-label":a("assets.maxPriceSliderAria"),onChange:s=>ce(Number(s.target.value))})]}),e.jsxs("div",{className:"price-filter__range",children:[e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(S,{className:"price-filter__coin"}),v.toLocaleString()]}),e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(S,{className:"price-filter__coin"}),C.toLocaleString()]})]})]}),e.jsx("div",{className:"sidebar__divider"}),e.jsxs("button",{type:"button",className:"sidebar__section-toggle","data-testid":"sidebar-section-toggle","aria-expanded":P,onClick:()=>z(s=>!s),children:[e.jsx("span",{className:"sidebar__section-label",children:a("assets.rarity")}),e.jsx(_e,{up:P,size:20,color:"var(--muted)"})]}),P?e.jsx("div",{className:"rarity-filter","data-testid":"rarity-filter",children:fe.map(s=>e.jsxs("label",{className:`rarity-filter__check${c.includes(s)?" is-on":""}`,"data-testid":"rarity-filter-check",children:[e.jsx("input",{type:"checkbox",checked:c.includes(s),onChange:()=>se(s)}),e.jsx("span",{children:s})]},s))}):null,e.jsxs("div",{className:"browse__sidebar-foot",children:[e.jsx("button",{type:"button",className:"browse__clear",onClick:ae,children:a("assets.clearFilters")}),e.jsx("button",{type:"button",className:"browse__apply",onClick:()=>f(!1),children:a("assets.apply")})]})]}),e.jsxs("div",{className:"browse__main",children:[e.jsx(xe,{sort:_,onSort:K,total:O,loading:o,query:l,onOpenFilters:()=>f(!0)}),V&&g.some(s=>s.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:a("assets.marketUnavailable")}):null,X?e.jsx(ve,{message:a("assets.loadError"),testId:"browse-error"}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:o?e.jsx(Q,{count:15}):e.jsxs(e.Fragment,{children:[g.map(s=>s.source==="legacy"?e.jsx($,{item:s,mode:"market",marketPriceCredits:Y(s),onBuyNow:re},s.id):e.jsx($,{item:s},s.id)),T?e.jsx(Q,{count:6}):null]})}),e.jsx(Ne,{hasNextPage:Z,isFetching:T,onLoadMore:()=>void H()}),!o&&g.length===0?e.jsx("p",{className:"muted",children:a("assets.noItems")}):null]}),L&&N?e.jsx(je,{listing:L,rate:N,onClose:()=>E(null),onSold:()=>{E(null),te()}}):null]})}export{Qe as Assets};
1
+ import{u as oe,r as i,j as e}from"./react-yytiy0wi.js";import{u as de,a as ue,t as a,b as B,C as S,A as $,f as me}from"./index-CAAtcdsn.js";import{S as G,C as pe,a as _e,R as fe,F as xe,b as Q,c as be}from"./categories-C4HyTLUC.js";import{m as he}from"./mana-rate-B9WM_wra.js";import{u as ge,M as je}from"./MarketCheckout-CUVL7ePz.js";import{L as Ne}from"./LoadMore-CUcfUpuY.js";import{u as ye}from"./useInfiniteGrid-DmEa4Rj6.js";import{E as ve}from"./ErrorNotice-CKeOu_Oi.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./buy-D-vBFkG6.js";import"./trade-encoding-Dr2besxr.js";import"./buy-gasless-BGON-kY0.js";import"./errors-fv83sI_L.js";const Ce=48,n=1e5;function Se(r){return{tradeId:r.tradeId??r.id,listingType:"primary",contractAddress:r.contractAddress,itemId:r.itemId??"",name:r.name,thumbnail:r.thumbnail,rarity:r.rarity,category:r.category,wearableCategory:r.wearableCategory??null,creator:r.creator,manaWei:r.manaWei??"0",available:1,network:r.network,chainId:r.chainId,createdAt:0}}function Qe(){const[r]=oe(),l=(r.get("q")??"").trim().toLowerCase(),U=de(),I=(r.get("q")??"").trim();ue({title:I?a("seo.collectibles.searchTitle",{query:I}):a("seo.collectibles.title"),description:a("seo.collectibles.description")});const[p,F]=i.useState("wearable"),[d,k]=i.useState(null),[c,R]=i.useState([]),[x,w]=i.useState(""),[b,M]=i.useState(""),[_,K]=i.useState("newest"),[P,z]=i.useState(!1),[h,f]=i.useState(!1),[L,E]=i.useState(null);i.useEffect(()=>{if(!h)return;const s=t=>{t.key==="Escape"&&f(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[h]);const u=x&&!Number.isNaN(Number(x))?Number(x):void 0,m=b&&!Number.isNaN(Number(b))?Number(b):void 0,D=d?be[d]:void 0,J=(G.find(s=>s.key===_)??G[0]).server,q={category:p,rarities:c.length?c:void 0,wearableCategories:D,minPriceCredits:u,maxPriceCredits:m,search:l||void 0,sortBy:J},{items:g,total:O,isLoading:o,error:X,hasNextPage:Z,isFetchingNextPage:T,fetchNextPage:H}=ye(["unified-listings",q],s=>me({...q,first:Ce,skip:s})),j=O,{data:N,isError:V}=ge(),Y=s=>N&&s.manaWei?he(s.manaWei,N):null,W=i.useRef(null);i.useEffect(()=>{o||!l||W.current===l||(W.current=l,B("Shop Searched",{query:l,result_count:j}))},[l,o,j]);const y=i.useRef("__init__");i.useEffect(()=>{if(o)return;const s=JSON.stringify({category:p,subCategory:d,rarities:c,min:u,max:m,sort:_});if(y.current==="__init__"||y.current===s){y.current=s;return}y.current=s,B("Shop Applied Filter",{filters:{category:p,sub_category:d,rarities:c,min_price_credits:u??null,max_price_credits:m??null,sort:_},result_count:j})},[p,d,c,u,m,_,o,j]);function ee(s){F(s),k(null)}function se(s){R(t=>t.includes(s)?t.filter(A=>A!==s):[...t,s])}function ae(){F("wearable"),k(null),R([]),w(""),M("")}function re(s){const t=g.find(A=>A.id===s.id);t&&t.source==="legacy"&&t.manaWei&&E(Se(t))}function te(){U.invalidateQueries({queryKey:["unified-listings"]})}const v=u!=null?Math.min(u,n):0,C=m!=null?Math.min(m,n):n,ie=v/n*100,ne=C/n*100;function le(s){const t=Math.min(s,C);w(t<=0?"":String(t))}function ce(s){const t=Math.max(s,v);M(t>=n?"":String(t))}return e.jsxs("div",{className:"browse browse--sidebar","data-testid":"browse",children:[h?e.jsx("div",{className:"browse__scrim",onClick:()=>f(!1),"aria-hidden":!0}):null,e.jsxs("aside",{className:`browse__sidebar${h?" is-open":""}`,"data-testid":"browse-sidebar",children:[e.jsxs("div",{className:"browse__sidebar-head",children:[e.jsx("span",{className:"browse__sidebar-title",children:a("assets.filters")}),e.jsx("button",{className:"browse__sidebar-close",onClick:()=>f(!1),"aria-label":a("assets.closeFilters"),children:"✕"})]}),e.jsx("div",{className:"sidebar__section-label",children:a("assets.category")}),e.jsx(pe,{category:p,subCategory:d,onCategory:ee,onSub:k}),e.jsx("div",{className:"sidebar__divider"}),e.jsx("div",{className:"sidebar__section-label",children:a("filter.price")}),e.jsxs("div",{className:"price-filter",children:[e.jsxs("div",{className:"price-filter__inputs",children:[e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:a("assets.min")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(S,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.minPriceAria"),placeholder:"0",value:x,onChange:s=>w(s.target.value)})]})]}),e.jsx("span",{className:"price-filter__to",children:a("assets.priceTo")}),e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:a("assets.max")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(S,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.maxPriceAria"),placeholder:"0",value:b,onChange:s=>M(s.target.value)})]})]})]}),e.jsxs("div",{className:"price-filter__slider",style:{"--min-pct":`${ie}%`,"--max-pct":`${ne}%`},children:[e.jsx("div",{className:"price-filter__track","aria-hidden":!0}),e.jsx("div",{className:"price-filter__fill","aria-hidden":!0}),e.jsx("input",{type:"range",min:0,max:n,value:v,"aria-label":a("assets.minPriceSliderAria"),onChange:s=>le(Number(s.target.value))}),e.jsx("input",{type:"range",min:0,max:n,value:C,"aria-label":a("assets.maxPriceSliderAria"),onChange:s=>ce(Number(s.target.value))})]}),e.jsxs("div",{className:"price-filter__range",children:[e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(S,{className:"price-filter__coin"}),v.toLocaleString()]}),e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(S,{className:"price-filter__coin"}),C.toLocaleString()]})]})]}),e.jsx("div",{className:"sidebar__divider"}),e.jsxs("button",{type:"button",className:"sidebar__section-toggle","data-testid":"sidebar-section-toggle","aria-expanded":P,onClick:()=>z(s=>!s),children:[e.jsx("span",{className:"sidebar__section-label",children:a("assets.rarity")}),e.jsx(_e,{up:P,size:20,color:"var(--muted)"})]}),P?e.jsx("div",{className:"rarity-filter","data-testid":"rarity-filter",children:fe.map(s=>e.jsxs("label",{className:`rarity-filter__check${c.includes(s)?" is-on":""}`,"data-testid":"rarity-filter-check",children:[e.jsx("input",{type:"checkbox",checked:c.includes(s),onChange:()=>se(s)}),e.jsx("span",{children:s})]},s))}):null,e.jsxs("div",{className:"browse__sidebar-foot",children:[e.jsx("button",{type:"button",className:"browse__clear",onClick:ae,children:a("assets.clearFilters")}),e.jsx("button",{type:"button",className:"browse__apply",onClick:()=>f(!1),children:a("assets.apply")})]})]}),e.jsxs("div",{className:"browse__main",children:[e.jsx(xe,{sort:_,onSort:K,total:O,loading:o,query:l,onOpenFilters:()=>f(!0)}),V&&g.some(s=>s.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:a("assets.marketUnavailable")}):null,X?e.jsx(ve,{message:a("assets.loadError"),testId:"browse-error"}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:o?e.jsx(Q,{count:15}):e.jsxs(e.Fragment,{children:[g.map(s=>s.source==="legacy"?e.jsx($,{item:s,mode:"market",marketPriceCredits:Y(s),onBuyNow:re},s.id):e.jsx($,{item:s},s.id)),T?e.jsx(Q,{count:6}):null]})}),e.jsx(Ne,{hasNextPage:Z,isFetching:T,onLoadMore:()=>void H()}),!o&&g.length===0?e.jsx("p",{className:"muted",children:a("assets.noItems")}):null]}),L&&N?e.jsx(je,{listing:L,rate:N,onClose:()=>E(null),onSold:()=>{E(null),te()}}):null]})}export{Qe as Assets};
@@ -0,0 +1,3 @@
1
+ import{j as e,r as j,a as Se,b as qe,L as X}from"./react-yytiy0wi.js";import{t as a,C as S,a6 as R,a as Ie,a7 as N,c as le,d as Le,g as Pe,o as Ee,u as Te,I as L,a8 as Be,b as O,a9 as ie,aa as Fe,D as A,s as Ae,B as Re,j as We,k as Ue,w as ze,q as de,ab as Qe,y as ue,x as $e,ac as Ke}from"./index-CAAtcdsn.js";import{a as he}from"./buy-D-vBFkG6.js";import{g as Oe,a as Ge,w as De,S as Je,G as Ve}from"./buy-gasless-BGON-kY0.js";import{R as G,r as Ye}from"./cart-checkout-BCBPBbFe.js";import{u as He,c as Xe}from"./useCreditPacks-jF-_aYkt.js";import{E as ye}from"./ErrorNotice-CKeOu_Oi.js";import{i as Ze,a as es}from"./errors-fv83sI_L.js";import{C as ss}from"./CollectionCarousel-D-AQXiSI.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-Dr2besxr.js";import"./index-HN6Rk25C.js";function as(t){const{phase:r,balanceCredits:p,onClose:l}=t,k=r==="processing",P=r!=="complete",E=r==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),f=r==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:k?void 0:l,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${f?" buy-modal__card--tall":""}`,children:[P&&e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:E}),!k&&e.jsx("button",{className:"buy-modal__x",onClick:l,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:r==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(S,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:R(p)})]})]}),r==="processing"&&e.jsx(ts,{step:t.step??1,total:t.total??1}),r==="nofunds"&&e.jsx(cs,{lines:t.lines??[],shortfallCredits:t.shortfallCredits??0,packs:t.packs??[],selectedPack:t.selectedPack??"",onSelectPack:t.onSelectPack??(()=>{}),onBuyPacks:t.onBuyPacks??(()=>{}),onCancel:l}),r==="complete"&&e.jsx(rs,{purchased:t.purchased??[],onMyAssets:t.onMyAssets??l,onTryInWorld:t.onTryInWorld??l}),r==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(ye,{message:t.message}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:l,children:a("buyModal.close")})})]})]})]})}function ts({step:t,total:r}){return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:"/icon-192.png",alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:a("buyModal.completingTransaction")}),e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})}),e.jsxs("span",{className:"cart-checkout__step",children:[t,"/",r]})]})]})}function cs({lines:t,shortfallCredits:r,packs:p,selectedPack:l,onSelectPack:k,onBuyPacks:P,onCancel:E}){const f=p.find(c=>c.id===l),D=t.reduce((c,_)=>c+(_.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,r)})})," ",a("buyModal.warningToPurchase",{count:D})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:t.map(c=>{const _=c.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:c.item.thumbnail?e.jsx("img",{src:c.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:c.item.name,children:[c.item.name||a("buyModal.itemFallback"),_>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:_})}):null]}),c.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:c.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(S,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:R(c.priceCredits*_)})]})]})]},c.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:p.map(c=>{const _=c.id===l;return e.jsxs("button",{className:`buy-modal__pack${_?" buy-modal__pack--on":""}`,onClick:()=>k(c.id),children:[e.jsx(S,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:R(c.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",c.usd.toFixed(2),")"]})]},c.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(S,{className:"buy-modal__total-ico"}),e.jsx("span",{children:R((f==null?void 0:f.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((f==null?void 0:f.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:E,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:P,children:a("buyModal.buy")})]})]})}function rs({purchased:t,onMyAssets:r,onTryInWorld:p}){return e.jsxs("div",{className:"buy-modal__body cart-checkout__done-body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"60",height:"60","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce77"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:a("getCredits.successTitle")})," ",a("buyModal.successBody")]})]}),e.jsx("div",{className:"cart-checkout__done",children:e.jsx("div",{className:"cart-checkout__done-scroll",children:t.map(l=>{const k=l.quantity??1;return e.jsxs("div",{className:"cart-checkout__done-row",children:[e.jsxs("div",{className:"cart-checkout__done-thumb",children:[l.thumbnail?e.jsx("img",{src:l.thumbnail,alt:""}):null,e.jsx("span",{className:"cart-checkout__done-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 18 18",width:"12",height:"12",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",fill:"none",stroke:"#fff",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"cart-checkout__done-info",children:[e.jsxs("div",{className:"cart-checkout__done-name",title:l.name,children:[l.name||a("buyModal.itemFallback"),k>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:k})}):null]}),l.creator?e.jsx("div",{className:"cart-checkout__done-creator",children:a("search.byCreator",{name:l.creator})}):null]}),e.jsxs("div",{className:"cart-checkout__done-price",children:[e.jsx(S,{className:"cart-checkout__done-price-ico"}),e.jsx("span",{children:R(l.priceCredits*k)})]})]},l.id)})})}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:r,children:a("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:p,children:[a("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})}const ns=Ae(Re)`
2
+ margin-top: 12px;
3
+ `;function me(t){if(Ze(t))return a("errors.rejected");const r=(t.message??"").toLowerCase();return r.includes("insufficient")?a("cart.error.insufficient",{currency:Ue.name}):r.includes("no active listing")||r.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const os=12e4,ls=We.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump";function is(t){const r=[];return t.unavailable.length&&r.push(a("cart.drop.unavailable",{count:t.unavailable.length})),t.own.length&&r.push(a("cart.drop.own",{count:t.own.length})),a("cart.drop.removed",{items:r.join(` ${a("cart.drop.and")} `)})}const _e=t=>t.reduce((r,p)=>r+p.priceCredits*p.quantity,0),ds=t=>t.flatMap(r=>Array.from({length:r.quantity},()=>({...r,quantity:1})));function ws(){Ie({title:a("nav.cart"),noindex:!0});const t=N(s=>s.items),r=N(s=>s.remove),p=N(s=>s.increment),l=N(s=>s.decrement),k=N(s=>s.clear),P=N(s=>s.restore),E=N(s=>s.setFittingOpen),f=le(s=>s.items),D=le(s=>s.toggle),{session:c}=Le(),_=He().packs.slice(0,3);j.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const be=t.some(s=>s.category!=="emote"),{data:J}=Pe({queryKey:["upsell-listings"],queryFn:()=>Ke({first:40}),staleTime:6e4}),{data:T}=Ee(c),W=Te(),U=Se(),{state:q}=qe(),[Z,B]=j.useState(null),[pe,C]=j.useState(null),[ee,z]=j.useState(null),[xe,I]=j.useState(!1),[g,F]=j.useState(null),se=j.useRef(0),[d,w]=j.useState(null),[V,ae]=j.useState(""),je=t.reduce((s,n)=>s+n.priceCredits*n.quantity,0),te=t.reduce((s,n)=>s+n.quantity,0),ke=g?g.liveTotalCredits:je,fe=new Set(t.map(s=>s.id)),ce=((J==null?void 0:J.items)??[]).filter(s=>!fe.has(s.id)).slice(0,12),ge=new Map(g==null?void 0:g.buyable.map(s=>[s.item.id,s])),Q=(T==null?void 0:T.credits)??0,ve=Fe;function $(s){s(),F(null),z(null),C(null)}function Ne(){w(null),I(!1)}function re(s){const n=_e(s),o=Math.max(0,n-Q),x=_.find(u=>u.credits>=o)??_[_.length-1];ae(x.id),O("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:n,credits_balance:Q,shortfall:o}),w({phase:"nofunds",lines:s.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:o}),I(!1)}async function Ce(s){if(!c||s.length===0)return;const n=ds(s),o=n.map(i=>({...i.item,priceCredits:i.priceCredits})),x=s.map(i=>({...i.item,priceCredits:i.priceCredits,quantity:i.quantity})),u=[];let v="authorize",K=!1;w({phase:"processing",step:1,total:n.length});try{const i=[];for(let h=0;h<n.length;h++){const y=n[h];w({phase:"processing",step:h+1,total:n.length});try{const{credit:b,maxCreditedValue:H}=await ze(c.identity,y.usdCents,y.trade.id);u.push(b.id),i.push({trade:y.trade,credits:[b],maxCreditedValue:H})}catch(b){if(es(b)){if(u.length){try{await de(c.identity,u)}catch(H){A(H,{flow:"cart_checkout",step:"release"})}W.invalidateQueries({queryKey:["usd-balance"]})}re(s);return}throw b}}v="submit";let m=[];if(Oe())try{m=await Ge({purchases:i,buyer:c.address,signer:c.signer});const y=(await Promise.allSettled(m.map(b=>De(b)))).flatMap(b=>b.status==="rejected"?[b.reason]:[]);if(y.length&&!y.some(b=>b instanceof Je))throw y[0];K=!0}catch(h){if(!(h instanceof Ve))throw h;m=await he({purchases:i,buyer:c.address,signer:c.signer})}else m=await he({purchases:i,buyer:c.address,signer:c.signer});s.forEach(h=>r(h.item.id)),F(null),O("Shop Completed Purchase",{...Qe(o),payment_type:"credits",no_crypto_step:K,transaction_hash:m[0]??null}),W.invalidateQueries({queryKey:["usd-balance"]}),w({phase:"complete",purchased:x})}catch(i){if(ue(i)||A(i,{flow:"cart_checkout",step:v,cart_size:s.length}),O(ue(i)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:$e(i),value_usd:ie(o.reduce((m,h)=>m+h.priceCredits,0)),cart_size:n.length}),u.length){try{await de(c.identity,u)}catch(m){A(m,{flow:"cart_checkout",step:"release"})}W.invalidateQueries({queryKey:["usd-balance"]})}w({phase:"error",message:me(i)})}}function ne(s){const n=_e(s);if(T!=null&&T.credits<n){re(s);return}Ce(s)}async function Y(){if(!c){C(a("buyModal.signInToCheckout"));return}const s=N.getState().items;if(s.length===0)return;C(null),z(null),I(!0);const n=s.reduce((o,x)=>o+x.priceCredits*x.quantity,0);O("Shop Started Checkout",{cart_size:s.length,cart_value_credits:n,cart_value_usd:ie(n),has_sufficient_credits:Q>=n});try{B(a("cart.status.reviewing"));const o=await Ye(s,c.address,ve),x=[...o.unavailable,...o.own];if(x.length&&(x.forEach(u=>r(u.id)),z(is(o))),o.buyable.length===0){C(a("cart.error.noneAvailable")),F(null),B(null);return}if(o.orderChanged){F(o),se.current=Date.now(),B(null);return}B(null),ne(o.buyable)}catch(o){A(o,{flow:"cart_checkout",step:"review",cart_size:s.length}),C(me(o)),B(null)}finally{I(!1)}}async function we(){if(g){if(!c){C(a("buyModal.signInToCheckout"));return}if(Date.now()-se.current>os){F(null),z(null),await Y();return}C(null),ne(g.buyable)}}async function Me(){if(V){try{sessionStorage.setItem(G,JSON.stringify(N.getState().items))}catch{}I(!0);try{const s=await Xe(V,c?{address:c.address,identity:c.identity}:void 0);if(s.url){window.location.href=s.url;return}U("/credits")}catch(s){try{sessionStorage.removeItem(G)}catch{}A(s,{flow:"cart_buy_credits"}),w({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{I(!1)}}}const oe=j.useRef(!1);j.useEffect(()=>{if(!(q!=null&&q.resumeCheckout)||oe.current)return;oe.current=!0;try{const n=sessionStorage.getItem(G);if(n){sessionStorage.removeItem(G);const o=JSON.parse(n);Array.isArray(o)&&o.length&&P(o)}}catch{}W.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void Y(),0);return()=>clearTimeout(s)},[q==null?void 0:q.resumeCheckout]);const M=xe||(d==null?void 0:d.phase)==="processing";return t.length===0&&!d?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(L,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(ns,{as:X,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>U(-1),type:"button",children:[e.jsx(L,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("section",{className:"checkout__panel",children:[e.jsxs("div",{className:"checkout__panel-head",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>U(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(L,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:te})}),be?e.jsxs("button",{className:"checkout__fitting",onClick:()=>E(!0),disabled:M,children:[e.jsx(L,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsx("div",{className:"checkout__list",children:t.map(s=>{const n=ge.get(s.id),o=n?n.priceCredits:s.priceCredits,x=!!n&&n.priceCredits!==s.priceCredits,u=!s.tokenId,v=s.quantity,K=typeof s.available=="number"&&v>=s.available,i=o*v,m=!!f[s.id],h=s.tokenId??s.itemId,y=s.contractAddress&&h?`/item/${s.contractAddress}/${h}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[y?e.jsx(X,{className:"checkout__thumb-link",to:y,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null,e.jsx("span",{className:"checkout__thumb-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[y?e.jsx(X,{className:"checkout__name",to:y,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Be,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[u?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>$(()=>l(s.id)),disabled:M||v<=1,"aria-label":a("cart.decreaseQuantity",{name:s.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:v}),e.jsx("button",{className:"checkout__step",onClick:()=>$(()=>p(s.id)),disabled:M||K,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(S,{className:"checkout__price-ico"})," ",i,x?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*v}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${m?" is-on":""}`,onClick:()=>D(s),"aria-label":m?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:m?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(L,{name:m?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>$(()=>r(s.id)),disabled:M,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(L,{name:"trash",size:24})})]})]},s.id)})}),e.jsxs("div",{className:"checkout__utils",children:[e.jsx("button",{className:"link",onClick:()=>$(k),disabled:M,children:a("cart.clearCart")}),null]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:te})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(S,{className:"checkout__total-ico"})," ",ke]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(g?we():Y()),disabled:M,children:M?a("cart.working"):g?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),g?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,ee?e.jsx("p",{className:"muted checkout__msg",children:ee}):null,Z?e.jsx("p",{className:"muted checkout__msg",children:Z}):null,e.jsx(ye,{message:pe,className:"checkout__msg"})]})]})]}),ce.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(ss,{title:a("cart.youMightAlsoLike"),items:ce})}):null,d?e.jsx(as,{phase:d.phase,balanceCredits:Q,onClose:Ne,step:d.phase==="processing"?d.step:void 0,total:d.phase==="processing"?d.total:void 0,lines:d.phase==="nofunds"?d.lines:void 0,shortfallCredits:d.phase==="nofunds"?d.shortfall:void 0,packs:_,selectedPack:V,onSelectPack:ae,onBuyPacks:()=>void Me(),purchased:d.phase==="complete"?d.purchased:void 0,onMyAssets:()=>U("/assets?tab=mine"),onTryInWorld:()=>window.open(ls,"_blank","noopener"),message:d.phase==="error"?d.message:void 0}):null]})}export{ws as Cart};
@@ -1,4 +1,4 @@
1
- import{H as N,J as U,K as w,L as z,M as o,N as E,O as c,P as I,Q as g,R as D,S as M}from"./index-d4x-ttpO.js";import{r as K,j as v}from"./react-yytiy0wi.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const L=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,W=M(P||(P=l`
1
+ import{F as N,G as U,H as w,J as z,K as o,L as E,M as c,N as F,O as g,P as D,Q as M}from"./index-CAAtcdsn.js";import{r as I,j as v}from"./react-yytiy0wi.js";function K(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const G=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,L=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -6,7 +6,7 @@ import{H as N,J as U,K as w,L as z,M as o,N as E,O as c,P as I,Q as g,R as D,S a
6
6
  100% {
7
7
  transform: rotate(360deg);
8
8
  }
9
- `)),B=M(S||(S=l`
9
+ `)),W=M(S||(S=l`
10
10
  0% {
11
11
  stroke-dasharray: 1px, 200px;
12
12
  stroke-dashoffset: 0;
@@ -21,8 +21,8 @@ import{H as N,J as U,K as w,L as z,M as o,N as E,O as c,P as I,Q as g,R as D,S a
21
21
  stroke-dasharray: 100px, 200px;
22
22
  stroke-dashoffset: -125px;
23
23
  }
24
- `)),G=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,u={root:["root",s,`color${c(a)}`],svg:["svg"],circle:["circle",`circle${c(s)}`,d&&"circleDisableShrink"]};return I(u,F,e)},H=g("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${c(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(b||(b=l`
24
+ `)),B=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,u={root:["root",s,`color${c(a)}`],svg:["svg"],circle:["circle",`circle${c(s)}`,d&&"circleDisableShrink"]};return F(u,K,e)},H=g("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${c(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(b||(b=l`
25
25
  animation: ${0} 1.4s linear infinite;
26
- `),W)),J=g("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),O=g("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${c(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
26
+ `),L)),J=g("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),O=g("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${c(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
27
27
  animation: ${0} 1.4s ease-in-out infinite;
28
- `),B)),Z=K.forwardRef(function(e,s){const a=w({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=z(a,L),n=o({},a,{color:u,disableShrink:R,size:m,thickness:i,value:p,variant:k}),f=G(n),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return v.jsx(H,o({className:E(f.root,d),style:o({width:m,height:m},x,_),ownerState:n,ref:s,role:"progressbar"},y,j,{children:v.jsx(J,{className:f.svg,ownerState:n,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:v.jsx(O,{className:f.circle,style:h,ownerState:n,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{Z as C};
28
+ `),W)),Z=I.forwardRef(function(e,s){const a=w({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=z(a,G),n=o({},a,{color:u,disableShrink:R,size:m,thickness:i,value:p,variant:k}),f=B(n),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return v.jsx(H,o({className:E(f.root,d),style:o({width:m,height:m},x,_),ownerState:n,ref:s,role:"progressbar"},y,j,{children:v.jsx(J,{className:f.svg,ownerState:n,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:v.jsx(O,{className:f.circle,style:h,ownerState:n,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{Z as C};
@@ -1,4 +1,4 @@
1
- import{j as e,r as p,d as Q,a as Y}from"./react-yytiy0wi.js";import{af as N,s as f,ag as Z,I as J,t,j as V,D as W,g as X,a as ee,A as ae,ar as te,k as re,as as se}from"./index-d4x-ttpO.js";import{E as oe}from"./ErrorNotice-CKeOu_Oi.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-BdgBOuhz.js";import{u as de}from"./useStore-BPgnQXlK.js";import{s as E}from"./address-DrURAr9O.js";import{S as F,C as me,F as pe,d as ue,b as R,c as ge}from"./categories-pY-U0UXm.js";import{L as xe}from"./LoadMore-CwKrPv19.js";import{u as he}from"./useInfiniteGrid-ClIfwXAY.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";const be=f.section`
1
+ import{j as e,r as p,d as Q,a as Y}from"./react-yytiy0wi.js";import{af as N,s as f,ag as Z,I as J,t,j as V,D as W,g as X,a as ee,A as ae,ar as te,k as re,as as se}from"./index-CAAtcdsn.js";import{E as oe}from"./ErrorNotice-CKeOu_Oi.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-WFDCerhK.js";import{u as de}from"./useStore-BDGgQjbV.js";import{s as E}from"./address-DrURAr9O.js";import{S as F,C as me,F as pe,d as ue,b as R,c as ge}from"./categories-C4HyTLUC.js";import{L as xe}from"./LoadMore-CUcfUpuY.js";import{u as he}from"./useInfiniteGrid-DmEa4Rj6.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";const be=f.section`
2
2
  position: relative;
3
3
  border-radius: ${N.radius.card};
4
4
  overflow: hidden;
@@ -1 +1 @@
1
- import{r as o,j as t}from"./react-yytiy0wi.js";import{t as s,I as k,E as f,A as N}from"./index-d4x-ttpO.js";function L({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,C]=o.useState(!0),[b,p]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),C(e<=1),p(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function w(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:b,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>w(e)},e))}):null]})}export{L as C};
1
+ import{r as o,j as t}from"./react-yytiy0wi.js";import{t as s,I as k,E as f,A as N}from"./index-CAAtcdsn.js";function L({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,C]=o.useState(!0),[b,p]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),C(e<=1),p(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function w(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:b,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>w(e)},e))}):null]})}export{L as C};
@@ -1 +1 @@
1
- import{a as K,j as e,L as re,d as se,u as te,r as N}from"./react-yytiy0wi.js";import{av as oe,aw as ce,aa as le,t as a,ax as E,B as ne,ag as D,d as ie,I,j as de,a as me,A as ue,ae as he,ay as ge,k as xe}from"./index-d4x-ttpO.js";import{d as _e,g as pe,a as je,A as Ne}from"./collection-BdgBOuhz.js";import{u as be,L as fe}from"./useStore-BPgnQXlK.js";import{s as O}from"./address-DrURAr9O.js";import{S as $,C as ve,b as w,F as Ce,d as we,c as ke}from"./categories-pY-U0UXm.js";import{L as B}from"./LoadMore-CwKrPv19.js";import{u as R}from"./useInfiniteGrid-ClIfwXAY.js";import{E as T}from"./ErrorNotice-CKeOu_Oi.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,j=r==null||o==null,{data:i}=oe(m,j),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function ye({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const Se={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=D(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||O(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,j=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(je({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:j,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:Se[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(ye,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function ze(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=D(t),g=(m==null?void 0:m.name)||(t?O(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,j]=N.useState("wearable"),[i,p]=N.useState(null),[h,_]=N.useState([]),[d,b]=N.useState(""),[l,f]=N.useState(""),[P,z]=N.useState("newest"),y=d&&!Number.isNaN(Number(d))?Number(d):void 0,S=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:y,maxPriceCredits:S,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:W,isFetchingNextPage:F,fetchNextPage:Z}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function q(s){j(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){j("wearable"),p(null),_([]),b(""),f("")}const k=!!(y||S),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(Ne,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:q,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:z,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:W,isFetching:F,onLoadMore:()=>void Z()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{ze as Creator,ze as default};
1
+ import{a as K,j as e,L as re,d as se,u as te,r as N}from"./react-yytiy0wi.js";import{av as oe,aw as ce,a8 as le,t as a,ax as E,B as ne,ag as D,d as ie,I,j as de,a as me,A as ue,ac as he,ay as ge,k as xe}from"./index-CAAtcdsn.js";import{d as _e,g as pe,a as je,A as Ne}from"./collection-WFDCerhK.js";import{u as be,L as fe}from"./useStore-BDGgQjbV.js";import{s as O}from"./address-DrURAr9O.js";import{S as $,C as ve,b as w,F as Ce,d as we,c as ke}from"./categories-C4HyTLUC.js";import{L as B}from"./LoadMore-CUcfUpuY.js";import{u as R}from"./useInfiniteGrid-DmEa4Rj6.js";import{E as T}from"./ErrorNotice-CKeOu_Oi.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,j=r==null||o==null,{data:i}=oe(m,j),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function ye({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const Se={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=D(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||O(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,j=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(je({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:j,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:Se[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(ye,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function ze(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=D(t),g=(m==null?void 0:m.name)||(t?O(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,j]=N.useState("wearable"),[i,p]=N.useState(null),[h,_]=N.useState([]),[d,b]=N.useState(""),[l,f]=N.useState(""),[P,z]=N.useState("newest"),y=d&&!Number.isNaN(Number(d))?Number(d):void 0,S=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:y,maxPriceCredits:S,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:W,isFetchingNextPage:F,fetchNextPage:Z}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function q(s){j(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){j("wearable"),p(null),_([]),b(""),f("")}const k=!!(y||S),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(Ne,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:q,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:z,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:W,isFetching:F,onLoadMore:()=>void Z()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{ze as Creator,ze as default};
@@ -1,4 +1,4 @@
1
- import{b6 as U,b7 as Ue,M as C,b8 as qe,b9 as Ye,W as Qe,ba as Ze,aV as Je,L as R,a_ as K,aZ as Te,bb as a,bc as Xe,bd as Le,T as et,b4 as tt}from"./index-d4x-ttpO.js";import{R as rt,g as ot}from"./getOverlayAlpha-BX66SxOu.js";import{j as T,r as y}from"./react-yytiy0wi.js";import{u as nt,a as Be}from"./useTheme-HWLX9NSW.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Ze,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
1
+ import{b6 as U,b7 as Ue,K as C,b8 as qe,b9 as Ye,U as Je,ba as Qe,aV as Ze,J as K,a_ as R,aZ as Te,bb as a,bc as Xe,bd as Le,T as et,b4 as tt}from"./index-CAAtcdsn.js";import{R as rt,g as ot}from"./getOverlayAlpha-Bem9pjlW.js";import{j as T,r as y}from"./react-yytiy0wi.js";import{u as nt,a as Be}from"./useTheme-DR6D7MpO.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Je.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Qe,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
2
2
  try {
3
3
  var mode = localStorage.getItem('${s}') || '${o}';
4
4
  var colorScheme = '';
@@ -20,5 +20,5 @@ try {
20
20
  if (colorScheme) {
21
21
  ${m}.setAttribute('${d}', colorScheme);
22
22
  }
23
- } catch(e){}})();`}},"mui-color-scheme-init")}function Ae(r){if(typeof window<"u"&&r==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Me(r,o){if(r.mode==="light"||r.mode==="system"&&r.systemMode==="light")return o("light");if(r.mode==="dark"||r.mode==="system"&&r.systemMode==="dark")return o("dark")}function ft(r){return Me(r,o=>{if(o==="light")return r.lightColorScheme;if(o==="dark")return r.darkColorScheme})}function ae(r,o){if(typeof window>"u")return;let n;try{n=localStorage.getItem(r)||void 0,n||localStorage.setItem(r,o)}catch{}return n||o}function ht(r){const{defaultMode:o="light",defaultLightColorScheme:n,defaultDarkColorScheme:i,supportedColorSchemes:s=[],modeStorageKey:l=le,colorSchemeStorageKey:d=ce,storageWindow:m=typeof window>"u"?void 0:window}=r,f=s.join(","),[S,b]=y.useState(()=>{const h=ae(l,o),c=ae(`${d}-light`,n),g=ae(`${d}-dark`,i);return{mode:h,systemMode:Ae(h),lightColorScheme:c,darkColorScheme:g}}),A=ft(S),M=y.useCallback(h=>{b(c=>{if(h===c.mode)return c;const g=h??o;try{localStorage.setItem(l,g)}catch{}return C({},c,{mode:g,systemMode:Ae(g)})})},[l,o]),v=y.useCallback(h=>{h?typeof h=="string"?h&&!f.includes(h)?console.error(`\`${h}\` does not exist in \`theme.colorSchemes\`.`):b(c=>{const g=C({},c);return Me(c,w=>{try{localStorage.setItem(`${d}-${w}`,h)}catch{}w==="light"&&(g.lightColorScheme=h),w==="dark"&&(g.darkColorScheme=h)}),g}):b(c=>{const g=C({},c),w=h.light===null?n:h.light,L=h.dark===null?i:h.dark;if(w)if(!f.includes(w))console.error(`\`${w}\` does not exist in \`theme.colorSchemes\`.`);else{g.lightColorScheme=w;try{localStorage.setItem(`${d}-light`,w)}catch{}}if(L)if(!f.includes(L))console.error(`\`${L}\` does not exist in \`theme.colorSchemes\`.`);else{g.darkColorScheme=L;try{localStorage.setItem(`${d}-dark`,L)}catch{}}return g}):b(c=>{try{localStorage.setItem(`${d}-light`,n),localStorage.setItem(`${d}-dark`,i)}catch{}return C({},c,{lightColorScheme:n,darkColorScheme:i})})},[f,d,n,i]),k=y.useCallback(h=>{S.mode==="system"&&b(c=>{const g=h!=null&&h.matches?"dark":"light";return c.systemMode===g?c:C({},c,{systemMode:g})})},[S.mode]),$=y.useRef(k);return $.current=k,y.useEffect(()=>{const h=(...g)=>$.current(...g),c=window.matchMedia("(prefers-color-scheme: dark)");return c.addListener(h),h(c),()=>{c.removeListener(h)}},[]),y.useEffect(()=>{if(m){const h=c=>{const g=c.newValue;typeof c.key=="string"&&c.key.startsWith(d)&&(!g||f.match(g))&&(c.key.endsWith("light")&&v({light:g}),c.key.endsWith("dark")&&v({dark:g})),c.key===l&&(!g||["light","dark","system"].includes(g))&&M(g||o)};return m.addEventListener("storage",h),()=>{m.removeEventListener("storage",h)}}},[v,M,l,d,f,o,m]),C({},S,{colorScheme:A,setMode:M,setColorScheme:v})}const gt=["colorSchemes","components","generateCssVars","cssVarPrefix"],pt="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function St(r){const{themeId:o,theme:n={},attribute:i=Ie,modeStorageKey:s=le,colorSchemeStorageKey:l=ce,defaultMode:d="light",defaultColorScheme:m,disableTransitionOnChange:f=!1,resolveTheme:S,excludeVariablesFromRoot:b}=r;(!n.colorSchemes||typeof m=="string"&&!n.colorSchemes[m]||typeof m=="object"&&!n.colorSchemes[m==null?void 0:m.light]||typeof m=="object"&&!n.colorSchemes[m==null?void 0:m.dark])&&console.error(`MUI: \`${m}\` does not exist in \`theme.colorSchemes\`.`);const A=y.createContext(void 0),M=()=>{const c=y.useContext(A);if(!c)throw new Error(Je(19));return c};function v(c){const{children:g,theme:w=n,modeStorageKey:L=s,colorSchemeStorageKey:B=l,attribute:e=i,defaultMode:u=d,defaultColorScheme:p=m,disableTransitionOnChange:_=f,storageWindow:q=typeof window>"u"?void 0:window,documentNode:V=typeof document>"u"?void 0:document,colorSchemeNode:Y=typeof document>"u"?void 0:document.documentElement,colorSchemeSelector:N=":root",disableNestedContext:Ve=!1,disableStyleSheetGeneration:je=!1}=c,Q=y.useRef(!1),de=se(),Z=y.useContext(A),J=!!Z&&!Ve,ue=w[o],me=ue||w,{colorSchemes:X={},components:Pe={},generateCssVars:fe=()=>({vars:{},css:{}}),cssVarPrefix:ee}=me,Fe=R(me,gt),te=Object.keys(X),he=typeof p=="string"?p:p.light,ge=typeof p=="string"?p:p.dark,{mode:Oe,setMode:pe,systemMode:Se,lightColorScheme:Ce,darkColorScheme:ye,colorScheme:Ge,setColorScheme:ve}=ht({supportedColorSchemes:te,defaultLightColorScheme:he,defaultDarkColorScheme:ge,modeStorageKey:L,colorSchemeStorageKey:B,defaultMode:u,storageWindow:q});let O=Oe,j=Ge;J&&(O=Z.mode,j=Z.colorScheme);const We=O||(u==="system"?d:u),Re=j||(We==="dark"?ge:he),{css:Ke,vars:be}=fe(),D=C({},Fe,{components:Pe,colorSchemes:X,cssVarPrefix:ee,vars:be,getColorSchemeSelector:x=>`[${e}="${x}"] &`}),re={},ke={};Object.entries(X).forEach(([x,P])=>{const{css:z,vars:Ne}=fe(x);D.vars=K(D.vars,Ne),x===Re&&(Object.keys(P).forEach(E=>{P[E]&&typeof P[E]=="object"?D[E]=C({},D[E],P[E]):D[E]=P[E]}),D.palette&&(D.palette.colorScheme=x));const ze=typeof p=="string"?p:u==="dark"?p.dark:p.light;if(x===ze){if(b){const E={};b(ee).forEach(oe=>{E[oe]=z[oe],delete z[oe]}),re[`[${e}="${x}"]`]=E}re[`${N}, [${e}="${x}"]`]=z}else ke[`${N===":root"?"":N}[${e}="${x}"]`]=z}),D.vars=K(D.vars,be),y.useEffect(()=>{j&&Y&&Y.setAttribute(e,j)},[j,e,Y]),y.useEffect(()=>{let x;if(_&&Q.current&&V){const P=V.createElement("style");P.appendChild(V.createTextNode(pt)),V.head.appendChild(P),window.getComputedStyle(V.body),x=setTimeout(()=>{V.head.removeChild(P)},1)}return()=>{clearTimeout(x)}},[j,_,V]),y.useEffect(()=>(Q.current=!0,()=>{Q.current=!1}),[]);const He=y.useMemo(()=>({allColorSchemes:te,colorScheme:j,darkColorScheme:ye,lightColorScheme:Ce,mode:O,setColorScheme:ve,setMode:pe,systemMode:Se}),[te,j,ye,Ce,O,ve,pe,Se]);let _e=!0;(je||J&&(de==null?void 0:de.cssVarPrefix)===ee)&&(_e=!1);const we=T.jsxs(y.Fragment,{children:[_e&&T.jsxs(y.Fragment,{children:[T.jsx(U,{styles:{[N]:Ke}}),T.jsx(U,{styles:re}),T.jsx(U,{styles:ke})]}),T.jsx(ut,{themeId:ue?o:void 0,theme:S?S(D):D,children:g})]});return J?we:T.jsx(A.Provider,{value:He,children:we})}const k=typeof m=="string"?m:m.light,$=typeof m=="string"?m:m.dark;return{CssVarsProvider:v,useColorScheme:M,getInitColorSchemeScript:c=>mt(C({attribute:i,colorSchemeStorageKey:l,defaultMode:d,defaultLightColorScheme:k,defaultDarkColorScheme:$,modeStorageKey:s},c))}}function Ct(r=""){function o(...i){if(!i.length)return"";const s=i[0];return typeof s=="string"&&!s.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${r?`${r}-`:""}${s}${o(...i.slice(1))})`:`, ${s}`}return(i,...s)=>`var(--${r?`${r}-`:""}${i}${o(...s)})`}const De=(r,o,n,i=[])=>{let s=r;o.forEach((l,d)=>{d===o.length-1?Array.isArray(s)?s[Number(l)]=n:s&&typeof s=="object"&&(s[l]=n):s&&typeof s=="object"&&(s[l]||(s[l]=i.includes(l)?[]:{}),s=s[l])})},yt=(r,o,n)=>{function i(s,l=[],d=[]){Object.entries(s).forEach(([m,f])=>{(!n||n&&!n([...l,m]))&&f!=null&&(typeof f=="object"&&Object.keys(f).length>0?i(f,[...l,m],Array.isArray(f)?[...d,m]:d):o([...l,m],f,d))})}i(r)},vt=(r,o)=>typeof o=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(i=>r.includes(i))||r[r.length-1].toLowerCase().indexOf("opacity")>=0?o:`${o}px`:o;function ie(r,o){const{prefix:n,shouldSkipGeneratingVar:i}=o||{},s={},l={},d={};return yt(r,(m,f,S)=>{if((typeof f=="string"||typeof f=="number")&&(!i||!i(m,f))){const b=`--${n?`${n}-`:""}${m.join("-")}`;Object.assign(s,{[b]:vt(m,f)}),De(l,m,`var(${b})`,S),De(d,m,`var(${b}, ${f})`,S)}},m=>m[0]==="vars"),{css:s,vars:l,varsWithDefaults:d}}function H(r){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},H(r)}function bt(r,o){if(H(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var i=n.call(r,o);if(H(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function kt(r){var o=bt(r,"string");return H(o)=="symbol"?o:o+""}const _t=["colorSchemes","components","defaultColorScheme"];function wt(r,o){const{colorSchemes:n={},defaultColorScheme:i="light"}=r,s=R(r,_t),{vars:l,css:d,varsWithDefaults:m}=ie(s,o);let f=m;const S={},{[i]:b}=n,A=R(n,[i].map(kt));if(Object.entries(A||{}).forEach(([v,k])=>{const{vars:$,css:h,varsWithDefaults:c}=ie(k,o);f=K(f,c),S[v]={css:h,vars:$}}),b){const{css:v,vars:k,varsWithDefaults:$}=ie(b,o);f=K(f,$),S[i]={css:v,vars:k}}return{vars:f,generateCssVars:v=>{var k;if(!v){var $;const c=C({},d);return{css:c,vars:l,selector:(o==null||($=o.getSelector)==null?void 0:$.call(o,v,c))||":root"}}const h=C({},S[v].css);return{css:h,vars:S[v].vars,selector:(o==null||(k=o.getSelector)==null?void 0:k.call(o,v,h))||":root"}}}}function Tt(r){var o;return!!r[0].match(/(cssVarPrefix|typography|mixins|breakpoints|direction|transitions)/)||!!r[0].match(/sxConfig$/)||r[0]==="palette"&&!!((o=r[1])!=null&&o.match(/(mode|contrastThreshold|tonalOffset)/))}const $t=["colorSchemes","cssVarPrefix","shouldSkipGeneratingVar"],xt=["palette"],At=[...Array(25)].map((r,o)=>{if(o===0)return;const n=ot(o);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Dt(r,o){o.forEach(n=>{r[n]||(r[n]={})})}function t(r,o,n){!r[o]&&n&&(r[o]=n)}function W(r){return!r||!r.startsWith("hsl")?r:a.hslToRgb(r)}function F(r,o){`${o}Channel`in r||(r[`${o}Channel`]=a.private_safeColorChannel(W(r[o]),`MUI: Can't create \`palette.${o}Channel\` because \`palette.${o}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
24
- To suppress this warning, you need to explicitly provide the \`palette.${o}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}const I=r=>{try{return r()}catch{}},Lt=(r="mui")=>Ct(r);function Bt(r={},...o){var n,i,s,l,d,m;const{colorSchemes:f={},cssVarPrefix:S="mui",shouldSkipGeneratingVar:b=Tt}=r,A=R(r,$t),M=Lt(S),v=Te(C({},A,f.light&&{palette:(n=f.light)==null?void 0:n.palette})),{palette:k}=v,$=R(v,xt),{palette:h}=Te({palette:C({mode:"dark"},(i=f.dark)==null?void 0:i.palette)});let c=C({},$,{cssVarPrefix:S,getCssVar:M,colorSchemes:C({},f,{light:C({},f.light,{palette:k,opacity:C({inputPlaceholder:.42,inputUnderline:.42,switchTrackDisabled:.12,switchTrack:.38},(s=f.light)==null?void 0:s.opacity),overlays:((l=f.light)==null?void 0:l.overlays)||[]}),dark:C({},f.dark,{palette:h,opacity:C({inputPlaceholder:.5,inputUnderline:.7,switchTrackDisabled:.2,switchTrack:.3},(d=f.dark)==null?void 0:d.opacity),overlays:((m=f.dark)==null?void 0:m.overlays)||At})})});Object.keys(c.colorSchemes).forEach(B=>{const e=c.colorSchemes[B].palette,u=p=>{const _=p.split("-"),q=_[1],V=_[2];return M(p,e[q][V])};if(B==="light"?(t(e.common,"background","#fff"),t(e.common,"onBackground","#000")):(t(e.common,"background","#000"),t(e.common,"onBackground","#fff")),Dt(e,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),B==="light"){t(e.Alert,"errorColor",a.private_safeDarken(e.error.light,.6)),t(e.Alert,"infoColor",a.private_safeDarken(e.info.light,.6)),t(e.Alert,"successColor",a.private_safeDarken(e.success.light,.6)),t(e.Alert,"warningColor",a.private_safeDarken(e.warning.light,.6)),t(e.Alert,"errorFilledBg",u("palette-error-main")),t(e.Alert,"infoFilledBg",u("palette-info-main")),t(e.Alert,"successFilledBg",u("palette-success-main")),t(e.Alert,"warningFilledBg",u("palette-warning-main")),t(e.Alert,"errorFilledColor",I(()=>k.getContrastText(e.error.main))),t(e.Alert,"infoFilledColor",I(()=>k.getContrastText(e.info.main))),t(e.Alert,"successFilledColor",I(()=>k.getContrastText(e.success.main))),t(e.Alert,"warningFilledColor",I(()=>k.getContrastText(e.warning.main))),t(e.Alert,"errorStandardBg",a.private_safeLighten(e.error.light,.9)),t(e.Alert,"infoStandardBg",a.private_safeLighten(e.info.light,.9)),t(e.Alert,"successStandardBg",a.private_safeLighten(e.success.light,.9)),t(e.Alert,"warningStandardBg",a.private_safeLighten(e.warning.light,.9)),t(e.Alert,"errorIconColor",u("palette-error-main")),t(e.Alert,"infoIconColor",u("palette-info-main")),t(e.Alert,"successIconColor",u("palette-success-main")),t(e.Alert,"warningIconColor",u("palette-warning-main")),t(e.AppBar,"defaultBg",u("palette-grey-100")),t(e.Avatar,"defaultBg",u("palette-grey-400")),t(e.Button,"inheritContainedBg",u("palette-grey-300")),t(e.Button,"inheritContainedHoverBg",u("palette-grey-A100")),t(e.Chip,"defaultBorder",u("palette-grey-400")),t(e.Chip,"defaultAvatarColor",u("palette-grey-700")),t(e.Chip,"defaultIconColor",u("palette-grey-700")),t(e.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),t(e.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),t(e.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),t(e.LinearProgress,"primaryBg",a.private_safeLighten(e.primary.main,.62)),t(e.LinearProgress,"secondaryBg",a.private_safeLighten(e.secondary.main,.62)),t(e.LinearProgress,"errorBg",a.private_safeLighten(e.error.main,.62)),t(e.LinearProgress,"infoBg",a.private_safeLighten(e.info.main,.62)),t(e.LinearProgress,"successBg",a.private_safeLighten(e.success.main,.62)),t(e.LinearProgress,"warningBg",a.private_safeLighten(e.warning.main,.62)),t(e.Skeleton,"bg",`rgba(${u("palette-text-primaryChannel")} / 0.11)`),t(e.Slider,"primaryTrack",a.private_safeLighten(e.primary.main,.62)),t(e.Slider,"secondaryTrack",a.private_safeLighten(e.secondary.main,.62)),t(e.Slider,"errorTrack",a.private_safeLighten(e.error.main,.62)),t(e.Slider,"infoTrack",a.private_safeLighten(e.info.main,.62)),t(e.Slider,"successTrack",a.private_safeLighten(e.success.main,.62)),t(e.Slider,"warningTrack",a.private_safeLighten(e.warning.main,.62));const p=a.private_safeEmphasize(e.background.default,.8);t(e.SnackbarContent,"bg",p),t(e.SnackbarContent,"color",I(()=>k.getContrastText(p))),t(e.SpeedDialAction,"fabHoverBg",a.private_safeEmphasize(e.background.paper,.15)),t(e.StepConnector,"border",u("palette-grey-400")),t(e.StepContent,"border",u("palette-grey-400")),t(e.Switch,"defaultColor",u("palette-common-white")),t(e.Switch,"defaultDisabledColor",u("palette-grey-100")),t(e.Switch,"primaryDisabledColor",a.private_safeLighten(e.primary.main,.62)),t(e.Switch,"secondaryDisabledColor",a.private_safeLighten(e.secondary.main,.62)),t(e.Switch,"errorDisabledColor",a.private_safeLighten(e.error.main,.62)),t(e.Switch,"infoDisabledColor",a.private_safeLighten(e.info.main,.62)),t(e.Switch,"successDisabledColor",a.private_safeLighten(e.success.main,.62)),t(e.Switch,"warningDisabledColor",a.private_safeLighten(e.warning.main,.62)),t(e.TableCell,"border",a.private_safeLighten(a.private_safeAlpha(e.divider,1),.88)),t(e.Tooltip,"bg",a.private_safeAlpha(e.grey[700],.92))}else{t(e.Alert,"errorColor",a.private_safeLighten(e.error.light,.6)),t(e.Alert,"infoColor",a.private_safeLighten(e.info.light,.6)),t(e.Alert,"successColor",a.private_safeLighten(e.success.light,.6)),t(e.Alert,"warningColor",a.private_safeLighten(e.warning.light,.6)),t(e.Alert,"errorFilledBg",u("palette-error-dark")),t(e.Alert,"infoFilledBg",u("palette-info-dark")),t(e.Alert,"successFilledBg",u("palette-success-dark")),t(e.Alert,"warningFilledBg",u("palette-warning-dark")),t(e.Alert,"errorFilledColor",I(()=>h.getContrastText(e.error.dark))),t(e.Alert,"infoFilledColor",I(()=>h.getContrastText(e.info.dark))),t(e.Alert,"successFilledColor",I(()=>h.getContrastText(e.success.dark))),t(e.Alert,"warningFilledColor",I(()=>h.getContrastText(e.warning.dark))),t(e.Alert,"errorStandardBg",a.private_safeDarken(e.error.light,.9)),t(e.Alert,"infoStandardBg",a.private_safeDarken(e.info.light,.9)),t(e.Alert,"successStandardBg",a.private_safeDarken(e.success.light,.9)),t(e.Alert,"warningStandardBg",a.private_safeDarken(e.warning.light,.9)),t(e.Alert,"errorIconColor",u("palette-error-main")),t(e.Alert,"infoIconColor",u("palette-info-main")),t(e.Alert,"successIconColor",u("palette-success-main")),t(e.Alert,"warningIconColor",u("palette-warning-main")),t(e.AppBar,"defaultBg",u("palette-grey-900")),t(e.AppBar,"darkBg",u("palette-background-paper")),t(e.AppBar,"darkColor",u("palette-text-primary")),t(e.Avatar,"defaultBg",u("palette-grey-600")),t(e.Button,"inheritContainedBg",u("palette-grey-800")),t(e.Button,"inheritContainedHoverBg",u("palette-grey-700")),t(e.Chip,"defaultBorder",u("palette-grey-700")),t(e.Chip,"defaultAvatarColor",u("palette-grey-300")),t(e.Chip,"defaultIconColor",u("palette-grey-300")),t(e.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),t(e.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),t(e.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),t(e.LinearProgress,"primaryBg",a.private_safeDarken(e.primary.main,.5)),t(e.LinearProgress,"secondaryBg",a.private_safeDarken(e.secondary.main,.5)),t(e.LinearProgress,"errorBg",a.private_safeDarken(e.error.main,.5)),t(e.LinearProgress,"infoBg",a.private_safeDarken(e.info.main,.5)),t(e.LinearProgress,"successBg",a.private_safeDarken(e.success.main,.5)),t(e.LinearProgress,"warningBg",a.private_safeDarken(e.warning.main,.5)),t(e.Skeleton,"bg",`rgba(${u("palette-text-primaryChannel")} / 0.13)`),t(e.Slider,"primaryTrack",a.private_safeDarken(e.primary.main,.5)),t(e.Slider,"secondaryTrack",a.private_safeDarken(e.secondary.main,.5)),t(e.Slider,"errorTrack",a.private_safeDarken(e.error.main,.5)),t(e.Slider,"infoTrack",a.private_safeDarken(e.info.main,.5)),t(e.Slider,"successTrack",a.private_safeDarken(e.success.main,.5)),t(e.Slider,"warningTrack",a.private_safeDarken(e.warning.main,.5));const p=a.private_safeEmphasize(e.background.default,.98);t(e.SnackbarContent,"bg",p),t(e.SnackbarContent,"color",I(()=>h.getContrastText(p))),t(e.SpeedDialAction,"fabHoverBg",a.private_safeEmphasize(e.background.paper,.15)),t(e.StepConnector,"border",u("palette-grey-600")),t(e.StepContent,"border",u("palette-grey-600")),t(e.Switch,"defaultColor",u("palette-grey-300")),t(e.Switch,"defaultDisabledColor",u("palette-grey-600")),t(e.Switch,"primaryDisabledColor",a.private_safeDarken(e.primary.main,.55)),t(e.Switch,"secondaryDisabledColor",a.private_safeDarken(e.secondary.main,.55)),t(e.Switch,"errorDisabledColor",a.private_safeDarken(e.error.main,.55)),t(e.Switch,"infoDisabledColor",a.private_safeDarken(e.info.main,.55)),t(e.Switch,"successDisabledColor",a.private_safeDarken(e.success.main,.55)),t(e.Switch,"warningDisabledColor",a.private_safeDarken(e.warning.main,.55)),t(e.TableCell,"border",a.private_safeDarken(a.private_safeAlpha(e.divider,1),.68)),t(e.Tooltip,"bg",a.private_safeAlpha(e.grey[700],.92))}F(e.background,"default"),F(e.background,"paper"),F(e.common,"background"),F(e.common,"onBackground"),F(e,"divider"),Object.keys(e).forEach(p=>{const _=e[p];_&&typeof _=="object"&&(_.main&&t(e[p],"mainChannel",a.private_safeColorChannel(W(_.main))),_.light&&t(e[p],"lightChannel",a.private_safeColorChannel(W(_.light))),_.dark&&t(e[p],"darkChannel",a.private_safeColorChannel(W(_.dark))),_.contrastText&&t(e[p],"contrastTextChannel",a.private_safeColorChannel(W(_.contrastText))),p==="text"&&(F(e[p],"primary"),F(e[p],"secondary")),p==="action"&&(_.active&&F(e[p],"active"),_.selected&&F(e[p],"selected")))})}),c=o.reduce((B,e)=>K(B,e),c);const g={prefix:S,shouldSkipGeneratingVar:b},{vars:w,generateCssVars:L}=wt(c,g);return c.vars=w,c.generateCssVars=L,c.shouldSkipGeneratingVar=b,c.unstable_sxConfig=C({},Xe,A==null?void 0:A.unstable_sxConfig),c.unstable_sx=function(e){return Le({sx:e,theme:this})},c}const Et=r=>[...[...Array(24)].map((o,n)=>`--${r?`${r}-`:""}overlays-${n+1}`),`--${r?`${r}-`:""}palette-AppBar-darkBg`,`--${r?`${r}-`:""}palette-AppBar-darkColor`],G={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},It=Bt(),{CssVarsProvider:Ot,useColorScheme:Gt,getInitColorSchemeScript:Mt}=St({themeId:et,theme:It,attribute:G.attribute,colorSchemeStorageKey:G.colorSchemeStorageKey,modeStorageKey:G.modeStorageKey,defaultColorScheme:{light:G.defaultLightColorScheme,dark:G.defaultDarkColorScheme},resolveTheme:r=>{const o=C({},r,{typography:tt(r.palette,r.typography)});return o.unstable_sx=function(i){return Le({sx:i,theme:this})},o},excludeVariablesFromRoot:Et}),Wt=Mt;export{Ot as C,at as G,ut as T,Et as a,Bt as e,Wt as g,Tt as s,Gt as u};
23
+ } catch(e){}})();`}},"mui-color-scheme-init")}function Ae(r){if(typeof window<"u"&&r==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Me(r,o){if(r.mode==="light"||r.mode==="system"&&r.systemMode==="light")return o("light");if(r.mode==="dark"||r.mode==="system"&&r.systemMode==="dark")return o("dark")}function ft(r){return Me(r,o=>{if(o==="light")return r.lightColorScheme;if(o==="dark")return r.darkColorScheme})}function ae(r,o){if(typeof window>"u")return;let n;try{n=localStorage.getItem(r)||void 0,n||localStorage.setItem(r,o)}catch{}return n||o}function ht(r){const{defaultMode:o="light",defaultLightColorScheme:n,defaultDarkColorScheme:i,supportedColorSchemes:s=[],modeStorageKey:l=le,colorSchemeStorageKey:d=ce,storageWindow:m=typeof window>"u"?void 0:window}=r,f=s.join(","),[S,b]=y.useState(()=>{const h=ae(l,o),c=ae(`${d}-light`,n),g=ae(`${d}-dark`,i);return{mode:h,systemMode:Ae(h),lightColorScheme:c,darkColorScheme:g}}),A=ft(S),M=y.useCallback(h=>{b(c=>{if(h===c.mode)return c;const g=h??o;try{localStorage.setItem(l,g)}catch{}return C({},c,{mode:g,systemMode:Ae(g)})})},[l,o]),v=y.useCallback(h=>{h?typeof h=="string"?h&&!f.includes(h)?console.error(`\`${h}\` does not exist in \`theme.colorSchemes\`.`):b(c=>{const g=C({},c);return Me(c,w=>{try{localStorage.setItem(`${d}-${w}`,h)}catch{}w==="light"&&(g.lightColorScheme=h),w==="dark"&&(g.darkColorScheme=h)}),g}):b(c=>{const g=C({},c),w=h.light===null?n:h.light,L=h.dark===null?i:h.dark;if(w)if(!f.includes(w))console.error(`\`${w}\` does not exist in \`theme.colorSchemes\`.`);else{g.lightColorScheme=w;try{localStorage.setItem(`${d}-light`,w)}catch{}}if(L)if(!f.includes(L))console.error(`\`${L}\` does not exist in \`theme.colorSchemes\`.`);else{g.darkColorScheme=L;try{localStorage.setItem(`${d}-dark`,L)}catch{}}return g}):b(c=>{try{localStorage.setItem(`${d}-light`,n),localStorage.setItem(`${d}-dark`,i)}catch{}return C({},c,{lightColorScheme:n,darkColorScheme:i})})},[f,d,n,i]),k=y.useCallback(h=>{S.mode==="system"&&b(c=>{const g=h!=null&&h.matches?"dark":"light";return c.systemMode===g?c:C({},c,{systemMode:g})})},[S.mode]),$=y.useRef(k);return $.current=k,y.useEffect(()=>{const h=(...g)=>$.current(...g),c=window.matchMedia("(prefers-color-scheme: dark)");return c.addListener(h),h(c),()=>{c.removeListener(h)}},[]),y.useEffect(()=>{if(m){const h=c=>{const g=c.newValue;typeof c.key=="string"&&c.key.startsWith(d)&&(!g||f.match(g))&&(c.key.endsWith("light")&&v({light:g}),c.key.endsWith("dark")&&v({dark:g})),c.key===l&&(!g||["light","dark","system"].includes(g))&&M(g||o)};return m.addEventListener("storage",h),()=>{m.removeEventListener("storage",h)}}},[v,M,l,d,f,o,m]),C({},S,{colorScheme:A,setMode:M,setColorScheme:v})}const gt=["colorSchemes","components","generateCssVars","cssVarPrefix"],pt="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function St(r){const{themeId:o,theme:n={},attribute:i=Ie,modeStorageKey:s=le,colorSchemeStorageKey:l=ce,defaultMode:d="light",defaultColorScheme:m,disableTransitionOnChange:f=!1,resolveTheme:S,excludeVariablesFromRoot:b}=r;(!n.colorSchemes||typeof m=="string"&&!n.colorSchemes[m]||typeof m=="object"&&!n.colorSchemes[m==null?void 0:m.light]||typeof m=="object"&&!n.colorSchemes[m==null?void 0:m.dark])&&console.error(`MUI: \`${m}\` does not exist in \`theme.colorSchemes\`.`);const A=y.createContext(void 0),M=()=>{const c=y.useContext(A);if(!c)throw new Error(Ze(19));return c};function v(c){const{children:g,theme:w=n,modeStorageKey:L=s,colorSchemeStorageKey:B=l,attribute:e=i,defaultMode:u=d,defaultColorScheme:p=m,disableTransitionOnChange:_=f,storageWindow:q=typeof window>"u"?void 0:window,documentNode:V=typeof document>"u"?void 0:document,colorSchemeNode:Y=typeof document>"u"?void 0:document.documentElement,colorSchemeSelector:N=":root",disableNestedContext:Ve=!1,disableStyleSheetGeneration:je=!1}=c,J=y.useRef(!1),de=se(),Q=y.useContext(A),Z=!!Q&&!Ve,ue=w[o],me=ue||w,{colorSchemes:X={},components:Pe={},generateCssVars:fe=()=>({vars:{},css:{}}),cssVarPrefix:ee}=me,Fe=K(me,gt),te=Object.keys(X),he=typeof p=="string"?p:p.light,ge=typeof p=="string"?p:p.dark,{mode:Oe,setMode:pe,systemMode:Se,lightColorScheme:Ce,darkColorScheme:ye,colorScheme:Ge,setColorScheme:ve}=ht({supportedColorSchemes:te,defaultLightColorScheme:he,defaultDarkColorScheme:ge,modeStorageKey:L,colorSchemeStorageKey:B,defaultMode:u,storageWindow:q});let O=Oe,j=Ge;Z&&(O=Q.mode,j=Q.colorScheme);const We=O||(u==="system"?d:u),Ke=j||(We==="dark"?ge:he),{css:Re,vars:be}=fe(),D=C({},Fe,{components:Pe,colorSchemes:X,cssVarPrefix:ee,vars:be,getColorSchemeSelector:x=>`[${e}="${x}"] &`}),re={},ke={};Object.entries(X).forEach(([x,P])=>{const{css:z,vars:Ne}=fe(x);D.vars=R(D.vars,Ne),x===Ke&&(Object.keys(P).forEach(E=>{P[E]&&typeof P[E]=="object"?D[E]=C({},D[E],P[E]):D[E]=P[E]}),D.palette&&(D.palette.colorScheme=x));const ze=typeof p=="string"?p:u==="dark"?p.dark:p.light;if(x===ze){if(b){const E={};b(ee).forEach(oe=>{E[oe]=z[oe],delete z[oe]}),re[`[${e}="${x}"]`]=E}re[`${N}, [${e}="${x}"]`]=z}else ke[`${N===":root"?"":N}[${e}="${x}"]`]=z}),D.vars=R(D.vars,be),y.useEffect(()=>{j&&Y&&Y.setAttribute(e,j)},[j,e,Y]),y.useEffect(()=>{let x;if(_&&J.current&&V){const P=V.createElement("style");P.appendChild(V.createTextNode(pt)),V.head.appendChild(P),window.getComputedStyle(V.body),x=setTimeout(()=>{V.head.removeChild(P)},1)}return()=>{clearTimeout(x)}},[j,_,V]),y.useEffect(()=>(J.current=!0,()=>{J.current=!1}),[]);const He=y.useMemo(()=>({allColorSchemes:te,colorScheme:j,darkColorScheme:ye,lightColorScheme:Ce,mode:O,setColorScheme:ve,setMode:pe,systemMode:Se}),[te,j,ye,Ce,O,ve,pe,Se]);let _e=!0;(je||Z&&(de==null?void 0:de.cssVarPrefix)===ee)&&(_e=!1);const we=T.jsxs(y.Fragment,{children:[_e&&T.jsxs(y.Fragment,{children:[T.jsx(U,{styles:{[N]:Re}}),T.jsx(U,{styles:re}),T.jsx(U,{styles:ke})]}),T.jsx(ut,{themeId:ue?o:void 0,theme:S?S(D):D,children:g})]});return Z?we:T.jsx(A.Provider,{value:He,children:we})}const k=typeof m=="string"?m:m.light,$=typeof m=="string"?m:m.dark;return{CssVarsProvider:v,useColorScheme:M,getInitColorSchemeScript:c=>mt(C({attribute:i,colorSchemeStorageKey:l,defaultMode:d,defaultLightColorScheme:k,defaultDarkColorScheme:$,modeStorageKey:s},c))}}function Ct(r=""){function o(...i){if(!i.length)return"";const s=i[0];return typeof s=="string"&&!s.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${r?`${r}-`:""}${s}${o(...i.slice(1))})`:`, ${s}`}return(i,...s)=>`var(--${r?`${r}-`:""}${i}${o(...s)})`}const De=(r,o,n,i=[])=>{let s=r;o.forEach((l,d)=>{d===o.length-1?Array.isArray(s)?s[Number(l)]=n:s&&typeof s=="object"&&(s[l]=n):s&&typeof s=="object"&&(s[l]||(s[l]=i.includes(l)?[]:{}),s=s[l])})},yt=(r,o,n)=>{function i(s,l=[],d=[]){Object.entries(s).forEach(([m,f])=>{(!n||n&&!n([...l,m]))&&f!=null&&(typeof f=="object"&&Object.keys(f).length>0?i(f,[...l,m],Array.isArray(f)?[...d,m]:d):o([...l,m],f,d))})}i(r)},vt=(r,o)=>typeof o=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(i=>r.includes(i))||r[r.length-1].toLowerCase().indexOf("opacity")>=0?o:`${o}px`:o;function ie(r,o){const{prefix:n,shouldSkipGeneratingVar:i}=o||{},s={},l={},d={};return yt(r,(m,f,S)=>{if((typeof f=="string"||typeof f=="number")&&(!i||!i(m,f))){const b=`--${n?`${n}-`:""}${m.join("-")}`;Object.assign(s,{[b]:vt(m,f)}),De(l,m,`var(${b})`,S),De(d,m,`var(${b}, ${f})`,S)}},m=>m[0]==="vars"),{css:s,vars:l,varsWithDefaults:d}}function H(r){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},H(r)}function bt(r,o){if(H(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var i=n.call(r,o);if(H(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function kt(r){var o=bt(r,"string");return H(o)=="symbol"?o:o+""}const _t=["colorSchemes","components","defaultColorScheme"];function wt(r,o){const{colorSchemes:n={},defaultColorScheme:i="light"}=r,s=K(r,_t),{vars:l,css:d,varsWithDefaults:m}=ie(s,o);let f=m;const S={},{[i]:b}=n,A=K(n,[i].map(kt));if(Object.entries(A||{}).forEach(([v,k])=>{const{vars:$,css:h,varsWithDefaults:c}=ie(k,o);f=R(f,c),S[v]={css:h,vars:$}}),b){const{css:v,vars:k,varsWithDefaults:$}=ie(b,o);f=R(f,$),S[i]={css:v,vars:k}}return{vars:f,generateCssVars:v=>{var k;if(!v){var $;const c=C({},d);return{css:c,vars:l,selector:(o==null||($=o.getSelector)==null?void 0:$.call(o,v,c))||":root"}}const h=C({},S[v].css);return{css:h,vars:S[v].vars,selector:(o==null||(k=o.getSelector)==null?void 0:k.call(o,v,h))||":root"}}}}function Tt(r){var o;return!!r[0].match(/(cssVarPrefix|typography|mixins|breakpoints|direction|transitions)/)||!!r[0].match(/sxConfig$/)||r[0]==="palette"&&!!((o=r[1])!=null&&o.match(/(mode|contrastThreshold|tonalOffset)/))}const $t=["colorSchemes","cssVarPrefix","shouldSkipGeneratingVar"],xt=["palette"],At=[...Array(25)].map((r,o)=>{if(o===0)return;const n=ot(o);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Dt(r,o){o.forEach(n=>{r[n]||(r[n]={})})}function t(r,o,n){!r[o]&&n&&(r[o]=n)}function W(r){return!r||!r.startsWith("hsl")?r:a.hslToRgb(r)}function F(r,o){`${o}Channel`in r||(r[`${o}Channel`]=a.private_safeColorChannel(W(r[o]),`MUI: Can't create \`palette.${o}Channel\` because \`palette.${o}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
24
+ To suppress this warning, you need to explicitly provide the \`palette.${o}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}const I=r=>{try{return r()}catch{}},Lt=(r="mui")=>Ct(r);function Bt(r={},...o){var n,i,s,l,d,m;const{colorSchemes:f={},cssVarPrefix:S="mui",shouldSkipGeneratingVar:b=Tt}=r,A=K(r,$t),M=Lt(S),v=Te(C({},A,f.light&&{palette:(n=f.light)==null?void 0:n.palette})),{palette:k}=v,$=K(v,xt),{palette:h}=Te({palette:C({mode:"dark"},(i=f.dark)==null?void 0:i.palette)});let c=C({},$,{cssVarPrefix:S,getCssVar:M,colorSchemes:C({},f,{light:C({},f.light,{palette:k,opacity:C({inputPlaceholder:.42,inputUnderline:.42,switchTrackDisabled:.12,switchTrack:.38},(s=f.light)==null?void 0:s.opacity),overlays:((l=f.light)==null?void 0:l.overlays)||[]}),dark:C({},f.dark,{palette:h,opacity:C({inputPlaceholder:.5,inputUnderline:.7,switchTrackDisabled:.2,switchTrack:.3},(d=f.dark)==null?void 0:d.opacity),overlays:((m=f.dark)==null?void 0:m.overlays)||At})})});Object.keys(c.colorSchemes).forEach(B=>{const e=c.colorSchemes[B].palette,u=p=>{const _=p.split("-"),q=_[1],V=_[2];return M(p,e[q][V])};if(B==="light"?(t(e.common,"background","#fff"),t(e.common,"onBackground","#000")):(t(e.common,"background","#000"),t(e.common,"onBackground","#fff")),Dt(e,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),B==="light"){t(e.Alert,"errorColor",a.private_safeDarken(e.error.light,.6)),t(e.Alert,"infoColor",a.private_safeDarken(e.info.light,.6)),t(e.Alert,"successColor",a.private_safeDarken(e.success.light,.6)),t(e.Alert,"warningColor",a.private_safeDarken(e.warning.light,.6)),t(e.Alert,"errorFilledBg",u("palette-error-main")),t(e.Alert,"infoFilledBg",u("palette-info-main")),t(e.Alert,"successFilledBg",u("palette-success-main")),t(e.Alert,"warningFilledBg",u("palette-warning-main")),t(e.Alert,"errorFilledColor",I(()=>k.getContrastText(e.error.main))),t(e.Alert,"infoFilledColor",I(()=>k.getContrastText(e.info.main))),t(e.Alert,"successFilledColor",I(()=>k.getContrastText(e.success.main))),t(e.Alert,"warningFilledColor",I(()=>k.getContrastText(e.warning.main))),t(e.Alert,"errorStandardBg",a.private_safeLighten(e.error.light,.9)),t(e.Alert,"infoStandardBg",a.private_safeLighten(e.info.light,.9)),t(e.Alert,"successStandardBg",a.private_safeLighten(e.success.light,.9)),t(e.Alert,"warningStandardBg",a.private_safeLighten(e.warning.light,.9)),t(e.Alert,"errorIconColor",u("palette-error-main")),t(e.Alert,"infoIconColor",u("palette-info-main")),t(e.Alert,"successIconColor",u("palette-success-main")),t(e.Alert,"warningIconColor",u("palette-warning-main")),t(e.AppBar,"defaultBg",u("palette-grey-100")),t(e.Avatar,"defaultBg",u("palette-grey-400")),t(e.Button,"inheritContainedBg",u("palette-grey-300")),t(e.Button,"inheritContainedHoverBg",u("palette-grey-A100")),t(e.Chip,"defaultBorder",u("palette-grey-400")),t(e.Chip,"defaultAvatarColor",u("palette-grey-700")),t(e.Chip,"defaultIconColor",u("palette-grey-700")),t(e.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),t(e.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),t(e.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),t(e.LinearProgress,"primaryBg",a.private_safeLighten(e.primary.main,.62)),t(e.LinearProgress,"secondaryBg",a.private_safeLighten(e.secondary.main,.62)),t(e.LinearProgress,"errorBg",a.private_safeLighten(e.error.main,.62)),t(e.LinearProgress,"infoBg",a.private_safeLighten(e.info.main,.62)),t(e.LinearProgress,"successBg",a.private_safeLighten(e.success.main,.62)),t(e.LinearProgress,"warningBg",a.private_safeLighten(e.warning.main,.62)),t(e.Skeleton,"bg",`rgba(${u("palette-text-primaryChannel")} / 0.11)`),t(e.Slider,"primaryTrack",a.private_safeLighten(e.primary.main,.62)),t(e.Slider,"secondaryTrack",a.private_safeLighten(e.secondary.main,.62)),t(e.Slider,"errorTrack",a.private_safeLighten(e.error.main,.62)),t(e.Slider,"infoTrack",a.private_safeLighten(e.info.main,.62)),t(e.Slider,"successTrack",a.private_safeLighten(e.success.main,.62)),t(e.Slider,"warningTrack",a.private_safeLighten(e.warning.main,.62));const p=a.private_safeEmphasize(e.background.default,.8);t(e.SnackbarContent,"bg",p),t(e.SnackbarContent,"color",I(()=>k.getContrastText(p))),t(e.SpeedDialAction,"fabHoverBg",a.private_safeEmphasize(e.background.paper,.15)),t(e.StepConnector,"border",u("palette-grey-400")),t(e.StepContent,"border",u("palette-grey-400")),t(e.Switch,"defaultColor",u("palette-common-white")),t(e.Switch,"defaultDisabledColor",u("palette-grey-100")),t(e.Switch,"primaryDisabledColor",a.private_safeLighten(e.primary.main,.62)),t(e.Switch,"secondaryDisabledColor",a.private_safeLighten(e.secondary.main,.62)),t(e.Switch,"errorDisabledColor",a.private_safeLighten(e.error.main,.62)),t(e.Switch,"infoDisabledColor",a.private_safeLighten(e.info.main,.62)),t(e.Switch,"successDisabledColor",a.private_safeLighten(e.success.main,.62)),t(e.Switch,"warningDisabledColor",a.private_safeLighten(e.warning.main,.62)),t(e.TableCell,"border",a.private_safeLighten(a.private_safeAlpha(e.divider,1),.88)),t(e.Tooltip,"bg",a.private_safeAlpha(e.grey[700],.92))}else{t(e.Alert,"errorColor",a.private_safeLighten(e.error.light,.6)),t(e.Alert,"infoColor",a.private_safeLighten(e.info.light,.6)),t(e.Alert,"successColor",a.private_safeLighten(e.success.light,.6)),t(e.Alert,"warningColor",a.private_safeLighten(e.warning.light,.6)),t(e.Alert,"errorFilledBg",u("palette-error-dark")),t(e.Alert,"infoFilledBg",u("palette-info-dark")),t(e.Alert,"successFilledBg",u("palette-success-dark")),t(e.Alert,"warningFilledBg",u("palette-warning-dark")),t(e.Alert,"errorFilledColor",I(()=>h.getContrastText(e.error.dark))),t(e.Alert,"infoFilledColor",I(()=>h.getContrastText(e.info.dark))),t(e.Alert,"successFilledColor",I(()=>h.getContrastText(e.success.dark))),t(e.Alert,"warningFilledColor",I(()=>h.getContrastText(e.warning.dark))),t(e.Alert,"errorStandardBg",a.private_safeDarken(e.error.light,.9)),t(e.Alert,"infoStandardBg",a.private_safeDarken(e.info.light,.9)),t(e.Alert,"successStandardBg",a.private_safeDarken(e.success.light,.9)),t(e.Alert,"warningStandardBg",a.private_safeDarken(e.warning.light,.9)),t(e.Alert,"errorIconColor",u("palette-error-main")),t(e.Alert,"infoIconColor",u("palette-info-main")),t(e.Alert,"successIconColor",u("palette-success-main")),t(e.Alert,"warningIconColor",u("palette-warning-main")),t(e.AppBar,"defaultBg",u("palette-grey-900")),t(e.AppBar,"darkBg",u("palette-background-paper")),t(e.AppBar,"darkColor",u("palette-text-primary")),t(e.Avatar,"defaultBg",u("palette-grey-600")),t(e.Button,"inheritContainedBg",u("palette-grey-800")),t(e.Button,"inheritContainedHoverBg",u("palette-grey-700")),t(e.Chip,"defaultBorder",u("palette-grey-700")),t(e.Chip,"defaultAvatarColor",u("palette-grey-300")),t(e.Chip,"defaultIconColor",u("palette-grey-300")),t(e.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),t(e.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),t(e.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),t(e.LinearProgress,"primaryBg",a.private_safeDarken(e.primary.main,.5)),t(e.LinearProgress,"secondaryBg",a.private_safeDarken(e.secondary.main,.5)),t(e.LinearProgress,"errorBg",a.private_safeDarken(e.error.main,.5)),t(e.LinearProgress,"infoBg",a.private_safeDarken(e.info.main,.5)),t(e.LinearProgress,"successBg",a.private_safeDarken(e.success.main,.5)),t(e.LinearProgress,"warningBg",a.private_safeDarken(e.warning.main,.5)),t(e.Skeleton,"bg",`rgba(${u("palette-text-primaryChannel")} / 0.13)`),t(e.Slider,"primaryTrack",a.private_safeDarken(e.primary.main,.5)),t(e.Slider,"secondaryTrack",a.private_safeDarken(e.secondary.main,.5)),t(e.Slider,"errorTrack",a.private_safeDarken(e.error.main,.5)),t(e.Slider,"infoTrack",a.private_safeDarken(e.info.main,.5)),t(e.Slider,"successTrack",a.private_safeDarken(e.success.main,.5)),t(e.Slider,"warningTrack",a.private_safeDarken(e.warning.main,.5));const p=a.private_safeEmphasize(e.background.default,.98);t(e.SnackbarContent,"bg",p),t(e.SnackbarContent,"color",I(()=>h.getContrastText(p))),t(e.SpeedDialAction,"fabHoverBg",a.private_safeEmphasize(e.background.paper,.15)),t(e.StepConnector,"border",u("palette-grey-600")),t(e.StepContent,"border",u("palette-grey-600")),t(e.Switch,"defaultColor",u("palette-grey-300")),t(e.Switch,"defaultDisabledColor",u("palette-grey-600")),t(e.Switch,"primaryDisabledColor",a.private_safeDarken(e.primary.main,.55)),t(e.Switch,"secondaryDisabledColor",a.private_safeDarken(e.secondary.main,.55)),t(e.Switch,"errorDisabledColor",a.private_safeDarken(e.error.main,.55)),t(e.Switch,"infoDisabledColor",a.private_safeDarken(e.info.main,.55)),t(e.Switch,"successDisabledColor",a.private_safeDarken(e.success.main,.55)),t(e.Switch,"warningDisabledColor",a.private_safeDarken(e.warning.main,.55)),t(e.TableCell,"border",a.private_safeDarken(a.private_safeAlpha(e.divider,1),.68)),t(e.Tooltip,"bg",a.private_safeAlpha(e.grey[700],.92))}F(e.background,"default"),F(e.background,"paper"),F(e.common,"background"),F(e.common,"onBackground"),F(e,"divider"),Object.keys(e).forEach(p=>{const _=e[p];_&&typeof _=="object"&&(_.main&&t(e[p],"mainChannel",a.private_safeColorChannel(W(_.main))),_.light&&t(e[p],"lightChannel",a.private_safeColorChannel(W(_.light))),_.dark&&t(e[p],"darkChannel",a.private_safeColorChannel(W(_.dark))),_.contrastText&&t(e[p],"contrastTextChannel",a.private_safeColorChannel(W(_.contrastText))),p==="text"&&(F(e[p],"primary"),F(e[p],"secondary")),p==="action"&&(_.active&&F(e[p],"active"),_.selected&&F(e[p],"selected")))})}),c=o.reduce((B,e)=>R(B,e),c);const g={prefix:S,shouldSkipGeneratingVar:b},{vars:w,generateCssVars:L}=wt(c,g);return c.vars=w,c.generateCssVars=L,c.shouldSkipGeneratingVar=b,c.unstable_sxConfig=C({},Xe,A==null?void 0:A.unstable_sxConfig),c.unstable_sx=function(e){return Le({sx:e,theme:this})},c}const Et=r=>[...[...Array(24)].map((o,n)=>`--${r?`${r}-`:""}overlays-${n+1}`),`--${r?`${r}-`:""}palette-AppBar-darkBg`,`--${r?`${r}-`:""}palette-AppBar-darkColor`],G={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},It=Bt(),{CssVarsProvider:Ot,useColorScheme:Gt,getInitColorSchemeScript:Mt}=St({themeId:et,theme:It,attribute:G.attribute,colorSchemeStorageKey:G.colorSchemeStorageKey,modeStorageKey:G.modeStorageKey,defaultColorScheme:{light:G.defaultLightColorScheme,dark:G.defaultDarkColorScheme},resolveTheme:r=>{const o=C({},r,{typography:tt(r.palette,r.typography)});return o.unstable_sx=function(i){return Le({sx:i,theme:this})},o},excludeVariablesFromRoot:Et}),Wt=Mt;export{Ot as C,at as G,ut as T,Et as a,Bt as e,Wt as g,Tt as s,Gt as u};
@@ -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-CaYG210l.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-Dc1jVnMf.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-DC5YSqzl.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-DfxDdXux.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 @@
1
+ import{a as D,u as O,r as n,j as e}from"./react-yytiy0wi.js";import{a as K,t as s,d as Y,u as $,b as g,k as d,D as R,x as A,C as q,r as Q}from"./index-CAAtcdsn.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as W}from"./cart-checkout-BCBPBbFe.js";import{u as z,p as J,c as X,i as ee}from"./useCreditPacks-jF-_aYkt.js";import{C as se}from"./CircularProgress-pGkqbXc8.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";const x="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/assets/pack-chips--HnOpf5U.webp",te="https://cdn.decentraland.org/@dcl/shop/0.1.0-29820418604.commit-45fc148/assets/credit-coin-CmcTCd5i.webp",re="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",ce="data:image/svg+xml,%3csvg%20width='61'%20height='61'%20viewBox='0%200%2061%2061'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M30.5%2061C47.3447%2061%2061%2047.3447%2061%2030.5C61%2013.6553%2047.3447%200%2030.5%200C13.6553%200%200%2013.6553%200%2030.5C0%2047.3447%2013.6553%2061%2030.5%2061Z'%20fill='url(%23gc_paint0)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.2001%2054.8997C17.2935%2058.7274%2023.6375%2060.9997%2030.5%2060.9997C37.3625%2060.9997%2043.7065%2058.7274%2048.8%2054.8997H12.2001Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.10013%2048.7997C7.83863%2051.1024%209.89738%2053.1612%2012.2001%2054.8997H48.8001C51.1029%2053.1612%2053.1616%2051.1024%2054.9001%2048.7997H6.10013Z'%20fill='%23FFA25A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2042.6998H2.5468C3.4923%2044.8805%204.69705%2046.924%206.10005%2048.7997H40.9311V42.6998H40.9158Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6094%2019.8247V42.6997H40.6719L21.6094%2019.8247Z'%20fill='url(%23gc_paint1)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.5468%2042.6997H21.6093V19.8248L2.5468%2042.6997Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2032.025V48.8H54.9L40.9158%2032.025Z'%20fill='url(%23gc_paint2)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9467%2048.8H40.9157V32.025L26.9467%2048.8Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2027.4497C45.127%2027.4497%2048.5408%2024.0359%2048.5408%2019.8247C48.5408%2015.6136%2045.127%2012.1998%2040.9158%2012.1998C36.7046%2012.1998%2033.2908%2015.6136%2033.2908%2019.8247C33.2908%2024.0359%2036.7046%2027.4497%2040.9158%2027.4497Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6092%2015.2497C23.7148%2015.2497%2025.4217%2013.5428%2025.4217%2011.4372C25.4217%209.33166%2023.7148%207.62475%2021.6092%207.62475C19.5036%207.62475%2017.7967%209.33166%2017.7967%2011.4372C17.7967%2013.5428%2019.5036%2015.2497%2021.6092%2015.2497Z'%20fill='%23FFC95B'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='gc_paint0'%20x1='30.5'%20y1='-12.6335'%20x2='-12.6335'%20y2='30.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint1'%20x1='21.6029'%20y1='19.8247'%20x2='21.6029'%20y2='42.6997'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint2'%20x1='40.9111'%20y1='32.025'%20x2='40.9111'%20y2='48.8'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",C=ee()?"mock":"stripe",ae={pack_5:x,pack_10:x,pack_25:x,pack_50:x},ie="https://docs.decentraland.org";function P(o){const r=o;if((r==null?void 0:r.name)==="AbortError")return s("getCredits.errorCanceled");const p=((r==null?void 0:r.message)??"").toLowerCase();return p.includes("sign in")?s("getCredits.errorSignIn",{currency:d.name}):p.includes("timed out")?s("getCredits.errorTimeout",{currency:d.name}):s("getCredits.errorGeneric")}function xe(){K({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const o=D(),{session:r,signIn:p}=Y(),i=$(),[j,w]=O(),{packs:H,isLoading:I}=z(),[m,l]=n.useState("select"),[a,S]=n.useState(null),[F,B]=n.useState(null),[U,h]=n.useState(null),[Z,v]=n.useState(!1),k=n.useRef(null);n.useEffect(()=>()=>{var t;return(t=k.current)==null?void 0:t.abort()},[]);const E=n.useCallback(()=>{w(t=>{const c=new URLSearchParams(t);return c.delete("order"),c.delete("canceled"),c},{replace:!0})},[w]),N=n.useCallback(async t=>{l("processing");const c=new AbortController;k.current=c;try{const u=await J(t,{signal:c.signal,address:r==null?void 0:r.address,identity:r==null?void 0:r.identity});if(u.status==="credited"){const f=u.creditsGranted??(a==null?void 0:a.credits)??0;B(f>0?f:null),l("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(a==null?void 0:a.usd)??null,credits:f>0?f:null,provider:C}),i.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(W)){o("/cart",{state:{resumeCheckout:!0}});return}}catch{}try{const L=sessionStorage.getItem(G);if(L){sessionStorage.removeItem(G);const _=JSON.parse(L),M=_.tokenId??_.itemId;if(_.contractAddress&&M){o(`/item/${_.contractAddress}/${M}`,{state:{item:_,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(a==null?void 0:a.usd)??null}),i.invalidateQueries({queryKey:["usd-balance"]}),l("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(a==null?void 0:a.usd)??null}),h(u.error??s("getCredits.errorGrant",{currency:d.name})),l("error"))}catch(u){R(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:A(u),pack_usd:(a==null?void 0:a.usd)??null}),h(P(u)),l("error")}},[a,r,i,o]),T=n.useCallback(async t=>{if(!r){p();return}h(null),v(!1),S(t),l(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:C});try{const c=await X(t.id,{address:r.address,identity:r.identity});if(c.mock)N(c.orderId);else if(c.url)g("Shop Redirected To Stripe",{order_id:c.orderId,pack_usd:t.usd,credits:t.credits}),window.location.href=c.url;else throw new Error("Checkout did not return a redirect url")}catch(c){R(c,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:A(c),pack_usd:t.usd}),h(P(c)),l("error")}},[r,p,N]),y=n.useRef(!1);n.useEffect(()=>{if(y.current)return;const t=j.get("order");if(j.get("canceled")!=null){y.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:C}),E(),v(!0),l("select");return}t&&(l("processing"),r&&(y.current=!0,E(),N(t)))},[j,r]);function b(){var t;(t=k.current)==null||t.abort(),l("select"),S(null),B(null),h(null),v(!1)}const V=m==="select";return e.jsxs("div",{className:"getcredits",children:[V&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:s("getCredits.title",{currency:d.name})}),e.jsxs("p",{className:"getcredits__sub",children:[s("getCredits.subtitle",{currency:d.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ie,target:"_blank",rel:"noreferrer",children:[s("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),m==="select"&&e.jsxs(e.Fragment,{children:[Z&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:s("getCredits.canceledNote")}),e.jsx(ne,{packs:H,loading:I,onSelect:t=>void T(t)})]}),m==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(se,{size:32}),e.jsx("p",{className:"muted",children:s("getCredits.redirecting")})]}),m==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:ce,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:s("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),m==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:re,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:s("getCredits.successTitle")})," ",s("getCredits.successBody",{currency:d.name})]})]}),F!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:te,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(q,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:F,currency:d.name})})," ",e.jsx("span",{className:"gc-credits__added",children:s("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:b,children:s("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")})]})]}),m==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.pendingTitle",{currency:d.name})}),e.jsx("p",{className:"muted",children:s("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:b,children:s("getCredits.done")})]})]}),m==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:U}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:b,children:s("getCredits.tryAgain")})})]})]})}function ne({packs:o,loading:r,onSelect:p}){return r?e.jsx("div",{className:"packs","aria-busy":"true","aria-label":s("getCredits.packsLoading",{currency:d.name}),children:[0,1,2,3].map(i=>e.jsx("div",{className:"pack pack--skeleton","aria-hidden":!0,children:e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"skeleton pack__label-sk"}),e.jsx("span",{className:"skeleton pack__art-sk"}),e.jsx("span",{className:"skeleton pack__cta-sk"})]})},i))}):e.jsx("div",{className:"packs",children:o.map(i=>e.jsxs("button",{type:"button",className:`pack${i.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>p(i),"aria-label":s("getCredits.packAria",{amount:Q(i.credits),usd:i.usd}),children:[i.bestValue&&e.jsx("span",{className:"pack__badge",children:s("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:s("getCredits.creditsAmount",{credits:i.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ae[i.id]??x,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",i.usd.toFixed(2)]})})]})]},i.id))})}export{xe as GetCredits,xe as default};
@@ -1,4 +1,4 @@
1
- import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-VhulZp0_.js";import{d as g,r as v}from"./index-Dc1jVnMf.js";import{C as c}from"./ConstantsUtil-BbIzv5xN.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-CaYG210l.js";import{au as y}from"./NetworkUtil-CLSFaUe_.js";const b=g`
1
+ import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-B2q3D1lR.js";import{d as g,r as v}from"./index-DfxDdXux.js";import{C as c}from"./ConstantsUtil-BbIzv5xN.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-DC5YSqzl.js";import{au as y}from"./NetworkUtil-CLSFaUe_.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{a as K,r as u,j as e,L as B}from"./react-yytiy0wi.js";import{t as s,k as w,B as k,C as L,b as $,D as A,a as P,d as U,u as W,g as O,s as Q,a7 as z}from"./index-d4x-ttpO.js";import{i as D,R as Y,f as G}from"./import-C7kEB_S5.js";import{s as H}from"./wallet-kind-B9P1TeIH.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./buy-BPkraJ17.js";import"./trade-encoding-cvcruSuW.js";import"./index-HN6Rk25C.js";import"./mana-rate-BWFOkvpC.js";function J({queue:n,session:T,onClose:j,onDone:h}){const N=K(),d=H(T.providerType),[m,f]=u.useState(()=>n.map(()=>"pending")),[I,M]=u.useState("running"),S=u.useRef(!1);u.useEffect(()=>{if(S.current)return;S.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(p=>p.map((g,o)=>o===r?"active":g));try{await D(n[r].item,n[r].priceCredits,T),$("Shop Migrated Listing",{item_id:n[r].item.itemId??n[r].item.oldTradeId??null,contract_address:n[r].item.contractAddress,new_price_credits:n[r].priceCredits,new_price_usd:n[r].priceCredits/10}),t||f(p=>p.map((g,o)=>o===r?"done":g))}catch(p){if(p instanceof Y)A(p,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((o,b)=>b===r?"unlisted":o));else{const g=p,o=g.code===4001||/reject|denied|cancel/i.test(g.message??"");o||A(p,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?o?"skipped":"failed":a))}}}t||M("finished")})(),()=>{t=!0}},[]);const _=m.filter(t=>t==="done").length,v=m.findIndex(t=>t==="active"),x=Math.round(m.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function y(){h(),j()}if(I==="finished"){const t=m.filter(r=>r==="skipped"||r==="failed").length,c=m.filter(r=>r==="unlisted").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:_>0?s("migrate.successTitle"):s("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[_>0?s("migrate.listedSummary",{count:_,currency:w.name}):s("migrate.noneListed"),t>0?" "+s("migrate.skippedSummary",{count:t}):"",c>0?" "+s("migrate.unlistedSummary",{count:c}):""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(k,{variant:"ghost",onClick:y,children:s("getCredits.done")}),c>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/assets")},children:s("migrate.viewInShop")}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate","data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:s("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[d?s("migrate.subConfirm"):s("migrate.subManaged")," ",v>=0?s("migrate.progressCount",{current:v+1,total:n.length}):""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${x}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((t,c)=>e.jsxs("li",{className:`migrate__row migrate__row--${m[c]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||s("migrate.itemFallback")}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(L,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:m[c]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",d?s("migrate.statusConfirm"):s("migrate.statusAdding")]}):m[c]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):m[c]==="skipped"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusSkipped")}):m[c]==="failed"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusFailed")}):m[c]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:s("migrate.unlistedTooltip"),children:s("migrate.statusUnlisted")}):e.jsx("span",{className:"migrate__wait",children:s("migrate.statusWaiting")})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:d?s("migrate.hintConfirm"):s("migrate.hintManaged")})]})})}const F=Q(k)`
1
+ import{a as K,r as u,j as e,L as B}from"./react-yytiy0wi.js";import{t as s,k as w,B as k,C as L,b as $,D as A,a as P,d as U,u as W,g as O,s as Q,a5 as z}from"./index-CAAtcdsn.js";import{i as D,R as Y,f as G}from"./import-Dnrd3Gn7.js";import{s as H}from"./wallet-kind-B9P1TeIH.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./buy-D-vBFkG6.js";import"./trade-encoding-Dr2besxr.js";import"./index-HN6Rk25C.js";import"./mana-rate-B9WM_wra.js";function J({queue:n,session:T,onClose:j,onDone:h}){const N=K(),d=H(T.providerType),[m,f]=u.useState(()=>n.map(()=>"pending")),[I,M]=u.useState("running"),S=u.useRef(!1);u.useEffect(()=>{if(S.current)return;S.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(p=>p.map((g,o)=>o===r?"active":g));try{await D(n[r].item,n[r].priceCredits,T),$("Shop Migrated Listing",{item_id:n[r].item.itemId??n[r].item.oldTradeId??null,contract_address:n[r].item.contractAddress,new_price_credits:n[r].priceCredits,new_price_usd:n[r].priceCredits/10}),t||f(p=>p.map((g,o)=>o===r?"done":g))}catch(p){if(p instanceof Y)A(p,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((o,b)=>b===r?"unlisted":o));else{const g=p,o=g.code===4001||/reject|denied|cancel/i.test(g.message??"");o||A(p,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?o?"skipped":"failed":a))}}}t||M("finished")})(),()=>{t=!0}},[]);const _=m.filter(t=>t==="done").length,v=m.findIndex(t=>t==="active"),x=Math.round(m.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function y(){h(),j()}if(I==="finished"){const t=m.filter(r=>r==="skipped"||r==="failed").length,c=m.filter(r=>r==="unlisted").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:_>0?s("migrate.successTitle"):s("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[_>0?s("migrate.listedSummary",{count:_,currency:w.name}):s("migrate.noneListed"),t>0?" "+s("migrate.skippedSummary",{count:t}):"",c>0?" "+s("migrate.unlistedSummary",{count:c}):""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(k,{variant:"ghost",onClick:y,children:s("getCredits.done")}),c>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/assets")},children:s("migrate.viewInShop")}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate","data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:s("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[d?s("migrate.subConfirm"):s("migrate.subManaged")," ",v>=0?s("migrate.progressCount",{current:v+1,total:n.length}):""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${x}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((t,c)=>e.jsxs("li",{className:`migrate__row migrate__row--${m[c]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||s("migrate.itemFallback")}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(L,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:m[c]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",d?s("migrate.statusConfirm"):s("migrate.statusAdding")]}):m[c]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):m[c]==="skipped"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusSkipped")}):m[c]==="failed"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusFailed")}):m[c]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:s("migrate.unlistedTooltip"),children:s("migrate.statusUnlisted")}):e.jsx("span",{className:"migrate__wait",children:s("migrate.statusWaiting")})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:d?s("migrate.hintConfirm"):s("migrate.hintManaged")})]})})}const F=Q(k)`
2
2
  margin-top: 10px;
3
3
  `,V=Q(k)`
4
4
  padding: 13px 24px;