@dcl/shop 0.1.0-29030398160.commit-dedc8ac → 0.1.0-29111888971.commit-e1b927a
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-8aI4vJAl.js → AnimatedBackground-XZF9g9Bk.js} +3 -3
- package/assets/{Assets-O86HcPf_.js → Assets-CZPTo1jO.js} +1 -1
- package/assets/{Button-D1faXtxc.js → Button-B2TDtyup.js} +1 -1
- package/assets/{Cart-wT4YY2XB.js → Cart-DhU4_S6H.js} +1 -1
- package/assets/{CircularProgress-ByISsJtD.js → CircularProgress-Cf__730y.js} +1 -1
- package/assets/{Collection-B-SrzrlP.js → Collection-CRBxkkqX.js} +1 -1
- package/assets/{Creator-3SRIb5GI.js → Creator-DO__19RD.js} +1 -1
- package/assets/{ExchangeController-CtvD9TxU.js → ExchangeController-txwSQL2Z.js} +1 -1
- package/assets/{GetCredits-BntbDm9-.js → GetCredits-DS1z5pyp.js} +2 -2
- package/assets/{HelpersUtil-zGctDzqI.js → HelpersUtil-CMysbO5y.js} +1 -1
- package/assets/{ImportListings-DvqpDa-s.js → ImportListings-ChNZ2UwM.js} +1 -1
- package/assets/{ItemDetail-CjSWRE3L.js → ItemDetail-Do5cjFW8.js} +2 -2
- package/assets/{Market-Hqywp2wQ.js → Market-Z4jp-uLb.js} +1 -1
- package/assets/{MenuItem-BzIPsU3-.js → MenuItem-B4U0TYKf.js} +1 -1
- package/assets/{MyAssets-nfsXXyUv.js → MyAssets-C7QdtDYF.js} +1 -1
- package/assets/{MyFavorites-B6_8hr5-.js → MyFavorites-Bu2IDcdJ.js} +1 -1
- package/assets/{MyPurchases-33hyTefC.js → MyPurchases-CDUC3XzQ.js} +1 -1
- package/assets/{NotFound-DXluG5-7.js → NotFound-D5sXjRPf.js} +1 -1
- package/assets/{RealCheckout-tQms6dAo.js → RealCheckout-DBL3uxEj.js} +1 -1
- package/assets/{ShopFooterInner-DV3X__jb.js → ShopFooterInner-BHh4OUAv.js} +2 -2
- package/assets/{Success-BblXOFEG.js → Success-BrvAPmP4.js} +1 -1
- package/assets/{SvgIcon-CVoRZ89M.js → SvgIcon-Cg5l4LDh.js} +1 -1
- package/assets/{SwapController-BEHLqATV.js → SwapController-BDZMxnNb.js} +1 -1
- package/assets/{TradeService-a9BKe-Oz.js → TradeService-CkLYTYcJ.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-HtGM3kiI.js → W3MFrameProviderSingleton-D4DCXtQm.js} +3 -3
- package/assets/{WebCryptoP256-bPjiT7wY.js → WebCryptoP256-OE37a6hF.js} +1 -1
- package/assets/{basic-awR2CJat.js → basic-SUHSB6nZ.js} +1 -1
- package/assets/{biconomy-CBCMLM9k.js → biconomy-C6flCXA4.js} +1 -1
- package/assets/{buy-C8v-ou6b.js → buy-YkuLG1h7.js} +1 -1
- package/assets/{buy-gasless-CUtIigP0.js → buy-gasless-gRmZHjsE.js} +1 -1
- package/assets/{ccip-BMCE_sFa.js → ccip-7fqLW_t2.js} +1 -1
- package/assets/{ccip-DiW7RkRR.js → ccip-ByQiZ_aq.js} +1 -1
- package/assets/{collection-D-oaSVfu.js → collection-2CKCNH2O.js} +1 -1
- package/assets/{controller-CJz3LUjz.js → controller-BO0zre2A.js} +2 -2
- package/assets/{core-CGoVaJvD.js → core-D-mQUZ3X.js} +4 -4
- package/assets/{custom-CLQCvu9h.js → custom-C6VO1Je_.js} +1 -1
- package/assets/{data-capture-C1enk8q3.js → data-capture-DdxbO7dd.js} +1 -1
- package/assets/decimals-ByIlBo-2.js +1 -0
- package/assets/{decimals-C8GSUqDy.js → decimals-Di7mGY-D.js} +1 -1
- package/assets/{detectExtension-Bdev6B_Y.js → detectExtension-DsE82Ej6.js} +1 -1
- package/assets/{email-DI1UmfjV.js → email-BTEyDEk6.js} +1 -1
- package/assets/{embedded-wallet-CUaCp934.js → embedded-wallet-QGoIGdCB.js} +1 -1
- package/assets/{engine-NUwMDIUh.js → engine-Bjifrd8K.js} +1 -1
- package/assets/{estimate-l1-fee-CkQ_-gw6.js → estimate-l1-fee-Bqou6JLl.js} +1 -1
- package/assets/{eth_estimateGas-DaI_qfS7.js → eth_estimateGas-CarYiSgL.js} +1 -1
- package/assets/{eth_getStorageAt-DqNZYObO.js → eth_getStorageAt-B-cqm2CG.js} +1 -1
- package/assets/{eth_getTransactionCount-BBYhaRkF.js → eth_getTransactionCount-Dfx3JW2Q.js} +1 -1
- package/assets/{extractIPFS-COY4B3_o.js → extractIPFS-C5EI4cZz.js} +1 -1
- package/assets/{features-DW4K2ZKu.js → features-U-ULFF0v.js} +1 -1
- package/assets/{fetchTokenMetadata-D4vVc_nQ.js → fetchTokenMetadata-DHc2WWGs.js} +2 -2
- package/assets/{generateUtilityClasses-D15hK3nM.js → generateUtilityClasses-BAjjhm6X.js} +1 -1
- package/assets/{get-ecosystem-wallet-info-QCLNyKk6.js → get-ecosystem-wallet-info-CWcGnKL4.js} +1 -1
- package/assets/{getBalance-CndsdQzG.js → getBalance-C8i1-K0c.js} +1 -1
- package/assets/{getInstalledModules-BZgUgPCr.js → getInstalledModules-BXhbS0To.js} +1 -1
- package/assets/{getNFT-Bw4qn7ry.js → getNFT-CzHwZ4FU.js} +2 -2
- package/assets/{getNFT-BQyw29TQ.js → getNFT-D3XSi6wm.js} +1 -1
- package/assets/{hashTypedData-Er6Ia-O7.js → hashTypedData-BOc0w62Q.js} +1 -1
- package/assets/{hashTypedData-CaO8N883.js → hashTypedData-DX5YrpbP.js} +1 -1
- package/assets/{import-NJqh-zgj.js → import-BulayqYM.js} +1 -1
- package/assets/{in-app-wallet-calls-BDq_Ik7W.js → in-app-wallet-calls-BI0pU06-.js} +1 -1
- package/assets/{index-P5U8LYs6.js → index--_rHc9Od.js} +1 -1
- package/assets/{index-BZIVWDQd.js → index-2NUAW7ds.js} +1 -1
- package/assets/{index-CDAYsxA6.js → index-BF6unOoT.js} +1 -1
- package/assets/{index-Hn-DbSZA.js → index-BKSTjS_b.js} +1 -1
- package/assets/{index-LDSpzB15.js → index-BLQJ40Mi.js} +1 -1
- package/assets/{index-CfKqUBFA.js → index-BNH6Xzon.js} +2 -2
- package/assets/{index-Bo34Cx12.js → index-BOQwd6ZB.js} +1 -1
- package/assets/{index-DwQ4pw8v.js → index-BZ5hUBd_.js} +1 -1
- package/assets/{index-mLXaZKmk.js → index-BaSqmd6J.js} +1 -1
- package/assets/{index-AgzyxgSU.js → index-BlEd83Li.js} +1 -1
- package/assets/{index-BqIdYoG8.js → index-Bo6hVxzu.js} +1 -1
- package/assets/{index-C6QyIhnE.js → index-C2OMQVG4.js} +1 -1
- package/assets/{index-FcUvAZuZ.js → index-C2U9pe20.js} +1 -1
- package/assets/{index-DXfwhNfH.js → index-C6FQ8I_Q.js} +2 -2
- package/assets/{index-Dmfk0azd.js → index-C7-iTfFV.js} +39 -39
- package/assets/{index-CDOPdFEN.js → index-CDMAFM2h.js} +1 -1
- package/assets/{index-zGd0k6zk.js → index-CIPKmOlZ.js} +1 -1
- package/assets/{index-D-VYD1II.js → index-CMavzzI_.js} +1 -1
- package/assets/{index-C1RysQbA.js → index-CbJmVQBN.js} +1 -1
- package/assets/{index-BoZx7TrW.js → index-CcQfGUgB.js} +1 -1
- package/assets/{index-DieH8QTn.js → index-CiIXwK1P.js} +1 -1
- package/assets/{index-DrcFvB51.js → index-CkHNiFzW.js} +1 -1
- package/assets/{index-BexyLNIk.js → index-CkVoCPEe.js} +1 -1
- package/assets/{index-BABCyrjx.js → index-CxyR8sie.js} +1 -1
- package/assets/{index-emGKKyxf.js → index-CzFnbzvY.js} +1 -1
- package/assets/{index-Dav5KOrd.js → index-CzfG6alx.js} +1 -1
- package/assets/{index-BdBYQDrP.js → index-D3hzhbb8.js} +1 -1
- package/assets/{index-PQMQyCqV.js → index-D4VlTBkw.js} +1 -1
- package/assets/{index-BRyy9_FL.js → index-D5qOQwpy.js} +1 -1
- package/assets/{index-BseAcDfV.js → index-DIMSfymy.js} +3 -3
- package/assets/{index-DVQRwKte.js → index-DIw62AgP.js} +1 -1
- package/assets/{index-CCxw-foK.js → index-DJyoXp5I.js} +1 -1
- package/assets/{index-j1oJp18p.js → index-DOTYPGXa.js} +1 -1
- package/assets/{index-Buf412yH.js → index-DQx-sY_c.js} +1 -1
- package/assets/{index-Gr3BFRx7.js → index-DS8DYtub.js} +1 -1
- package/assets/{index-ccNJtibX.js → index-DShBCYos.js} +3 -3
- package/assets/{index-2l5r0dRI.js → index-DV4p99KA.js} +2 -2
- package/assets/{index-KUsuHO11.js → index-DacKA042.js} +1 -1
- package/assets/{index-Ddmzqmxk.js → index-DhBdPYnK.js} +1 -1
- package/assets/{index-CWz8eoAl.js → index-DjPU0-Js.js} +1 -1
- package/assets/{index-CRhrr6gN.js → index-DlllSUoB.js} +1 -1
- package/assets/{index-BEzzzIlC.js → index-DtrBN21c.js} +1 -1
- package/assets/{index-CWHR1ZBn.js → index-Eb-Zd0F2.js} +1 -1
- package/assets/{index-C6xmzvY-.js → index-GAmNssSM.js} +1 -1
- package/assets/{index-CmcvhZsS.js → index-IfYZnKCO.js} +1 -1
- package/assets/{index-FrZezou7.js → index-LSZxonl2.js} +1 -1
- package/assets/{index-CyDCPwX2.js → index-Pp2oEhTr.js} +1 -1
- package/assets/{index-DRm7xERf.js → index-Qzch3HJ1.js} +1 -1
- package/assets/{index-BUaGOTLN.js → index-ULMMROQ0.js} +1 -1
- package/assets/{index-Dm67LTtv.js → index-YfJF6hV4.js} +1 -1
- package/assets/{index-BKg37Q5D.js → index-jYazATJj.js} +1 -1
- package/assets/{index-DJCTaNyE.js → index-kxu93Of2.js} +1 -1
- package/assets/{index-Dq7Rlnvq.js → index-n-cFV5ht.js} +1 -1
- package/assets/{index.es-DZDKrrOX.js → index.es-Dk6KC5kj.js} +1 -1
- package/assets/{index.es-7keraYJG.js → index.es-DnMpNe4m.js} +4 -4
- package/assets/{index.es-C2X55s9j.js → index.es-IGCEipYb.js} +1 -1
- package/assets/{localBatchGatewayRequest-ntoba0Xt.js → localBatchGatewayRequest-BLJAP4fw.js} +1 -1
- package/assets/{mana-rate-D_DTt_S8.js → mana-rate-DkxpKYLQ.js} +1 -1
- package/assets/network-DsCGVBhE.js +1 -0
- package/assets/{networks-DvMCxuQT.js → networks-Bc_Uf_7y.js} +1 -1
- package/assets/{onramp-D4LFsmfg.js → onramp-DnhEoZl6.js} +1 -1
- package/assets/{openzeppelin-CJAun2pO.js → openzeppelin-DwFpqgXP.js} +1 -1
- package/assets/{ownerOf-DrmYf79A.js → ownerOf-Qq7Or7yc.js} +1 -1
- package/assets/{parseNft-Yzo9Plhx.js → parseNft-B-POJxiL.js} +2 -2
- package/assets/{parseSignature-3yq9FfJP.js → parseSignature-ClLI6O4f.js} +3 -3
- package/assets/{parseSignature-h2iJV3NZ.js → parseSignature-kOoafZEo.js} +1 -1
- package/assets/{pay-with-exchange-BWW2tZIp.js → pay-with-exchange-BZR4RMBZ.js} +1 -1
- package/assets/{qr-overlay-hYqgRnm0.js → qr-overlay-9WMDd_PO.js} +1 -1
- package/assets/{receive-BMHwXxqP.js → receive-CtJWuhGM.js} +1 -1
- package/assets/{resolveImplementation-DS1nY4sc.js → resolveImplementation-BJatMhHh.js} +1 -1
- package/assets/{rpc-BC6ESxMB.js → rpc-BA0W82l4.js} +1 -1
- package/assets/{secp256k1-DNCGSF8O.js → secp256k1-B82Rx-TY.js} +1 -1
- package/assets/{secp256k1-BQuyxdaC.js → secp256k1-DFslM7tB.js} +1 -1
- package/assets/{secp256k1-CrZRZ9L5.js → secp256k1-DHqlJ8nk.js} +1 -1
- package/assets/{send-B62L18Hx.js → send-DXVwWcB5.js} +1 -1
- package/assets/{send-batch-transaction-De_pBpa_.js → send-batch-transaction-D1j9aZww.js} +1 -1
- package/assets/{send-eip712-transaction-D-GzcP3o.js → send-eip712-transaction-CrryJAyV.js} +2 -2
- package/assets/{send-gasless-transaction-Iil1KVOe.js → send-gasless-transaction-B7YcLCGg.js} +2 -2
- package/assets/{sendRawTransaction-BqauPPYf.js → sendRawTransaction-DT-ObNx8.js} +3 -3
- package/assets/{serializeTransaction-B4qzULZO.js → serializeTransaction-DawhfTu0.js} +1 -1
- package/assets/{session-proposal-C4Cz1cln.js → session-proposal-lgMupzDT.js} +1 -1
- package/assets/{session-request-De0p90UO.js → session-request-DacijEHD.js} +2 -2
- package/assets/{sha256-bg_KfcLv.js → sha256-BxR-wXll.js} +1 -1
- package/assets/{signing-BGpVago5.js → signing-CoPa7cSW.js} +4 -4
- package/assets/{socials-vOukOtuh.js → socials-CMh8u0Ej.js} +1 -1
- package/assets/{swaps-FEWWVCcs.js → swaps-B0Q00kKq.js} +1 -1
- package/assets/{thirdweb-C8ToELvu.js → thirdweb-9c12J_EF.js} +3 -3
- package/assets/{totalSupply-C5jxuFw1.js → totalSupply-BCZn9Djj.js} +1 -1
- package/assets/{transactionReceipt-CbcThGoC.js → transactionReceipt-C2iQ3ozz.js} +1 -1
- package/assets/{transactions-CaxBviMm.js → transactions-Dqx74UWQ.js} +1 -1
- package/assets/{useInfiniteGrid-BiC1UMEK.js → useInfiniteGrid-DgSsqvQS.js} +1 -1
- package/assets/{verifyHash-JbNzrsYR.js → verifyHash-BVbpPoSf.js} +1 -1
- package/assets/{w3m-modal-BUwENQ4T.js → w3m-modal-CGHylzdj.js} +1 -1
- package/assets/{w3m-modal-BfRGsEzF.js → w3m-modal-DvCL5Oh_.js} +1 -1
- package/assets/{wait-for-tx-receipt-BJDKOLGI.js → wait-for-tx-receipt-Dm2aAIs1.js} +1 -1
- package/assets/{wallet-kind-CuaDlRao.js → wallet-kind-vciDs8sO.js} +1 -1
- package/assets/{wallets-BnBHCJi8.js → wallets-D8labJv_.js} +6 -6
- package/assets/{web-connector-CJKlFm6H.js → web-connector-C9MeCxtf.js} +3 -3
- package/assets/{writeContract-CtBYiULm.js → writeContract-C3IzBPhR.js} +1 -1
- package/assets/{zoraTestnet-CJMxifqR.js → zoraTestnet-CduWQC79.js} +1 -1
- package/index.html +8 -8
- package/package.json +2 -2
- package/assets/decimals-DnNelAv5.js +0 -1
- package/assets/network-CFFySFe9.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-Vu6nbGi5.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
1
|
+
import{r as l,j as v}from"./react-Vu6nbGi5.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29111888971.commit-e1b927a/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29111888971.commit-e1b927a/assets/DCL_LogoPattern-BryBPc3d.png",b=`
|
|
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
|
+
`,U=`
|
|
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,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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e,b as D}from"./react-Vu6nbGi5.js";import{m as F,l as I,A as K,B as J}from"./index-
|
|
1
|
+
import{r as i,j as e,b as D}from"./react-Vu6nbGi5.js";import{m as F,l as I,A as K,B as J}from"./index-C7-iTfFV.js";import{S as A,F as W,a as Y}from"./FilterBar-CdU8B66A.js";import{S as M}from"./SkeletonCards-BysJEVmg.js";import{L as Z}from"./LoadMore-BOCtgPLI.js";import{u as z}from"./useInfiniteGrid-DgSsqvQS.js";import"./ethers-DHDSyreX.js";const Q=[{key:"all",label:"Shop All"},{key:"wearable",label:"Wearables",expandable:!0,subs:[{key:"Head",label:"Head",icon:"cat-head"},{key:"Upper Body",label:"Upper Body",icon:"cat-upper"},{key:"Handwear",label:"Handwear",icon:"cat-handwear"},{key:"Lower Body",label:"Lower Body",icon:"cat-lower"},{key:"Feet",label:"Feet",icon:"cat-feet"},{key:"Accessories",label:"Accessories",icon:"cat-accessories"},{key:"Skins",label:"Skins",icon:"cat-skins"}]},{key:"emote",label:"Emotes",expandable:!0,subs:[{key:"Dance",label:"Dance",icon:"emote-dance"},{key:"Stunt",label:"Stunt",icon:"emote-stunt"},{key:"Greetings",label:"Greetings",icon:"emote-greetings"},{key:"Fun",label:"Fun",icon:"emote-fun"},{key:"Poses",label:"Poses",icon:"emote-poses"},{key:"Reactions",label:"Reactions",icon:"emote-reactions"},{key:"Horror",label:"Horror",icon:"emote-horror"},{key:"Miscellaneous",label:"Miscellaneous",icon:"emote-misc"}]}];function V({category:f,subCategory:n,onCategory:l,onSub:x}){const[c,b]=i.useState(()=>f==="wearable"?"wearable":null);function o(s){s.subs?b(t=>{const u=t!==s.key;return u&&l(s.key),u?s.key:null}):(l(s.key),b(null))}return e.jsx("div",{className:"catfilter",children:Q.map(s=>{const t=c===s.key&&!!s.subs,u=s.key===f;return e.jsxs("div",{className:"catfilter__group",children:[e.jsxs("button",{type:"button",className:`catfilter__cat${t?" is-expanded":""}${u?" is-selected":""}`,onClick:()=>o(s),children:[e.jsx("span",{className:"catfilter__cat-label",children:s.label}),s.expandable?e.jsx("span",{className:`ico ico-chevron catfilter__chev${t?" is-up":""}`,"aria-hidden":!0}):null]}),s.subs?e.jsx("div",{className:`catfilter__subs${t?" is-open":""}`,children:e.jsx("div",{className:"catfilter__subs-inner",children:s.subs.map(r=>e.jsx("button",{type:"button",className:`catfilter__sub${n===r.key?" is-active":""}`,onClick:()=>x(n===r.key?null:r.key),children:e.jsxs("span",{className:"catfilter__sub-left",children:[e.jsx("span",{className:`ico ico-${r.icon} catfilter__sub-ico`,"aria-hidden":!0}),e.jsx("span",{className:"catfilter__sub-label",children:r.label})]})},r.key))})}):null]},s.key)})})}const X=48,ee={Head:["head","hat","hair","facial_hair","eyes","eyebrows","mouth","mask","helmet","tiara","top_head"],"Upper Body":["upper_body"],Handwear:["hands_wear"],"Lower Body":["lower_body"],Feet:["feet"],Accessories:["earring","eyewear"],Skins:["skin"],Dance:["dance"],Stunt:["stunt"],Greetings:["greetings"],Fun:["fun"],Poses:["poses"],Reactions:["reactions"],Horror:["horror"],Miscellaneous:["miscellaneous"]};function ce(){const[f]=D(),n=(f.get("q")??"").trim().toLowerCase(),[l,x]=i.useState("wearable"),[c,b]=i.useState(null),[o,s]=i.useState([]),[t,u]=i.useState(""),[r,N]=i.useState(""),[p,R]=i.useState("newest"),y=t&&!Number.isNaN(Number(t))?Number(t):void 0,h=r&&!Number.isNaN(Number(r))?Number(r):void 0,E=c?ee[c]:void 0,B=(A.find(a=>a.key===p)??A[0]).server,j={category:l,rarities:o.length?o:void 0,wearableCategories:E,minPriceCredits:y,maxPriceCredits:h,search:n||void 0,sortBy:B},{items:S,total:w,isLoading:d,error:v,hasNextPage:L,isFetchingNextPage:C,fetchNextPage:H}=z(["listings",j],a=>J({...j,first:X,skip:a})),_=w,P=i.useRef(null);i.useEffect(()=>{d||!n||P.current===n||(P.current=n,F("Shop Searched",{query:n,result_count:_}))},[n,d,_]);const g=i.useRef("__init__");i.useEffect(()=>{if(d)return;const a=JSON.stringify({category:l,subCategory:c,rarities:o,min:y,max:h,sort:p});if(g.current==="__init__"||g.current===a){g.current=a;return}g.current=a,F("Shop Applied Filter",{filters:{category:l,sub_category:c,rarities:o,min_price_credits:y??null,max_price_credits:h??null,sort:p},result_count:_})},[l,c,o,y,h,p,d,_]);function $(a){x(a),b(null)}function G(a){s(m=>m.includes(a)?m.filter(O=>O!==a):[...m,a])}function T(){x("wearable"),b(null),s([]),u(""),N("")}const k=!!(y||h),U=k?`${t||"0"}–${r||"∞"}`:"Price",q=l!=="wearable"||!!c||o.length>0||k;return e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(V,{category:l,subCategory:c,onCategory:$,onSub:b})}),e.jsxs("div",{className:"browse__main",children:[e.jsx(W,{rarities:o,onToggleRarity:G,sort:p,onSort:R,total:w,loading:d,query:n,anyActive:q,onClear:T,renderTrailing:a=>e.jsx(Y,{panelKey:"price",label:U,active:k,panel:a,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":"Minimum price",placeholder:"Min",value:t,onChange:m=>u(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":"Maximum price",placeholder:"Max",value:r,onChange:m=>N(m.target.value)})]}),e.jsxs("p",{className:"filter-pop__hint",children:["Price in ",I.name]})]})})}),v?e.jsx("p",{className:"error",children:v.message}):null,e.jsx("div",{className:"grid",children:d?e.jsx(M,{count:15}):e.jsxs(e.Fragment,{children:[S.map(a=>e.jsx(K,{item:a},a.id)),C?e.jsx(M,{count:6}):null]})}),e.jsx(Z,{hasNextPage:L,isFetching:C,onLoadMore:()=>H()}),!d&&S.length===0?e.jsx("p",{className:"muted",children:"No items match your filters."}):null]})]})}export{ce as Assets};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,i as st,j as z,e as lt,R as H}from"./react-Vu6nbGi5.js";import{b as m,C as Ne,d as M,T as ut,t as ct,v as dt,x as pt,y as ft,_ as Y,c as I,a as ee,u as fe,s as A,k as he,g as Se,e as Ve,n as ht,z as mt,A as bt,q as gt,p as J}from"./generateUtilityClasses-
|
|
1
|
+
import{r as a,i as st,j as z,e as lt,R as H}from"./react-Vu6nbGi5.js";import{b as m,C as Ne,d as M,T as ut,t as ct,v as dt,x as pt,y as ft,_ as Y,c as I,a as ee,u as fe,s as A,k as he,g as Se,e as Ve,n as ht,z as mt,A as bt,q as gt,p as J}from"./generateUtilityClasses-BAjjhm6X.js";import{S as Ce}from"./SvgIcon-Cg5l4LDh.js";var se={};function vt(...e){return e.reduce((t,n)=>n==null?t:function(...r){t.apply(this,r),n.apply(this,r)},()=>{})}function xt(e,t=166){let n;function o(...r){const i=()=>{e.apply(this,r)};clearTimeout(n),n=setTimeout(i,t)}return o.clear=()=>{clearTimeout(n)},o}function yt(e,t){return()=>null}function Ct(e,t){var n,o;return a.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(o=e.type)==null||(o=o._payload)==null||(o=o.value)==null?void 0:o.muiName)!==-1}function ke(e){return e&&e.ownerDocument||document}function Rt(e){return ke(e).defaultView||window}function Et(e,t){return()=>null}function Le(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const _e=typeof window<"u"?a.useLayoutEffect:a.useEffect;let Re=0;function It(e){const[t,n]=a.useState(e),o=e||t;return a.useEffect(()=>{t==null&&(Re+=1,n(`mui-${Re}`))},[t]),o}const Ee=st.useId;function Tt(e){if(Ee!==void 0){const t=Ee();return e??t}return It(e)}function Mt(e,t,n,o,r){return null}function zt({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=a.useRef(e!==void 0),[i,s]=a.useState(t),c=r?e:i,u=a.useCallback(d=>{r||s(d)},[]);return[c,u]}function X(e){const t=a.useRef(e);return _e(()=>{t.current=e}),a.useRef((...n)=>(0,t.current)(...n)).current}function ue(...e){return a.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{Le(n,t)})},e)}const Ie={};function $t(e,t){const n=a.useRef(Ie);return n.current===Ie&&(n.current=e(t)),n}const Bt=[];function Pt(e){a.useEffect(e,Bt)}class te{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new te}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function Nt(){const e=$t(te.create).current;return Pt(e.disposeEffect),e}let ne=!0,ce=!1;const St=new te,Vt={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function kt(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&Vt[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function Lt(e){e.metaKey||e.altKey||e.ctrlKey||(ne=!0)}function le(){ne=!1}function _t(){this.visibilityState==="hidden"&&ce&&(ne=!0)}function Ft(e){e.addEventListener("keydown",Lt,!0),e.addEventListener("mousedown",le,!0),e.addEventListener("pointerdown",le,!0),e.addEventListener("touchstart",le,!0),e.addEventListener("visibilitychange",_t,!0)}function Dt(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return ne||kt(t)}function Fe(){const e=a.useCallback(r=>{r!=null&&Ft(r.ownerDocument)},[]),t=a.useRef(!1);function n(){return t.current?(ce=!0,St.start(100,()=>{ce=!1}),t.current=!1,!0):!1}function o(r){return Dt(r)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:o,onBlur:n,ref:e}}function jt(e,t){function n(o,r){return z.jsx(Ce,m({"data-testid":`${t}Icon`,ref:r},o,{children:e}))}return n.muiName=Ce.muiName,a.memo(a.forwardRef(n))}const Ot={configure:e=>{Ne.configure(e)}},Ut=Object.freeze(Object.defineProperty({__proto__:null,capitalize:M,createChainedFunction:vt,createSvgIcon:jt,debounce:xt,deprecatedPropType:yt,isMuiElement:Ct,ownerDocument:ke,ownerWindow:Rt,requirePropFactory:Et,setRef:Le,unstable_ClassNameGenerator:Ot,unstable_useEnhancedEffect:_e,unstable_useId:Tt,unsupportedProp:Mt,useControlled:zt,useEventCallback:X,useForkRef:ue,useIsFocusVisible:Fe},Symbol.toStringTag,{value:"Module"})),Wt=lt(Ut);var Te;function Vn(){return Te||(Te=1,(function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=Wt})(se)),se}function wt(e){return Object.keys(e).length===0}function At(e=null){const t=a.useContext(ut);return!t||wt(t)?e:t}const Kt=ct();function Gt(e=Kt){return At(e)}function De(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=De(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Ht(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=De(e))&&(o&&(o+=" "),o+=t);return o}const Xt=["className","component"];function Yt(e={}){const{themeId:t,defaultTheme:n,defaultClassName:o="MuiBox-root",generateClassName:r}=e,i=dt("div",{shouldForwardProp:c=>c!=="theme"&&c!=="sx"&&c!=="as"})(pt);return a.forwardRef(function(u,d){const f=Gt(n),b=ft(u),{className:g,component:x="div"}=b,h=Y(b,Xt);return z.jsx(i,m({as:x,ref:d,className:Ht(g,r?r(o):o),theme:t&&f[t]||f},h))})}function de(e,t){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},de(e,t)}function qt(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,de(e,t)}const Me=H.createContext(null);function Zt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function me(e,t){var n=function(i){return t&&a.isValidElement(i)?t(i):i},o=Object.create(null);return e&&a.Children.map(e,function(r){return r}).forEach(function(r){o[r.key]=n(r)}),o}function Jt(e,t){e=e||{},t=t||{};function n(f){return f in t?t[f]:e[f]}var o=Object.create(null),r=[];for(var i in e)i in t?r.length&&(o[i]=r,r=[]):r.push(i);var s,c={};for(var u in t){if(o[u])for(s=0;s<o[u].length;s++){var d=o[u][s];c[o[u][s]]=n(d)}c[u]=n(u)}for(s=0;s<r.length;s++)c[r[s]]=n(r[s]);return c}function w(e,t,n){return n[t]!=null?n[t]:e.props[t]}function Qt(e,t){return me(e.children,function(n){return a.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:w(n,"appear",e),enter:w(n,"enter",e),exit:w(n,"exit",e)})})}function en(e,t,n){var o=me(e.children),r=Jt(t,o);return Object.keys(r).forEach(function(i){var s=r[i];if(a.isValidElement(s)){var c=i in t,u=i in o,d=t[i],f=a.isValidElement(d)&&!d.props.in;u&&(!c||f)?r[i]=a.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:w(s,"exit",e),enter:w(s,"enter",e)}):!u&&c&&!f?r[i]=a.cloneElement(s,{in:!1}):u&&c&&a.isValidElement(d)&&(r[i]=a.cloneElement(s,{onExited:n.bind(null,s),in:d.props.in,exit:w(s,"exit",e),enter:w(s,"enter",e)}))}}),r}var tn=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},nn={component:"div",childFactory:function(t){return t}},be=(function(e){qt(t,e);function t(o,r){var i;i=e.call(this,o,r)||this;var s=i.handleExited.bind(Zt(i));return i.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(r,i){var s=i.children,c=i.handleExited,u=i.firstRender;return{children:u?Qt(r,c):en(r,s,c),firstRender:!1}},n.handleExited=function(r,i){var s=me(this.props.children);r.key in s||(r.props.onExited&&r.props.onExited(i),this.mounted&&this.setState(function(c){var u=m({},c.children);return delete u[r.key],{children:u}}))},n.render=function(){var r=this.props,i=r.component,s=r.childFactory,c=Y(r,["component","childFactory"]),u=this.state.contextValue,d=tn(this.state.children).map(s);return delete c.appear,delete c.enter,delete c.exit,i===null?H.createElement(Me.Provider,{value:u},d):H.createElement(Me.Provider,{value:u},H.createElement(i,c,d))},t})(H.Component);be.propTypes={};be.defaultProps=nn;function on(e){const{className:t,classes:n,pulsate:o=!1,rippleX:r,rippleY:i,rippleSize:s,in:c,onExited:u,timeout:d}=e,[f,b]=a.useState(!1),g=I(t,n.ripple,n.rippleVisible,o&&n.ripplePulsate),x={width:s,height:s,top:-(s/2)+i,left:-(s/2)+r},h=I(n.child,f&&n.childLeaving,o&&n.childPulsate);return!c&&!f&&b(!0),a.useEffect(()=>{if(!c&&u!=null){const C=setTimeout(u,d);return()=>{clearTimeout(C)}}},[u,c,d]),z.jsx("span",{className:g,style:x,children:z.jsx("span",{className:h})})}const T=ee("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),rn=["center","classes","className"];let oe=e=>e,ze,$e,Be,Pe;const pe=550,an=80,sn=he(ze||(ze=oe`
|
|
2
2
|
0% {
|
|
3
3
|
transform: scale(0);
|
|
4
4
|
opacity: 0.1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as $,r as g,j as e,L as I}from"./react-Vu6nbGi5.js";import{i as _,a as A,c as K,j as O,k as M,t as j,C as H,d as v,l as R,A as V,m as N,n as P,g as D,o as J,q as X,r as Z,s as ee,v as q,w as F,x as se,y as ae,z as te,B as re}from"./index-
|
|
1
|
+
import{a as $,r as g,j as e,L as I}from"./react-Vu6nbGi5.js";import{i as _,a as A,c as K,j as O,k as M,t as j,C as H,d as v,l as R,A as V,m as N,n as P,g as D,o as J,q as X,r as Z,s as ee,v as q,w as F,x as se,y as ae,z as te,B as re}from"./index-C7-iTfFV.js";import{f as z}from"./buy-YkuLG1h7.js";import{g as ce,b as ie,w as ne,G as le}from"./buy-gasless-gRmZHjsE.js";import"./ethers-DHDSyreX.js";import"./index-BlEd83Li.js";function oe(a){const o=a,i=(o.message??"").toLowerCase();return o.code===4001||i.includes("reject")||i.includes("denied")||i.includes("cancel")?"You cancelled the request.":i.includes("insufficient")?`You don't have enough ${R.name} — get more first.`:i.includes("no active listing")||i.includes("your own listing")?o.message:"Couldn't complete checkout — please try again."}function de(a){return te(a.received[0].amount)}function fe(){const a=_(s=>s.items),o=_(s=>s.remove),i=_(s=>s.clear),U=_(s=>s.setFittingOpen),{session:t}=A(),Y=a.some(s=>s.category!=="emote"),{data:y}=K({queryKey:["upsell-listings"],queryFn:()=>re({first:40}),staleTime:6e4}),{data:l}=O(t),b=M(),G=$(),[C,m]=g.useState(null),[w,f]=g.useState(null),[h,k]=g.useState(!1),d=a.reduce((s,u)=>s+u.priceCredits,0),B=new Set(a.map(s=>s.id)),S=((y==null?void 0:y.items)??[]).filter(s=>!B.has(s.id)).slice(0,6);async function L(){if(!t){f("Sign in to check out.");return}f(null),k(!0),N("Shop Started Checkout",{cart_size:a.length,cart_value_credits:d,cart_value_usd:P(d),has_sufficient_credits:((l==null?void 0:l.credits)??0)>=d});const s=a.slice(),u=[];let x="authorize",E=!1;try{m("Preparing your order…");const c=[];for(const r of a){const p=r.tradeId?await D(r.tradeId):await J(r.contractAddress,r.itemId??"");if(!p)throw new Error(`No active listing for ${r.name}.`);if(X(p,t.address))throw new Error(`You can't buy your own listing: ${r.name}.`);const Q=de(p),{credit:T,maxCreditedValue:W}=await Z(t.identity,Q,r.tradeId);u.push(T.id),c.push({trade:p,credits:[T],maxCreditedValue:W})}m("Confirming your purchase…"),x="submit";let n=[];if(ce())try{n=await ie({purchases:c,buyer:t.address,signer:t.signer}),await Promise.all(n.map(r=>ne(r))),E=!0}catch(r){if(!(r instanceof le))throw r;n=await z({purchases:c,buyer:t.address,signer:t.signer})}else n=await z({purchases:c,buyer:t.address,signer:t.signer});i(),m("Purchased! 🎉"),N("Shop Completed Purchase",{...ee(s),payment_type:"credits",no_crypto_step:E,transaction_hash:n[0]??null}),b.invalidateQueries({queryKey:["usd-balance"]}),G("/success",{state:{items:s,txHash:n[0]}})}catch(c){if(q(c)||F(c,{flow:"cart_checkout",step:x,cart_size:a.length}),N(q(c)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:x,error_code:se(c),value_usd:P(d),cart_size:a.length}),u.length){try{await ae(t.identity,u)}catch(n){F(n,{flow:"cart_checkout",step:"release"})}b.invalidateQueries({queryKey:["usd-balance"]})}f(oe(c)),m(null)}finally{k(!1)}}return a.length===0?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx("span",{className:"ico ico-cart cart-empty__ico","aria-hidden":!0}),e.jsx("p",{className:"cart-empty__title",children:j("cart.empty.title")}),e.jsx("p",{className:"muted",children:j("cart.empty.body")}),e.jsx(I,{className:"btn btn--purple",to:"/assets",children:j("cart.empty.cta")})]}):e.jsxs("div",{className:"cart",children:[e.jsxs("h1",{children:["Cart (",a.length,")"]}),e.jsx("div",{className:"cart__list",children:a.map(s=>e.jsxs("div",{className:"cart__row",children:[e.jsx("div",{className:"cart__thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}),e.jsxs("div",{className:"cart__info",children:[e.jsx("div",{className:"cart__name",children:s.name}),s.creator?e.jsx(H,{address:s.creator,className:"cart__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"cart__price",children:[e.jsx(v,{className:"ccy-mark"})," ",s.priceCredits]}),e.jsx("button",{className:"cart__remove",onClick:()=>o(s.id),disabled:h,"aria-label":`Remove ${s.name}`,title:"Remove",children:e.jsx("span",{className:"ico ico-trash","aria-hidden":!0})})]},s.id))}),e.jsxs("div",{className:"cart__foot",children:[e.jsxs("div",{className:"cart__total",children:[e.jsxs("div",{className:"cart__total-line",children:["Total ",e.jsxs("strong",{children:[e.jsx(v,{className:"ccy-mark"})," ",d]})]}),t?e.jsxs("div",{className:"muted cart__balance",children:["Your balance: ",e.jsx(v,{className:"ccy-mark"})," ",(l==null?void 0:l.credits)??0]}):null]}),e.jsxs("div",{className:"cart__actions",children:[Y?e.jsx("button",{className:"btn btn--ghost",onClick:()=>U(!0),disabled:h,children:"Try on outfit"}):null,e.jsxs(I,{className:"btn btn--ghost",to:"/credits",children:["Get ",R.name]}),e.jsx("button",{className:"btn btn--purple cart__checkout",onClick:L,disabled:h,children:"Checkout"})]})]}),e.jsxs("div",{className:"cart__utils",children:[e.jsx("button",{className:"link",onClick:i,disabled:h,children:"Clear cart"}),null]}),C?e.jsx("p",{className:"muted",style:{marginTop:12},children:C}):null,w?e.jsx("p",{className:"error",style:{marginTop:12},children:w}):null,S.length>0?e.jsxs("section",{className:"row cart-upsell",children:[e.jsx("div",{className:"row__head",children:e.jsx("h2",{className:"row__title",children:"You might also like"})}),e.jsx("div",{className:"row__track",children:S.map(s=>e.jsx(V,{item:s},s.id))})]}):null]})}export{fe as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as N,a as U,u as w,_ as z,b as o,c as E,d as n,e as I,s as v,f as D,k as _}from"./generateUtilityClasses-
|
|
1
|
+
import{g as N,a as U,u as w,_ as z,b as o,c as E,d as n,e as I,s as v,f as D,k as _}from"./generateUtilityClasses-BAjjhm6X.js";import{r as F,j as g}from"./react-Vu6nbGi5.js";function K(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=_(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as g,a as h,j as e}from"./react-Vu6nbGi5.js";import{C as x,A as j,f as _}from"./index-
|
|
1
|
+
import{u as g,a as h,j as e}from"./react-Vu6nbGi5.js";import{C as x,A as j,f as _}from"./index-C7-iTfFV.js";import{A as N}from"./collection-2CKCNH2O.js";import{S as m}from"./SkeletonCards-BysJEVmg.js";import{L as f}from"./LoadMore-BOCtgPLI.js";import{u as C}from"./useInfiniteGrid-DgSsqvQS.js";import"./ethers-DHDSyreX.js";const b=48;function F(){var i;const{contractAddress:o}=g(),d=h(),{items:s,total:t,isLoading:a,error:c,hasNextPage:u,isFetchingNextPage:n,fetchNextPage:p}=C(["collection-page",o],l=>_(o,{first:b,skip:l}),{enabled:!!o}),r=(i=s[0])==null?void 0:i.creator;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>d("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Collection"})]}),e.jsxs("header",{className:"collection-page__head",children:[e.jsx("h1",{className:"collection-page__title",children:"Collection"}),r?e.jsx(x,{address:r,className:"collection-page__creator"}):null,e.jsx("span",{className:"muted collection-page__count",children:a?"…":`${t.toLocaleString()} item${t===1?"":"s"}`})]}),!a&&s.length>0?e.jsx(N,{items:s,source:"collection"}):null,c?e.jsx("p",{className:"error",children:c.message}):null,e.jsx("div",{className:"grid",children:a?e.jsx(m,{count:12}):e.jsxs(e.Fragment,{children:[s.map(l=>e.jsx(j,{item:l},l.id)),n?e.jsx(m,{count:6}):null]})}),e.jsx(f,{hasNextPage:u,isFetching:n,onLoadMore:()=>p()}),!a&&!c&&s.length===0?e.jsx("p",{className:"muted",children:"This collection has no items to show."}):null]})}export{F as Collection,F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,u as g,a as p}from"./react-Vu6nbGi5.js";import{G as i,C as h,A as x,H as j}from"./index-
|
|
1
|
+
import{j as e,u as g,a as p}from"./react-Vu6nbGi5.js";import{G as i,C as h,A as x,H as j}from"./index-C7-iTfFV.js";import{A as f}from"./collection-2CKCNH2O.js";import{S as m}from"./SkeletonCards-BysJEVmg.js";import{L as N}from"./LoadMore-BOCtgPLI.js";import{u as b}from"./useInfiniteGrid-DgSsqvQS.js";import"./ethers-DHDSyreX.js";function _({address:s,className:r=""}){const o=i(t=>t.followed.includes(s.toLowerCase())),a=i(t=>t.toggle);return s?e.jsx("button",{type:"button",className:`btn btn--sm ${o?"btn--ghost":"btn--outline"} ${r}`.trim(),"aria-pressed":o,title:o?"Unfollow creator":"Follow creator",onClick:()=>a(s),children:o?"Following":"Follow"}):null}const C=48;function S(){const{address:s}=g(),r=p(),{items:o,total:a,isLoading:t,error:n,hasNextPage:u,isFetchingNextPage:c,fetchNextPage:d}=b(["creator-page",s],l=>j(s,{first:C,skip:l}),{enabled:!!s});return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Creator"})]}),e.jsxs("header",{className:"collection-page__head",children:[s?e.jsx(h,{address:s,className:"collection-page__title-creator"}):null,s?e.jsx(_,{address:s}):null,e.jsx("span",{className:"muted collection-page__count",children:t?"…":`${a.toLocaleString()} item${a===1?"":"s"}`})]}),!t&&o.length>0?e.jsx(f,{items:o,source:"creator"}):null,n?e.jsx("p",{className:"error",children:n.message}):null,e.jsx("div",{className:"grid",children:t?e.jsx(m,{count:12}):e.jsxs(e.Fragment,{children:[o.map(l=>e.jsx(x,{item:l},l.id)),c?e.jsx(m,{count:6}):null]})}),e.jsx(N,{hasNextPage:u,isFetching:c,onLoadMore:()=>d()}),!t&&!n&&o.length===0?e.jsx("p",{className:"muted",children:"This creator has no items to show yet."}):null]})}export{S as Creator,S as default};
|
|
@@ -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-
|
|
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-D4DCXtQm.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-DIMSfymy.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,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RealCheckout-
|
|
2
|
-
import{R as P,h as y,S as F,a as O,k as V,m as _,w as v,x as S,l as u,d as C,K as $,_ as K}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RealCheckout-DBL3uxEj.js","assets/react-Vu6nbGi5.js","assets/index-C7-iTfFV.js","assets/ethers-DHDSyreX.js","assets/index-DCrqkiFN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{R as P,h as y,S as F,a as O,k as V,m as _,w as v,x as S,l as u,d as C,K as $,_ as K}from"./index-C7-iTfFV.js";import{a as Y,r as l,j as e}from"./react-Vu6nbGi5.js";import{C as N}from"./CircularProgress-Cf__730y.js";import"./ethers-DHDSyreX.js";import"./generateUtilityClasses-BAjjhm6X.js";function R(){return y.shopServerUrl||y.creditsServerUrl}async function z(t,s){const r=await P(`${R()}/credits/checkout`,{method:"POST",identity:s,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify({packId:t})});if(!r.ok)throw new Error(`checkout ${r.status}: ${await r.text()}`);const{orderId:a,clientSecret:n}=await r.json();return{orderId:a,clientSecret:n,mock:!1}}async function L(t,s,r={}){const{intervalMs:a=1500,timeoutMs:n=6e4,signal:i}=r,c=Date.now()+n;for(;;){if(i!=null&&i.aborted)throw new DOMException("Aborted","AbortError");const m=await q(t,s,i);if(m.status!=="processing")return m;if(Date.now()>c)return{status:"failed",error:"Timed out waiting for your credits."};await J(a,i)}}async function q(t,s,r){const a=await P(`${R()}/credits/orders/${t}`,{method:"GET",identity:s,metadata:{},signal:r});if(!a.ok)throw new Error(`order status ${a.status}`);return a.json()}function J(t,s){return new Promise((r,a)=>{const n=setTimeout(r,t);s==null||s.addEventListener("abort",()=>{clearTimeout(n),a(new DOMException("Aborted","AbortError"))})})}const Q=.1,G=[{id:"pack_5",usd:5,credits:x(5)},{id:"pack_10",usd:10,credits:x(10)},{id:"pack_25",usd:25,credits:x(25),bestValue:!0},{id:"pack_50",usd:50,credits:x(50)}];function x(t){return Math.round(t/Q)}function T(t){return G.find(s=>s.id===t)}const j="mock_cs_";function M(){return!y.stripePublishableKey||!y.shopServerUrl}async function W(t,s){const r=T(t);if(!r)throw new Error("Unknown pack");if(M())return H(r);if(!(s!=null&&s.identity))throw new Error("Sign in to get credits.");return z(t,s.identity)}async function X(t,s={}){const{intervalMs:r,timeoutMs:a,signal:n,identity:i}=s;if(t.startsWith(j)||M())return Z(t,s);if(!i)throw new Error("Sign in to get credits.");return L(t,i,{intervalMs:r,timeoutMs:a,signal:n})}function H(t){const s=`${j}${t.id}_${Date.now()}`;return D(400).then(()=>({orderId:s,clientSecret:`${j}${t.id}`,mock:!0}))}async function Z(t,s={}){await D(s.intervalMs??900);const r=t.replace(j,"").replace(/_\d+$/,""),a=T(r),n=(a==null?void 0:a.credits)??0;if(s.address&&a)try{const i=await F(s.address,Math.round(a.usd*100));return{status:"credited",creditsGranted:n,newBalance:i.credits}}catch(i){return{status:"failed",error:i.message}}return{status:"credited",creditsGranted:n,newBalance:n}}function D(t,s){return new Promise((r,a)=>{setTimeout(r,t)})}const b=y.shopServerUrl?"stripe":"mock",ee=l.lazy(()=>K(()=>import("./RealCheckout-DBL3uxEj.js"),__vite__mapDeps([0,1,2,3,4])));function E(t){const s=t;if((s==null?void 0:s.name)==="AbortError")return"You cancelled the request.";const r=((s==null?void 0:s.message)??"").toLowerCase();return r.includes("sign in")?`Sign in to get ${u.name}.`:r.includes("timed out")?`This is taking longer than usual — your ${u.name} will appear shortly.`:"Couldn't complete your purchase — please try again."}function oe(){const t=Y(),{session:s,signIn:r}=O(),a=V(),[n,i]=l.useState("select"),[c,m]=l.useState(null),[h,k]=l.useState(null),[I,w]=l.useState(null),[A,p]=l.useState(null),f=l.useRef(null);l.useEffect(()=>()=>{var d;return(d=f.current)==null?void 0:d.abort()},[]);const B=l.useCallback(async d=>{if(!s){r();return}p(null),m(d),i("paying"),_("Shop Started Buy Credits",{pack_usd:d.usd,credits:d.credits,provider:b});try{const o=await W(d.id,{address:s.address,identity:s.identity});k(o)}catch(o){v(o,{flow:"get_credits",step:"checkout",provider:b}),_("Shop Buy Credits Failed",{step:"checkout",error_code:S(o),pack_usd:d.usd}),p(E(o)),i("error")}},[s,r]),U=l.useCallback(async()=>{if(!h)return;i("processing");const d=new AbortController;f.current=d;try{const o=await X(h.orderId,{signal:d.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});o.status==="credited"?(w(o.creditsGranted??(c==null?void 0:c.credits)??0),i("success"),_("Shop Completed Buy Credits",{order_id:h.orderId,pack_usd:(c==null?void 0:c.usd)??null,credits:o.creditsGranted??(c==null?void 0:c.credits)??0,provider:b}),a.invalidateQueries({queryKey:["usd-balance"]})):(_("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),p(o.error??`Couldn't add your ${u.name} — please try again.`),i("error"))}catch(o){v(o,{flow:"get_credits",step:"grant",order_id:h.orderId}),_("Shop Buy Credits Failed",{step:"grant",error_code:S(o),pack_usd:(c==null?void 0:c.usd)??null}),p(E(o)),i("error")}},[h,c,s,a]);function g(){var d;(d=f.current)==null||d.abort(),i("select"),m(null),k(null),w(null),p(null)}return e.jsxs("div",{className:"getcredits",children:[e.jsxs("header",{className:"getcredits__head",children:[e.jsxs("h1",{className:"getcredits__title",children:["Get ",u.name]}),e.jsxs("p",{className:"muted",children:["Add ",u.name," to your account to shop. Pay with any card."]})]}),s?e.jsxs(e.Fragment,{children:[n==="select"&&e.jsx(se,{onSelect:B}),n==="paying"&&c&&e.jsx(te,{pack:c,checkout:h,onPaid:U,onCancel:g}),n==="processing"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:40}),e.jsxs("p",{className:"getcredits__status-title",children:["Adding your ",u.name,"…"]}),e.jsx("p",{className:"muted",children:"Payment received. Just a moment while we top up your balance."})]}),n==="success"&&e.jsxs("div",{className:"getcredits__status getcredits__status--ok",role:"status","aria-live":"polite",children:[e.jsx("div",{className:"getcredits__confetti","aria-hidden":!0,children:"🎉"}),e.jsx("p",{className:"getcredits__status-title",children:"You’re all set!"}),e.jsxs("p",{className:"muted",children:[e.jsxs("strong",{children:[e.jsx(C,{className:"ccy-mark"})," ",I]})," ",u.name," added to your account."]}),e.jsxs("div",{className:"getcredits__status-actions",children:[e.jsx("button",{className:"btn",onClick:()=>t("/cart"),children:"Back to cart"}),e.jsxs("button",{className:"btn btn--ghost",onClick:g,children:["Get more ",u.name]})]})]}),n==="error"&&e.jsxs("div",{className:"getcredits__status getcredits__status--err",role:"alert",children:[e.jsx("p",{className:"getcredits__status-title",children:"Something went wrong"}),e.jsx("p",{className:"error",children:A}),e.jsx("div",{className:"getcredits__status-actions",children:e.jsx("button",{className:"btn",onClick:g,children:"Try again"})})]})]}):e.jsxs("div",{className:"getcredits__status",role:"status",children:[e.jsxs("p",{className:"getcredits__status-title",children:["Sign in to get ",u.name]}),e.jsxs("p",{className:"muted",children:["Connect your account to buy ",u.name," and start shopping."]}),e.jsx("div",{className:"getcredits__status-actions",children:e.jsx("button",{className:"btn btn--purple",onClick:r,children:"Sign in"})})]})]})}function se({onSelect:t}){return e.jsx("div",{className:"packs",children:G.map(s=>e.jsxs("button",{type:"button",className:`pack${s.bestValue?" pack--best":""}`,onClick:()=>t(s),"aria-label":`Get ${$(s.credits)} for $${s.usd}`,children:[s.bestValue&&e.jsx("span",{className:"pack__ribbon",children:"Best value"}),e.jsxs("span",{className:"pack__credits",children:[e.jsx(C,{className:"pack__credits-ico"}),s.credits]}),e.jsx("span",{className:"pack__label",children:u.name}),e.jsxs("span",{className:"pack__price",children:["$",s.usd]}),e.jsxs("span",{className:"pack__cta",children:["Get ",u.name]})]},s.id))})}function te({pack:t,checkout:s,onPaid:r,onCancel:a}){return e.jsxs("div",{className:"pay",children:[e.jsxs("div",{className:"pay__summary",children:[e.jsx("button",{className:"link",onClick:a,children:"← Choose a different pack"}),e.jsxs("div",{className:"pay__summary-row",children:[e.jsx("span",{children:"You’ll get"}),e.jsxs("strong",{children:[e.jsx(C,{className:"ccy-mark"})," ",$(t.credits)]})]}),e.jsxs("div",{className:"pay__summary-row pay__summary-row--total",children:[e.jsx("span",{children:"You pay"}),e.jsxs("strong",{children:["$",t.usd]})]})]}),e.jsx("div",{className:"pay__form",children:s?s.mock?e.jsx(re,{onPaid:r,amountUsd:t.usd}):e.jsx(l.Suspense,{fallback:e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:32}),e.jsx("p",{className:"muted",children:"Getting the payment form ready…"})]}),children:e.jsx(ee,{clientSecret:s.clientSecret,onComplete:r})}):e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(N,{size:32}),e.jsx("p",{className:"muted",children:"Getting the payment form ready…"})]})})]})}function re({onPaid:t,amountUsd:s}){const[r,a]=l.useState("4242 4242 4242 4242"),[n,i]=l.useState(!1);function c(){i(!0),setTimeout(()=>t(),700)}return e.jsxs("div",{className:"card-form","aria-label":"Payment details",children:[e.jsx("p",{className:"muted small card-form__note",children:"Demo mode — no real charge is made."}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Card number"}),e.jsx("input",{value:r,onChange:m=>a(m.target.value),disabled:n,inputMode:"numeric"})]}),e.jsxs("div",{className:"card-form__row",children:[e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Expiry"}),e.jsx("input",{defaultValue:"12 / 34",disabled:n})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"CVC"}),e.jsx("input",{defaultValue:"123",disabled:n,inputMode:"numeric"})]})]}),e.jsx("button",{className:"btn btn--purple card-form__pay",onClick:c,disabled:n,children:n?"Processing…":`Pay $${s}`})]})}export{oe as GetCredits,oe 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-
|
|
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-BOQwd6ZB.js";import{d as g,r as v}from"./index-DIMSfymy.js";import{C as c}from"./ConstantsUtil-DrWe0yob.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-D4DCXtQm.js";import{au as y}from"./NetworkUtil-Ddexw9-U.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E,r as d,j as e,L as M}from"./react-Vu6nbGi5.js";import{m as Q,w as A,l as w,d as v,a as K,k as F,c as P,I as R}from"./index-
|
|
1
|
+
import{a as E,r as d,j as e,L as M}from"./react-Vu6nbGi5.js";import{m as Q,w as A,l as w,d as v,a as K,k as F,c as P,I as R}from"./index-C7-iTfFV.js";import{i as W,f as Y}from"./import-BulayqYM.js";import{s as O}from"./wallet-kind-vciDs8sO.js";import"./ethers-DHDSyreX.js";import"./buy-YkuLG1h7.js";import"./index-BlEd83Li.js";import"./mana-rate-DkxpKYLQ.js";function B({queue:n,session:k,onClose:j,onDone:u}){const N=E(),l=O(k.providerType),[c,f]=d.useState(()=>n.map(()=>"pending")),[y,C]=d.useState("running"),I=d.useRef(!1);d.useEffect(()=>{if(I.current)return;I.current=!0;let a=!1;return(async()=>{for(let i=0;i<n.length;i++){if(a)return;f(o=>o.map((p,h)=>h===i?"active":p));try{await W(n[i].item,n[i].priceCredits,k),Q("Shop Migrated Listing",{item_id:n[i].item.itemId??n[i].item.oldTradeId??null,contract_address:n[i].item.contractAddress,new_price_credits:n[i].priceCredits,new_price_usd:n[i].priceCredits/10}),a||f(o=>o.map((p,h)=>h===i?"done":p))}catch(o){const p=o,h=p.code===4001||/reject|denied|cancel/i.test(p.message??"");h||A(o,{flow:"import_listing",itemId:n[i].item.itemId??n[i].item.oldTradeId}),a||f(S=>S.map((T,t)=>t===i?h?"skipped":"failed":T))}}a||C("finished")})(),()=>{a=!0}},[]);const m=c.filter(a=>a==="done").length,g=c.findIndex(a=>a==="active"),_=Math.round(c.filter(a=>a!=="pending"&&a!=="active").length/n.length*100);function x(){u(),j()}if(y==="finished"){const a=c.filter(i=>i==="skipped"||i==="failed").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:m>0?"You're in the Shop! 🎉":"Nothing listed"}),e.jsxs("p",{className:"muted",style:{margin:0},children:[m>0?`${m} ${m===1?"item is":"items are"} now for sale with ${w.name}.`:"No items were listed.",a>0?` ${a} skipped — you can try those again anytime.`:""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:x,children:"Done"}),m>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{u(),j(),N("/assets")},children:"View in Shop"}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:"Listing your items"}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[l?"We take down each old listing and re-list it for credits — confirm each step.":"Moving your items to the Shop."," ",g>=0?`${g+1} of ${n.length}`:""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${_}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((a,i)=>e.jsxs("li",{className:`migrate__row migrate__row--${c[i]}`,children:[e.jsx("span",{className:"migrate__thumb",children:a.item.thumbnail?e.jsx("img",{src:a.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:a.item.name,children:a.item.name||"Item"}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(v,{className:"ccy-mark"})," ",a.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:c[i]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",l?"Confirm…":"Adding…"]}):c[i]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):c[i]==="skipped"?e.jsx("span",{className:"migrate__skip",children:"Skipped"}):c[i]==="failed"?e.jsx("span",{className:"migrate__skip",children:"Failed"}):e.jsx("span",{className:"migrate__wait",children:"Waiting"})})]},a.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:l?"A couple of quick confirmations pop up per item (take down + re-list). Keep this open.":"This only takes a moment — keep this open."})]})})}const D=[{key:"creations",title:"Your creations",sub:"Items you made. Put them on sale in the Shop."},{key:"owned",title:"Items you own",sub:"Things you've bought elsewhere — resell them in the Shop."}];function q(){const{session:n,signIn:k,restore:j}=K(),u=F(),N=n==null?void 0:n.address;d.useEffect(()=>{j()},[j]);const{data:l,isLoading:c}=P({queryKey:["importable",N],queryFn:()=>Y(N),enabled:!!N}),[f,y]=d.useState({}),[C,I]=d.useState(new Set),[m,g]=d.useState(null),_=d.useMemo(()=>[...(l==null?void 0:l.creations)??[],...(l==null?void 0:l.owned)??[]],[l]);d.useEffect(()=>{_.length&&y(t=>{const r={...t};for(const s of _)r[s.oldTradeId]==null&&(r[s.oldTradeId]=s.suggestedCredits);return r})},[_]);const x=t=>!C.has(t),a=t=>f[t.oldTradeId]??t.suggestedCredits,i=_.filter(t=>x(t.oldTradeId)),o=i.reduce((t,r)=>t+a(r),0);function p(t,r){const s=r.replace(/[^\d]/g,"");y(b=>({...b,[t]:s===""?0:parseInt(s,10)}))}function h(t){I(r=>{const s=new Set(r);return s.has(t)?s.delete(t):s.add(t),s})}function S(t){return t.map(r=>({item:r,priceCredits:Math.max(1,a(r))}))}function T(){u.invalidateQueries({queryKey:["importable"]}),u.invalidateQueries({queryKey:["listings"]}),u.invalidateQueries({queryKey:["my-assets"]}),u.invalidateQueries({queryKey:["collection-sale-state"]}),R.success("Your Shop is updated.")}return n?!c&&_.length===0?e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"✨"}),e.jsx("h1",{className:"imp-empty__title",children:"You're all caught up"}),e.jsx("p",{className:"muted",children:"Everything you sell is already in the Shop — nothing to import."}),e.jsx(M,{className:"btn btn--purple",to:"/my-assets",children:"Go to My Assets"})]}):e.jsxs("div",{className:"imp",children:[e.jsxs("header",{className:"imp__head",children:[e.jsx("span",{className:"imp__eyebrow",children:"Import to the Shop"}),e.jsxs("h1",{className:"imp__title",children:["Bring your listings ",e.jsx("span",{className:"imp__grad",children:"into the Shop"})]}),e.jsxs("p",{className:"imp__lede",children:["These items are already for sale elsewhere. We suggested a price in ",w.name," for each — matched to today's rate and rounded up. Adjust anything, then list them."]})]}),e.jsxs("div",{className:"imp__ratebar",children:[e.jsx(v,{className:"ccy-mark imp__diamond"})," 1 ",w.nameSingular," = $0.10 · prices rounded up"]}),c?e.jsx("div",{className:"imp__list",children:Array.from({length:4}).map((t,r)=>e.jsx("div",{className:"imp-row imp-row--skeleton"},r))}):D.map(t=>{const r=(l==null?void 0:l[t.key])??[];return r.length===0?null:e.jsxs("section",{className:"imp__section",children:[e.jsxs("div",{className:"imp__section-head",children:[e.jsx("h2",{className:"imp__section-title",children:t.title}),e.jsx("span",{className:"imp__section-sub",children:t.sub})]}),e.jsx("div",{className:"imp__list",children:r.map(s=>{const b=a(s),L=b!==s.suggestedCredits;return e.jsxs("article",{className:`imp-row${x(s.oldTradeId)?"":" is-off"}`,children:[e.jsx("input",{type:"checkbox",className:"imp-check",checked:x(s.oldTradeId),onChange:()=>h(s.oldTradeId),"aria-label":`Include ${s.name}`}),e.jsx("div",{className:"imp-thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs("div",{className:"imp-meta",children:[e.jsx("div",{className:"imp-name",title:s.name,children:s.name||"Item"}),e.jsx("span",{className:"imp-chip",children:s.rarity})]}),e.jsxs("div",{className:"imp-price",children:[e.jsxs("div",{className:"imp-price__field",children:[e.jsx(v,{className:"ccy-mark imp-price__diamond"}),e.jsx("input",{className:"imp-price__input",inputMode:"numeric",value:b.toLocaleString(),onChange:$=>p(s.oldTradeId,$.target.value),"aria-label":`Price in ${w.name} for ${s.name}`})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(b*.1).toFixed(2)]}),L?e.jsxs("button",{className:"imp-price__reset",onClick:()=>y($=>({...$,[s.oldTradeId]:s.suggestedCredits})),children:["Reset to ",e.jsx(v,{className:"ccy-mark"}),s.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx("div",{className:"imp-action",children:e.jsx("button",{className:"btn btn--sm imp-row__list",disabled:!x(s.oldTradeId),onClick:()=>g(S([s])),children:"List"})})]},s.oldTradeId)})})]},t.key)}),e.jsx("div",{className:"imp-dock",children:e.jsxs("div",{className:"imp-dock__inner",children:[e.jsxs("div",{className:"imp-dock__summary",children:[e.jsxs("div",{className:"imp-dock__total",children:[e.jsx(v,{className:"ccy-mark imp__diamond"})," ",o.toLocaleString()]}),e.jsxs("div",{className:"imp-dock__sub",children:[i.length," item",i.length===1?"":"s"," selected · $",(o*.1).toFixed(2)]})]}),e.jsx("span",{className:"imp-dock__spacer"}),e.jsxs("button",{className:"btn btn--purple imp-dock__cta",disabled:i.length===0,onClick:()=>g(S(i)),children:["List all (",i.length,")"]})]})}),m&&n?e.jsx(B,{queue:m,session:n,onClose:()=>g(null),onDone:T}):null]}):e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"📦"}),e.jsx("h1",{className:"imp-empty__title",children:"Import your listings"}),e.jsx("p",{className:"muted",children:"Sign in to bring the items you already sell into the Shop."}),e.jsx("button",{className:"btn btn--purple",onClick:()=>k(),children:"Sign in"})]})}export{q as ImportListings};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{j as e,r as c,u as pe,d as fe,a as ve,L as xe}from"./react-Vu6nbGi5.js";import{_ as je,a as Q,V as Ne,X as be,Y as ye,Z as ge,W as Ie,D as A,h as X,$ as we,i as T,d as L,I as Ce,u as Y,j as Ae,c as P,m as V,a0 as ke,a1 as Ee,a2 as Se,a3 as Le,C as Pe,a4 as K,a5 as Te,g as Re,q as Fe,z as $e,r as Be,s as qe,v as H,w as Me,y as Ve,n as De,x as Oe,l as We,f as Ue,a6 as ze,a7 as Ge,o as Ye}from"./index-Dmfk0azd.js";import{h as Z}from"./buy-C8v-ou6b.js";import{g as Ke,a as He,w as Ze,G as Qe}from"./buy-gasless-CUtIigP0.js";import"./ethers-DHDSyreX.js";import"./index-AgzyxgSU.js";const Xe=c.lazy(()=>je(()=>import("./index-PQMQyCqV.js").then(t=>t.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(t=>({default:t.EmoteControls})));function Je(t){return e.jsx(c.Suspense,{fallback:null,children:e.jsx(Xe,{...t})})}function es({item:t}){const n=Q(v=>{var y;return(y=v.session)==null?void 0:y.address}),{data:r,isLoading:p}=Ne(n),I=n&&r?n:"default",u=t.category==="emote",[j,l]=c.useState("avatar"),m=!u&&j==="item",[s,i]=c.useState(!0);c.useEffect(()=>{i(!0)},[t.id,m]);const o=!!n&&!!r,f=o&&be(t,ye(r)),b=ge(t)[0],h=o&&!f&&!u;return e.jsxs(e.Fragment,{children:[p?null:e.jsx(Ie,{id:"shop-item-preview",contractAddress:t.contractAddress,tokenId:t.tokenId??void 0,itemId:t.tokenId?void 0:t.itemId??void 0,profile:m?void 0:f?I:"default",bodyShape:m||f?void 0:b,type:u?void 0:m?A.PreviewType.WEARABLE:A.PreviewType.AVATAR,emote:u||m?void 0:A.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:u?1.5:void 0,wheelStart:u?100:void 0,dev:X.chainId===80002,onLoad:()=>i(!1)},t.id),p||s?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":"Loading preview",children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,h&&!m?e.jsxs("p",{className:"item-preview__note",children:["Shown on a ",we(b)," body — this item isn’t made for your avatar’s shape."]}):null,u?e.jsx("div",{className:"item-preview__emote-controls",children:e.jsx(Je,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":"Preview mode",children:[e.jsx("button",{type:"button",className:j==="avatar"?"is-active":"","aria-pressed":j==="avatar",onClick:()=>l("avatar"),children:"On avatar"}),e.jsx("button",{type:"button",className:j==="item"?"is-active":"","aria-pressed":j==="item",onClick:()=>l("item"),children:"Item"})]})]})}function ss(t){return t==="male"?"♂":t==="female"?"♀":t==="unisex"?"⚥":""}function as({title:t,items:n,activeId:r,onSelect:p,onViewAll:I}){const u=c.useRef(null),j=T(i=>i.add),l=T(i=>i.items.map(o=>o.id));if(n.length===0)return null;function m(i){j(i,"carousel"),Ce.success(`“${i.name}” added to your cart.`)}function s(i){const o=u.current;o&&o.scrollBy({left:i*Math.round(o.clientWidth*.8),behavior:"smooth"})}return e.jsxs("section",{className:"collection-carousel",children:[e.jsxs("div",{className:"collection-carousel__head",children:[e.jsx("h2",{className:"collection-carousel__title",children:t}),e.jsxs("div",{className:"collection-carousel__head-right",children:[I?e.jsx("button",{className:"collection-carousel__viewall",onClick:I,children:"View all"}):null,e.jsxs("div",{className:"collection-carousel__arrows",children:[e.jsx("button",{className:"collection-carousel__arrow",onClick:()=>s(-1),"aria-label":"Scroll left",children:"‹"}),e.jsx("button",{className:"collection-carousel__arrow",onClick:()=>s(1),"aria-label":"Scroll right",children:"›"})]})]})]}),e.jsx("div",{className:"collection-carousel__track",ref:u,children:n.map(i=>{const o=ss(i.gender),f=i.id===r,b=i.priceCredits>0,h=l.includes(i.id);return e.jsxs("article",{className:`collection-carousel__card${f?" is-active":""}`,onClick:()=>p(i),role:"button",tabIndex:0,"aria-current":f||void 0,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),p(i))},children:[e.jsxs("div",{className:"collection-carousel__media",children:[i.thumbnail?e.jsx("img",{className:"collection-carousel__img",src:i.thumbnail,alt:i.name,loading:"lazy"}):null,b?e.jsx("button",{className:"collection-carousel__add",disabled:h,"aria-label":h?"In cart":`Add ${i.name} to cart`,title:h?"In cart":"Add to cart",onClick:v=>{v.stopPropagation(),h||m(i)},children:e.jsx("span",{className:`ico ${h?"ico-cart-solid":"ico-cart"}`,"aria-hidden":!0})}):null]}),e.jsxs("div",{className:"collection-carousel__body",children:[e.jsx("div",{className:"collection-carousel__name",title:i.name,children:i.name}),e.jsxs("div",{className:"collection-carousel__meta",children:[b?e.jsxs("span",{className:"collection-carousel__price",children:[e.jsx(L,{className:"collection-carousel__diamond"}),i.priceCredits]}):e.jsx("span",{className:"collection-carousel__price collection-carousel__na",children:"Not listed"}),e.jsxs("span",{className:"collection-carousel__chips",children:[e.jsx("span",{className:"chip chip--rarity",children:i.rarity}),o?e.jsx("span",{className:"chip chip--icon",children:o}):null]})]})]})]},i.id)})})]})}function ts(t){return Object.values(A.Rarity).includes(t)}function is(t){return t==="male"?"Male":t==="female"?"Female":t==="unisex"?"Unisex":null}function rs(t){const n=t,r=(n.message??"").toLowerCase();return n.code===4001||r.includes("reject")||r.includes("denied")||r.includes("cancel")?"You cancelled the request.":r.includes("insufficient")?`You don't have enough ${We.name} — get more first.`:r.includes("no active listing")||r.includes("not for sale")?"This item is not for sale right now.":"Couldn't complete checkout — please try again."}function ms(){const{contractAddress:t,tokenId:n}=pe(),{state:r}=fe(),p=ve(),I=T(a=>a.add),u=T(a=>a.items),j=Y(a=>a.toggle),{session:l}=Q(),{data:m}=Ae(l),[s,i]=c.useState(()=>r!=null&&r.item?{...r.item,tradeId:r.tradeId??r.item.tradeId}:{id:`${t}-${n}`,name:"",creator:"",contractAddress:t??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:X.chainId,thumbnail:"",priceCredits:0,gender:null,tokenId:n??void 0,tradeId:r==null?void 0:r.tradeId}),[o,f]=c.useState(!1),[b,h]=c.useState(null),[v,y]=c.useState(null),{data:w=[],isFetched:J}=P({queryKey:["collection-items",s.contractAddress],enabled:!!s.contractAddress,queryFn:()=>Ue(s.contractAddress,{first:20}).then(a=>a.items)}),{data:R,isLoading:ee}=P({queryKey:["shop-item",s.contractAddress,n],enabled:!(r!=null&&r.item)&&!!s.contractAddress&&!!n,queryFn:()=>ze(s.contractAddress,n)});c.useEffect(()=>{R&&i(a=>a.tradeId?a:{...R})},[R]);const[D,se]=c.useState(!1),{data:F=""}=P({queryKey:["item-desc",s.contractAddress,s.itemId],enabled:!!s.contractAddress&&!!s.itemId,staleTime:5*6e4,queryFn:()=>Ge(s.contractAddress,s.itemId)});c.useEffect(()=>{if(s.name||w.length===0)return;const a=n&&w.find(d=>d.tokenId===n||d.itemId===n)||w.find(d=>d.contractAddress===s.contractAddress);a&&i(d=>({...a,tradeId:d.tradeId??a.tradeId}))},[w]);const ae=c.useMemo(()=>{const a=new Set,d=[];for(const _ of w){if(_.id===s.id||s.itemId&&_.itemId===s.itemId||s.tokenId&&_.tokenId===s.tokenId)continue;const S=`${_.contractAddress}-${_.itemId??_.tokenId??_.id}`;a.has(S)||(a.add(S),d.push(_))}return d},[w,s.id,s.itemId,s.tokenId]),{data:te,isLoading:k}=P({queryKey:["detail-trade",s.id,s.tradeId,s.contractAddress,s.itemId],enabled:!!s.contractAddress,queryFn:async()=>{if(s.tradeId)return s.tradeId;if(s.itemId){const a=await Ye(s.contractAddress,s.itemId);return(a==null?void 0:a.id)??null}return null}}),g=s.tradeId??te??void 0,N=!!g,E=c.useMemo(()=>({...s,tradeId:g,id:g??s.id}),[s,g]),$=u.some(a=>a.id===E.id),B=Y(a=>!!a.items[s.id]);c.useEffect(()=>{h(null),y(null)},[s.id]);const O=c.useRef(null);c.useEffect(()=>{!s.name||k||O.current===s.id||(O.current=s.id,V("Shop Viewed Item",{...ke(s),for_sale:N}),Ee(s))},[s.id,s.name,k,N]);function ie(a){i(a);const d=a.tokenId??a.itemId;a.contractAddress&&d&&p(`/item/${a.contractAddress}/${d}`,{replace:!0,state:{item:a}}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}function re(){!N||$||U||I(E,"item_detail")}async function ne(){var S;if(!N||!g)return;if(!l){y("Sign in to check out.");return}y(null),f(!0);let a,d="authorize",_=!1;try{h(`Buying ${s.name||"item"}…`);const x=await Re(g);if(!x)throw new Error("not for sale");if(Fe(x,l.address)){y("You can't buy your own listing."),h(null),f(!1);return}const q=(S=x.received)==null?void 0:S[0],he=$e(q==null?void 0:q.amount),{credit:z,maxCreditedValue:_e}=await Be(l.identity,he,g);a=z.id,d="submit";const M={trade:x,buyer:l.address,signer:l.signer,credits:[z],maxCreditedValue:_e};let C;if(Ke())try{C=await He(M),await Ze(C),_=!0}catch(G){if(!(G instanceof Qe))throw G;C=await Z(M)}else C=await Z(M);a=void 0,V("Shop Completed Purchase",{...qe([E]),payment_type:"credits",no_crypto_step:_,transaction_hash:C??null}),p("/success",{state:{items:[E],txHash:C}})}catch(x){H(x)||Me(x,{flow:"buy",step:d,gasless:_}),a&&Ve(l.identity,[a]).catch(()=>{}),V(H(x)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:d,error_code:Oe(x),value_usd:De(E.priceCredits)}),y(rs(x)),h(null)}finally{f(!1)}}const ce=ts(s.rarity)?s.rarity:A.Rarity.COMMON,[le]=A.Rarity.getGradient(ce),W=is(s.gender),de=N&&Se({priceCredits:s.priceCredits,compareAtCredits:s.compareAtCredits,saleEndsAt:s.saleEndsAt}),oe="More from this collection",U=Le(s,l==null?void 0:l.address),ue=N?$?"In cart":k?"Checking…":"Add to cart":"Not for sale",me=ee||!!s.contractAddress&&!J;return!s.name&&!me?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx("span",{className:"ico ico-cart item-detail__notfound-ico","aria-hidden":!0}),e.jsx("h1",{className:"item-detail__notfound-title",children:"This item isn’t available"}),e.jsx("p",{className:"muted",children:"It may have been delisted or moved. Browse Collectibles for something else."}),e.jsx("button",{className:"btn btn--purple",onClick:()=>p("/assets"),children:"Browse Collectibles"})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>p("/assets"),children:"Collectibles"}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:s.name||"Item"})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsx("div",{className:"item-detail__preview",style:{background:`radial-gradient(circle at 50% 38%, ${le}33 0%, var(--media) 68%)`},children:s.name?e.jsx(es,{item:s}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":"Loading preview",children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})})}),e.jsxs("div",{className:"item-detail__info",children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:s.name||"Loading…"}),e.jsx("button",{className:`item-detail__fav${B?" is-on":""}`,onClick:()=>j(s),"aria-pressed":B,"aria-label":B?"Remove from favorites":"Add to favorites",children:e.jsx("span",{className:"ico ico-heart","aria-hidden":!0})})]}),s.creator?e.jsx(Pe,{address:s.creator,className:"item-detail__creator",linkToProfile:!0}):null,e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",children:s.rarity}),e.jsx("span",{className:"chip",children:s.category==="emote"?"Emote":"Wearable"}),W?e.jsx("span",{className:"chip",children:W}):null]}),F?e.jsxs("div",{className:"item-detail__description",children:[e.jsx("p",{className:`item-detail__desc-text${D?" is-expanded":""}`,children:F}),F.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>se(a=>!a),children:D?"Show less":"Read more"}):null]}):null,e.jsxs("div",{className:"item-detail__card",children:[e.jsxs("div",{className:"item-detail__price-block",children:[e.jsx("div",{className:"item-detail__price-label",children:"Price"}),N?de?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(L,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:s.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(L,{className:"item-detail__diamond item-detail__diamond--was"}),s.compareAtCredits]}),K(s.compareAtCredits,s.priceCredits)>0?e.jsxs("span",{className:"item-detail__sale-badge",children:["SALE -",K(s.compareAtCredits,s.priceCredits),"%"]}):null,e.jsx(Te,{endsAt:s.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(L,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:s.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:"Not for sale"}),l?e.jsxs("div",{className:"item-detail__balance muted",children:["Your balance: ",e.jsx(L,{className:"ccy-mark"})," ",(m==null?void 0:m.credits)??0]}):null]}),e.jsx("div",{className:"item-detail__ctas",children:U?e.jsxs("p",{className:"item-detail__own-note muted",children:["This is your item — manage it in ",e.jsx(xe,{to:"/my-assets",children:"My Assets"}),"."]}):e.jsxs(e.Fragment,{children:[N?e.jsx("button",{className:"btn btn--purple item-detail__cta",onClick:ne,disabled:o||k,children:o?"Buying…":"Buy now"}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:re,disabled:!N||$||k||o,children:[e.jsx("span",{className:"ico ico-cart-solid item-detail__addcart-ico","aria-hidden":!0}),ue]})]})}),b?e.jsx("p",{className:"muted item-detail__status",children:b}):null,v?e.jsx("p",{className:"error item-detail__status",children:v}):null]})]})]}),e.jsx(as,{title:oe,items:ae,activeId:s.id,onSelect:ie,onViewAll:s.contractAddress?()=>p(`/collection/${s.contractAddress}`):void 0})]})}export{ms as ItemDetail,ms as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D4VlTBkw.js","assets/react-Vu6nbGi5.js","assets/index-C7-iTfFV.js","assets/ethers-DHDSyreX.js","assets/index-DCrqkiFN.css","assets/generateUtilityClasses-BAjjhm6X.js","assets/Button-B2TDtyup.js","assets/SvgIcon-Cg5l4LDh.js","assets/CircularProgress-Cf__730y.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as c,u as pe,d as fe,a as ve,L as xe}from"./react-Vu6nbGi5.js";import{_ as je,a as Q,V as Ne,X as be,Y as ye,Z as ge,W as Ie,D as A,h as X,$ as we,i as T,d as L,I as Ce,u as Y,j as Ae,c as P,m as V,a0 as ke,a1 as Ee,a2 as Se,a3 as Le,C as Pe,a4 as K,a5 as Te,g as Re,q as Fe,z as $e,r as Be,s as qe,v as H,w as Me,y as Ve,n as De,x as Oe,l as We,f as Ue,a6 as ze,a7 as Ge,o as Ye}from"./index-C7-iTfFV.js";import{h as Z}from"./buy-YkuLG1h7.js";import{g as Ke,a as He,w as Ze,G as Qe}from"./buy-gasless-gRmZHjsE.js";import"./ethers-DHDSyreX.js";import"./index-BlEd83Li.js";const Xe=c.lazy(()=>je(()=>import("./index-D4VlTBkw.js").then(t=>t.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(t=>({default:t.EmoteControls})));function Je(t){return e.jsx(c.Suspense,{fallback:null,children:e.jsx(Xe,{...t})})}function es({item:t}){const n=Q(v=>{var y;return(y=v.session)==null?void 0:y.address}),{data:r,isLoading:p}=Ne(n),I=n&&r?n:"default",u=t.category==="emote",[j,l]=c.useState("avatar"),m=!u&&j==="item",[s,i]=c.useState(!0);c.useEffect(()=>{i(!0)},[t.id,m]);const o=!!n&&!!r,f=o&&be(t,ye(r)),b=ge(t)[0],h=o&&!f&&!u;return e.jsxs(e.Fragment,{children:[p?null:e.jsx(Ie,{id:"shop-item-preview",contractAddress:t.contractAddress,tokenId:t.tokenId??void 0,itemId:t.tokenId?void 0:t.itemId??void 0,profile:m?void 0:f?I:"default",bodyShape:m||f?void 0:b,type:u?void 0:m?A.PreviewType.WEARABLE:A.PreviewType.AVATAR,emote:u||m?void 0:A.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:u?1.5:void 0,wheelStart:u?100:void 0,dev:X.chainId===80002,onLoad:()=>i(!1)},t.id),p||s?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":"Loading preview",children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,h&&!m?e.jsxs("p",{className:"item-preview__note",children:["Shown on a ",we(b)," body — this item isn’t made for your avatar’s shape."]}):null,u?e.jsx("div",{className:"item-preview__emote-controls",children:e.jsx(Je,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":"Preview mode",children:[e.jsx("button",{type:"button",className:j==="avatar"?"is-active":"","aria-pressed":j==="avatar",onClick:()=>l("avatar"),children:"On avatar"}),e.jsx("button",{type:"button",className:j==="item"?"is-active":"","aria-pressed":j==="item",onClick:()=>l("item"),children:"Item"})]})]})}function ss(t){return t==="male"?"♂":t==="female"?"♀":t==="unisex"?"⚥":""}function as({title:t,items:n,activeId:r,onSelect:p,onViewAll:I}){const u=c.useRef(null),j=T(i=>i.add),l=T(i=>i.items.map(o=>o.id));if(n.length===0)return null;function m(i){j(i,"carousel"),Ce.success(`“${i.name}” added to your cart.`)}function s(i){const o=u.current;o&&o.scrollBy({left:i*Math.round(o.clientWidth*.8),behavior:"smooth"})}return e.jsxs("section",{className:"collection-carousel",children:[e.jsxs("div",{className:"collection-carousel__head",children:[e.jsx("h2",{className:"collection-carousel__title",children:t}),e.jsxs("div",{className:"collection-carousel__head-right",children:[I?e.jsx("button",{className:"collection-carousel__viewall",onClick:I,children:"View all"}):null,e.jsxs("div",{className:"collection-carousel__arrows",children:[e.jsx("button",{className:"collection-carousel__arrow",onClick:()=>s(-1),"aria-label":"Scroll left",children:"‹"}),e.jsx("button",{className:"collection-carousel__arrow",onClick:()=>s(1),"aria-label":"Scroll right",children:"›"})]})]})]}),e.jsx("div",{className:"collection-carousel__track",ref:u,children:n.map(i=>{const o=ss(i.gender),f=i.id===r,b=i.priceCredits>0,h=l.includes(i.id);return e.jsxs("article",{className:`collection-carousel__card${f?" is-active":""}`,onClick:()=>p(i),role:"button",tabIndex:0,"aria-current":f||void 0,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),p(i))},children:[e.jsxs("div",{className:"collection-carousel__media",children:[i.thumbnail?e.jsx("img",{className:"collection-carousel__img",src:i.thumbnail,alt:i.name,loading:"lazy"}):null,b?e.jsx("button",{className:"collection-carousel__add",disabled:h,"aria-label":h?"In cart":`Add ${i.name} to cart`,title:h?"In cart":"Add to cart",onClick:v=>{v.stopPropagation(),h||m(i)},children:e.jsx("span",{className:`ico ${h?"ico-cart-solid":"ico-cart"}`,"aria-hidden":!0})}):null]}),e.jsxs("div",{className:"collection-carousel__body",children:[e.jsx("div",{className:"collection-carousel__name",title:i.name,children:i.name}),e.jsxs("div",{className:"collection-carousel__meta",children:[b?e.jsxs("span",{className:"collection-carousel__price",children:[e.jsx(L,{className:"collection-carousel__diamond"}),i.priceCredits]}):e.jsx("span",{className:"collection-carousel__price collection-carousel__na",children:"Not listed"}),e.jsxs("span",{className:"collection-carousel__chips",children:[e.jsx("span",{className:"chip chip--rarity",children:i.rarity}),o?e.jsx("span",{className:"chip chip--icon",children:o}):null]})]})]})]},i.id)})})]})}function ts(t){return Object.values(A.Rarity).includes(t)}function is(t){return t==="male"?"Male":t==="female"?"Female":t==="unisex"?"Unisex":null}function rs(t){const n=t,r=(n.message??"").toLowerCase();return n.code===4001||r.includes("reject")||r.includes("denied")||r.includes("cancel")?"You cancelled the request.":r.includes("insufficient")?`You don't have enough ${We.name} — get more first.`:r.includes("no active listing")||r.includes("not for sale")?"This item is not for sale right now.":"Couldn't complete checkout — please try again."}function ms(){const{contractAddress:t,tokenId:n}=pe(),{state:r}=fe(),p=ve(),I=T(a=>a.add),u=T(a=>a.items),j=Y(a=>a.toggle),{session:l}=Q(),{data:m}=Ae(l),[s,i]=c.useState(()=>r!=null&&r.item?{...r.item,tradeId:r.tradeId??r.item.tradeId}:{id:`${t}-${n}`,name:"",creator:"",contractAddress:t??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:X.chainId,thumbnail:"",priceCredits:0,gender:null,tokenId:n??void 0,tradeId:r==null?void 0:r.tradeId}),[o,f]=c.useState(!1),[b,h]=c.useState(null),[v,y]=c.useState(null),{data:w=[],isFetched:J}=P({queryKey:["collection-items",s.contractAddress],enabled:!!s.contractAddress,queryFn:()=>Ue(s.contractAddress,{first:20}).then(a=>a.items)}),{data:R,isLoading:ee}=P({queryKey:["shop-item",s.contractAddress,n],enabled:!(r!=null&&r.item)&&!!s.contractAddress&&!!n,queryFn:()=>ze(s.contractAddress,n)});c.useEffect(()=>{R&&i(a=>a.tradeId?a:{...R})},[R]);const[D,se]=c.useState(!1),{data:F=""}=P({queryKey:["item-desc",s.contractAddress,s.itemId],enabled:!!s.contractAddress&&!!s.itemId,staleTime:5*6e4,queryFn:()=>Ge(s.contractAddress,s.itemId)});c.useEffect(()=>{if(s.name||w.length===0)return;const a=n&&w.find(d=>d.tokenId===n||d.itemId===n)||w.find(d=>d.contractAddress===s.contractAddress);a&&i(d=>({...a,tradeId:d.tradeId??a.tradeId}))},[w]);const ae=c.useMemo(()=>{const a=new Set,d=[];for(const _ of w){if(_.id===s.id||s.itemId&&_.itemId===s.itemId||s.tokenId&&_.tokenId===s.tokenId)continue;const S=`${_.contractAddress}-${_.itemId??_.tokenId??_.id}`;a.has(S)||(a.add(S),d.push(_))}return d},[w,s.id,s.itemId,s.tokenId]),{data:te,isLoading:k}=P({queryKey:["detail-trade",s.id,s.tradeId,s.contractAddress,s.itemId],enabled:!!s.contractAddress,queryFn:async()=>{if(s.tradeId)return s.tradeId;if(s.itemId){const a=await Ye(s.contractAddress,s.itemId);return(a==null?void 0:a.id)??null}return null}}),g=s.tradeId??te??void 0,N=!!g,E=c.useMemo(()=>({...s,tradeId:g,id:g??s.id}),[s,g]),$=u.some(a=>a.id===E.id),B=Y(a=>!!a.items[s.id]);c.useEffect(()=>{h(null),y(null)},[s.id]);const O=c.useRef(null);c.useEffect(()=>{!s.name||k||O.current===s.id||(O.current=s.id,V("Shop Viewed Item",{...ke(s),for_sale:N}),Ee(s))},[s.id,s.name,k,N]);function ie(a){i(a);const d=a.tokenId??a.itemId;a.contractAddress&&d&&p(`/item/${a.contractAddress}/${d}`,{replace:!0,state:{item:a}}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}function re(){!N||$||U||I(E,"item_detail")}async function ne(){var S;if(!N||!g)return;if(!l){y("Sign in to check out.");return}y(null),f(!0);let a,d="authorize",_=!1;try{h(`Buying ${s.name||"item"}…`);const x=await Re(g);if(!x)throw new Error("not for sale");if(Fe(x,l.address)){y("You can't buy your own listing."),h(null),f(!1);return}const q=(S=x.received)==null?void 0:S[0],he=$e(q==null?void 0:q.amount),{credit:z,maxCreditedValue:_e}=await Be(l.identity,he,g);a=z.id,d="submit";const M={trade:x,buyer:l.address,signer:l.signer,credits:[z],maxCreditedValue:_e};let C;if(Ke())try{C=await He(M),await Ze(C),_=!0}catch(G){if(!(G instanceof Qe))throw G;C=await Z(M)}else C=await Z(M);a=void 0,V("Shop Completed Purchase",{...qe([E]),payment_type:"credits",no_crypto_step:_,transaction_hash:C??null}),p("/success",{state:{items:[E],txHash:C}})}catch(x){H(x)||Me(x,{flow:"buy",step:d,gasless:_}),a&&Ve(l.identity,[a]).catch(()=>{}),V(H(x)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:d,error_code:Oe(x),value_usd:De(E.priceCredits)}),y(rs(x)),h(null)}finally{f(!1)}}const ce=ts(s.rarity)?s.rarity:A.Rarity.COMMON,[le]=A.Rarity.getGradient(ce),W=is(s.gender),de=N&&Se({priceCredits:s.priceCredits,compareAtCredits:s.compareAtCredits,saleEndsAt:s.saleEndsAt}),oe="More from this collection",U=Le(s,l==null?void 0:l.address),ue=N?$?"In cart":k?"Checking…":"Add to cart":"Not for sale",me=ee||!!s.contractAddress&&!J;return!s.name&&!me?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx("span",{className:"ico ico-cart item-detail__notfound-ico","aria-hidden":!0}),e.jsx("h1",{className:"item-detail__notfound-title",children:"This item isn’t available"}),e.jsx("p",{className:"muted",children:"It may have been delisted or moved. Browse Collectibles for something else."}),e.jsx("button",{className:"btn btn--purple",onClick:()=>p("/assets"),children:"Browse Collectibles"})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>p("/assets"),children:"Collectibles"}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:s.name||"Item"})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsx("div",{className:"item-detail__preview",style:{background:`radial-gradient(circle at 50% 38%, ${le}33 0%, var(--media) 68%)`},children:s.name?e.jsx(es,{item:s}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":"Loading preview",children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})})}),e.jsxs("div",{className:"item-detail__info",children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:s.name||"Loading…"}),e.jsx("button",{className:`item-detail__fav${B?" is-on":""}`,onClick:()=>j(s),"aria-pressed":B,"aria-label":B?"Remove from favorites":"Add to favorites",children:e.jsx("span",{className:"ico ico-heart","aria-hidden":!0})})]}),s.creator?e.jsx(Pe,{address:s.creator,className:"item-detail__creator",linkToProfile:!0}):null,e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",children:s.rarity}),e.jsx("span",{className:"chip",children:s.category==="emote"?"Emote":"Wearable"}),W?e.jsx("span",{className:"chip",children:W}):null]}),F?e.jsxs("div",{className:"item-detail__description",children:[e.jsx("p",{className:`item-detail__desc-text${D?" is-expanded":""}`,children:F}),F.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>se(a=>!a),children:D?"Show less":"Read more"}):null]}):null,e.jsxs("div",{className:"item-detail__card",children:[e.jsxs("div",{className:"item-detail__price-block",children:[e.jsx("div",{className:"item-detail__price-label",children:"Price"}),N?de?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(L,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:s.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(L,{className:"item-detail__diamond item-detail__diamond--was"}),s.compareAtCredits]}),K(s.compareAtCredits,s.priceCredits)>0?e.jsxs("span",{className:"item-detail__sale-badge",children:["SALE -",K(s.compareAtCredits,s.priceCredits),"%"]}):null,e.jsx(Te,{endsAt:s.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(L,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:s.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:"Not for sale"}),l?e.jsxs("div",{className:"item-detail__balance muted",children:["Your balance: ",e.jsx(L,{className:"ccy-mark"})," ",(m==null?void 0:m.credits)??0]}):null]}),e.jsx("div",{className:"item-detail__ctas",children:U?e.jsxs("p",{className:"item-detail__own-note muted",children:["This is your item — manage it in ",e.jsx(xe,{to:"/my-assets",children:"My Assets"}),"."]}):e.jsxs(e.Fragment,{children:[N?e.jsx("button",{className:"btn btn--purple item-detail__cta",onClick:ne,disabled:o||k,children:o?"Buying…":"Buy now"}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:re,disabled:!N||$||k||o,children:[e.jsx("span",{className:"ico ico-cart-solid item-detail__addcart-ico","aria-hidden":!0}),ue]})]})}),b?e.jsx("p",{className:"muted item-detail__status",children:b}):null,v?e.jsx("p",{className:"error item-detail__status",children:v}):null]})]})]}),e.jsx(as,{title:oe,items:ae,activeId:s.id,onSelect:ie,onViewAll:s.contractAddress?()=>p(`/collection/${s.contractAddress}`):void 0})]})}export{ms as ItemDetail,ms as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ee,r as u,j as e,b as ae}from"./react-Vu6nbGi5.js";import{c as te,h as W,a as re,j as se,k as z,g as ie,q as ne,r as oe,y as S,m as q,x as $,v as G,d as M,K,l as U,A as ce,L as de}from"./index-
|
|
1
|
+
import{a as ee,r as u,j as e,b as ae}from"./react-Vu6nbGi5.js";import{c as te,h as W,a as re,j as se,k as z,g as ie,q as ne,r as oe,y as S,m as q,x as $,v as G,d as M,K,l as U,A as ce,L as de}from"./index-C7-iTfFV.js";import{r as le,a as T,m as ue}from"./mana-rate-DkxpKYLQ.js";import{S as Y,F as me,a as he}from"./FilterBar-CdU8B66A.js";import{S as H}from"./SkeletonCards-BysJEVmg.js";import{L as ye}from"./LoadMore-BOCtgPLI.js";import{h as Q}from"./buy-YkuLG1h7.js";import{g as pe,a as fe,w as ke,G as be}from"./buy-gasless-gRmZHjsE.js";import{u as _e}from"./useInfiniteGrid-DgSsqvQS.js";import"./ethers-DHDSyreX.js";import"./index-BlEd83Li.js";function ge(){return te({queryKey:["mana-rate",W.chainId],queryFn:()=>le(W.chainId),staleTime:6e4,refetchInterval:6e4,retry:1})}function O(a){const m=a,d=(m.message??"").toLowerCase();return m.code===4001||d.includes("reject")||d.includes("denied")||d.includes("cancel")?"You cancelled the request.":d.includes("insufficient")?`Not enough ${U.name} — get more first.`:d.includes("not found")||d.includes("no active listing")||d.includes("404")?"This item was just sold or removed. Refreshing the market…":d.includes("your own listing")?"You can't buy your own listing.":"Couldn't complete checkout — please try again."}function xe(a){return{id:a.tradeId,tradeId:a.tradeId,name:a.name,creator:a.creator,contractAddress:a.contractAddress,itemId:a.itemId,category:a.category,wearableCategory:a.wearableCategory??void 0,rarity:a.rarity,network:a.network,chainId:a.chainId,thumbnail:a.thumbnail,priceCredits:0,gender:null}}function ve({listing:a,rate:m,onClose:d,onSold:p}){const{session:i}=re(),{data:o}=se(i),f=z(),k=ee(),[C,b]=u.useState("confirm"),[j,w]=u.useState("Locking today’s price…"),[x,v]=u.useState(null),[s,E]=u.useState(null),l=u.useRef(null),P=Math.ceil(T(a.manaWei,m)/10);u.useEffect(()=>{let h=!1;if(!i){b("error"),v("Sign in to check out.");return}return(async()=>{try{const r=await ie(a.tradeId);if(!r)throw new Error("not found");if(ne(r,i.address))throw new Error("You can't buy your own listing.");const c=T(a.manaWei,m);if(!Number.isFinite(c)||c<=0)throw new Error("price unavailable");const{credit:y,maxCreditedValue:R,usdCents:L}=await oe(i.identity,c,a.tradeId);if(h){S(i.identity,[y.id]).catch(()=>{});return}l.current=y.id,E({trade:r,credit:y,maxCreditedValue:R,usdCents:L,credits:Math.ceil(L/10)}),w("")}catch(r){if(h)return;console.error("[market] authorize failed",r),q(G(r)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:$(r),value_usd:Math.round(T(a.manaWei,m))/100}),b("error"),v(O(r))}})(),()=>{h=!0,l.current&&i&&(S(i.identity,[l.current]).catch(()=>{}),l.current=null)}},[]);const _=!!s&&((o==null?void 0:o.credits)??0)<s.credits;async function A(){if(!i||!s)return;if(_){S(i.identity,[s.credit.id]).catch(()=>{}),l.current=null,k("/credits");return}b("working"),v(null);let h=!1;try{w("Confirming your purchase…");const r={trade:s.trade,buyer:i.address,signer:i.signer,credits:[s.credit],maxCreditedValue:s.maxCreditedValue};let c;if(pe())try{c=await fe(r),await ke(c),h=!0}catch(y){if(!(y instanceof be))throw y;c=await Q(r)}else c=await Q(r);l.current=null,q("Shop Completed Purchase",{items:[{item_id:a.itemId??null,contract_address:a.contractAddress,token_id:null,price_usd:s.usdCents/100}],value_credits:s.credits,value_usd:s.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:h,transaction_hash:c??null}),f.invalidateQueries({queryKey:["usd-balance"]}),k("/success",{state:{items:[xe(a)],txHash:c}})}catch(r){console.error("[market] buy now failed",r),S(i.identity,[s.credit.id]).catch(()=>{}),l.current=null,q(G(r)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:$(r),value_usd:s.usdCents/100}),f.invalidateQueries({queryKey:["usd-balance"]});const c=O(r);v(c),b("error"),/sold or removed/i.test(c)&&p()}}function F(){i&&s&&S(i.identity,[s.credit.id]).catch(()=>{}),l.current=null,d()}const g=C==="working";return e.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":`Buy ${a.name}`,children:[e.jsx("div",{className:"mkt-modal__scrim",onClick:g?void 0:F,"aria-hidden":!0}),e.jsxs("div",{className:"mkt-modal__card",children:[e.jsxs("div",{className:"mkt-modal__head",children:[e.jsx("div",{className:"mkt-modal__thumb",children:a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:""}):null}),e.jsxs("div",{children:[e.jsx("div",{className:"mkt-modal__name",title:a.name,children:a.name||"Item"}),e.jsx("span",{className:"chip chip--rarity",children:a.rarity})]})]}),e.jsx("div",{className:"mkt-modal__price",children:s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mkt-modal__price-label",children:"Final price"}),e.jsxs("div",{className:"mkt-modal__price-value",children:[e.jsx(M,{className:"mkt-modal__diamond"}),K(s.credits)]}),e.jsxs("div",{className:"mkt-modal__price-sub muted",children:["Locked for this purchase · $",(s.usdCents/100).toFixed(2)]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mkt-modal__price-label",children:"Today’s price"}),e.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[e.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),e.jsx(M,{className:"mkt-modal__diamond"}),K(P)]}),e.jsx("div",{className:"mkt-modal__price-sub muted",children:j||"Locking today’s price…"})]})}),i?e.jsxs("div",{className:"mkt-modal__balance muted",children:["Your balance: ",e.jsx(M,{className:"ccy-mark"})," ",(o==null?void 0:o.credits)??0]}):null,_?e.jsxs("p",{className:"muted mkt-modal__note",children:["You’ll need a few more ",U.name," to buy this."]}):null,j&&C==="working"?e.jsx("p",{className:"muted mkt-modal__note",children:j}):null,x?e.jsx("p",{className:"error mkt-modal__note",children:x}):null,e.jsxs("div",{className:"mkt-modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:F,disabled:g,children:"Cancel"}),e.jsx("button",{className:"btn btn--purple",onClick:A,disabled:g||!s,children:g?"Buying…":_?`Get ${U.name}`:"Confirm purchase"})]})]})]})}const Ce=48,B=[{key:"wearable",label:"Wearables",sub:["Head","Upper Body","Handwear","Lower Body","Feet","Accessories","Skins"]},{key:"emote",label:"Emotes",sub:[]}],je={Head:["head","hat","hair","facial_hair","eyes","eyebrows","mouth","mask","helmet","tiara","top_head"],"Upper Body":["upper_body"],Handwear:["hands_wear"],"Lower Body":["lower_body"],Feet:["feet"],Accessories:["earring","eyewear"],Skins:["skin"]};function we(a){return{id:a.tradeId,tradeId:a.tradeId,name:a.name,creator:a.creator,contractAddress:a.contractAddress,itemId:a.itemId,category:a.category,wearableCategory:a.wearableCategory??void 0,rarity:a.rarity,network:a.network,chainId:a.chainId,thumbnail:a.thumbnail,priceCredits:0,gender:null}}function Te(){const[a]=ae(),m=(a.get("q")??"").trim().toLowerCase(),d=z(),[p,i]=u.useState("wearable"),[o,f]=u.useState(null),[k,C]=u.useState([]),[b,j]=u.useState("newest"),[w,x]=u.useState(null),v=o?je[o]:void 0,s=(Y.find(t=>t.key===b)??Y[0]).server,E={category:p,rarities:k.length?k:void 0,wearableCategories:v,search:m||void 0,sortBy:s},{items:l,total:P,isLoading:_,error:A,hasNextPage:F,isFetchingNextPage:g,fetchNextPage:h}=_e(["legacy-listings",E],t=>de({...E,first:Ce,skip:t})),{data:r,isError:c}=ge(),y=t=>r?ue(t.manaWei,r):null;function R(t){i(t),f(null)}function L(t){C(n=>n.includes(t)?n.filter(I=>I!==t):[...n,t])}function V(){i("wearable"),f(null),C([])}function Z(t){const n=l.find(I=>I.tradeId===t.tradeId);n&&x(n)}function D(){d.invalidateQueries({queryKey:["legacy-listings"]})}const N=B.find(t=>t.key===p)??B[0],J=o?`${N.label} · ${o}`:N.label,X=p!=="wearable"||!!o||k.length>0;return e.jsxs("div",{className:"browse",children:[e.jsxs("div",{className:"market-banner",children:[e.jsx("span",{className:"market-banner__ico","aria-hidden":!0,children:"✨"}),e.jsx("span",{children:"Prices here follow the live market and may shift slightly at checkout."})]}),c?e.jsx("p",{className:"market-banner market-banner--warn",children:"The market price is temporarily unavailable — buying is paused for a moment. Please try again shortly."}):null,e.jsx(me,{rarities:k,onToggleRarity:L,sort:b,onSort:j,total:P,loading:_,query:m,anyActive:X,onClear:V,renderLeading:t=>e.jsx(he,{panelKey:"section",label:J,active:!!o||p!=="wearable",panel:t,children:e.jsxs("div",{className:"filter-pop filter-pop--section",children:[e.jsx("ul",{className:"filter-pop__cats",children:B.map(n=>e.jsx("li",{children:e.jsx("button",{className:`filter-pop__cat${p===n.key?" is-active":""}`,onClick:()=>R(n.key),children:n.label})},n.key))}),N.sub.length?e.jsxs("ul",{className:"filter-pop__subs",children:[e.jsx("li",{children:e.jsxs("button",{className:`filter-pop__sub${o?"":" is-active"}`,onClick:()=>{f(null),t.close()},children:["All ",N.label]})}),N.sub.map(n=>e.jsx("li",{children:e.jsx("button",{className:`filter-pop__sub${o===n?" is-active":""}`,onClick:()=>{f(I=>I===n?null:n),t.close()},children:n})},n))]}):null]})})}),A?e.jsx("p",{className:"error",children:A.message}):null,e.jsx("div",{className:"grid",children:_?e.jsx(H,{count:15}):e.jsxs(e.Fragment,{children:[l.map(t=>e.jsx(ce,{item:we(t),mode:"market",marketPriceCredits:y(t),onBuyNow:Z},t.tradeId)),g?e.jsx(H,{count:6}):null]})}),e.jsx(ye,{hasNextPage:F,isFetching:g,onLoadMore:()=>h()}),!_&&l.length===0?e.jsx("p",{className:"muted",children:"No items match your filters."}):null,w&&r?e.jsx(ve,{listing:w,rate:r,onClose:()=>x(null),onSold:()=>{x(null),D()}}):null]})}export{Te as Market,Te as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as w,b as g,n as Ne,o as ke,g as Q,a as A,u as ie,c as Z,e as ae,s as le,p as H,q as we}from"./generateUtilityClasses-
|
|
1
|
+
import{_ as w,b as g,n as Ne,o as ke,g as Q,a as A,u as ie,c as Z,e as ae,s as le,p as H,q as we}from"./generateUtilityClasses-BAjjhm6X.js";import{r as p,j as T,f as z,R as X,h as De}from"./react-Vu6nbGi5.js";import{u as Oe,_ as Le,T as Ce,a as W,b as J,s as ue,c as _e,o as ce,B as Fe}from"./Button-B2TDtyup.js";function je(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const He=["value"],Se=p.createContext();function xt(e){let{value:t}=e,n=w(e,He);return T.jsx(Se.Provider,g({value:t??!0},n))}const bt=()=>{const e=p.useContext(Se);return e??!1};function Ae(){const e=Oe(ke);return e[Ne]||e}const de=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)};var ee={exports:{}},d={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-is.production.min.js
|
|
4
4
|
*
|