@dcl/shop 0.1.0-29931880276.commit-39a954b → 0.1.0-29941568358.commit-de47e56
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.
- package/assets/{AnimatedBackground-xIwScd64.js → AnimatedBackground-cMeJUDnS.js} +3 -3
- package/assets/{Assets-DzhUMOjU.js → Assets-D4bmQvg2.js} +11 -11
- package/assets/{Assets.styles-BF1K0Jbw.js → Assets.styles-JIZQe0rQ.js} +33 -19
- package/assets/Authorizations-Bxum5Ckz.js +163 -0
- package/assets/Cart-pFVN5ROM.js +3 -0
- package/assets/{CircularProgress-D7exEomy.js → CircularProgress-DVvK_YYJ.js} +3 -3
- package/assets/{Collection-GqEK3_zk.js → Collection-CCeBHPqN.js} +1 -1
- package/assets/{CollectionCarousel-C7O5o-Tv.js → CollectionCarousel-CfEwak3h.js} +1 -1
- package/assets/{ContentClient-BjQkITL0.js → ContentClient-DWUTshFt.js} +1 -1
- package/assets/{Creator-Clylca_l.js → Creator-DyLgE_Lq.js} +1 -1
- package/assets/{CssVarsProvider-CboyQkKy.js → CssVarsProvider-CaTQjQty.js} +3 -3
- package/assets/{DeploymentBuilder-D-b1kMax.js → DeploymentBuilder-BeZK0qfR.js} +1 -1
- package/assets/{ExchangeController-DmlCZsSW.js → ExchangeController-ZePEIh3m.js} +1 -1
- package/assets/{GetCredits-D-SU9u6H.js → GetCredits-BcaMNIRG.js} +1 -1
- package/assets/{HelpersUtil-BRd8Wboc.js → HelpersUtil-CRTK_83W.js} +1 -1
- package/assets/{ImportListings-HESYhm4w.js → ImportListings-9YfzHduB.js} +2 -2
- package/assets/ItemDetail-BSqp8w-l.js +78 -0
- package/assets/{LoadMore-DehCeiiw.js → LoadMore-BK9c312B.js} +1 -1
- package/assets/{MarketCheckout-JtWPjxr4.js → MarketCheckout-BxM5rUvM.js} +1 -1
- package/assets/{MyAssets-xIy0Iu3r.js → MyAssets-BA5zCiVR.js} +2 -2
- package/assets/{MyFavorites-CzDX3Blr.js → MyFavorites-DWjt5m8Z.js} +1 -1
- package/assets/{MyPurchases-Bi8MSD7t.js → MyPurchases--MUfwO_U.js} +5 -5
- package/assets/{NotFound-93qdZPW6.js → NotFound-DVZ9W5Hr.js} +1 -1
- package/assets/PrimaryListModal-CQHoY5iG.js +1 -0
- package/assets/{StoreSettings-BSsFAKLn.js → StoreSettings-CpeZPPkb.js} +2 -2
- package/assets/{Success-ClYYwwKU.js → Success-CxrAGNmd.js} +3 -3
- package/assets/{SwapController-BQwxN-hZ.js → SwapController-BH4rWo6P.js} +1 -1
- package/assets/{Tooltip-DvkMJN9a.js → Tooltip-zazDSBbm.js} +1 -1
- package/assets/{TradeService-B-A7fi8q.js → TradeService-IuqYxWb8.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-Dj1XgPIq.js → W3MFrameProviderSingleton-CFGfbV9-.js} +3 -3
- package/assets/{WebCryptoP256-B7nDm7bV.js → WebCryptoP256-ByM1YcL4.js} +1 -1
- package/assets/authorizations-CsduRV0X.js +1 -0
- package/assets/{basic-DmwPxIIO.js → basic-BMJtBJ3f.js} +1 -1
- package/assets/{biconomy-BhaU-x0n.js → biconomy-WqxLiteU.js} +1 -1
- package/assets/buy-CN2rC9a0.js +1 -0
- package/assets/buy-gasless-iZXsoGZN.js +1 -0
- package/assets/{cart-checkout-CtsIeuCD.js → cart-checkout-CLMqKMCz.js} +1 -1
- package/assets/{categories-DOvsccJ3.js → categories-D7_Qudaw.js} +1 -1
- package/assets/{ccip-7QG8EGU2.js → ccip-Be5Dn1Zo.js} +1 -1
- package/assets/{ccip-DtXhpG-g.js → ccip-DLXgNS3N.js} +1 -1
- package/assets/collection-DbmjhyjW.js +1 -0
- package/assets/{controller-DkZ-Dz5-.js → controller-CDv5xjYs.js} +2 -2
- package/assets/{core-0HmbO-iH.js → core-B1vdvz8J.js} +4 -4
- package/assets/{custom-D-DeuiP6.js → custom-3-JWbHeB.js} +1 -1
- package/assets/{data-capture-CicifRfZ.js → data-capture-B9u0j-_M.js} +1 -1
- package/assets/{email-Dwf-6WA1.js → email-Bu0wLP5a.js} +1 -1
- package/assets/{embedded-wallet-DCPuLx8U.js → embedded-wallet-DALUv36Z.js} +1 -1
- package/assets/emotion-styled.browser.esm-rI_2ZiJm.js +1 -0
- package/assets/{engine-DpGff5Yu.js → engine-COZjF6GN.js} +1 -1
- package/assets/{errors-BR15RpBo.js → errors-BuvqNt2H.js} +1 -1
- package/assets/{estimate-l1-fee-B28SdcW0.js → estimate-l1-fee-y9SYh7nZ.js} +1 -1
- package/assets/{ethers-CeDRuWE-.js → ethers-Dpp9c5As.js} +1 -1
- package/assets/{execute-DCmpb9bW.js → execute-DVE3v1AF.js} +2 -2
- package/assets/{features-VE0_vWYT.js → features-CqkOcXXU.js} +1 -1
- package/assets/{fetchTokenMetadata-BAX-FhAK.js → fetchTokenMetadata-CZAPbDmS.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-BX24vsJU.js → get-ecosystem-wallet-info-CSMzgHAT.js} +1 -1
- package/assets/{getBalance-D4m2CI4L.js → getBalance-BawNMn6h.js} +1 -1
- package/assets/{getNFT-CIxfY1zw.js → getNFT-BnfoPCmO.js} +1 -1
- package/assets/{getNFT-cGXDfd4w.js → getNFT-yjjewJwo.js} +1 -1
- package/assets/{getOverlayAlpha-Bbwa0Id2.js → getOverlayAlpha-DAstUi74.js} +1 -1
- package/assets/{hashTypedData-DW9glqLV.js → hashTypedData-CKhs32SE.js} +1 -1
- package/assets/{hashTypedData-CuGYT3MD.js → hashTypedData-Cb3dj8Vj.js} +1 -1
- package/assets/import-D2QUSpyp.js +1 -0
- package/assets/{in-app-D6FFhYL8.js → in-app-Dy6198Ub.js} +1 -1
- package/assets/{in-app-wallet-calls--JWObqaU.js → in-app-wallet-calls-Df8xMcoL.js} +1 -1
- package/assets/{index-DnJZZYa0.js → index-4DPFDe86.js} +1 -1
- package/assets/{index-DVbGVOvy.js → index-85kWMWjg.js} +1 -1
- package/assets/{index-CJtIa-2G.js → index-B0SpA1TA.js} +1 -1
- package/assets/{index-DhJdnUKp.js → index-B4Jw07i3.js} +1 -1
- package/assets/{index-iErwYSN4.js → index-B83hIo9e.js} +1 -1
- package/assets/{index-B9YK8_ai.js → index-BCWp_6cV.js} +1 -1
- package/assets/{index-CEvq6ig8.js → index-BDN6djsw.js} +1 -1
- package/assets/{index-tXcpBNpH.js → index-BItUV6PM.js} +1 -1
- package/assets/{index-D68970iX.js → index-BIulqLQL.js} +1 -1
- package/assets/{index-CuHvb1dG.js → index-BPKqBTdV.js} +1 -1
- package/assets/{index-Bzu2ISZD.js → index-BRKyx7oU.js} +2 -2
- package/assets/{index-Ccb6psTR.js → index-BRNsIe3m.js} +1 -1
- package/assets/{index-Cw8VkaQM.js → index-BcuysZka.js} +1 -1
- package/assets/{index-Cx_FuvLh.js → index-BhfJUYAQ.js} +1 -1
- package/assets/{index-CaWRGHs2.js → index-Bi4zgWjQ.js} +2 -2
- package/assets/{index-gVFIc3Gf.js → index-BlBcCTXj.js} +1 -1
- package/assets/{index-Bn291VMX.js → index-BmlDboHr.js} +3 -3
- package/assets/{index-CJNQr62o.js → index-BsI3EWcy.js} +1 -1
- package/assets/{index-wkMH5x15.js → index-BzcxFNUz.js} +1 -1
- package/assets/{index-BY4sZyBS.js → index-C2-W1jZ1.js} +1 -1
- package/assets/{index-DwXbBOKz.js → index-C2ZtkYpB.js} +2 -2
- package/assets/{index-CJ8YWRNg.js → index-CEhWolV_.js} +1 -1
- package/assets/{index-BrDFuwwz.js → index-CIHaBruC.js} +1 -1
- package/assets/{index-BfKLBheW.js → index-CIfdS8Db.js} +1 -1
- package/assets/{index-Bdrkx_0l.js → index-CJRmkopy.js} +3 -3
- package/assets/{index-BprEr1Ly.js → index-CNpvozfL.js} +1 -1
- package/assets/{index-Dj-dQr5B.js → index-CPs7rZSr.js} +1 -1
- package/assets/{index-fBrY7bRL.js → index-CRSMETpm.js} +1 -1
- package/assets/{index-8vvLtURI.js → index-CXgtaw1w.js} +1 -1
- package/assets/{index-C_ZvSr7-.js → index-CaOpng6c.js} +1 -1
- package/assets/{index-Ci9NOZul.js → index-CbxN7Krq.js} +1 -1
- package/assets/{index-MVoUqF_G.js → index-Cnmgw5PF.js} +1 -1
- package/assets/{index-DaGkyRHK.js → index-Ct22HWuE.js} +1 -1
- package/assets/{index-DH2U2f22.js → index-Cz1Suly9.js} +1 -1
- package/assets/{index-3aaL8y7_.js → index-D0xvd_Dp.js} +2 -2
- package/assets/{index-CrqG2Pmp.js → index-D8me2ig5.js} +1 -1
- package/assets/{index-3BS3wmrm.js → index-DIGUl9iX.js} +1 -1
- package/assets/{index-AbU1f7V7.js → index-DIpMchso.js} +1 -1
- package/assets/{index-BWk0YlC1.js → index-DP9-yadx.js} +1 -1
- package/assets/{index-Dgvroxgs.js → index-DPTvpJzS.js} +1 -1
- package/assets/{index-CIAWDbLx.js → index-DPp2bhUs.js} +1 -1
- package/assets/{index-DtQgf-Kz.js → index-D_Osq35D.js} +1 -1
- package/assets/{index-C9vfzG8K.js → index-DgYBZU4A.js} +1 -1
- package/assets/{index-ctBIBolh.js → index-DlvbN_Av.js} +1 -1
- package/assets/{index-1lXRwbFZ.js → index-DoaLV6gK.js} +1 -1
- package/assets/{index-BdMt2ArB.js → index-DoxUiIoZ.js} +3 -3
- package/assets/{index-Drt6Trho.js → index-DtYBJNaS.js} +1 -1
- package/assets/{index-NHYbH9Q9.js → index-FFhK2B90.js} +1 -1
- package/assets/{index-HRn0zui-.js → index-HRvlJsjj.js} +1 -1
- package/assets/{index-Cn4BXJFK.js → index-Tfh0IyJl.js} +1 -1
- package/assets/{index-DcUSP1NZ.js → index-V0hMC6mZ.js} +28 -28
- package/assets/{index-CAp_8XyK.js → index-V1lpWoC-.js} +1 -1
- package/assets/{index-BKftXRbu.js → index-cA2ARKGJ.js} +1 -1
- package/assets/{index-DNk71Hf-.js → index-cjI3Jxw7.js} +1 -1
- package/assets/{index-BKhuX1Zk.js → index-kbFINusp.js} +1 -1
- package/assets/{index-AD8y2fos.js → index-rFCcyY0H.js} +1 -1
- package/assets/{index-B4MafS4f.js → index-sN6H-jhd.js} +1 -1
- package/assets/{index-BNGJhE6h.js → index-uTPBgRyq.js} +3 -3
- package/assets/{index.es-BkYyf3CC.js → index.es-BqAU2pak.js} +4 -4
- package/assets/{index.es-DkpPJT72.js → index.es-C7FJOZk9.js} +1 -1
- package/assets/{index.es-CSzCsCdX.js → index.es-DLc2fyYi.js} +1 -1
- package/assets/{localBatchGatewayRequest-DZtDtccC.js → localBatchGatewayRequest-aE453fG9.js} +1 -1
- package/assets/{mana-rate-CQXoYDgW.js → mana-rate-CFrZfrxV.js} +1 -1
- package/assets/{networks-DqRgQwei.js → networks-DYw-qqg1.js} +1 -1
- package/assets/{onramp-Dua2KqaL.js → onramp-Dv5XffT1.js} +1 -1
- package/assets/{openzeppelin-B5v-lnYu.js → openzeppelin-DY9zonpF.js} +1 -1
- package/assets/{parseNft-C_apsVdc.js → parseNft-BoqFzz1w.js} +2 -2
- package/assets/{parseSignature-vZe7fqAs.js → parseSignature-DLqUl44D.js} +1 -1
- package/assets/{parseSignature-BpJH_FE8.js → parseSignature-_8ci0C1c.js} +3 -3
- package/assets/{passkeys-OcN7qNpX.js → passkeys-9jKCllXJ.js} +1 -1
- package/assets/{pay-with-exchange-GQhZYq31.js → pay-with-exchange-q2w3TOV5.js} +1 -1
- package/assets/{qr-overlay-8TuM7lya.js → qr-overlay-kE0-Tb5Q.js} +1 -1
- package/assets/{receive-Ce9v7PbK.js → receive-BlDcpWqy.js} +1 -1
- package/assets/{resolveImplementation-CnyGjBjb.js → resolveImplementation-u5UN_seG.js} +1 -1
- package/assets/{rpc-C-8Z-khV.js → rpc-hzBSsIuq.js} +1 -1
- package/assets/{secp256k1-XWlToBxV.js → secp256k1-CIm5iUJu.js} +1 -1
- package/assets/{secp256k1-GS9coht8.js → secp256k1-D_XLFIAD.js} +1 -1
- package/assets/{secp256k1-CD5thO9M.js → secp256k1-DogjvjtS.js} +1 -1
- package/assets/{send-CTpoky5o.js → send-33Lvo35v.js} +1 -1
- package/assets/{send-batch-transaction-B3SkjaJd.js → send-batch-transaction-DxqLfBgo.js} +1 -1
- package/assets/{send-eip712-transaction-b2YwZsw6.js → send-eip712-transaction-BWi3gkm3.js} +2 -2
- package/assets/{send-gasless-transaction-DauMfM6n.js → send-gasless-transaction-CC-pEfDw.js} +2 -2
- package/assets/{send-transaction-CZpR2DTm.js → send-transaction-DN1HyeTa.js} +2 -2
- package/assets/{sendRawTransaction-DgxONikM.js → sendRawTransaction-DqtJOwfz.js} +3 -3
- package/assets/{serializeTransaction-Co5GcIEc.js → serializeTransaction-DOUpHqmp.js} +1 -1
- package/assets/{session-proposal-G8Yjn8ZD.js → session-proposal-BtkIO7cP.js} +1 -1
- package/assets/{session-request-DJdz6eXZ.js → session-request-lsymM3l6.js} +2 -2
- package/assets/{signing-4ZA6JTPf.js → signing-Bskb_x4I.js} +3 -3
- package/assets/{socials-DIMb8ZdT.js → socials-BrDjbXdD.js} +1 -1
- package/assets/{swaps-BNBy_8lk.js → swaps-BcWPrBSV.js} +1 -1
- package/assets/{thirdweb-B3zScHLY.js → thirdweb-Cpf8EN89.js} +3 -3
- package/assets/{to-serializable-transaction-D1abmMv3.js → to-serializable-transaction-gyjNAfk6.js} +2 -2
- package/assets/trade-encoding-vTSEXgN1.js +1 -0
- package/assets/{transactionReceipt-BpaL5a1n.js → transactionReceipt-Bum6hzjL.js} +1 -1
- package/assets/{transactions-DQ-Lv1I4.js → transactions-D-Z-vxC7.js} +1 -1
- package/assets/{useCreditPacks-FWq5J9OL.js → useCreditPacks-BJp5mEnq.js} +1 -1
- package/assets/{useInfiniteGrid-8ySZNn_a.js → useInfiniteGrid-COXciuKu.js} +1 -1
- package/assets/{useStore-BUhMTkWi.js → useStore-cTXMZhwG.js} +2 -2
- package/assets/useTheme-Cv3anIxV.js +1 -0
- package/assets/{useTheme-CX-2YuFt.js → useTheme-DmdtRbZb.js} +1 -1
- package/assets/{verifyHash-BxRMQYBh.js → verifyHash-DOsO5RNA.js} +1 -1
- package/assets/{w3m-modal-Bf0ntzho.js → w3m-modal-D1Pu_W_3.js} +1 -1
- package/assets/{w3m-modal-DOisJtvB.js → w3m-modal-oBw-UuhI.js} +1 -1
- package/assets/{wait-for-tx-receipt-CtkeURk6.js → wait-for-tx-receipt-BYt5Gcy_.js} +1 -1
- package/assets/{wallets-TN4SBaj9.js → wallets-uu9PjeR0.js} +5 -5
- package/assets/{web-connector-BoAILdPa.js → web-connector-Vwf5Urnw.js} +3 -3
- package/assets/{writeContract-NLcb9_dn.js → writeContract-iaip-T2H.js} +1 -1
- package/assets/{zoraTestnet-BoW5OfYU.js → zoraTestnet-EJHbKpn0.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Cart-w8N0Y0ya.js +0 -3
- package/assets/ItemDetail-NzttQaG_.js +0 -78
- package/assets/PrimaryListModal-D8flQ4s3.js +0 -1
- package/assets/buy-CG6T8PdF.js +0 -1
- package/assets/buy-gasless-D8VGUOmZ.js +0 -1
- package/assets/collection-D_arZ29c.js +0 -1
- package/assets/emotion-styled.browser.esm-BbfM-qS4.js +0 -1
- package/assets/import-NCiecwkp.js +0 -1
- package/assets/useTheme-DbMI5R67.js +0 -1
- package/assets/wallet-kind-BcpepgVH.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-BMZSDQJw.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
1
|
+
import{r as l,j as v}from"./react-BMZSDQJw.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29941568358.commit-de47e56/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29941568358.commit-de47e56/assets/DCL_LogoPattern-BryBPc3d.png",U=`
|
|
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
|
-
`,
|
|
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,
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import{u as Ke,r as p,j as e,a as
|
|
1
|
+
import{u as Ke,r as p,j as e,a as Je}from"./react-BMZSDQJw.js";import{c as F,o as Qe,k as Ze,a3 as Xe,s,y as t,g as Te,h as Ye,j as ze,am as Ie,J as et,t as o,I as z,l as B,n as pe,q as D,r as tt,v as nt,u as Ne,z as st,A as K,aA as ot,aB as it}from"./index-V0hMC6mZ.js";import{r as rt,a as at,m as Ae}from"./mana-rate-CFrZfrxV.js";import{u as _e,M as lt}from"./MarketCheckout-BxM5rUvM.js";import{g as ct,h as dt,i as ft,j as pt,k as ut,C as xt,l as ht,o as mt,m as gt,n as bt,M as yt}from"./Assets.styles-JIZQe0rQ.js";import{d as ue,R as wt,F as jt,S as xe,b as vt}from"./categories-D7_Qudaw.js";import{L as $t}from"./LoadMore-BK9c312B.js";import{u as Ct}from"./useInfiniteGrid-COXciuKu.js";import{E as kt}from"./ErrorNotice-DDr3KjIH.js";import{d as St}from"./dcl-schemas-BICTSpB5.js";import{u as Rt,G as Et,w as Tt,S as zt}from"./buy-gasless-iZXsoGZN.js";import{s as It}from"./buy-CN2rC9a0.js";import{h as Nt}from"./trade-encoding-vTSEXgN1.js";import{f as At}from"./errors-BuvqNt2H.js";import{J as _t,C as Pt,B as ne}from"./ethers-Dpp9c5As.js";import{l as Mt}from"./loader-logo-BzY9EKdC.js";import{n as Lt}from"./emotion-CSxEP8yM.js";import"./sentry-8SzFotJj.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./Tooltip-zazDSBbm.js";import"./authorizations-CsduRV0X.js";function J(n){const i=n.source??"item",f=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${i}:${f}`}const W="100000000000000000000",Pe=2,V=15,Bt=/^[a-zA-Z0-9]+$/;function he(n){const i=n.trim();return i.length===0?{ok:!1,reason:"empty"}:Bt.test(i)?i.length<Pe?{ok:!1,reason:"too-short"}:i.length>V?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Ft(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,V)}const Wt=["function available(string _subdomain) view returns (bool)"],me={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Ht(){return F.chainId===St.ChainId.MATIC_MAINNET?me.mainnet:me.sepolia}async function Ut(n,i={}){var d;const{rpc:f,address:u}=Ht(),l=new _t(f),c=new Pt(u,Wt,l);console.info(`[names] availability check → DCLRegistrar(${u}).available("${n}") on ${f}`);const x=await c.available(n);if((d=i.signal)!=null&&d.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${x}`),x?"available":"taken"}const Ot="https://app.across.to/api";class Me extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function qt(n){return at(W,n)}async function Gt(n,i,f={}){var d;const u=f.chainId??F.chainId,l=f.provider??"across",c=`${F.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${u}&provider=${l}`,x=await Xe(c,{method:"GET",identity:n,metadata:{}});if(!x.ok){let a;try{a=(d=await x.json())==null?void 0:d.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Me:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function Dt(n,i){const f=ne.from(n.availableAmount),l=ne.from(W).sub(f);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:Nt(n.id)}],creditsSignatures:[n.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:l.isNegative()?"0":l.toString(),maxCreditedValue:W}}async function Vt(n,i={}){const f=Ot,u=i.intervalMs??1e4,l=i.maxAttempts??60;let c={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<l;x++){try{const d=await fetch(`${f}/deposit/status?originChainId=137&depositTxHash=${n}`);if(d.ok){const a=await d.json(),m=(a.status??"pending").toLowerCase(),w=a.fillTx??a.fillTxnRef??null,y=a.actionsSucceeded!==!1;if(m==="filled")return{status:"filled",destinationTxHash:w,actionsSucceeded:y};if(m==="refunded"||m==="expired")return{status:m,destinationTxHash:null,actionsSucceeded:!1};c={status:"pending",destinationTxHash:w,actionsSucceeded:y}}}catch{}x<l-1&&await new Promise(d=>setTimeout(d,u))}return c}async function Kt(n){const{name:i,identity:f,signer:u}=n,l=n.chainId??F.chainId,c=n.provider??"across",x=(n.beneficiary??await u.getAddress()).toLowerCase();let d=null,a=!1;console.info("[names] register start",{name:i,buyer:x,chainId:l,provider:c});try{const m=await rt(l),w=qt(m);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:m});const y=await Gt(f,i,{chainId:l,provider:c});console.info("[names] step 2/6 route fetched",{target:y.externalCall.target,selector:y.externalCall.selector,provider:y.provider,quoteId:y.quoteId});const j=await Qe(f,w);if(d=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),ne.from(j.maxCreditedValue).lt(W))throw new Error("Credit under-sized for the name price");const C=Dt(j.credit,y);let h;try{h=await Rt({chainId:l,buyer:x,signer:u,args:C})}catch(b){if(!(b instanceof Et))throw b;h=await It(l,C,u)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:h}),await Tt(h),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:h}),c==="across"){const b=await Vt(h,n.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:h};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:h,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:h}}catch(m){if(console.error("[names] register failed — raw error:",m,{name:i,buyer:x,originConfirmed:a}),m instanceof zt)return{status:"pending",originTxHash:m.txHash};throw d&&!a&&await Ze(f,[d]).catch(()=>{}),m instanceof Me?m:new Error(At(m,"Couldn't register the name. Please try again.",{sale:!0}))}}const Jt=s.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -7,7 +7,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
7
7
|
justify-content: center;
|
|
8
8
|
padding: 16px;
|
|
9
9
|
background: rgba(22, 21, 24, 0.55);
|
|
10
|
-
`,
|
|
10
|
+
`,Qt=s.div`
|
|
11
11
|
width: 560px;
|
|
12
12
|
max-width: 100%;
|
|
13
13
|
max-height: 92vh;
|
|
@@ -127,7 +127,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
127
127
|
height: 22px;
|
|
128
128
|
color: ${t.colors.brandViolet};
|
|
129
129
|
}
|
|
130
|
-
`,
|
|
130
|
+
`,Zt=s.div`
|
|
131
131
|
margin-top: 16px;
|
|
132
132
|
padding: 16px;
|
|
133
133
|
border-radius: 12px;
|
|
@@ -186,7 +186,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
186
186
|
font-family: ${t.font.sans};
|
|
187
187
|
font-size: 16px;
|
|
188
188
|
color: ${t.colors.muted2};
|
|
189
|
-
`,
|
|
189
|
+
`,Ee=s.button`
|
|
190
190
|
margin-top: 16px;
|
|
191
191
|
width: 100%;
|
|
192
192
|
height: 52px;
|
|
@@ -366,7 +366,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
366
366
|
flex: none;
|
|
367
367
|
color: ${t.colors.dclRed};
|
|
368
368
|
}
|
|
369
|
-
`;function bn({name:n,priceCredits:i,onClose:f}){const{session:u}=
|
|
369
|
+
`;function bn({name:n,priceCredits:i,onClose:f}){const{session:u}=Te(),{data:l,isError:c}=Ye(u),x=ze(),d=Ke(),[a,m]=p.useState("confirm"),[w,y]=p.useState(""),[j,C]=p.useState(null),h=p.useRef(!1),b=w.trim().toLowerCase()===n.toLowerCase(),v=a==="completing",S=i!=null?Ie(i):"—";p.useEffect(()=>{const g=N=>{N.key==="Escape"&&!v&&f()};document.addEventListener("keydown",g);const H=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=H}},[v,f]);async function k(){if(!(!u||!b||h.current)){h.current=!0,m("completing"),C(null);try{await Kt({name:n,identity:u.identity,signer:u.signer}),D("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),x.invalidateQueries({queryKey:["usd-balance"]}),m("success")}catch(g){D(nt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:tt(g),purchase_type:"name"}),C((g==null?void 0:g.message)||o("names.errorGeneric")),m("error")}finally{h.current=!1}}}const I=a!=="success",R=et(u==null?void 0:u.providerType);return e.jsx(Jt,{onClick:v?void 0:f,role:"presentation",children:e.jsxs(Qt,{role:"dialog","aria-modal":"true","aria-label":o("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[I&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(be,{children:a==="error"?o("names.errorTitle"):o("names.buyTitle")}),e.jsx(ye,{onClick:f,disabled:v,"aria-label":o("buyModal.close"),children:e.jsx(z,{name:"close"})})]}),e.jsxs(we,{children:[o("names.myCreditsBalance")," ",e.jsx(B,{})," ",pe(l,c)]}),e.jsx(je,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ve,{children:[e.jsx($e,{"aria-hidden":!0,children:"@"}),e.jsxs(Ce,{children:[e.jsxs(ke,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Se,{children:o("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(B,{}),S]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(gn,{children:[e.jsx(z,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Ee,{onClick:()=>m("confirm"),children:o("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Zt,{children:[e.jsx(Xt,{children:o("names.confirmTitle")}),e.jsx(Yt,{dangerouslySetInnerHTML:{__html:o("names.confirmBody",{name:`<b>@${yn(n)}</b>`})}}),e.jsxs(en,{children:[e.jsx(tn,{"aria-hidden":!0,children:"@"}),e.jsx(nn,{value:w,onChange:g=>y(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":o("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(w.length,8)}ch`}}),e.jsx(sn,{children:".dcl.eth"})]})]}),e.jsx(Ee,{onClick:()=>void k(),disabled:!b||!u,children:o("names.buyCta")})]})]}),a==="completing"&&e.jsxs(on,{children:[e.jsx(rn,{src:Mt,alt:"",width:56,height:56}),e.jsx(an,{children:R?o("names.confirming"):o("names.completing")}),e.jsxs(ln,{children:[e.jsx(cn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(dn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(be,{children:o("names.successHeaderTitle")}),e.jsx(ye,{onClick:f,"aria-label":o("buyModal.close"),children:e.jsx(z,{name:"close"})})]}),e.jsxs(we,{children:[o("names.myCreditsBalance")," ",e.jsx(B,{})," ",pe(l,c)]}),e.jsx(je,{}),e.jsxs(fn,{children:[e.jsx(pn,{"aria-hidden":!0,children:e.jsx(z,{name:"check"})}),e.jsxs(un,{children:[e.jsx("b",{children:o("names.successBannerBold")})," ",o("names.successBannerRest")]})]}),e.jsxs(ve,{style:{marginTop:20},children:[e.jsx($e,{"aria-hidden":!0,children:"@"}),e.jsxs(Ce,{children:[e.jsxs(ke,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Se,{children:o("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(B,{}),S]})]}),e.jsxs(xn,{children:[e.jsx(hn,{onClick:()=>{f(),d("/my-assets")},children:o("names.myItems")}),e.jsx(mn,{href:F.profileUrl,target:"_blank",rel:"noopener noreferrer",children:o("names.assignToAvatar")})]})]})]})})}function yn(n){return n.replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i])}const wn=s.div`
|
|
370
370
|
width: 100%;
|
|
371
371
|
min-width: 0;
|
|
372
372
|
`,jn=s.nav`
|
|
@@ -441,7 +441,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
441
441
|
${t.media.down("mobile")} {
|
|
442
442
|
font-size: 26px;
|
|
443
443
|
}
|
|
444
|
-
`,
|
|
444
|
+
`,En=s.p`
|
|
445
445
|
margin: 0;
|
|
446
446
|
max-width: 760px;
|
|
447
447
|
font-family: ${t.font.sans};
|
|
@@ -453,12 +453,12 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
453
453
|
${t.media.down("mobile")} {
|
|
454
454
|
font-size: 16px;
|
|
455
455
|
}
|
|
456
|
-
`,
|
|
456
|
+
`,Tn=s.div`
|
|
457
457
|
width: min(785px, 100%);
|
|
458
458
|
display: flex;
|
|
459
459
|
flex-direction: column;
|
|
460
460
|
gap: 12px;
|
|
461
|
-
`,
|
|
461
|
+
`,zn=s.div`
|
|
462
462
|
position: relative;
|
|
463
463
|
`,In=s("div",Lt("invalid"))`
|
|
464
464
|
display: flex;
|
|
@@ -645,7 +645,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
645
645
|
width: 16px;
|
|
646
646
|
height: 16px;
|
|
647
647
|
}
|
|
648
|
-
`,
|
|
648
|
+
`,Q=s.div`
|
|
649
649
|
display: flex;
|
|
650
650
|
align-items: center;
|
|
651
651
|
gap: 8px;
|
|
@@ -695,7 +695,7 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
695
695
|
flex-direction: column;
|
|
696
696
|
gap: 24px;
|
|
697
697
|
}
|
|
698
|
-
`,
|
|
698
|
+
`,Z=s.article`
|
|
699
699
|
flex: 1 0 0;
|
|
700
700
|
min-width: 0;
|
|
701
701
|
display: flex;
|
|
@@ -755,4 +755,4 @@ import{u as Ke,r as p,j as e,a as Qe}from"./react-BMZSDQJw.js";import{c as F,o a
|
|
|
755
755
|
clip: rect(0, 0, 0, 0);
|
|
756
756
|
white-space: nowrap;
|
|
757
757
|
border: 0;
|
|
758
|
-
`,Kn="https://docs.decentraland.org/creator/worlds/about/";function
|
|
758
|
+
`,Kn="https://docs.decentraland.org/creator/worlds/about/";function Jn(n){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function Qn({onBack:n}){Ne({title:o("seo.names.title"),description:o("seo.names.description")});const{session:i,signIn:f}=Te(),{data:u}=_e(),l=u?Ae(W,u):null,[c,x]=p.useState(""),[d,a]=p.useState("idle"),[m,w]=p.useState(!1),y=p.useRef(null),[j,C]=p.useState(void 0);p.useLayoutEffect(()=>{y.current&&C(y.current.offsetWidth)},[c]),p.useEffect(()=>{if(!he(c).ok){a(c.length===0?"idle":"invalid");return}a("checking");const I=new AbortController,R=setTimeout(()=>{(async()=>{try{const g=await Ut(c,{signal:I.signal});a(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(R),I.abort()}},[c]);const h=he(c),b=h.ok&&(d==="available"||d==="error");function v(){if(b){if(!i){f();return}w(!0)}}const S=e.jsxs(e.Fragment,{children:[o("names.claim"),l!=null?e.jsxs(Hn,{children:[e.jsx(B,{}),Ie(l)]}):null]});return e.jsxs(wn,{"data-testid":"names-page",children:[e.jsxs(jn,{"aria-label":o("names.breadcrumbAria"),children:[e.jsx(vn,{onClick:n,children:o("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx($n,{children:o("names.breadcrumbCurrent")})]}),e.jsxs(Cn,{children:[e.jsxs(kn,{children:[e.jsxs(Sn,{children:[e.jsx(Rn,{children:o("names.heroTitle")}),e.jsx(En,{children:o("names.heroSubtitle")})]}),e.jsxs(Tn,{children:[e.jsxs(zn,{children:[e.jsxs(In,{invalid:d==="taken",children:[e.jsxs(Pn,{children:[e.jsx(Mn,{"aria-hidden":!0,children:"@"}),e.jsx(Ln,{value:c,onChange:k=>x(Ft(k.target.value)),placeholder:o("names.inputPlaceholder"),"aria-label":o("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:V,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Nn,{ref:y,"aria-hidden":!0,children:c||o("names.inputPlaceholder")}),e.jsx(Bn,{children:o("names.suffix")})]}),c.length>0?e.jsxs(Fn,{"aria-hidden":!0,children:[c.length,"/",V]}):null,e.jsx(Le,{onClick:v,disabled:!b,"data-testid":"names-claim",children:S})]}),d==="taken"?e.jsxs(An,{role:"status","data-testid":"names-taken",children:[e.jsx(z,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:o("names.taken")}),e.jsxs(_n,{href:Jn(c),target:"_blank",rel:"noopener noreferrer",children:[o("names.takenMakeOffer"),e.jsx(z,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Wn,{onClick:v,disabled:!b,children:S}),d==="checking"?e.jsx(Q,{tone:"muted",role:"status","data-testid":"names-checking",children:o("names.checking")}):d==="error"?e.jsx(Q,{tone:"muted",role:"status",children:o("names.checkError")}):d==="invalid"&&!h.ok&&h.reason==="too-short"?e.jsx(Q,{tone:"muted",role:"status",children:o("names.tooShort",{min:Pe})}):null,e.jsx(Vn,{role:"status","aria-live":"polite",children:d==="available"?o("names.available",{name:c}):""})]})]}),e.jsxs(Un,{children:[e.jsx(On,{children:o("names.whyTitle")}),e.jsxs(qn,{children:[e.jsxs(Z,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsx(Y,{children:e.jsx(ee,{children:o("names.why1")})})]}),e.jsxs(Z,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsxs(Y,{children:[e.jsx(ee,{children:o("names.why2")}),e.jsxs(Gn,{href:Kn,target:"_blank",rel:"noopener noreferrer",children:[o("names.why2Link"),e.jsx(z,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(X,{"aria-hidden":!0}),e.jsxs(Y,{children:[e.jsx(ee,{children:o("names.why3")}),e.jsx(Dn,{children:o("names.why3Link")})]})]})]})]})]}),m?e.jsx(bn,{name:c,priceCredits:l,onClose:()=>w(!1)}):null]})}const te=48;function Zn(n){return{tradeId:n.tradeId??n.id,listingType:"primary",contractAddress:n.contractAddress,itemId:n.itemId??"",name:n.name,thumbnail:n.thumbnail,rarity:n.rarity,category:n.category,wearableCategory:n.wearableCategory??null,creator:n.creator,manaWei:n.manaWei??"0",available:1,network:n.network,chainId:n.chainId,createdAt:0}}function ws(){const[n]=Je(),i=(n.get("q")??"").trim().toLowerCase(),f=ze(),u=(n.get("q")??"").trim();Ne({title:u?o("seo.collectibles.searchTitle",{query:u}):o("seo.collectibles.title"),description:o("seo.collectibles.description")});const[l,c]=p.useState("wearable"),[x,d]=p.useState(null),[a,m]=p.useState([]),[w,y]=p.useState(""),[j,C]=p.useState(""),[h,b]=p.useState("on_sale"),[v,S]=p.useState(!1),[k,I]=p.useState("newest"),[R,g]=p.useState(!1),[H,N]=p.useState(null);p.useEffect(()=>{if(!R)return;const r=L=>{L.key==="Escape"&&g(!1)};document.addEventListener("keydown",r);const $=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=$}},[R]);const U=h==="on_sale",A=w&&!Number.isNaN(Number(w))?Number(w):void 0,_=j&&!Number.isNaN(Number(j))?Number(j):void 0,se=x?vt[x]:void 0,oe=(ue.find(r=>r.key===k)??ue[0]).server,ie={category:l,rarities:a.length?a:void 0,wearableCategories:se,minPriceCredits:A,maxPriceCredits:_,search:i||void 0,sortBy:oe,isSmart:v||void 0,onSale:!0},re={category:l,rarities:a.length?a:void 0,wearableCategories:se,search:i||void 0,sortBy:oe,isWearableSmart:v||void 0,isOnSale:h==="not_for_sale"?!1:void 0},{items:P,total:ae,isLoading:E,isPlaceholderData:T,error:Be,hasNextPage:Fe,isFetchingNextPage:le,fetchNextPage:We}=Ct(U?["unified-listings",ie]:["catalog-items",re],r=>U?ot({...ie,first:te,skip:r}):it({...re,first:te,skip:r}),{enabled:l!=="names"}),O=ae,He=E||T,Ue=E?15:Math.min(Math.max(P.length,1),te),{data:q,isError:Oe}=_e(),qe=r=>q&&r.manaWei?Ae(r.manaWei,q):null,ce=p.useRef(null);p.useEffect(()=>{E||T||!i||ce.current===i||(ce.current=i,D("Shop Searched",{query:i,result_count:O}))},[i,E,T,O]);const G=p.useRef("__init__");p.useEffect(()=>{if(E||T)return;const r=JSON.stringify({category:l,subCategory:x,rarities:a,min:A,max:_,sort:k,status:h,smart:v});if(G.current==="__init__"||G.current===r){G.current=r;return}G.current=r,D("Shop Applied Filter",{filters:{category:l,sub_category:x,rarities:a,min_price_credits:A??null,max_price_credits:_??null,status:h,smart:v,sort:k},result_count:O})},[l,x,a,A,_,k,h,v,E,T,O]);function de(r){c(r),d(null)}function fe(r){m($=>$.includes(r)?$.filter(L=>L!==r):[...$,r])}function Ge(){c("wearable"),d(null),m([]),y(""),C(""),b("on_sale"),S(!1)}function De(r){const $=P.find(L=>L.id===r.id);$&&$.source==="legacy"&&$.manaWei&&N(Zn($))}function Ve(){f.invalidateQueries({queryKey:["unified-listings"]})}const M=[];(A!=null||_!=null)&&M.push({key:"price",label:o("filter.price"),onRemove:()=>{y(""),C("")}});for(const r of wt)a.includes(r)&&M.push({key:`rarity-${r}`,label:st(r),onRemove:()=>fe(r)});return v&&M.push({key:"smart",label:o("filter.smart"),onRemove:()=>S(!1)}),h!=="on_sale"&&M.push({key:"status",label:h==="all"?o("filter.statusAll"):o("filter.notForSale"),onRemove:()=>b("on_sale")}),e.jsxs(ct,{"data-testid":"browse",children:[l!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(dt,{onClick:()=>g(!1),"aria-hidden":!0}):null,e.jsxs(ft,{className:R?"is-open":"","data-testid":"browse-sidebar",children:[e.jsxs(pt,{children:[e.jsx(ut,{children:o("assets.filters")}),e.jsx(xt,{onClick:()=>g(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(ht,{children:e.jsx(mt,{category:l,subCategory:x,onCategory:de,onSub:d,priceMin:w,priceMax:j,onPriceMin:y,onPriceMax:C,rarities:a,onToggleRarity:fe,status:h,onStatus:b,smart:v,onSmart:S})}),e.jsx(gt,{children:e.jsx(bt,{type:"button",onClick:()=>g(!1),children:o("assets.showItems")})})]})]}),e.jsx(yt,{children:l==="names"?e.jsx(Qn,{onBack:()=>de("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(jt,{sort:k,onSort:I,total:ae,loading:E||T,query:i,onOpenFilters:()=>g(!0),chips:M,onClearChips:Ge}),Oe&&U&&P.some(r=>r.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:o("assets.marketUnavailable")}):null,Be?e.jsx(kt,{message:o("assets.loadError"),testId:"browse-error"}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:He?e.jsx(xe,{count:Ue}):e.jsxs(e.Fragment,{children:[P.map(r=>{if(!U)return e.jsx(K,{item:r,mode:"view"},J(r));const $=r;return $.source==="legacy"?e.jsx(K,{item:$,mode:"market",marketPriceCredits:qe($),onBuyNow:De},J(r)):e.jsx(K,{item:r},J(r))}),le?e.jsx(xe,{count:6}):null]})}),e.jsx($t,{hasNextPage:Fe,isFetching:le,onLoadMore:()=>void We()}),!E&&!T&&P.length===0?e.jsx("p",{className:"muted",children:o("assets.noItems")}):null]})}),H&&q?e.jsx(lt,{listing:H,rate:q,onClose:()=>N(null),onSold:()=>{N(null),Ve()}}):null]})}export{ws as Assets};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as $,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c as se}from"./categories-D7_Qudaw.js";import{T as ne}from"./Tooltip-zazDSBbm.js";import{y as e,s as o,I as u,t as n,z as re,C as v}from"./index-V0hMC6mZ.js";import{n as c}from"./emotion-CSxEP8yM.js";const ae=o.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -83,7 +83,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
83
83
|
`,ge=o.div`
|
|
84
84
|
overflow: hidden;
|
|
85
85
|
min-height: 0;
|
|
86
|
-
`,
|
|
86
|
+
`,ue=o.div`
|
|
87
87
|
display: flex;
|
|
88
88
|
align-items: flex-end;
|
|
89
89
|
justify-content: center;
|
|
@@ -113,7 +113,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
113
113
|
&:focus-within {
|
|
114
114
|
border-color: ${e.rarities.epic};
|
|
115
115
|
}
|
|
116
|
-
`,F=o(
|
|
116
|
+
`,F=o(u)`
|
|
117
117
|
width: 16px;
|
|
118
118
|
height: 16px;
|
|
119
119
|
color: ${e.colors.rarity};
|
|
@@ -135,7 +135,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
135
135
|
-webkit-appearance: none;
|
|
136
136
|
margin: 0;
|
|
137
137
|
}
|
|
138
|
-
`,
|
|
138
|
+
`,me=o.span`
|
|
139
139
|
padding-bottom: 12px;
|
|
140
140
|
color: ${e.colors.text};
|
|
141
141
|
font-family: ${e.font.sans};
|
|
@@ -196,23 +196,23 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
196
196
|
box-shadow: 0 1px 3px rgba(22, 21, 24, 0.25);
|
|
197
197
|
cursor: pointer;
|
|
198
198
|
}
|
|
199
|
-
|
|
199
|
+
`,ye=o.div`
|
|
200
200
|
display: flex;
|
|
201
201
|
align-items: center;
|
|
202
202
|
justify-content: space-between;
|
|
203
203
|
padding: 12px 4px 0;
|
|
204
|
-
`,
|
|
204
|
+
`,H=o.span`
|
|
205
205
|
display: inline-flex;
|
|
206
206
|
align-items: center;
|
|
207
207
|
gap: 2px;
|
|
208
208
|
font-family: ${e.font.sans};
|
|
209
209
|
font-size: 13px;
|
|
210
210
|
color: ${e.colors.text};
|
|
211
|
-
`,
|
|
211
|
+
`,D=o(u)`
|
|
212
212
|
width: 16px;
|
|
213
213
|
height: 16px;
|
|
214
214
|
color: ${e.colors.text};
|
|
215
|
-
|
|
215
|
+
`,$e=o.div`
|
|
216
216
|
display: flex;
|
|
217
217
|
flex-wrap: wrap;
|
|
218
218
|
gap: 12px;
|
|
@@ -245,7 +245,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
245
245
|
border-radius: 4px;
|
|
246
246
|
background: ${({color:i})=>i};
|
|
247
247
|
flex: none;
|
|
248
|
-
`,ke=o(
|
|
248
|
+
`,ke=o(u)`
|
|
249
249
|
position: absolute;
|
|
250
250
|
inset: 0;
|
|
251
251
|
width: 16px;
|
|
@@ -300,7 +300,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
300
300
|
display: flex;
|
|
301
301
|
align-items: center;
|
|
302
302
|
gap: 6px;
|
|
303
|
-
`,Pe=o(
|
|
303
|
+
`,Pe=o(u)`
|
|
304
304
|
width: 14px;
|
|
305
305
|
height: 14px;
|
|
306
306
|
color: ${e.colors.text};
|
|
@@ -322,7 +322,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
322
322
|
${e.media.down("lg")} {
|
|
323
323
|
font-size: 16px;
|
|
324
324
|
}
|
|
325
|
-
`,Ie=o(
|
|
325
|
+
`,Ie=o(u)`
|
|
326
326
|
width: 12px;
|
|
327
327
|
height: 12px;
|
|
328
328
|
color: ${e.colors.muted2};
|
|
@@ -350,7 +350,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
350
350
|
width: 40px;
|
|
351
351
|
height: 22px;
|
|
352
352
|
}
|
|
353
|
-
`,
|
|
353
|
+
`,He=o("span",c("on"))`
|
|
354
354
|
position: absolute;
|
|
355
355
|
top: 50%;
|
|
356
356
|
left: ${({on:i})=>i?"calc(100% - 12px)":"0px"};
|
|
@@ -367,7 +367,7 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
367
367
|
height: 18px;
|
|
368
368
|
left: ${({on:i})=>i?"calc(100% - 18px)":"2px"};
|
|
369
369
|
}
|
|
370
|
-
`,d=1e5;function
|
|
370
|
+
`,d=1e5;function De(i){var l;for(const h of ie){const p=(l=h.subs)==null?void 0:l.find(r=>r.key===i);if(p)return n(p.labelKey)}return i}function k({title:i,open:l,onToggle:h,summary:p,desktopStatic:r,headerTestId:x,headerAria:m,children:f}){const g=t.jsx(se,{up:l,size:24,color:"var(--text)"});return t.jsxs(le,{children:[t.jsxs(ce,{type:"button",desktopStatic:r,onClick:h,"aria-expanded":l,"aria-label":m,"data-testid":x,children:[t.jsx(de,{children:i}),r?t.jsx(pe,{children:g}):g]}),!l&&p?t.jsx(xe,{desktopHidden:r,children:p}):null,t.jsx(he,{open:l,desktopStatic:r,children:t.jsx(ge,{children:f})})]})}function Ye({category:i,subCategory:l,onCategory:h,onSub:p,priceMin:r,priceMax:x,onPriceMin:m,onPriceMax:f,rarities:g,onToggleRarity:E,status:S,onStatus:_,smart:b,onSmart:L}){const[M,O]=$.useState(!0),[Y,B]=$.useState(!0),[K,W]=$.useState(!1),[G,U]=$.useState(!0),R=r&&!Number.isNaN(Number(r))?Number(r):void 0,C=x&&!Number.isNaN(Number(x))?Number(x):void 0,w=R!=null?Math.min(R,d):0,y=C!=null?Math.min(C,d):d,V=w/d*100,X=y/d*100;function q(s){const a=Math.min(s,y);m(a<=0?"":String(a))}function J(s){const a=Math.max(s,w);f(a>=d?"":String(a))}const Q=l?De(l):i!=="wearable"?n(`categories.${i==="emote"?"emotes":i==="all"?"shopAll":i}`):"",Z=R!=null||C!=null?`${r||"0"}-${x||"∞"}`:"",ee=z.filter(s=>g.includes(s)).map(re).join(", "),te=S==="on_sale"?n("filter.onSale"):S==="not_for_sale"?n("filter.notForSale"):"";return t.jsxs(ae,{children:[t.jsx(k,{title:n("assets.category"),open:M,onToggle:()=>O(s=>!s),summary:Q,desktopStatic:!0,children:t.jsx(oe,{category:i,subCategory:l,onCategory:h,onSub:p})}),t.jsx(j,{}),t.jsxs(k,{title:n("filter.price"),open:Y,onToggle:()=>B(s=>!s),summary:Z,desktopStatic:!0,children:[t.jsxs(ue,{children:[t.jsxs(T,{children:[t.jsx(N,{children:n("assets.min")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(I,{type:"number",min:"0","aria-label":n("assets.minPriceAria"),placeholder:"0",value:r,onChange:s=>m(s.target.value)})]})]}),t.jsx(me,{children:n("assets.priceTo")}),t.jsxs(T,{children:[t.jsx(N,{children:n("assets.max")}),t.jsxs(P,{children:[t.jsx(F,{name:v.iconName,"aria-hidden":!0}),t.jsx(I,{type:"number",min:"0","aria-label":n("assets.maxPriceAria"),placeholder:"0",value:x,onChange:s=>f(s.target.value)})]})]})]}),t.jsxs(fe,{children:[t.jsx(be,{"aria-hidden":!0}),t.jsx(we,{minPct:V,maxPct:X,"aria-hidden":!0}),t.jsx(A,{type:"range",min:0,max:d,value:w,"aria-label":n("assets.minPriceSliderAria"),onChange:s=>q(Number(s.target.value))}),t.jsx(A,{type:"range",min:0,max:d,value:y,"aria-label":n("assets.maxPriceSliderAria"),onChange:s=>J(Number(s.target.value))})]}),t.jsxs(ye,{children:[t.jsxs(H,{children:[t.jsx(D,{name:v.iconName,"aria-hidden":!0}),w.toLocaleString()]}),t.jsxs(H,{children:[t.jsx(D,{name:v.iconName,"aria-hidden":!0}),y.toLocaleString()]})]})]}),t.jsx(j,{}),t.jsx(k,{title:n("assets.rarity"),open:K,onToggle:()=>W(s=>!s),summary:ee,headerTestId:"sidebar-section-toggle",children:t.jsx($e,{"data-testid":"rarity-filter",children:z.map(s=>{const a=g.includes(s);return t.jsxs(ve,{type:"button",selected:a,"aria-pressed":a,onClick:()=>E(s),"data-testid":"rarity-filter-check",children:[t.jsx(je,{color:e.rarities[s],children:a?t.jsx(ke,{name:"check","aria-hidden":!0}):null}),t.jsx(Se,{selected:a,children:s})]},s)})})}),t.jsx(j,{}),t.jsx(k,{title:n("filter.status"),open:G,onToggle:()=>U(s=>!s),summary:te,children:[["all",n("filter.statusAll")],["on_sale",n("filter.onSale")],["not_for_sale",n("filter.notForSale")]].map(([s,a])=>t.jsxs(Re,{children:[t.jsx(Ce,{type:"radio",name:"shop-status",checked:S===s,onChange:()=>_(s)}),t.jsx(ze,{children:a})]},s))}),t.jsx(j,{}),t.jsxs(Te,{children:[t.jsxs(Ne,{children:[t.jsx(Pe,{name:"smart","aria-hidden":!0}),t.jsx(Fe,{children:n("filter.smart")}),t.jsx(ne,{content:n("filter.smartHint"),placement:"bottom",children:t.jsx(Ie,{name:"info",role:"img","aria-label":n("filter.smartHint"),tabIndex:0})})]}),t.jsx(Ae,{type:"button",role:"switch",on:b,"aria-checked":b,"aria-label":n("filter.smart"),onClick:()=>L(!b),children:t.jsx(He,{on:b})})]})]})}const Be=o.div`
|
|
371
371
|
position: relative;
|
|
372
372
|
display: flex;
|
|
373
373
|
gap: 32px;
|
|
@@ -401,19 +401,33 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
401
401
|
max-height: calc(100vh - 158px - 24px);
|
|
402
402
|
overflow-y: auto;
|
|
403
403
|
overscroll-behavior: contain;
|
|
404
|
+
/* Reserve the scrollbar gutter so revealing the bar on hover doesn't shift the filter content. */
|
|
405
|
+
scrollbar-gutter: stable;
|
|
404
406
|
|
|
405
|
-
/*
|
|
406
|
-
|
|
407
|
-
|
|
407
|
+
/* Hover-only scrollbar: hidden while the catalog scrolls, revealed only when the cursor is over the
|
|
408
|
+
filters column (so a subtle bar appears just as you try to scroll within it). Stays scrollable
|
|
409
|
+
throughout — only the bar's visibility changes. Matches the subtle cart-list treatment (cart.css). */
|
|
410
|
+
scrollbar-width: none;
|
|
411
|
+
scrollbar-color: transparent transparent;
|
|
412
|
+
transition: scrollbar-color 0.2s ease;
|
|
408
413
|
&::-webkit-scrollbar {
|
|
409
|
-
width:
|
|
414
|
+
width: 8px;
|
|
410
415
|
}
|
|
411
416
|
&::-webkit-scrollbar-track {
|
|
412
417
|
background: transparent;
|
|
413
418
|
}
|
|
414
419
|
&::-webkit-scrollbar-thumb {
|
|
415
|
-
background:
|
|
420
|
+
background: transparent;
|
|
416
421
|
border-radius: 8px;
|
|
422
|
+
transition: background 0.2s ease;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
&:hover {
|
|
426
|
+
scrollbar-width: thin;
|
|
427
|
+
scrollbar-color: ${e.colors.muted2} transparent;
|
|
428
|
+
}
|
|
429
|
+
&:hover::-webkit-scrollbar-thumb {
|
|
430
|
+
background: ${e.colors.muted2};
|
|
417
431
|
}
|
|
418
432
|
}
|
|
419
433
|
|
|
@@ -530,4 +544,4 @@ import{r as y,j as t}from"./react-BMZSDQJw.js";import{R as z,a as oe,C as ie,c a
|
|
|
530
544
|
outline: 2px solid ${e.colors.accent};
|
|
531
545
|
outline-offset: 2px;
|
|
532
546
|
}
|
|
533
|
-
`;export{qe as C,j as D,k as F,Ke as M
|
|
547
|
+
`;export{qe as C,j as D,k as F,Ke as M,$e as R,Re as S,ve as a,je as b,ke as c,Se as d,Ce as e,ze as f,Be as g,Ue as h,We as i,Ve as j,Xe as k,Ge as l,Je as m,Qe as n,Ye as o};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import{j as t,L as R,r as D}from"./react-BMZSDQJw.js";import{s as a,B as L,y as e,H as q,u as B,t as i,g as N,J as F,I as x,l as G,e as A,j as H,c as Q,E as y,x as K,D as z}from"./index-V0hMC6mZ.js";import{g as M,a as W,s as J,b as O}from"./authorizations-CsduRV0X.js";import{f as P}from"./errors-BuvqNt2H.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-Dpp9c5As.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";const X=q`
|
|
2
|
+
to { transform: rotate(360deg); }
|
|
3
|
+
`,U=a.section`
|
|
4
|
+
width: 100%;
|
|
5
|
+
min-width: 0;
|
|
6
|
+
max-width: 760px;
|
|
7
|
+
`,V=a.div`
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 6px;
|
|
11
|
+
margin-bottom: 24px;
|
|
12
|
+
`,Y=a.h1`
|
|
13
|
+
font-family: ${e.font.sans};
|
|
14
|
+
margin: 0;
|
|
15
|
+
`,Z=a.p`
|
|
16
|
+
color: ${e.colors.muted};
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
margin: 0;
|
|
19
|
+
max-width: 60ch;
|
|
20
|
+
`,j=a.div`
|
|
21
|
+
margin-bottom: 28px;
|
|
22
|
+
`,w=a.h2`
|
|
23
|
+
font-family: ${e.font.sans};
|
|
24
|
+
font-size: 15px;
|
|
25
|
+
font-weight: 700;
|
|
26
|
+
color: ${e.colors.text};
|
|
27
|
+
margin: 0 0 10px;
|
|
28
|
+
`,b=a.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: 12px;
|
|
32
|
+
`,_=a.div`
|
|
33
|
+
display: grid;
|
|
34
|
+
grid-template-columns: 44px 1fr auto;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: 14px;
|
|
37
|
+
padding: 14px 18px;
|
|
38
|
+
background: ${e.colors.white};
|
|
39
|
+
border: 1px solid ${e.colors.line};
|
|
40
|
+
border-radius: 16px;
|
|
41
|
+
|
|
42
|
+
${e.media.down("mobile")} {
|
|
43
|
+
grid-template-columns: 44px 1fr;
|
|
44
|
+
grid-row-gap: 10px;
|
|
45
|
+
}
|
|
46
|
+
`,tt=a.div`
|
|
47
|
+
width: 44px;
|
|
48
|
+
height: 44px;
|
|
49
|
+
border-radius: 10px;
|
|
50
|
+
background: ${e.colors.media};
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
color: ${e.colors.muted2};
|
|
56
|
+
|
|
57
|
+
img {
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
object-fit: contain;
|
|
61
|
+
}
|
|
62
|
+
`,it=a.div`
|
|
63
|
+
min-width: 0;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: 3px;
|
|
67
|
+
`,ot=a.span`
|
|
68
|
+
font-weight: 700;
|
|
69
|
+
color: ${e.colors.text};
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
text-overflow: ellipsis;
|
|
73
|
+
`,et=a.span`
|
|
74
|
+
font-size: 13px;
|
|
75
|
+
color: ${e.colors.muted};
|
|
76
|
+
`,at=a.span`
|
|
77
|
+
font-size: 12px;
|
|
78
|
+
font-weight: 700;
|
|
79
|
+
color: ${e.colors.muted2};
|
|
80
|
+
|
|
81
|
+
&[data-active='true'] {
|
|
82
|
+
color: ${e.colors.okStrong};
|
|
83
|
+
}
|
|
84
|
+
`,st=a.div`
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: 10px;
|
|
88
|
+
justify-self: end;
|
|
89
|
+
|
|
90
|
+
${e.media.down("mobile")} {
|
|
91
|
+
grid-column: 1 / -1;
|
|
92
|
+
justify-self: start;
|
|
93
|
+
}
|
|
94
|
+
`,nt=a.button`
|
|
95
|
+
position: relative;
|
|
96
|
+
width: 46px;
|
|
97
|
+
height: 26px;
|
|
98
|
+
flex: 0 0 auto;
|
|
99
|
+
border-radius: ${e.radius.pill};
|
|
100
|
+
border: none;
|
|
101
|
+
background: ${e.colors.gray4};
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
transition: background 0.15s;
|
|
104
|
+
padding: 0;
|
|
105
|
+
|
|
106
|
+
&::after {
|
|
107
|
+
content: '';
|
|
108
|
+
position: absolute;
|
|
109
|
+
top: 3px;
|
|
110
|
+
left: 3px;
|
|
111
|
+
width: 20px;
|
|
112
|
+
height: 20px;
|
|
113
|
+
border-radius: 50%;
|
|
114
|
+
background: ${e.colors.white};
|
|
115
|
+
transition: transform 0.15s;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&[data-active='true'] {
|
|
119
|
+
background: ${e.colors.accent};
|
|
120
|
+
}
|
|
121
|
+
&[data-active='true']::after {
|
|
122
|
+
transform: translateX(20px);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&:disabled {
|
|
126
|
+
cursor: default;
|
|
127
|
+
opacity: 0.6;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:focus-visible {
|
|
131
|
+
outline: 2px solid ${e.colors.accent};
|
|
132
|
+
outline-offset: 2px;
|
|
133
|
+
}
|
|
134
|
+
`,rt=a.span`
|
|
135
|
+
width: 16px;
|
|
136
|
+
height: 16px;
|
|
137
|
+
border-radius: 50%;
|
|
138
|
+
border: 2px solid ${e.colors.gray4};
|
|
139
|
+
border-top-color: ${e.colors.accent};
|
|
140
|
+
animation: ${X} 0.7s linear infinite;
|
|
141
|
+
|
|
142
|
+
@media (prefers-reduced-motion: reduce) {
|
|
143
|
+
animation: none;
|
|
144
|
+
}
|
|
145
|
+
`,v=a.p`
|
|
146
|
+
color: ${e.colors.muted};
|
|
147
|
+
font-size: 14px;
|
|
148
|
+
margin: 0;
|
|
149
|
+
`,$=a.div`
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: 8px;
|
|
154
|
+
text-align: center;
|
|
155
|
+
padding: 90px 20px;
|
|
156
|
+
min-height: 50vh;
|
|
157
|
+
`,k=a.p`
|
|
158
|
+
font-size: 22px;
|
|
159
|
+
font-weight: 700;
|
|
160
|
+
margin: 6px 0 0;
|
|
161
|
+
`,ct=a(L)`
|
|
162
|
+
margin-top: 12px;
|
|
163
|
+
`;function C({descriptor:o,owner:n,signer:l,name:s,description:d,image:r,icon:u}){const T=H(),[m,g]=D.useState(!1),{data:c,isLoading:p,refetch:E}=A({queryKey:["authorization",o.id,n],queryFn:()=>O(o,n),staleTime:3e4});async function I(){if(m||p)return;const h=!c;g(!0);try{await J({auth:o,signer:l,active:h}),await E(),T.setQueryData(["authorization",o.id,n],h),y.success(h?i("authorizations.toastActivated",{name:s}):i("authorizations.toastDeactivated",{name:s}))}catch(f){K(f,{flow:"authorizations",step:h?"grant":"revoke"}),y.error(P(f,i("authorizations.errorGeneric")))}finally{g(!1)}}const S=p?i("authorizations.checking"):c?i("authorizations.active"):i("authorizations.inactive");return t.jsxs(_,{"data-testid":`authorization-${o.id}`,"data-active":!!c,children:[t.jsx(tt,{children:r?t.jsx("img",{src:r,alt:""}):u}),t.jsxs(it,{children:[t.jsx(ot,{title:s,children:s}),t.jsx(et,{children:d})]}),t.jsxs(st,{children:[t.jsx(at,{"data-active":!!c,children:S}),m?t.jsx(rt,{"aria-label":i("authorizations.working")}):t.jsx(nt,{type:"button","data-testid":`authorization-toggle-${o.id}`,"data-active":!!c,role:"switch","aria-checked":!!c,"aria-label":c?i("authorizations.deactivateAria",{name:s}):i("authorizations.activateAria",{name:s}),disabled:p,onClick:()=>void I()})]})]})}function lt(o){return A({queryKey:["owned-collections",o],enabled:!!o,staleTime:6e4,queryFn:async()=>{const[n,l]=await Promise.all([z(o,{category:"wearable",first:96}),z(o,{category:"emote",first:96})]),s=new Map;for(const d of[...n.assets,...l.assets]){const r=d.contractAddress.toLowerCase();s.has(r)||s.set(r,d)}return[...s.values()]}})}function zt(){B({title:i("authorizations.title"),noindex:!0});const{session:o}=N(),n=Q.chainId,l=F(o==null?void 0:o.providerType),{data:s,isLoading:d}=lt(l?o==null?void 0:o.address:void 0);if(!o)return t.jsxs($,{children:[t.jsx(x,{name:"info",size:40,color:"var(--muted-2)"}),t.jsx(k,{children:i("authorizations.signInTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.signInBody")})]});if(!l)return t.jsxs($,{children:[t.jsx(x,{name:"check",size:40,color:"var(--ok)"}),t.jsx(k,{children:i("authorizations.managedTitle")}),t.jsx("p",{className:"muted",children:i("authorizations.managedBody")}),t.jsx(ct,{as:R,to:"/assets",variant:"purple",children:i("authorizations.managedCta")})]});const r=M(n);return t.jsxs(U,{children:[t.jsxs(V,{children:[t.jsx(Y,{children:i("authorizations.title")}),t.jsx(Z,{children:i("authorizations.intro")})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.buyingTitle")}),t.jsx(b,{children:t.jsx(C,{descriptor:r,owner:o.address,signer:o.signer,name:i("authorizations.creditsName"),description:i("authorizations.creditsDesc"),icon:t.jsx(G,{className:"ccy-mark"})})})]}),t.jsxs(j,{children:[t.jsx(w,{children:i("authorizations.sellingTitle")}),d?t.jsx(v,{children:i("authorizations.checking")}):s&&s.length>0?t.jsx(b,{children:s.map(u=>t.jsx(C,{descriptor:W(u.contractAddress,n),owner:o.address,signer:o.signer,name:u.name||i("authorizations.collectionFallback"),description:i("authorizations.sellingDesc"),image:u.image,icon:t.jsx(x,{name:"pen",size:18})},u.contractAddress))}):t.jsx(v,{children:i("authorizations.sellingEmpty")})]})]})}export{zt as Authorizations};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{j as e,r as j,u as Se,b as qe,L as Z}from"./react-BMZSDQJw.js";import{t as a,l as I,am as W,u as Le,ak as C,a as ie,g as Ie,e as Te,h as Pe,j as Ee,I as E,an as Be,J as Fe,q as J,ao as de,ap as Ae,x as R,s as Re,B as We,c as Ue,C as ze,o as $e,k as ue,aq as Qe,v as he,r as Ke,ar as Oe}from"./index-V0hMC6mZ.js";import{a as me}from"./buy-CN2rC9a0.js";import{g as Ge,a as Je,w as De,S as He,G as Ve}from"./buy-gasless-iZXsoGZN.js";import{R as D,r as Ye}from"./cart-checkout-CLMqKMCz.js";import{u as Xe,c as Ze}from"./useCreditPacks-BJp5mEnq.js";import{l as es}from"./loader-logo-BzY9EKdC.js";import{i as ss,a as as}from"./errors-BuvqNt2H.js";import{E as ts}from"./ErrorNotice-DDr3KjIH.js";import{C as cs}from"./CollectionCarousel-CfEwak3h.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-8SzFotJj.js";import"./ethers-Dpp9c5As.js";import"./intl-CBcMB1D2.js";import"./authorizations-CsduRV0X.js";import"./index-HN6Rk25C.js";import"./trade-encoding-vTSEXgN1.js";const rs="https://cdn.decentraland.org/@dcl/shop/0.1.0-29941568358.commit-de47e56/assets/buy-error-22UunaPC.png";function ns(t){const{phase:r,balanceCredits:u,onClose:l}=t,_=r==="processing",w=r!=="complete",M=r==="error"?a("cartCheckout.errorTitle"):r==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),k=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:_?void 0:l,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${k?" buy-modal__card--tall":""}`,children:[w&&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:M}),!_&&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(I,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:W(u)})]})]}),r==="processing"&&e.jsx(os,{stage:t.stage??"reserving",step:t.step??1,total:t.total??1,isSelfCustody:!!t.isSelfCustody}),r==="nofunds"&&e.jsx(ls,{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(is,{purchased:t.purchased??[],onMyAssets:t.onMyAssets??l,onTryInWorld:t.onTryInWorld??l}),r==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:rs,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:l,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:t.onRetry??l,children:a("cartCheckout.tryAgain")})]})]})]})]})}function os({stage:t,step:r,total:u,isSelfCustody:l}){const _=t==="reserving",w=u>0?Math.min(100,Math.round(r/u*100)):0,M=t==="awaiting-signature"?l?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):t==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:es,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:M}),_?e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill buy-modal__progress-fill--step",style:{width:`${w}%`}})}),u>1?e.jsxs("span",{className:"cart-checkout__step",children:[r,"/",u]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function ls({lines:t,shortfallCredits:r,packs:u,selectedPack:l,onSelectPack:_,onBuyPacks:w,onCancel:M}){const k=u.find(c=>c.id===l),H=t.reduce((c,y)=>c+(y.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:H})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:t.map(c=>{const y=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"),y>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:y})}):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(I,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:W(c.priceCredits*y)})]})]})]},c.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:u.map(c=>{const y=c.id===l;return e.jsxs("button",{className:`buy-modal__pack${y?" buy-modal__pack--on":""}`,onClick:()=>_(c.id),children:[e.jsx(I,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:W(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(I,{className:"buy-modal__total-ico"}),e.jsx("span",{children:W((k==null?void 0:k.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((k==null?void 0:k.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:M,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:a("buyModal.buy")})]})]})}function is({purchased:t,onMyAssets:r,onTryInWorld:u}){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 _=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"),_>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:_})}):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(I,{className:"cart-checkout__done-price-ico"}),e.jsx("span",{children:W(l.priceCredits*_)})]})]},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:u,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 ds=Re(We)`
|
|
2
|
+
margin-top: 12px;
|
|
3
|
+
`;function _e(t){if(ss(t))return a("errors.rejected");const r=(t.message??"").toLowerCase();return r.includes("insufficient")?a("cart.error.insufficient",{currency:ze.name}):r.includes("no active listing")||r.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const us=12e4,hs=Ue.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump";function ms(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 ye=t=>t.reduce((r,u)=>r+u.priceCredits*u.quantity,0),_s=t=>t.flatMap(r=>Array.from({length:r.quantity},()=>({...r,quantity:1})));function Ts(){Le({title:a("nav.cart"),noindex:!0});const t=C(s=>s.items),r=C(s=>s.remove),u=C(s=>s.increment),l=C(s=>s.decrement),_=C(s=>s.clear),w=C(s=>s.restore),M=C(s=>s.setFittingOpen),k=ie(s=>s.items),H=ie(s=>s.toggle),{session:c}=Ie(),y=Xe().packs.slice(0,3);j.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const pe=t.some(s=>s.category!=="emote"),{data:V}=Te({queryKey:["upsell-listings"],queryFn:()=>Oe({first:40}),staleTime:6e4}),{data:B}=Pe(c),U=Ee(),z=Se(),{state:T}=qe(),[ee,F]=j.useState(null),[be,S]=j.useState(null),[se,$]=j.useState(null),[xe,P]=j.useState(!1),[g,A]=j.useState(null),ae=j.useRef(0),[i,v]=j.useState(null),[Y,te]=j.useState(""),je=t.reduce((s,n)=>s+n.priceCredits*n.quantity,0),ce=t.reduce((s,n)=>s+n.quantity,0),ke=g?g.liveTotalCredits:je,ge=new Set(t.map(s=>s.id)),re=((V==null?void 0:V.items)??[]).filter(s=>!ge.has(s.id)).slice(0,12),fe=new Map(g==null?void 0:g.buyable.map(s=>[s.item.id,s])),Q=(B==null?void 0:B.credits)??0,ve=Ae;function K(s){s(),A(null),$(null),S(null)}function Ne(){v(null),P(!1)}function ne(s){const n=ye(s),o=Math.max(0,n-Q),b=y.find(h=>h.credits>=o)??y[y.length-1];te(b.id),J("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:n,credits_balance:Q,shortfall:o}),v({phase:"nofunds",lines:s.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),P(!1)}async function Ce(s){if(!c||s.length===0)return;const n=_s(s),o=n.map(d=>({...d.item,priceCredits:d.priceCredits})),b=s.map(d=>({...d.item,priceCredits:d.priceCredits,quantity:d.quantity})),h=[];let N="authorize",G=!1;v({phase:"processing",stage:"reserving",step:1,total:n.length});try{const d=[];for(let m=0;m<n.length;m++){const L=n[m];v({phase:"processing",stage:"reserving",step:m+1,total:n.length});try{const{credit:p,maxCreditedValue:X}=await $e(c.identity,L.usdCents,L.trade.id);h.push(p.id),d.push({trade:L.trade,credits:[p],maxCreditedValue:X})}catch(p){if(as(p)){if(h.length){try{await ue(c.identity,h)}catch(X){R(X,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw p}}N="submit";const x=()=>v({phase:"processing",stage:"settling",step:n.length,total:n.length});v({phase:"processing",stage:"awaiting-signature",step:n.length,total:n.length});let f=[];if(Ge())try{f=await Je({purchases:d,buyer:c.address,signer:c.signer,onSigned:x});const L=(await Promise.allSettled(f.map(p=>De(p)))).flatMap(p=>p.status==="rejected"?[p.reason]:[]);if(L.length&&!L.some(p=>p instanceof He))throw L[0];G=!0}catch(m){if(!(m instanceof Ve))throw m;f=await me({purchases:d,buyer:c.address,signer:c.signer,onSigned:x})}else f=await me({purchases:d,buyer:c.address,signer:c.signer});s.forEach(m=>r(m.item.id)),A(null),J("Shop Completed Purchase",{...Qe(o),payment_type:"credits",no_crypto_step:G,transaction_hash:f[0]??null}),U.invalidateQueries({queryKey:["usd-balance"]}),v({phase:"complete",purchased:b})}catch(d){if(he(d)||R(d,{flow:"cart_checkout",step:N,cart_size:s.length}),J(he(d)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:N,error_code:Ke(d),value_usd:de(o.reduce((x,f)=>x+f.priceCredits,0)),cart_size:n.length}),h.length){try{await ue(c.identity,h)}catch(x){R(x,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}v({phase:"error",message:_e(d)})}}function oe(s){const n=ye(s);if(B!=null&&B.credits<n){ne(s);return}Ce(s)}async function O(){if(!c){S(a("buyModal.signInToCheckout"));return}const s=C.getState().items;if(s.length===0)return;S(null),$(null),P(!0);const n=s.reduce((o,b)=>o+b.priceCredits*b.quantity,0);J("Shop Started Checkout",{cart_size:s.length,cart_value_credits:n,cart_value_usd:de(n),has_sufficient_credits:Q>=n});try{F(a("cart.status.reviewing"));const o=await Ye(s,c.address,ve),b=[...o.unavailable,...o.own];if(b.length&&(b.forEach(h=>r(h.id)),$(ms(o))),o.buyable.length===0){S(a("cart.error.noneAvailable")),A(null),F(null);return}if(o.orderChanged){A(o),ae.current=Date.now(),F(null);return}F(null),oe(o.buyable)}catch(o){R(o,{flow:"cart_checkout",step:"review",cart_size:s.length}),S(_e(o)),F(null)}finally{P(!1)}}async function we(){if(g){if(!c){S(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>us){A(null),$(null),await O();return}S(null),oe(g.buyable)}}async function Me(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(C.getState().items))}catch{}P(!0);try{const s=await Ze(Y,c?{address:c.address,identity:c.identity}:void 0);if(s.url){window.location.href=s.url;return}z("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}R(s,{flow:"cart_buy_credits"}),v({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{P(!1)}}}const le=j.useRef(!1);j.useEffect(()=>{if(!(T!=null&&T.resumeCheckout)||le.current)return;le.current=!0;try{const n=sessionStorage.getItem(D);if(n){sessionStorage.removeItem(D);const o=JSON.parse(n);Array.isArray(o)&&o.length&&w(o)}}catch{}U.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void O(),0);return()=>clearTimeout(s)},[T==null?void 0:T.resumeCheckout]);const q=xe||(i==null?void 0:i.phase)==="processing";return t.length===0&&!i?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(E,{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(ds,{as:Z,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>z(-1),type:"button",children:[e.jsx(E,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>z(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(E,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:ce})}),pe?e.jsxs("button",{className:"checkout__fitting",onClick:()=>M(!0),disabled:q,children:[e.jsx(E,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:t.map(s=>{const n=fe.get(s.id),o=n?n.priceCredits:s.priceCredits,b=!!n&&n.priceCredits!==s.priceCredits,h=!s.tokenId,N=s.quantity,G=typeof s.available=="number"&&N>=s.available,d=o*N,x=!!k[s.id],f=s.tokenId??s.itemId,m=s.contractAddress&&f?`/item/${s.contractAddress}/${f}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[m?e.jsx(Z,{className:"checkout__thumb-link",to:m,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:[m?e.jsx(Z,{className:"checkout__name",to:m,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:[h?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>l(s.id)),disabled:q||N<=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:N}),e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>u(s.id)),disabled:q||G,"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(I,{className:"checkout__price-ico"})," ",d,b?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*N}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${x?" is-on":""}`,onClick:()=>H(s),"aria-label":x?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:x?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(E,{name:x?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>K(()=>r(s.id)),disabled:q,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(E,{name:"trash",size:24})})]})]},s.id)})}),e.jsx("div",{className:"checkout__utils",children:e.jsx("button",{className:"link",onClick:()=>K(_),disabled:q,children:a("cart.clearCart")})})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:ce})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(I,{className:"checkout__total-ico"})," ",ke]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(g?we():O()),disabled:q,children:q?a("cart.working"):g?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),g?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,se?e.jsx("p",{className:"muted checkout__msg",children:se}):null,ee?e.jsx("p",{className:"muted checkout__msg",children:ee}):null,e.jsx(ts,{message:be,className:"checkout__msg"})]})]})]})]}),re.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(cs,{title:a("cart.youMightAlsoLike"),items:re})}):null,i?e.jsx(ns,{phase:i.phase,balanceCredits:Q,onClose:Ne,stage:i.phase==="processing"?i.stage:void 0,step:i.phase==="processing"?i.step:void 0,total:i.phase==="processing"?i.total:void 0,isSelfCustody:Fe(c==null?void 0:c.providerType),lines:i.phase==="nofunds"?i.lines:void 0,shortfallCredits:i.phase==="nofunds"?i.shortfall:void 0,packs:y,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Me(),purchased:i.phase==="complete"?i.purchased:void 0,onMyAssets:()=>z("/assets?tab=mine"),onTryInWorld:()=>window.open(hs,"_blank","noopener"),message:i.phase==="error"?i.message:void 0,onRetry:()=>void O()}):null]})}export{Ts as Cart};
|