@dcl/shop 0.1.0-29734911263.commit-97d18ef → 0.1.0-29735885306.commit-7a39d45
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-Dc0wzLz1.js → AnimatedBackground-nfWV-TLm.js} +1 -1
- package/assets/Assets-DxJogT5a.js +1 -0
- package/assets/Cart-CIl0AjqN.js +1 -0
- package/assets/{CircularProgress-BDWVwtML.js → CircularProgress-DndPkIP8.js} +5 -5
- package/assets/Collection-BJEblsKJ.js +1 -0
- package/assets/CollectionCarousel-DttKFbs9.js +1 -0
- package/assets/Creator-DZmgR_-B.js +1 -0
- package/assets/{CssVarsProvider-CwWOpnL3.js → CssVarsProvider-B8lKeq36.js} +3 -3
- package/assets/{ExchangeController-nU1L87yP.js → ExchangeController-B7IETzbU.js} +1 -1
- package/assets/GetCredits-DbHhfh2c.js +1 -0
- package/assets/{HelpersUtil-CvduV3iF.js → HelpersUtil-DlIzn60f.js} +1 -1
- package/assets/ImportListings-S_dZIlJJ.js +1 -0
- package/assets/ItemDetail-DkTooWrA.js +2 -0
- package/assets/ItemDetail-Dkstj3oi.css +1 -0
- package/assets/LoadMore-DOqijdHT.js +1 -0
- package/assets/MarketCheckout-BSyyg6RV.js +1 -0
- package/assets/MyAssets-DVnMIIXj.js +1 -0
- package/assets/MyFavorites-BiTv35sh.js +1 -0
- package/assets/MyPurchases-7h6djrh3.js +1 -0
- package/assets/NotFound-Dla84AhU.js +1 -0
- package/assets/StoreSettings-TpgP82R_.js +1 -0
- package/assets/Success-grPwRvA7.js +1 -0
- package/assets/{SwapController-rop7Cy13.js → SwapController-Dfa4Uexs.js} +1 -1
- package/assets/{TradeService-D1JN9Ta2.js → TradeService-oRYiZhuO.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-igVJGnIP.js → W3MFrameProviderSingleton-BIMCH_xH.js} +3 -3
- package/assets/{WebCryptoP256-DhJgbrxa.js → WebCryptoP256-CrVbiM8b.js} +1 -1
- package/assets/address-DrURAr9O.js +1 -0
- package/assets/{basic-ClmBw3no.js → basic-BNz1bcOI.js} +1 -1
- package/assets/{biconomy-Bh94ZwGM.js → biconomy-DTAZzZV9.js} +1 -1
- package/assets/{buy-qpkIddNt.js → buy-C3XM-F5L.js} +1 -1
- package/assets/{buy-gasless-COqF6TfJ.js → buy-gasless-CgW1uOlT.js} +1 -1
- package/assets/{cart-checkout-0Ra3OSr3.js → cart-checkout-N2i7gwjl.js} +1 -1
- package/assets/categories-DlVqkFPG.js +1 -0
- package/assets/{ccip-DLAoDUFz.js → ccip-D0GvNkRi.js} +1 -1
- package/assets/{ccip-C1vfcfuy.js → ccip-wZRny90t.js} +1 -1
- package/assets/collection-Cb2Yk135.js +1 -0
- package/assets/{controller-BTZuhR9-.js → controller-DzxfBNm5.js} +2 -2
- package/assets/{core-C_85sR5Z.js → core-BQO-8l1a.js} +4 -4
- package/assets/credit-coin-CmcTCd5i.webp +0 -0
- package/assets/{custom-H6a3SIvl.js → custom-Q09UtzLL.js} +1 -1
- package/assets/{data-capture-BVpYsiYY.js → data-capture-DQHHGJqw.js} +1 -1
- package/assets/{decimals-CpjItqe-.js → decimals-BKlvk0e7.js} +1 -1
- package/assets/{decimals-DhBB7VPD.js → decimals-Lrh0ljC2.js} +1 -1
- package/assets/{detectExtension-DPopT1Kb.js → detectExtension-BdYqD6Wo.js} +1 -1
- package/assets/{email-CCv85Jjp.js → email-CrFGZcog.js} +1 -1
- package/assets/{embedded-wallet-C9sVH0T_.js → embedded-wallet-CKipxTpW.js} +1 -1
- package/assets/emotion-styled.browser.esm-De8LzLi0.js +1 -0
- package/assets/{engine-DPnRS4Vr.js → engine-MccFrbTY.js} +1 -1
- package/assets/{estimate-l1-fee-0Ox9h9v8.js → estimate-l1-fee-D1fAN0FJ.js} +1 -1
- package/assets/{eth_estimateGas-B9zdAB24.js → eth_estimateGas-DMW0srlc.js} +1 -1
- package/assets/{eth_getStorageAt-Bp0VdFG_.js → eth_getStorageAt-CmJ0aKBu.js} +1 -1
- package/assets/{eth_getTransactionCount-D3ux_Uy2.js → eth_getTransactionCount-DQPgCd6N.js} +1 -1
- package/assets/{extractIPFS-DnEM7HGg.js → extractIPFS-B5WjncQS.js} +1 -1
- package/assets/{features-C3BsUywQ.js → features-VCGghgYt.js} +1 -1
- package/assets/{fetchTokenMetadata-r_xnkq91.js → fetchTokenMetadata-DkvbC6O0.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-rMoPuP61.js → get-ecosystem-wallet-info-DkDbe072.js} +1 -1
- package/assets/{getBalance-DxuNPttj.js → getBalance-BTMKBCSR.js} +1 -1
- package/assets/{getInstalledModules-BNrMQMSM.js → getInstalledModules-CwEcTlva.js} +1 -1
- package/assets/{getNFT-CU0p112E.js → getNFT-CJo_PX2T.js} +1 -1
- package/assets/{getNFT-BlFsKfLP.js → getNFT-CboVo0ST.js} +2 -2
- package/assets/{getOverlayAlpha-B57gNsKL.js → getOverlayAlpha-DC6Z8-Ah.js} +1 -1
- package/assets/{hashTypedData-C1FGwn-3.js → hashTypedData-BVFQaTLd.js} +1 -1
- package/assets/{hashTypedData-DiQfP4ez.js → hashTypedData-Wmo1SoPQ.js} +1 -1
- package/assets/{import-DU_OhvUC.js → import-CXHQHUHE.js} +1 -1
- package/assets/{in-app-wallet-calls-BREibEL9.js → in-app-wallet-calls-B_WDQVOa.js} +1 -1
- package/assets/{index-CvvKgwgx.js → index-1GZEZj4_.js} +1 -1
- package/assets/{index-6Yrg17AO.js → index-6iJH5OM1.js} +1 -1
- package/assets/{index-Bu7y6WnQ.js → index-B1fyFQFf.js} +1 -1
- package/assets/{index-CONsWgTr.js → index-B4j7NVUo.js} +1 -1
- package/assets/{index-DAGAMRoL.js → index-B6PMUPlS.js} +2 -2
- package/assets/{index-BBeG1LQT.js → index-BA4dfRb5.js} +3 -3
- package/assets/{index-B857ik7x.js → index-BB7DOq9K.js} +3 -3
- package/assets/{index-DYCwB2y3.js → index-BEsHe9Z5.js} +1 -1
- package/assets/{index-Clrgbbm8.js → index-BOT_rPtb.js} +1 -1
- package/assets/{index-CuqC8d2-.js → index-BROh4m8F.js} +2 -2
- package/assets/{index-DaX1PcgD.js → index-Bcl8cVXN.js} +1 -1
- package/assets/{index-CEy7C-8g.js → index-Bg_Z6GcI.js} +1 -1
- package/assets/{index-HDuUFApJ.js → index-BiI9BcQf.js} +1 -1
- package/assets/{index-B7Kupr-o.js → index-BiwUvFgE.js} +1 -1
- package/assets/{index-6A6nGPwX.js → index-Bj8v99Kt.js} +1 -1
- package/assets/index-BmjbHn2J.js +2 -0
- package/assets/{index-CvEf0SP-.js → index-Bq9AJ_VL.js} +1 -1
- package/assets/{index-C_M9XsGM.js → index-BrmfoEW0.js} +1 -1
- package/assets/{index-BHgXtxHt.js → index-BvXoWZ6K.js} +1 -1
- package/assets/{index-C4TyPwon.js → index-Bxzx66sM.js} +1 -1
- package/assets/{index-l4HYDe7V.js → index-C3fHjE5h.js} +1 -1
- package/assets/{index-DxzGOm1i.js → index-C3jzUKd2.js} +1 -1
- package/assets/index-C7swV0s7.js +38 -0
- package/assets/{index-BFflIlJl.js → index-C88tdWU9.js} +1 -1
- package/assets/{index-DVRw_gw9.js → index-C8n7W-px.js} +1 -1
- package/assets/{index-BtMWp3zQ.js → index-C8sLfN4n.js} +1 -1
- package/assets/{index-C4CMYXNA.js → index-CLw6S26l.js} +1 -1
- package/assets/{index-C3UC6Rs5.js → index-CPHHOZWE.js} +1 -1
- package/assets/{index-h7-uke9P.js → index-CetrppOt.js} +1 -1
- package/assets/{index-BToZY4wT.js → index-CskTAJ-W.js} +1 -1
- package/assets/{index-DUvTWkbt.js → index-CubVHBvM.js} +1 -1
- package/assets/{index-B1DKag9y.js → index-Cx0y-N27.js} +1 -1
- package/assets/{index-YhrkEkkQ.js → index-D6vI6KM2.js} +1 -1
- package/assets/{index-D_bGCuiT.js → index-D9qKBsi3.js} +1 -1
- package/assets/{index-r1XpXEwi.js → index-DGY13Ahk.js} +1 -1
- package/assets/{index-BxVm-10z.js → index-DMlzjjO0.js} +1 -1
- package/assets/{index-CPGmwqDl.js → index-DWn4PjtM.js} +1 -1
- package/assets/{index-jbcqNek9.css → index-DgcUoaxa.css} +1 -1
- package/assets/{index-CFOnfjiX.js → index-Dnfafk6L.js} +1 -1
- package/assets/{index-D4gUO6YF.js → index-Dwz4bI1F.js} +1 -1
- package/assets/{index-BvkmByTC.js → index-DyrEEs7h.js} +1 -1
- package/assets/{index-BKCbqIDV.js → index-ImENe_e0.js} +2 -2
- package/assets/{index-kSkl-zIU.js → index-ODYcuX6L.js} +1 -1
- package/assets/{index-BdSETUQy.js → index-QAGQ97Gb.js} +1 -1
- package/assets/{index-GPWVD-So.js → index-SDT0ZTp_.js} +1 -1
- package/assets/{index-CkdLU61h.js → index-VBXOJYUE.js} +1 -1
- package/assets/{index-BhQRaolS.js → index-brSzzARD.js} +1 -1
- package/assets/{index-B29hZWU0.js → index-dgWkyV5E.js} +3 -3
- package/assets/{index-DWwpSRi-.js → index-hxyN2V1_.js} +1 -1
- package/assets/{index-BLfwzasm.js → index-nKws02kd.js} +1 -1
- package/assets/{index-D4Qahz_H.js → index-oL7RezGF.js} +1 -1
- package/assets/{index-GCfy9KhE.js → index-tThe6wod.js} +1 -1
- package/assets/{index.es-SxKlpBqs.js → index.es-BGK42TWV.js} +1 -1
- package/assets/{index.es-DtmgeITt.js → index.es-BhZE_HCI.js} +1 -1
- package/assets/{index.es-BWh_1tnr.js → index.es-qyZ61vOn.js} +4 -4
- package/assets/{localBatchGatewayRequest-Bisheu8W.js → localBatchGatewayRequest-CDYO5vBd.js} +1 -1
- package/assets/{mana-rate-CPIzN4Vi.js → mana-rate-B7ShUGMF.js} +1 -1
- package/assets/{networks-2BN2k4cV.js → networks-CpFUsIQ_.js} +1 -1
- package/assets/{onramp-ezPwBLqh.js → onramp-DWAWL5fr.js} +1 -1
- package/assets/{openzeppelin-DKT-fJnL.js → openzeppelin-BaxH-Q6e.js} +1 -1
- package/assets/{ownerOf-6bPfyUUB.js → ownerOf-DBfj8RDj.js} +1 -1
- package/assets/pack-chips--HnOpf5U.webp +0 -0
- package/assets/{parseNft-C64AqdIb.js → parseNft-cZiLURCL.js} +2 -2
- package/assets/{parseSignature-C5pd7yT7.js → parseSignature-CUH6T5zg.js} +3 -3
- package/assets/{parseSignature-7t7DXXbe.js → parseSignature-CX4h7HOk.js} +1 -1
- package/assets/{pay-with-exchange-Brk67N1Q.js → pay-with-exchange-DjAaDdMt.js} +1 -1
- package/assets/{payments-D1TsNJWo.js → payments-BojP1AK1.js} +1 -1
- package/assets/{qr-overlay-CLl0wVbt.js → qr-overlay-Fy7O6nEI.js} +1 -1
- package/assets/{receive-Bt81cJu3.js → receive-BNl1PgFA.js} +1 -1
- package/assets/{resolveImplementation-D-DhhnNB.js → resolveImplementation-CZ_XMNcD.js} +1 -1
- package/assets/{rpc-Bhmgfz1e.js → rpc-DXpRyhuY.js} +1 -1
- package/assets/{secp256k1-B6MVDYDd.js → secp256k1-BFgSemLO.js} +1 -1
- package/assets/{secp256k1-CdH-AER_.js → secp256k1-CJ-cDuAO.js} +1 -1
- package/assets/{secp256k1-DcIYGay5.js → secp256k1-CxwXKjt6.js} +1 -1
- package/assets/{send-Dzpx6XEO.js → send-BWF4FoMf.js} +1 -1
- package/assets/{send-batch-transaction-twz9plvu.js → send-batch-transaction-D-WGupzl.js} +1 -1
- package/assets/{send-eip712-transaction-DuYMjY_7.js → send-eip712-transaction-D7CHMT8d.js} +2 -2
- package/assets/{send-gasless-transaction-RKoViIvt.js → send-gasless-transaction-jYvtBlEa.js} +2 -2
- package/assets/{sendRawTransaction-B5C16ilB.js → sendRawTransaction-BuyvDRxp.js} +3 -3
- package/assets/{serializeTransaction-COuCzUc4.js → serializeTransaction-DUb3Uucc.js} +1 -1
- package/assets/{session-proposal-DKbxmMJ5.js → session-proposal-BG4o8sS8.js} +1 -1
- package/assets/{session-request-DuILxTGu.js → session-request-CWTif92g.js} +2 -2
- package/assets/{sha256-Bj4vNOnb.js → sha256-BwE5sZLM.js} +1 -1
- package/assets/{signing-DW4tyFl0.js → signing-MwqooMKP.js} +4 -4
- package/assets/{socials-CBCHs9Sz.js → socials-DpvGTg5S.js} +1 -1
- package/assets/{swaps-21QHpuMJ.js → swaps-QEBdU08e.js} +1 -1
- package/assets/{thirdweb-C69j7iTG.js → thirdweb-D3Oq7iMk.js} +3 -3
- package/assets/{totalSupply-BjrHK1ZH.js → totalSupply-DRMMQQGk.js} +1 -1
- package/assets/{trade-encoding-BtlpyT8N.js → trade-encoding-BkDaYyvb.js} +1 -1
- package/assets/{transactionReceipt-CK-ZZNkd.js → transactionReceipt-4Guo2WN5.js} +1 -1
- package/assets/{transactions-DYJvsdj0.js → transactions-x2ljt4Bz.js} +1 -1
- package/assets/{useInfiniteGrid-Bso7ZIlQ.js → useInfiniteGrid-LLmuFcQo.js} +1 -1
- package/assets/{useStore-BomIn5qc.js → useStore-CTx-2Xfe.js} +1 -1
- package/assets/useTheme-3xICgEAy.js +1 -0
- package/assets/useTheme-B8h6R_Xd.js +1 -0
- package/assets/{verifyHash-DpeDDe0l.js → verifyHash-DmZ6Vxbz.js} +1 -1
- package/assets/{w3m-modal-BHGgG_1M.js → w3m-modal-1ZEUEUoj.js} +1 -1
- package/assets/{w3m-modal-B5GRQ8Bk.js → w3m-modal-CD__AMAe.js} +1 -1
- package/assets/{wait-for-tx-receipt-D9A_u2fN.js → wait-for-tx-receipt-D9CGEBK0.js} +1 -1
- package/assets/{wallets-DvzXHK5n.js → wallets-B5OIkVJ3.js} +6 -6
- package/assets/{web-connector-B4y564hP.js → web-connector-BSSZAM8o.js} +3 -3
- package/assets/{writeContract-ChFbWN7V.js → writeContract-PwOFfBlu.js} +1 -1
- package/assets/{zoraTestnet-B1VFNgcm.js → zoraTestnet-BjKQVWoc.js} +1 -1
- package/index.html +15 -15
- package/package.json +2 -2
- package/assets/Assets-DPWTLJJO.js +0 -1
- package/assets/Cart-C5IFRFSf.js +0 -1
- package/assets/Collection-M5DaYZlo.js +0 -1
- package/assets/CollectionCarousel-_a53Z75p.js +0 -1
- package/assets/Creator-CTzdaC_3.js +0 -1
- package/assets/GetCredits-BpLPWa0W.js +0 -1
- package/assets/ImportListings-BNQe3kWr.js +0 -1
- package/assets/ItemDetail-Bu2_xAf0.css +0 -1
- package/assets/ItemDetail-Cei4y0nZ.js +0 -2
- package/assets/LoadMore-CiZkVzux.js +0 -1
- package/assets/MarketCheckout-Do7I_hLx.js +0 -1
- package/assets/MyAssets-Bxikz0O1.js +0 -1
- package/assets/MyFavorites-dmVn-jNs.js +0 -1
- package/assets/MyPurchases-62SCltGJ.js +0 -1
- package/assets/NotFound-CaztEVTk.js +0 -1
- package/assets/StoreSettings-DjI99hf0.js +0 -1
- package/assets/Success-KQj99-pf.js +0 -1
- package/assets/categories-Chd4fnsf.js +0 -1
- package/assets/collection-s3UDaDJs.js +0 -1
- package/assets/emotion-styled.browser.esm-7U6PLHlL.js +0 -1
- package/assets/index-BABdIN2I.js +0 -2
- package/assets/index-CNSWvtL0.js +0 -38
- package/assets/useTheme-gY3T76jp.js +0 -1
- package/assets/useTheme-qyEpY8zT.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-yytiy0wi.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
1
|
+
import{r as l,j as v}from"./react-yytiy0wi.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/DCL_LogoPattern-BryBPc3d.png",U=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as oe,r as t,j as e}from"./react-yytiy0wi.js";import{u as de,a as ue,t as a,b as $,C,A as B,f as me}from"./index-C7swV0s7.js";import{m as pe}from"./mana-rate-B7ShUGMF.js";import{u as _e,M as xe}from"./MarketCheckout-BSyyg6RV.js";import{S as G,C as fe,R as he,F as be,a as Q,b as ge}from"./categories-DlVqkFPG.js";import{L as je}from"./LoadMore-DOqijdHT.js";import{u as Ne}from"./useInfiniteGrid-LLmuFcQo.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./buy-C3XM-F5L.js";import"./trade-encoding-BkDaYyvb.js";import"./buy-gasless-CgW1uOlT.js";const ye=48,n=1e5;function ve(r){return{tradeId:r.tradeId??r.id,listingType:"primary",contractAddress:r.contractAddress,itemId:r.itemId??"",name:r.name,thumbnail:r.thumbnail,rarity:r.rarity,category:r.category,wearableCategory:r.wearableCategory??null,creator:r.creator,manaWei:r.manaWei??"0",available:1,network:r.network,chainId:r.chainId,createdAt:0}}function We(){const[r]=oe(),l=(r.get("q")??"").trim().toLowerCase(),U=de(),I=(r.get("q")??"").trim();ue({title:I?a("seo.collectibles.searchTitle",{query:I}):a("seo.collectibles.title"),description:a("seo.collectibles.description")});const[p,F]=t.useState("wearable"),[d,k]=t.useState(null),[c,R]=t.useState([]),[f,w]=t.useState(""),[h,M]=t.useState(""),[_,K]=t.useState("newest"),[P,D]=t.useState(!1),[b,x]=t.useState(!1),[L,A]=t.useState(null);t.useEffect(()=>{if(!b)return;const s=i=>{i.key==="Escape"&&x(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[b]);const u=f&&!Number.isNaN(Number(f))?Number(f):void 0,m=h&&!Number.isNaN(Number(h))?Number(h):void 0,J=d?ge[d]:void 0,X=(G.find(s=>s.key===_)??G[0]).server,q={category:p,rarities:c.length?c:void 0,wearableCategories:J,minPriceCredits:u,maxPriceCredits:m,search:l||void 0,sortBy:X},{items:g,total:O,isLoading:o,error:Z,hasNextPage:z,isFetchingNextPage:T,fetchNextPage:H}=Ne(["unified-listings",q],s=>me({...q,first:ye,skip:s})),j=O,{data:N,isError:V}=_e(),Y=s=>N&&s.manaWei?pe(s.manaWei,N):null,W=t.useRef(null);t.useEffect(()=>{o||!l||W.current===l||(W.current=l,$("Shop Searched",{query:l,result_count:j}))},[l,o,j]);const y=t.useRef("__init__");t.useEffect(()=>{if(o)return;const s=JSON.stringify({category:p,subCategory:d,rarities:c,min:u,max:m,sort:_});if(y.current==="__init__"||y.current===s){y.current=s;return}y.current=s,$("Shop Applied Filter",{filters:{category:p,sub_category:d,rarities:c,min_price_credits:u??null,max_price_credits:m??null,sort:_},result_count:j})},[p,d,c,u,m,_,o,j]);function ee(s){F(s),k(null)}function se(s){R(i=>i.includes(s)?i.filter(E=>E!==s):[...i,s])}function ae(){F("wearable"),k(null),R([]),w(""),M("")}function re(s){const i=g.find(E=>E.id===s.id);i&&i.source==="legacy"&&i.manaWei&&A(ve(i))}function ie(){U.invalidateQueries({queryKey:["unified-listings"]})}const v=u!=null?Math.min(u,n):0,S=m!=null?Math.min(m,n):n,te=v/n*100,ne=S/n*100;function le(s){const i=Math.min(s,S);w(i<=0?"":String(i))}function ce(s){const i=Math.max(s,v);M(i>=n?"":String(i))}return e.jsxs("div",{className:"browse browse--sidebar",children:[b?e.jsx("div",{className:"browse__scrim",onClick:()=>x(!1),"aria-hidden":!0}):null,e.jsxs("aside",{className:`browse__sidebar${b?" is-open":""}`,children:[e.jsxs("div",{className:"browse__sidebar-head",children:[e.jsx("span",{className:"browse__sidebar-title",children:a("assets.filters")}),e.jsx("button",{className:"browse__sidebar-close",onClick:()=>x(!1),"aria-label":a("assets.closeFilters"),children:"✕"})]}),e.jsx("div",{className:"sidebar__section-label",children:a("assets.category")}),e.jsx(fe,{category:p,subCategory:d,onCategory:ee,onSub:k}),e.jsx("div",{className:"sidebar__divider"}),e.jsx("div",{className:"sidebar__section-label",children:a("filter.price")}),e.jsxs("div",{className:"price-filter",children:[e.jsxs("div",{className:"price-filter__inputs",children:[e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:a("assets.min")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(C,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.minPriceAria"),placeholder:"0",value:f,onChange:s=>w(s.target.value)})]})]}),e.jsx("span",{className:"price-filter__to",children:a("assets.priceTo")}),e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:a("assets.max")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(C,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.maxPriceAria"),placeholder:"0",value:h,onChange:s=>M(s.target.value)})]})]})]}),e.jsxs("div",{className:"price-filter__slider",style:{"--min-pct":`${te}%`,"--max-pct":`${ne}%`},children:[e.jsx("div",{className:"price-filter__track","aria-hidden":!0}),e.jsx("div",{className:"price-filter__fill","aria-hidden":!0}),e.jsx("input",{type:"range",min:0,max:n,value:v,"aria-label":a("assets.minPriceSliderAria"),onChange:s=>le(Number(s.target.value))}),e.jsx("input",{type:"range",min:0,max:n,value:S,"aria-label":a("assets.maxPriceSliderAria"),onChange:s=>ce(Number(s.target.value))})]}),e.jsxs("div",{className:"price-filter__range",children:[e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(C,{className:"price-filter__coin"}),v.toLocaleString()]}),e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(C,{className:"price-filter__coin"}),S.toLocaleString()]})]})]}),e.jsx("div",{className:"sidebar__divider"}),e.jsxs("button",{type:"button",className:"sidebar__section-toggle","aria-expanded":P,onClick:()=>D(s=>!s),children:[e.jsx("span",{className:"sidebar__section-label",children:a("assets.rarity")}),e.jsx("span",{className:`ico ico-chevron sidebar__section-chev${P?" is-up":""}`,"aria-hidden":!0})]}),P?e.jsx("div",{className:"rarity-filter",children:he.map(s=>e.jsxs("label",{className:`rarity-filter__check${c.includes(s)?" is-on":""}`,children:[e.jsx("input",{type:"checkbox",checked:c.includes(s),onChange:()=>se(s)}),e.jsx("span",{children:s})]},s))}):null,e.jsxs("div",{className:"browse__sidebar-foot",children:[e.jsx("button",{type:"button",className:"browse__clear",onClick:ae,children:a("assets.clearFilters")}),e.jsx("button",{type:"button",className:"browse__apply",onClick:()=>x(!1),children:a("assets.apply")})]})]}),e.jsxs("div",{className:"browse__main",children:[e.jsx(be,{sort:_,onSort:K,total:O,loading:o,query:l,onOpenFilters:()=>x(!0)}),V&&g.some(s=>s.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:a("assets.marketUnavailable")}):null,Z?e.jsx("p",{className:"error",children:a("assets.loadError")}):null,e.jsx("div",{className:"grid",children:o?e.jsx(Q,{count:15}):e.jsxs(e.Fragment,{children:[g.map(s=>s.source==="legacy"?e.jsx(B,{item:s,mode:"market",marketPriceCredits:Y(s),onBuyNow:re},s.id):e.jsx(B,{item:s},s.id)),T?e.jsx(Q,{count:6}):null]})}),e.jsx(je,{hasNextPage:z,isFetching:T,onLoadMore:()=>void H()}),!o&&g.length===0?e.jsx("p",{className:"muted",children:a("assets.noItems")}):null]}),L&&N?e.jsx(xe,{listing:L,rate:N,onClose:()=>A(null),onSold:()=>{A(null),ie()}}):null]})}export{We as Assets};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,a as fe,b as ke,r as j,L as J}from"./react-yytiy0wi.js";import{t as a,C as N,ad as A,a as ge,ae as v,c as ce,d as ve,g as Ne,n as Ce,u as we,af as Me,b as $,ag as re,ah as Se,z as B,j as Ie,s as Le,v as Pe,o as ne,ai as Te,x as le,w as Fe,aj as Ee}from"./index-C7swV0s7.js";import{a as ie}from"./buy-C3XM-F5L.js";import{g as Be,a as Ae,w as Re,S as We,G as Ue}from"./buy-gasless-CgW1uOlT.js";import{R as q,r as ze}from"./cart-checkout-N2i7gwjl.js";import{c as $e,C as qe}from"./payments-BojP1AK1.js";import{C as Ke}from"./CollectionCarousel-DttKFbs9.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BkDaYyvb.js";import"./index-HN6Rk25C.js";function Qe(t){const{phase:r,balanceCredits:h,onClose:i}=t,C=r==="processing",I=r!=="complete",L=r==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),n=r==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:C?void 0:i,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${n?" buy-modal__card--tall":""}`,children:[I&&e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:L}),!C&&e.jsx("button",{className:"buy-modal__x",onClick:i,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:r==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(N,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:A(h)})]})]}),r==="processing"&&e.jsx(Oe,{step:t.step??1,total:t.total??1}),r==="nofunds"&&e.jsx(Ge,{lines:t.lines??[],shortfallCredits:t.shortfallCredits??0,packs:t.packs??[],selectedPack:t.selectedPack??"",onSelectPack:t.onSelectPack??(()=>{}),onBuyPacks:t.onBuyPacks??(()=>{}),onCancel:i}),r==="complete"&&e.jsx(De,{purchased:t.purchased??[],onMyAssets:t.onMyAssets??i,onTryInWorld:t.onTryInWorld??i}),r==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx("p",{className:"buy-modal__error",children:t.message}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:i,children:a("buyModal.close")})})]})]})]})}function Oe({step:t,total:r}){return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:"/icon-192.png",alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:a("buyModal.completingTransaction")}),e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})}),e.jsxs("span",{className:"cart-checkout__step",children:[t,"/",r]})]})]})}function Ge({lines:t,shortfallCredits:r,packs:h,selectedPack:i,onSelectPack:C,onBuyPacks:I,onCancel:L}){const n=h.find(o=>o.id===i);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,r)})})," ",a("buyModal.warningToPurchase",{count:t.length})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:t.map(o=>e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:o.item.thumbnail?e.jsx("img",{src:o.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsx("div",{className:"buy-modal__asset-name",title:o.item.name,children:o.item.name||a("buyModal.itemFallback")}),o.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:o.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(N,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:A(o.priceCredits)})]})]})]},o.item.id))}),e.jsx("div",{className:"buy-modal__packs",children:h.map(o=>{const P=o.id===i;return e.jsxs("button",{className:`buy-modal__pack${P?" buy-modal__pack--on":""}`,onClick:()=>C(o.id),children:[e.jsx(N,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:A(o.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",o.usd.toFixed(2),")"]})]},o.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(N,{className:"buy-modal__total-ico"}),e.jsx("span",{children:A((n==null?void 0:n.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((n==null?void 0:n.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:L,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:I,children:a("buyModal.buy")})]})]})}function De({purchased:t,onMyAssets:r,onTryInWorld:h}){return e.jsxs("div",{className:"buy-modal__body cart-checkout__done-body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"60",height:"60","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce77"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:a("getCredits.successTitle")})," ",a("buyModal.successBody")]})]}),e.jsx("div",{className:"cart-checkout__done",children:e.jsx("div",{className:"cart-checkout__done-scroll",children:t.map(i=>e.jsxs("div",{className:"cart-checkout__done-row",children:[e.jsxs("div",{className:"cart-checkout__done-thumb",children:[i.thumbnail?e.jsx("img",{src:i.thumbnail,alt:""}):null,e.jsx("span",{className:"cart-checkout__done-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 18 18",width:"12",height:"12",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",fill:"none",stroke:"#fff",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"cart-checkout__done-info",children:[e.jsx("div",{className:"cart-checkout__done-name",title:i.name,children:i.name||a("buyModal.itemFallback")}),i.creator?e.jsx("div",{className:"cart-checkout__done-creator",children:a("search.byCreator",{name:i.creator})}):null]}),e.jsxs("div",{className:"cart-checkout__done-price",children:[e.jsx(N,{className:"cart-checkout__done-price-ico"}),e.jsx("span",{children:A(i.priceCredits)})]})]},i.id))})}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:r,children:a("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:h,children:[a("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})}function oe(t){const r=t,h=(r.message??"").toLowerCase();return r.code===4001||h.includes("reject")||h.includes("denied")||h.includes("cancel")?a("getCredits.errorCanceled"):h.includes("insufficient")?a("cart.error.insufficient",{currency:Le.name}):h.includes("no active listing")||h.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}function Je(t){const r=t;return r.code===402||r.status===402||(r.message??"").toLowerCase().includes("insufficient")}const Ve=12e4,K=qe.slice(0,3),Ye=Ie.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump";function He(t){const r=[];return t.unavailable.length&&r.push(a("cart.drop.unavailable",{count:t.unavailable.length})),t.own.length&&r.push(a("cart.drop.own",{count:t.own.length})),a("cart.drop.removed",{items:r.join(` ${a("cart.drop.and")} `)})}function us(){ge({title:a("nav.cart"),noindex:!0});const t=v(s=>s.items),r=v(s=>s.remove),h=v(s=>s.clear),i=v(s=>s.restore),C=v(s=>s.setFittingOpen),I=ce(s=>s.items),L=ce(s=>s.toggle),{session:n}=ve(),o=t.some(s=>s.category!=="emote"),{data:P}=Ne({queryKey:["upsell-listings"],queryFn:()=>Ee({first:40}),staleTime:6e4}),{data:T}=Ce(n),R=we(),W=fe(),{state:w}=ke(),[V,F]=j.useState(null),[Y,f]=j.useState(null),[H,U]=j.useState(null),[de,M]=j.useState(!1),[x,E]=j.useState(null),X=j.useRef(0),[d,k]=j.useState(null),[Q,Z]=j.useState(""),ue=t.reduce((s,c)=>s+c.priceCredits,0),he=x?x.liveTotalCredits:ue,me=new Set(t.map(s=>s.id)),ee=((P==null?void 0:P.items)??[]).filter(s=>!me.has(s.id)).slice(0,12),_e=new Map(x==null?void 0:x.buyable.map(s=>[s.item.id,s])),z=(T==null?void 0:T.credits)??0,be=Se;function O(s){s(),E(null),U(null),f(null)}function pe(){k(null),M(!1)}function se(s){const c=s.reduce((m,u)=>m+u.priceCredits,0),l=Math.max(0,c-z),y=K.find(m=>m.credits>=l)??K[K.length-1];Z(y.id),$("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:c,credits_balance:z,shortfall:l}),k({phase:"nofunds",lines:s.map(m=>({item:m.item,priceCredits:m.priceCredits})),shortfall:l}),M(!1)}async function ye(s){if(!n||s.length===0)return;const c=s.map(u=>({...u.item,priceCredits:u.priceCredits})),l=[];let y="authorize",m=!1;k({phase:"processing",step:1,total:s.length});try{const u=[];for(let b=0;b<s.length;b++){const g=s[b];k({phase:"processing",step:b+1,total:s.length});try{const{credit:p,maxCreditedValue:D}=await Pe(n.identity,g.usdCents,g.trade.id);l.push(p.id),u.push({trade:g.trade,credits:[p],maxCreditedValue:D})}catch(p){if(Je(p)){if(l.length){try{await ne(n.identity,l)}catch(D){B(D,{flow:"cart_checkout",step:"release"})}R.invalidateQueries({queryKey:["usd-balance"]})}se(s);return}throw p}}y="submit";let _=[];if(Be())try{_=await Ae({purchases:u,buyer:n.address,signer:n.signer});const g=(await Promise.allSettled(_.map(p=>Re(p)))).flatMap(p=>p.status==="rejected"?[p.reason]:[]);if(g.length&&!g.some(p=>p instanceof We))throw g[0];m=!0}catch(b){if(!(b instanceof Ue))throw b;_=await ie({purchases:u,buyer:n.address,signer:n.signer})}else _=await ie({purchases:u,buyer:n.address,signer:n.signer});s.forEach(b=>r(b.item.id)),E(null),$("Shop Completed Purchase",{...Te(c),payment_type:"credits",no_crypto_step:m,transaction_hash:_[0]??null}),R.invalidateQueries({queryKey:["usd-balance"]}),k({phase:"complete",purchased:c})}catch(u){if(le(u)||B(u,{flow:"cart_checkout",step:y,cart_size:s.length}),$(le(u)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:y,error_code:Fe(u),value_usd:re(c.reduce((_,b)=>_+b.priceCredits,0)),cart_size:s.length}),l.length){try{await ne(n.identity,l)}catch(_){B(_,{flow:"cart_checkout",step:"release"})}R.invalidateQueries({queryKey:["usd-balance"]})}k({phase:"error",message:oe(u)})}}function ae(s){const c=s.reduce((l,y)=>l+y.priceCredits,0);if(T!=null&&T.credits<c){se(s);return}ye(s)}async function G(){if(!n){f(a("buyModal.signInToCheckout"));return}const s=v.getState().items;if(s.length!==0){f(null),U(null),M(!0),$("Shop Started Checkout",{cart_size:s.length,cart_value_credits:s.reduce((c,l)=>c+l.priceCredits,0),cart_value_usd:re(s.reduce((c,l)=>c+l.priceCredits,0)),has_sufficient_credits:z>=s.reduce((c,l)=>c+l.priceCredits,0)});try{F(a("cart.status.reviewing"));const c=await ze(s,n.address,be),l=[...c.unavailable,...c.own];if(l.length&&(l.forEach(y=>r(y.id)),U(He(c))),c.buyable.length===0){f(a("cart.error.noneAvailable")),E(null),F(null);return}if(c.orderChanged){E(c),X.current=Date.now(),F(null);return}F(null),ae(c.buyable)}catch(c){B(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),f(oe(c)),F(null)}finally{M(!1)}}}async function xe(){if(x){if(!n){f(a("buyModal.signInToCheckout"));return}if(Date.now()-X.current>Ve){E(null),U(null),await G();return}f(null),ae(x.buyable)}}async function je(){if(Q){try{sessionStorage.setItem(q,JSON.stringify(v.getState().items))}catch{}M(!0);try{const s=await $e(Q,n?{address:n.address,identity:n.identity}:void 0);if(s.url){window.location.href=s.url;return}W("/credits")}catch(s){try{sessionStorage.removeItem(q)}catch{}B(s,{flow:"cart_buy_credits"}),k({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{M(!1)}}}const te=j.useRef(!1);j.useEffect(()=>{if(!(w!=null&&w.resumeCheckout)||te.current)return;te.current=!0;try{const c=sessionStorage.getItem(q);if(c){sessionStorage.removeItem(q);const l=JSON.parse(c);Array.isArray(l)&&l.length&&i(l)}}catch{}R.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void G(),0);return()=>clearTimeout(s)},[w==null?void 0:w.resumeCheckout]);const S=de||(d==null?void 0:d.phase)==="processing";return t.length===0&&!d?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:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(J,{className:"btn btn--purple",to:"/assets",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>W(-1),type:"button",children:[e.jsx("span",{className:"ico ico-arrow-left","aria-hidden":!0}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("section",{className:"checkout__panel",children:[e.jsxs("div",{className:"checkout__panel-head",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>W(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx("span",{className:"ico ico-arrow-left","aria-hidden":!0})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:t.length})}),o?e.jsxs("button",{className:"checkout__fitting",onClick:()=>C(!0),disabled:S,children:[e.jsx("span",{className:"ico ico-fitting-room checkout__fitting-ico","aria-hidden":!0}),a("cart.fittingRoom")]}):null]}),e.jsx("div",{className:"checkout__list",children:t.map(s=>{const c=_e.get(s.id),l=c?c.priceCredits:s.priceCredits,y=!!c&&c.priceCredits!==s.priceCredits,m=!!I[s.id],u=s.tokenId??s.itemId,_=s.contractAddress&&u?`/item/${s.contractAddress}/${u}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[_?e.jsx(J,{className:"checkout__thumb-link",to:_,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null,e.jsx("span",{className:"checkout__thumb-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[_?e.jsx(J,{className:"checkout__name",to:_,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Me,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>O(()=>r(s.id)),disabled:S,"aria-label":a("cart.removeFromCart",{name:s.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:"1"}),e.jsx("button",{className:"checkout__step",disabled:!0,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"checkout__price",children:[e.jsx(N,{className:"checkout__price-ico"})," ",l,y?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${m?" is-on":""}`,onClick:()=>L(s),"aria-label":m?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:m?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx("span",{className:`ico ${m?"ico-heart-solid":"ico-heart"}`,"aria-hidden":!0})}),e.jsx("button",{className:"checkout__remove",onClick:()=>O(()=>r(s.id)),disabled:S,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx("span",{className:"ico ico-trash","aria-hidden":!0})})]})]},s.id)})}),e.jsxs("div",{className:"checkout__utils",children:[e.jsx("button",{className:"link",onClick:()=>O(h),disabled:S,children:a("cart.clearCart")}),null]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:t.length})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(N,{className:"checkout__total-ico"})," ",he]})]}),e.jsx("button",{className:"checkout__cta",onClick:x?xe:G,disabled:S,children:S?a("cart.working"):x?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),x?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,H?e.jsx("p",{className:"muted checkout__msg",children:H}):null,V?e.jsx("p",{className:"muted checkout__msg",children:V}):null,Y?e.jsx("p",{className:"error checkout__msg",children:Y}):null]})]})]}),ee.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(Ke,{title:a("cart.youMightAlsoLike"),items:ee})}):null,d?e.jsx(Qe,{phase:d.phase,balanceCredits:z,onClose:pe,step:d.phase==="processing"?d.step:void 0,total:d.phase==="processing"?d.total:void 0,lines:d.phase==="nofunds"?d.lines:void 0,shortfallCredits:d.phase==="nofunds"?d.shortfall:void 0,packs:K,selectedPack:Q,onSelectPack:Z,onBuyPacks:je,purchased:d.phase==="complete"?d.purchased:void 0,onMyAssets:()=>W("/assets?tab=mine"),onTryInWorld:()=>window.open(Ye,"_blank","noopener"),message:d.phase==="error"?d.message:void 0}):null]})}export{us as Cart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{M as N,N as U,O as w,P as z,Q as o,R as E,S as c,U as I,V as g,X as D,Y as M}from"./index-C7swV0s7.js";import{r as F,j as v}from"./react-yytiy0wi.js";function K(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const V=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,W=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -6,7 +6,7 @@ import{L as N,M as U,N as w,O as z,P as o,Q as E,R as c,S as I,U as g,V as D,X a
|
|
|
6
6
|
100% {
|
|
7
7
|
transform: rotate(360deg);
|
|
8
8
|
}
|
|
9
|
-
`)),
|
|
9
|
+
`)),B=M(S||(S=l`
|
|
10
10
|
0% {
|
|
11
11
|
stroke-dasharray: 1px, 200px;
|
|
12
12
|
stroke-dashoffset: 0;
|
|
@@ -21,8 +21,8 @@ import{L as N,M as U,N as w,O as z,P as o,Q as E,R as c,S as I,U as g,V as D,X a
|
|
|
21
21
|
stroke-dasharray: 100px, 200px;
|
|
22
22
|
stroke-dashoffset: -125px;
|
|
23
23
|
}
|
|
24
|
-
`)),
|
|
24
|
+
`)),G=r=>{const{classes:e,variant:s,color:a,disableShrink:d}=r,u={root:["root",s,`color${c(a)}`],svg:["svg"],circle:["circle",`circle${c(s)}`,d&&"circleDisableShrink"]};return I(u,K,e)},L=g("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.root,e[s.variant],e[`color${c(s.color)}`]]}})(({ownerState:r,theme:e})=>o({display:"inline-block"},r.variant==="determinate"&&{transition:e.transitions.create("transform")},r.color!=="inherit"&&{color:(e.vars||e).palette[r.color].main}),({ownerState:r})=>r.variant==="indeterminate"&&D(b||(b=l`
|
|
25
25
|
animation: ${0} 1.4s linear infinite;
|
|
26
|
-
`),
|
|
26
|
+
`),W)),O=g("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(r,e)=>e.svg})({display:"block"}),Q=g("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(r,e)=>{const{ownerState:s}=r;return[e.circle,e[`circle${c(s.variant)}`],s.disableShrink&&e.circleDisableShrink]}})(({ownerState:r,theme:e})=>o({stroke:"currentColor"},r.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},r.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:r})=>r.variant==="indeterminate"&&!r.disableShrink&&D($||($=l`
|
|
27
27
|
animation: ${0} 1.4s ease-in-out infinite;
|
|
28
|
-
`),
|
|
28
|
+
`),B)),Z=F.forwardRef(function(e,s){const a=w({props:e,name:"MuiCircularProgress"}),{className:d,color:u="primary",disableShrink:R=!1,size:m=40,style:_,thickness:i=3.6,value:p=0,variant:k="indeterminate"}=a,j=z(a,V),n=o({},a,{color:u,disableShrink:R,size:m,thickness:i,value:p,variant:k}),f=G(n),h={},x={},y={};if(k==="determinate"){const C=2*Math.PI*((t-i)/2);h.strokeDasharray=C.toFixed(3),y["aria-valuenow"]=Math.round(p),h.strokeDashoffset=`${((100-p)/100*C).toFixed(3)}px`,x.transform="rotate(-90deg)"}return v.jsx(L,o({className:E(f.root,d),style:o({width:m,height:m},x,_),ownerState:n,ref:s,role:"progressbar"},y,j,{children:v.jsx(O,{className:f.svg,ownerState:n,viewBox:`${t/2} ${t/2} ${t} ${t}`,children:v.jsx(Q,{className:f.circle,style:h,ownerState:n,cx:t,cy:t,r:(t-i)/2,fill:"none",strokeWidth:i})})}))});export{Z as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as u,d as D,a as O}from"./react-yytiy0wi.js";import{F as Q,t as r,j as Y,z as Z,g as J,a as V,A as W,an as X,s as ee,ao as ae}from"./index-C7swV0s7.js";import{d as re,g as te,a as se,A as ce}from"./collection-Cb2Yk135.js";import{u as oe}from"./useStore-CTx-2Xfe.js";import{s as M}from"./address-DrURAr9O.js";import{S as F,C as ie,F as le,c as ne,a as T,b as de}from"./categories-DlVqkFPG.js";import{L as me}from"./LoadMore-DOqijdHT.js";import{u as ue}from"./useInfiniteGrid-LLmuFcQo.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";function pe({name:t,creator:a}){const{data:o}=oe(a),l=(o==null?void 0:o.cover)||re;return e.jsxs("section",{className:"collection-hero","aria-label":t,children:[e.jsxs("div",{className:"collection-hero__cover",children:[e.jsx("img",{className:"collection-hero__cover-img",src:l,alt:"",loading:"eager"}),e.jsx("div",{className:"collection-hero__scrim","aria-hidden":!0})]}),e.jsx("h1",{className:"collection-hero__title",children:t})]})}function he({address:t}){var x,i;const{data:a}=Q(t),[o,l]=u.useState(!1);if(!t)return null;const n=(a==null?void 0:a.name)||M(t),p=(i=(x=a==null?void 0:a.avatar)==null?void 0:x.snapshots)==null?void 0:i.face256,h=`${Y.profileUrl}/${t}`,g=te(se({name:a==null?void 0:a.name,hasClaimedName:a==null?void 0:a.hasClaimedName,ethAddress:(a==null?void 0:a.ethAddress)??t}));async function d(){try{await navigator.clipboard.writeText(t),l(!0),window.setTimeout(()=>l(!1),1500)}catch(_){Z(_,{flow:"copy_creator_address"})}}return e.jsxs("div",{className:"creator-card",children:[p?e.jsx("img",{className:"creator-card__ava",src:p,alt:"",loading:"eager",style:{backgroundColor:g}}):e.jsx("span",{className:"creator-card__ava creator-card__ava--ph","aria-hidden":!0,style:{backgroundColor:g}}),e.jsx("h2",{className:"creator-card__name",title:n,children:n}),e.jsxs("button",{type:"button",className:"creator-card__account",onClick:()=>void d(),title:o?r("collection.copied"):r("collection.copyAddress"),"aria-label":o?r("collection.copied"):r("collection.copyAddress"),children:[e.jsx("span",{className:"creator-card__account-text",children:M(t)}),e.jsx("span",{className:"ico ico-copy creator-card__copy","aria-hidden":!0})]}),e.jsx("a",{className:"creator-card__view",href:h,target:"_blank",rel:"noopener noreferrer",children:r("collection.viewProfile")})]})}const ge=48;function Pe(){var k;const{contractAddress:t}=D(),a=O(),[o,l]=u.useState("wearable"),[n,p]=u.useState(null),[h,g]=u.useState([]),[d,x]=u.useState(""),[i,_]=u.useState(""),[v,R]=u.useState("newest"),f=d&&!Number.isNaN(Number(d))?Number(d):void 0,C=i&&!Number.isNaN(Number(i))?Number(i):void 0,E=n?de[n]:void 0,B=(F.find(s=>s.key===v)??F[0]).server,y={category:o,rarities:h.length?h:void 0,wearableCategories:E,minPriceCredits:f,maxPriceCredits:C,sortBy:B},{items:b,total:L,isLoading:N,error:A,hasNextPage:U,isFetchingNextPage:S,fetchNextPage:$}=ue(["collection-page",t,y],s=>X(t,{...y,first:ge,skip:s}),{enabled:!!t}),{data:c}=J({queryKey:["collection-meta",t],queryFn:()=>ae(t),enabled:!!t,staleTime:5*6e4}),w=(c==null?void 0:c.name)||r("collection.fallbackTitle");V({title:c==null?void 0:c.name,description:c!=null&&c.name?r("seo.collection.description",{name:c.name}):void 0});const P=(c==null?void 0:c.creator)||((k=b[0])==null?void 0:k.creator);function I(s){l(s),p(null)}function q(s){g(m=>m.includes(s)?m.filter(z=>z!==s):[...m,s])}function G(){l("wearable"),p(null),g([]),x(""),_("")}const j=!!(f||C),H=j?`${d||"0"}–${i||"∞"}`:r("filter.price"),K=o!=="wearable"||!!n||h.length>0||j;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":r("collection.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>a("/assets"),children:r("collection.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:w})]}),e.jsx(pe,{name:w,creator:P}),e.jsxs("div",{className:"browse browse--sidebar collection-page__browse",children:[e.jsxs("aside",{className:"browse__sidebar",children:[e.jsx(he,{address:P}),e.jsx(ie,{category:o,subCategory:n,onCategory:I,onSub:p,title:r("collection.category"),flat:!0})]}),e.jsxs("div",{className:"browse__main",children:[!N&&b.length>0?e.jsx(ce,{items:b,source:"collection"}):null,e.jsx(le,{rarities:h,onToggleRarity:q,sort:v,onSort:R,total:L,loading:N,anyActive:K,onClear:G,renderTrailing:s=>e.jsx(ne,{panelKey:"price",label:H,active:j,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":r("collection.priceMin"),placeholder:r("collection.priceMinPlaceholder"),value:d,onChange:m=>x(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":r("collection.priceMax"),placeholder:r("collection.priceMaxPlaceholder"),value:i,onChange:m=>_(m.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:r("collection.priceHint",{currency:ee.name})})]})})}),A?e.jsx("p",{className:"error",children:r("collection.error")}):null,e.jsx("div",{className:"grid",children:N?e.jsx(T,{count:15}):e.jsxs(e.Fragment,{children:[b.map(s=>e.jsx(W,{item:s},s.id)),S?e.jsx(T,{count:6}):null]})}),e.jsx(me,{hasNextPage:U,isFetching:S,onLoadMore:()=>void $()}),!N&&!A&&b.length===0?e.jsx("p",{className:"muted",children:r("collection.empty")}):null]})]})]})}export{Pe as Collection,Pe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,j as t}from"./react-yytiy0wi.js";import{t as s,B as f,A as k}from"./index-C7swV0s7.js";function A({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,p]=o.useState(!0),[C,b]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),p(e<=1),b(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function w(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx("span",{className:"ico ico-chevron collection-carousel__viewall-ico","aria-hidden":!0})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(k,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:C,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>w(e)},e))}):null]})}export{A as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as B,j as e,L as ee,d as ae,u as re,r as j}from"./react-yytiy0wi.js";import{aH as se,aI as te,af as oe,t as a,aJ as $,F as U,d as ce,j as le,a as ne,A as ie,aj as de,aK as me,s as ue}from"./index-C7swV0s7.js";import{d as he,g as ge,a as xe,A as _e}from"./collection-Cb2Yk135.js";import{u as pe,L as Ne}from"./useStore-CTx-2Xfe.js";import{s as K}from"./address-DrURAr9O.js";import{S as I,C as je,a as w,F as be,c as fe,b as Ce}from"./categories-DlVqkFPG.js";import{L as R}from"./LoadMore-DOqijdHT.js";import{u as T}from"./useInfiniteGrid-LLmuFcQo.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";function ve({collection:t,cover:r,itemCount:o}){const n=B(),{contractAddress:m,name:g,creator:x}=t,N=r==null||o==null,{data:i}=se(m,N),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(te,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(oe,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function we({address:t,className:r=""}){const o=$(m=>m.followed.includes(t.toLowerCase())),n=$(m=>m.toggle);return t?e.jsx("button",{type:"button",className:`btn btn--sm ${o?"btn--ghost":"btn--outline"} ${r}`.trim(),"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const ke={website:"ico-website",twitter:"ico-twitter",discord:"ico-discord",facebook:"ico-facebook"};function Pe({address:t}){var d,b;const{data:r}=U(t),{data:o}=pe(t),n=ce(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||K(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,N=(o==null?void 0:o.cover)||he,i=o==null?void 0:o.description,p=`${le.profileUrl}/${t}`,h=Ne.filter(l=>o==null?void 0:o.links[l]),_=ge(xe({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:N,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx("span",{className:`ico ${ke[l]}`,"aria-hidden":!0})},l)),m&&e.jsx(ee,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx("span",{className:"ico ico-pen","aria-hidden":!0})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(we,{address:t,className:"creator-hero__follow"})]})]})]})}const E=48;function Ue(){const{address:t}=ae(),r=B(),[o]=re(),n=o.has("collections"),{data:m}=U(t),g=(m==null?void 0:m.name)||(t?K(t):a("creator.fallbackName"));ne({title:g,description:a("seo.creator.description",{name:g})});const[x,N]=j.useState("wearable"),[i,p]=j.useState(null),[h,_]=j.useState([]),[d,b]=j.useState(""),[l,f]=j.useState(""),[P,D]=j.useState("newest"),S=d&&!Number.isNaN(Number(d))?Number(d):void 0,y=l&&!Number.isNaN(Number(l))?Number(l):void 0,H=i?Ce[i]:void 0,O=(I.find(s=>s.key===P)??I[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:H,minPriceCredits:S,maxPriceCredits:y,sortBy:O},{items:C,total:G,isLoading:v,error:A,hasNextPage:Y,isFetchingNextPage:F,fetchNextPage:z}=T(["creator-listings",L],s=>de({...L,first:E,skip:s}),{enabled:!!t&&!n}),u=T(["creator-collections",t],s=>me(t,{first:E,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function J(s){N(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function W(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Z(s){_(c=>c.includes(s)?c.filter(X=>X!==s):[...c,s])}function q(){N("wearable"),p(null),_([]),b(""),f("")}const k=!!(S||y),Q=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),V=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Pe,{address:t}):null,!n&&!v&&C.length>0?e.jsx(_e,{items:C,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(je,{category:x,subCategory:i,onCategory:J,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:W})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx("p",{className:"error",children:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(ve,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(R,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{rarities:h,onToggleRarity:Z,sort:P,onSort:D,total:G,loading:v,anyActive:V,onClear:q,renderTrailing:s=>e.jsx(fe,{panelKey:"price",label:Q,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:ue.name})})]})})}),A?e.jsx("p",{className:"error",children:a("creator.error")}):null,e.jsx("div",{className:"grid",children:v?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[C.map(s=>e.jsx(ie,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(R,{hasNextPage:Y,isFetching:F,onLoadMore:()=>void z()}),!v&&!A&&C.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Ue as Creator,Ue as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a$ as U,b0 as Ue,Q as C,b1 as qe,b2 as Ye,a0 as Qe,b3 as Ze,aO as Je,P as R,aT as K,aS as Te,b4 as a,b5 as Xe,b6 as Le,T as et,aZ as tt}from"./index-C7swV0s7.js";import{R as rt,g as ot}from"./getOverlayAlpha-DC6Z8-Ah.js";import{j as T,r as y}from"./react-yytiy0wi.js";import{u as nt,a as Be}from"./useTheme-3xICgEAy.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Ze,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
|
|
2
2
|
try {
|
|
3
3
|
var mode = localStorage.getItem('${s}') || '${o}';
|
|
4
4
|
var colorScheme = '';
|
|
@@ -20,5 +20,5 @@ try {
|
|
|
20
20
|
if (colorScheme) {
|
|
21
21
|
${m}.setAttribute('${d}', colorScheme);
|
|
22
22
|
}
|
|
23
|
-
} catch(e){}})();`}},"mui-color-scheme-init")}function Ae(r){if(typeof window<"u"&&r==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Me(r,o){if(r.mode==="light"||r.mode==="system"&&r.systemMode==="light")return o("light");if(r.mode==="dark"||r.mode==="system"&&r.systemMode==="dark")return o("dark")}function ft(r){return Me(r,o=>{if(o==="light")return r.lightColorScheme;if(o==="dark")return r.darkColorScheme})}function ae(r,o){if(typeof window>"u")return;let n;try{n=localStorage.getItem(r)||void 0,n||localStorage.setItem(r,o)}catch{}return n||o}function ht(r){const{defaultMode:o="light",defaultLightColorScheme:n,defaultDarkColorScheme:i,supportedColorSchemes:s=[],modeStorageKey:l=le,colorSchemeStorageKey:d=ce,storageWindow:m=typeof window>"u"?void 0:window}=r,f=s.join(","),[S,b]=y.useState(()=>{const h=ae(l,o),c=ae(`${d}-light`,n),g=ae(`${d}-dark`,i);return{mode:h,systemMode:Ae(h),lightColorScheme:c,darkColorScheme:g}}),A=ft(S),M=y.useCallback(h=>{b(c=>{if(h===c.mode)return c;const g=h??o;try{localStorage.setItem(l,g)}catch{}return C({},c,{mode:g,systemMode:Ae(g)})})},[l,o]),v=y.useCallback(h=>{h?typeof h=="string"?h&&!f.includes(h)?console.error(`\`${h}\` does not exist in \`theme.colorSchemes\`.`):b(c=>{const g=C({},c);return Me(c,w=>{try{localStorage.setItem(`${d}-${w}`,h)}catch{}w==="light"&&(g.lightColorScheme=h),w==="dark"&&(g.darkColorScheme=h)}),g}):b(c=>{const g=C({},c),w=h.light===null?n:h.light,L=h.dark===null?i:h.dark;if(w)if(!f.includes(w))console.error(`\`${w}\` does not exist in \`theme.colorSchemes\`.`);else{g.lightColorScheme=w;try{localStorage.setItem(`${d}-light`,w)}catch{}}if(L)if(!f.includes(L))console.error(`\`${L}\` does not exist in \`theme.colorSchemes\`.`);else{g.darkColorScheme=L;try{localStorage.setItem(`${d}-dark`,L)}catch{}}return g}):b(c=>{try{localStorage.setItem(`${d}-light`,n),localStorage.setItem(`${d}-dark`,i)}catch{}return C({},c,{lightColorScheme:n,darkColorScheme:i})})},[f,d,n,i]),k=y.useCallback(h=>{S.mode==="system"&&b(c=>{const g=h!=null&&h.matches?"dark":"light";return c.systemMode===g?c:C({},c,{systemMode:g})})},[S.mode]),$=y.useRef(k);return $.current=k,y.useEffect(()=>{const h=(...g)=>$.current(...g),c=window.matchMedia("(prefers-color-scheme: dark)");return c.addListener(h),h(c),()=>{c.removeListener(h)}},[]),y.useEffect(()=>{if(m){const h=c=>{const g=c.newValue;typeof c.key=="string"&&c.key.startsWith(d)&&(!g||f.match(g))&&(c.key.endsWith("light")&&v({light:g}),c.key.endsWith("dark")&&v({dark:g})),c.key===l&&(!g||["light","dark","system"].includes(g))&&M(g||o)};return m.addEventListener("storage",h),()=>{m.removeEventListener("storage",h)}}},[v,M,l,d,f,o,m]),C({},S,{colorScheme:A,setMode:M,setColorScheme:v})}const gt=["colorSchemes","components","generateCssVars","cssVarPrefix"],pt="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function St(r){const{themeId:o,theme:n={},attribute:i=Ie,modeStorageKey:s=le,colorSchemeStorageKey:l=ce,defaultMode:d="light",defaultColorScheme:m,disableTransitionOnChange:f=!1,resolveTheme:S,excludeVariablesFromRoot:b}=r;(!n.colorSchemes||typeof m=="string"&&!n.colorSchemes[m]||typeof m=="object"&&!n.colorSchemes[m==null?void 0:m.light]||typeof m=="object"&&!n.colorSchemes[m==null?void 0:m.dark])&&console.error(`MUI: \`${m}\` does not exist in \`theme.colorSchemes\`.`);const A=y.createContext(void 0),M=()=>{const c=y.useContext(A);if(!c)throw new Error(
|
|
24
|
-
To suppress this warning, you need to explicitly provide the \`palette.${o}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}const I=r=>{try{return r()}catch{}},Lt=(r="mui")=>Ct(r);function Bt(r={},...o){var n,i,s,l,d,m;const{colorSchemes:f={},cssVarPrefix:S="mui",shouldSkipGeneratingVar:b=Tt}=r,A=W(r,$t),M=Lt(S),v=Te(C({},A,f.light&&{palette:(n=f.light)==null?void 0:n.palette})),{palette:k}=v,$=W(v,xt),{palette:h}=Te({palette:C({mode:"dark"},(i=f.dark)==null?void 0:i.palette)});let c=C({},$,{cssVarPrefix:S,getCssVar:M,colorSchemes:C({},f,{light:C({},f.light,{palette:k,opacity:C({inputPlaceholder:.42,inputUnderline:.42,switchTrackDisabled:.12,switchTrack:.38},(s=f.light)==null?void 0:s.opacity),overlays:((l=f.light)==null?void 0:l.overlays)||[]}),dark:C({},f.dark,{palette:h,opacity:C({inputPlaceholder:.5,inputUnderline:.7,switchTrackDisabled:.2,switchTrack:.3},(d=f.dark)==null?void 0:d.opacity),overlays:((m=f.dark)==null?void 0:m.overlays)||At})})});Object.keys(c.colorSchemes).forEach(B=>{const e=c.colorSchemes[B].palette,u=p=>{const _=p.split("-"),q=_[1],P=_[2];return M(p,e[q][P])};if(B==="light"?(t(e.common,"background","#fff"),t(e.common,"onBackground","#000")):(t(e.common,"background","#000"),t(e.common,"onBackground","#fff")),Dt(e,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),B==="light"){t(e.Alert,"errorColor",a.private_safeDarken(e.error.light,.6)),t(e.Alert,"infoColor",a.private_safeDarken(e.info.light,.6)),t(e.Alert,"successColor",a.private_safeDarken(e.success.light,.6)),t(e.Alert,"warningColor",a.private_safeDarken(e.warning.light,.6)),t(e.Alert,"errorFilledBg",u("palette-error-main")),t(e.Alert,"infoFilledBg",u("palette-info-main")),t(e.Alert,"successFilledBg",u("palette-success-main")),t(e.Alert,"warningFilledBg",u("palette-warning-main")),t(e.Alert,"errorFilledColor",I(()=>k.getContrastText(e.error.main))),t(e.Alert,"infoFilledColor",I(()=>k.getContrastText(e.info.main))),t(e.Alert,"successFilledColor",I(()=>k.getContrastText(e.success.main))),t(e.Alert,"warningFilledColor",I(()=>k.getContrastText(e.warning.main))),t(e.Alert,"errorStandardBg",a.private_safeLighten(e.error.light,.9)),t(e.Alert,"infoStandardBg",a.private_safeLighten(e.info.light,.9)),t(e.Alert,"successStandardBg",a.private_safeLighten(e.success.light,.9)),t(e.Alert,"warningStandardBg",a.private_safeLighten(e.warning.light,.9)),t(e.Alert,"errorIconColor",u("palette-error-main")),t(e.Alert,"infoIconColor",u("palette-info-main")),t(e.Alert,"successIconColor",u("palette-success-main")),t(e.Alert,"warningIconColor",u("palette-warning-main")),t(e.AppBar,"defaultBg",u("palette-grey-100")),t(e.Avatar,"defaultBg",u("palette-grey-400")),t(e.Button,"inheritContainedBg",u("palette-grey-300")),t(e.Button,"inheritContainedHoverBg",u("palette-grey-A100")),t(e.Chip,"defaultBorder",u("palette-grey-400")),t(e.Chip,"defaultAvatarColor",u("palette-grey-700")),t(e.Chip,"defaultIconColor",u("palette-grey-700")),t(e.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),t(e.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),t(e.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),t(e.LinearProgress,"primaryBg",a.private_safeLighten(e.primary.main,.62)),t(e.LinearProgress,"secondaryBg",a.private_safeLighten(e.secondary.main,.62)),t(e.LinearProgress,"errorBg",a.private_safeLighten(e.error.main,.62)),t(e.LinearProgress,"infoBg",a.private_safeLighten(e.info.main,.62)),t(e.LinearProgress,"successBg",a.private_safeLighten(e.success.main,.62)),t(e.LinearProgress,"warningBg",a.private_safeLighten(e.warning.main,.62)),t(e.Skeleton,"bg",`rgba(${u("palette-text-primaryChannel")} / 0.11)`),t(e.Slider,"primaryTrack",a.private_safeLighten(e.primary.main,.62)),t(e.Slider,"secondaryTrack",a.private_safeLighten(e.secondary.main,.62)),t(e.Slider,"errorTrack",a.private_safeLighten(e.error.main,.62)),t(e.Slider,"infoTrack",a.private_safeLighten(e.info.main,.62)),t(e.Slider,"successTrack",a.private_safeLighten(e.success.main,.62)),t(e.Slider,"warningTrack",a.private_safeLighten(e.warning.main,.62));const p=a.private_safeEmphasize(e.background.default,.8);t(e.SnackbarContent,"bg",p),t(e.SnackbarContent,"color",I(()=>k.getContrastText(p))),t(e.SpeedDialAction,"fabHoverBg",a.private_safeEmphasize(e.background.paper,.15)),t(e.StepConnector,"border",u("palette-grey-400")),t(e.StepContent,"border",u("palette-grey-400")),t(e.Switch,"defaultColor",u("palette-common-white")),t(e.Switch,"defaultDisabledColor",u("palette-grey-100")),t(e.Switch,"primaryDisabledColor",a.private_safeLighten(e.primary.main,.62)),t(e.Switch,"secondaryDisabledColor",a.private_safeLighten(e.secondary.main,.62)),t(e.Switch,"errorDisabledColor",a.private_safeLighten(e.error.main,.62)),t(e.Switch,"infoDisabledColor",a.private_safeLighten(e.info.main,.62)),t(e.Switch,"successDisabledColor",a.private_safeLighten(e.success.main,.62)),t(e.Switch,"warningDisabledColor",a.private_safeLighten(e.warning.main,.62)),t(e.TableCell,"border",a.private_safeLighten(a.private_safeAlpha(e.divider,1),.88)),t(e.Tooltip,"bg",a.private_safeAlpha(e.grey[700],.92))}else{t(e.Alert,"errorColor",a.private_safeLighten(e.error.light,.6)),t(e.Alert,"infoColor",a.private_safeLighten(e.info.light,.6)),t(e.Alert,"successColor",a.private_safeLighten(e.success.light,.6)),t(e.Alert,"warningColor",a.private_safeLighten(e.warning.light,.6)),t(e.Alert,"errorFilledBg",u("palette-error-dark")),t(e.Alert,"infoFilledBg",u("palette-info-dark")),t(e.Alert,"successFilledBg",u("palette-success-dark")),t(e.Alert,"warningFilledBg",u("palette-warning-dark")),t(e.Alert,"errorFilledColor",I(()=>h.getContrastText(e.error.dark))),t(e.Alert,"infoFilledColor",I(()=>h.getContrastText(e.info.dark))),t(e.Alert,"successFilledColor",I(()=>h.getContrastText(e.success.dark))),t(e.Alert,"warningFilledColor",I(()=>h.getContrastText(e.warning.dark))),t(e.Alert,"errorStandardBg",a.private_safeDarken(e.error.light,.9)),t(e.Alert,"infoStandardBg",a.private_safeDarken(e.info.light,.9)),t(e.Alert,"successStandardBg",a.private_safeDarken(e.success.light,.9)),t(e.Alert,"warningStandardBg",a.private_safeDarken(e.warning.light,.9)),t(e.Alert,"errorIconColor",u("palette-error-main")),t(e.Alert,"infoIconColor",u("palette-info-main")),t(e.Alert,"successIconColor",u("palette-success-main")),t(e.Alert,"warningIconColor",u("palette-warning-main")),t(e.AppBar,"defaultBg",u("palette-grey-900")),t(e.AppBar,"darkBg",u("palette-background-paper")),t(e.AppBar,"darkColor",u("palette-text-primary")),t(e.Avatar,"defaultBg",u("palette-grey-600")),t(e.Button,"inheritContainedBg",u("palette-grey-800")),t(e.Button,"inheritContainedHoverBg",u("palette-grey-700")),t(e.Chip,"defaultBorder",u("palette-grey-700")),t(e.Chip,"defaultAvatarColor",u("palette-grey-300")),t(e.Chip,"defaultIconColor",u("palette-grey-300")),t(e.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),t(e.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),t(e.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),t(e.LinearProgress,"primaryBg",a.private_safeDarken(e.primary.main,.5)),t(e.LinearProgress,"secondaryBg",a.private_safeDarken(e.secondary.main,.5)),t(e.LinearProgress,"errorBg",a.private_safeDarken(e.error.main,.5)),t(e.LinearProgress,"infoBg",a.private_safeDarken(e.info.main,.5)),t(e.LinearProgress,"successBg",a.private_safeDarken(e.success.main,.5)),t(e.LinearProgress,"warningBg",a.private_safeDarken(e.warning.main,.5)),t(e.Skeleton,"bg",`rgba(${u("palette-text-primaryChannel")} / 0.13)`),t(e.Slider,"primaryTrack",a.private_safeDarken(e.primary.main,.5)),t(e.Slider,"secondaryTrack",a.private_safeDarken(e.secondary.main,.5)),t(e.Slider,"errorTrack",a.private_safeDarken(e.error.main,.5)),t(e.Slider,"infoTrack",a.private_safeDarken(e.info.main,.5)),t(e.Slider,"successTrack",a.private_safeDarken(e.success.main,.5)),t(e.Slider,"warningTrack",a.private_safeDarken(e.warning.main,.5));const p=a.private_safeEmphasize(e.background.default,.98);t(e.SnackbarContent,"bg",p),t(e.SnackbarContent,"color",I(()=>h.getContrastText(p))),t(e.SpeedDialAction,"fabHoverBg",a.private_safeEmphasize(e.background.paper,.15)),t(e.StepConnector,"border",u("palette-grey-600")),t(e.StepContent,"border",u("palette-grey-600")),t(e.Switch,"defaultColor",u("palette-grey-300")),t(e.Switch,"defaultDisabledColor",u("palette-grey-600")),t(e.Switch,"primaryDisabledColor",a.private_safeDarken(e.primary.main,.55)),t(e.Switch,"secondaryDisabledColor",a.private_safeDarken(e.secondary.main,.55)),t(e.Switch,"errorDisabledColor",a.private_safeDarken(e.error.main,.55)),t(e.Switch,"infoDisabledColor",a.private_safeDarken(e.info.main,.55)),t(e.Switch,"successDisabledColor",a.private_safeDarken(e.success.main,.55)),t(e.Switch,"warningDisabledColor",a.private_safeDarken(e.warning.main,.55)),t(e.TableCell,"border",a.private_safeDarken(a.private_safeAlpha(e.divider,1),.68)),t(e.Tooltip,"bg",a.private_safeAlpha(e.grey[700],.92))}F(e.background,"default"),F(e.background,"paper"),F(e.common,"background"),F(e.common,"onBackground"),F(e,"divider"),Object.keys(e).forEach(p=>{const _=e[p];_&&typeof _=="object"&&(_.main&&t(e[p],"mainChannel",a.private_safeColorChannel(R(_.main))),_.light&&t(e[p],"lightChannel",a.private_safeColorChannel(R(_.light))),_.dark&&t(e[p],"darkChannel",a.private_safeColorChannel(R(_.dark))),_.contrastText&&t(e[p],"contrastTextChannel",a.private_safeColorChannel(R(_.contrastText))),p==="text"&&(F(e[p],"primary"),F(e[p],"secondary")),p==="action"&&(_.active&&F(e[p],"active"),_.selected&&F(e[p],"selected")))})}),c=o.reduce((B,e)=>K(B,e),c);const g={prefix:S,shouldSkipGeneratingVar:b},{vars:w,generateCssVars:L}=wt(c,g);return c.vars=w,c.generateCssVars=L,c.shouldSkipGeneratingVar=b,c.unstable_sxConfig=C({},Ze,A==null?void 0:A.unstable_sxConfig),c.unstable_sx=function(e){return Le({sx:e,theme:this})},c}const Et=r=>[...[...Array(24)].map((o,n)=>`--${r?`${r}-`:""}overlays-${n+1}`),`--${r?`${r}-`:""}palette-AppBar-darkBg`,`--${r?`${r}-`:""}palette-AppBar-darkColor`],G={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},It=Bt(),{CssVarsProvider:Ot,useColorScheme:Gt,getInitColorSchemeScript:Mt}=St({themeId:et,theme:It,attribute:G.attribute,colorSchemeStorageKey:G.colorSchemeStorageKey,modeStorageKey:G.modeStorageKey,defaultColorScheme:{light:G.defaultLightColorScheme,dark:G.defaultDarkColorScheme},resolveTheme:r=>{const o=C({},r,{typography:tt(r.palette,r.typography)});return o.unstable_sx=function(i){return Le({sx:i,theme:this})},o},excludeVariablesFromRoot:Et}),Rt=Mt;export{Ot as C,at as G,ut as T,Et as a,Bt as e,Rt as g,Tt as s,Gt as u};
|
|
23
|
+
} catch(e){}})();`}},"mui-color-scheme-init")}function Ae(r){if(typeof window<"u"&&r==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Me(r,o){if(r.mode==="light"||r.mode==="system"&&r.systemMode==="light")return o("light");if(r.mode==="dark"||r.mode==="system"&&r.systemMode==="dark")return o("dark")}function ft(r){return Me(r,o=>{if(o==="light")return r.lightColorScheme;if(o==="dark")return r.darkColorScheme})}function ae(r,o){if(typeof window>"u")return;let n;try{n=localStorage.getItem(r)||void 0,n||localStorage.setItem(r,o)}catch{}return n||o}function ht(r){const{defaultMode:o="light",defaultLightColorScheme:n,defaultDarkColorScheme:i,supportedColorSchemes:s=[],modeStorageKey:l=le,colorSchemeStorageKey:d=ce,storageWindow:m=typeof window>"u"?void 0:window}=r,f=s.join(","),[S,b]=y.useState(()=>{const h=ae(l,o),c=ae(`${d}-light`,n),g=ae(`${d}-dark`,i);return{mode:h,systemMode:Ae(h),lightColorScheme:c,darkColorScheme:g}}),A=ft(S),M=y.useCallback(h=>{b(c=>{if(h===c.mode)return c;const g=h??o;try{localStorage.setItem(l,g)}catch{}return C({},c,{mode:g,systemMode:Ae(g)})})},[l,o]),v=y.useCallback(h=>{h?typeof h=="string"?h&&!f.includes(h)?console.error(`\`${h}\` does not exist in \`theme.colorSchemes\`.`):b(c=>{const g=C({},c);return Me(c,w=>{try{localStorage.setItem(`${d}-${w}`,h)}catch{}w==="light"&&(g.lightColorScheme=h),w==="dark"&&(g.darkColorScheme=h)}),g}):b(c=>{const g=C({},c),w=h.light===null?n:h.light,L=h.dark===null?i:h.dark;if(w)if(!f.includes(w))console.error(`\`${w}\` does not exist in \`theme.colorSchemes\`.`);else{g.lightColorScheme=w;try{localStorage.setItem(`${d}-light`,w)}catch{}}if(L)if(!f.includes(L))console.error(`\`${L}\` does not exist in \`theme.colorSchemes\`.`);else{g.darkColorScheme=L;try{localStorage.setItem(`${d}-dark`,L)}catch{}}return g}):b(c=>{try{localStorage.setItem(`${d}-light`,n),localStorage.setItem(`${d}-dark`,i)}catch{}return C({},c,{lightColorScheme:n,darkColorScheme:i})})},[f,d,n,i]),k=y.useCallback(h=>{S.mode==="system"&&b(c=>{const g=h!=null&&h.matches?"dark":"light";return c.systemMode===g?c:C({},c,{systemMode:g})})},[S.mode]),$=y.useRef(k);return $.current=k,y.useEffect(()=>{const h=(...g)=>$.current(...g),c=window.matchMedia("(prefers-color-scheme: dark)");return c.addListener(h),h(c),()=>{c.removeListener(h)}},[]),y.useEffect(()=>{if(m){const h=c=>{const g=c.newValue;typeof c.key=="string"&&c.key.startsWith(d)&&(!g||f.match(g))&&(c.key.endsWith("light")&&v({light:g}),c.key.endsWith("dark")&&v({dark:g})),c.key===l&&(!g||["light","dark","system"].includes(g))&&M(g||o)};return m.addEventListener("storage",h),()=>{m.removeEventListener("storage",h)}}},[v,M,l,d,f,o,m]),C({},S,{colorScheme:A,setMode:M,setColorScheme:v})}const gt=["colorSchemes","components","generateCssVars","cssVarPrefix"],pt="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function St(r){const{themeId:o,theme:n={},attribute:i=Ie,modeStorageKey:s=le,colorSchemeStorageKey:l=ce,defaultMode:d="light",defaultColorScheme:m,disableTransitionOnChange:f=!1,resolveTheme:S,excludeVariablesFromRoot:b}=r;(!n.colorSchemes||typeof m=="string"&&!n.colorSchemes[m]||typeof m=="object"&&!n.colorSchemes[m==null?void 0:m.light]||typeof m=="object"&&!n.colorSchemes[m==null?void 0:m.dark])&&console.error(`MUI: \`${m}\` does not exist in \`theme.colorSchemes\`.`);const A=y.createContext(void 0),M=()=>{const c=y.useContext(A);if(!c)throw new Error(Je(19));return c};function v(c){const{children:g,theme:w=n,modeStorageKey:L=s,colorSchemeStorageKey:B=l,attribute:e=i,defaultMode:u=d,defaultColorScheme:p=m,disableTransitionOnChange:_=f,storageWindow:q=typeof window>"u"?void 0:window,documentNode:P=typeof document>"u"?void 0:document,colorSchemeNode:Y=typeof document>"u"?void 0:document.documentElement,colorSchemeSelector:N=":root",disableNestedContext:Pe=!1,disableStyleSheetGeneration:je=!1}=c,Q=y.useRef(!1),de=se(),Z=y.useContext(A),J=!!Z&&!Pe,ue=w[o],me=ue||w,{colorSchemes:X={},components:Ve={},generateCssVars:fe=()=>({vars:{},css:{}}),cssVarPrefix:ee}=me,Fe=R(me,gt),te=Object.keys(X),he=typeof p=="string"?p:p.light,ge=typeof p=="string"?p:p.dark,{mode:Oe,setMode:pe,systemMode:Se,lightColorScheme:Ce,darkColorScheme:ye,colorScheme:Ge,setColorScheme:ve}=ht({supportedColorSchemes:te,defaultLightColorScheme:he,defaultDarkColorScheme:ge,modeStorageKey:L,colorSchemeStorageKey:B,defaultMode:u,storageWindow:q});let O=Oe,j=Ge;J&&(O=Z.mode,j=Z.colorScheme);const We=O||(u==="system"?d:u),Re=j||(We==="dark"?ge:he),{css:Ke,vars:be}=fe(),D=C({},Fe,{components:Ve,colorSchemes:X,cssVarPrefix:ee,vars:be,getColorSchemeSelector:x=>`[${e}="${x}"] &`}),re={},ke={};Object.entries(X).forEach(([x,V])=>{const{css:z,vars:Ne}=fe(x);D.vars=K(D.vars,Ne),x===Re&&(Object.keys(V).forEach(E=>{V[E]&&typeof V[E]=="object"?D[E]=C({},D[E],V[E]):D[E]=V[E]}),D.palette&&(D.palette.colorScheme=x));const ze=typeof p=="string"?p:u==="dark"?p.dark:p.light;if(x===ze){if(b){const E={};b(ee).forEach(oe=>{E[oe]=z[oe],delete z[oe]}),re[`[${e}="${x}"]`]=E}re[`${N}, [${e}="${x}"]`]=z}else ke[`${N===":root"?"":N}[${e}="${x}"]`]=z}),D.vars=K(D.vars,be),y.useEffect(()=>{j&&Y&&Y.setAttribute(e,j)},[j,e,Y]),y.useEffect(()=>{let x;if(_&&Q.current&&P){const V=P.createElement("style");V.appendChild(P.createTextNode(pt)),P.head.appendChild(V),window.getComputedStyle(P.body),x=setTimeout(()=>{P.head.removeChild(V)},1)}return()=>{clearTimeout(x)}},[j,_,P]),y.useEffect(()=>(Q.current=!0,()=>{Q.current=!1}),[]);const He=y.useMemo(()=>({allColorSchemes:te,colorScheme:j,darkColorScheme:ye,lightColorScheme:Ce,mode:O,setColorScheme:ve,setMode:pe,systemMode:Se}),[te,j,ye,Ce,O,ve,pe,Se]);let _e=!0;(je||J&&(de==null?void 0:de.cssVarPrefix)===ee)&&(_e=!1);const we=T.jsxs(y.Fragment,{children:[_e&&T.jsxs(y.Fragment,{children:[T.jsx(U,{styles:{[N]:Ke}}),T.jsx(U,{styles:re}),T.jsx(U,{styles:ke})]}),T.jsx(ut,{themeId:ue?o:void 0,theme:S?S(D):D,children:g})]});return J?we:T.jsx(A.Provider,{value:He,children:we})}const k=typeof m=="string"?m:m.light,$=typeof m=="string"?m:m.dark;return{CssVarsProvider:v,useColorScheme:M,getInitColorSchemeScript:c=>mt(C({attribute:i,colorSchemeStorageKey:l,defaultMode:d,defaultLightColorScheme:k,defaultDarkColorScheme:$,modeStorageKey:s},c))}}function Ct(r=""){function o(...i){if(!i.length)return"";const s=i[0];return typeof s=="string"&&!s.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${r?`${r}-`:""}${s}${o(...i.slice(1))})`:`, ${s}`}return(i,...s)=>`var(--${r?`${r}-`:""}${i}${o(...s)})`}const De=(r,o,n,i=[])=>{let s=r;o.forEach((l,d)=>{d===o.length-1?Array.isArray(s)?s[Number(l)]=n:s&&typeof s=="object"&&(s[l]=n):s&&typeof s=="object"&&(s[l]||(s[l]=i.includes(l)?[]:{}),s=s[l])})},yt=(r,o,n)=>{function i(s,l=[],d=[]){Object.entries(s).forEach(([m,f])=>{(!n||n&&!n([...l,m]))&&f!=null&&(typeof f=="object"&&Object.keys(f).length>0?i(f,[...l,m],Array.isArray(f)?[...d,m]:d):o([...l,m],f,d))})}i(r)},vt=(r,o)=>typeof o=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(i=>r.includes(i))||r[r.length-1].toLowerCase().indexOf("opacity")>=0?o:`${o}px`:o;function ie(r,o){const{prefix:n,shouldSkipGeneratingVar:i}=o||{},s={},l={},d={};return yt(r,(m,f,S)=>{if((typeof f=="string"||typeof f=="number")&&(!i||!i(m,f))){const b=`--${n?`${n}-`:""}${m.join("-")}`;Object.assign(s,{[b]:vt(m,f)}),De(l,m,`var(${b})`,S),De(d,m,`var(${b}, ${f})`,S)}},m=>m[0]==="vars"),{css:s,vars:l,varsWithDefaults:d}}function H(r){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},H(r)}function bt(r,o){if(H(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var i=n.call(r,o);if(H(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function kt(r){var o=bt(r,"string");return H(o)=="symbol"?o:o+""}const _t=["colorSchemes","components","defaultColorScheme"];function wt(r,o){const{colorSchemes:n={},defaultColorScheme:i="light"}=r,s=R(r,_t),{vars:l,css:d,varsWithDefaults:m}=ie(s,o);let f=m;const S={},{[i]:b}=n,A=R(n,[i].map(kt));if(Object.entries(A||{}).forEach(([v,k])=>{const{vars:$,css:h,varsWithDefaults:c}=ie(k,o);f=K(f,c),S[v]={css:h,vars:$}}),b){const{css:v,vars:k,varsWithDefaults:$}=ie(b,o);f=K(f,$),S[i]={css:v,vars:k}}return{vars:f,generateCssVars:v=>{var k;if(!v){var $;const c=C({},d);return{css:c,vars:l,selector:(o==null||($=o.getSelector)==null?void 0:$.call(o,v,c))||":root"}}const h=C({},S[v].css);return{css:h,vars:S[v].vars,selector:(o==null||(k=o.getSelector)==null?void 0:k.call(o,v,h))||":root"}}}}function Tt(r){var o;return!!r[0].match(/(cssVarPrefix|typography|mixins|breakpoints|direction|transitions)/)||!!r[0].match(/sxConfig$/)||r[0]==="palette"&&!!((o=r[1])!=null&&o.match(/(mode|contrastThreshold|tonalOffset)/))}const $t=["colorSchemes","cssVarPrefix","shouldSkipGeneratingVar"],xt=["palette"],At=[...Array(25)].map((r,o)=>{if(o===0)return;const n=ot(o);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Dt(r,o){o.forEach(n=>{r[n]||(r[n]={})})}function t(r,o,n){!r[o]&&n&&(r[o]=n)}function W(r){return!r||!r.startsWith("hsl")?r:a.hslToRgb(r)}function F(r,o){`${o}Channel`in r||(r[`${o}Channel`]=a.private_safeColorChannel(W(r[o]),`MUI: Can't create \`palette.${o}Channel\` because \`palette.${o}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
|
|
24
|
+
To suppress this warning, you need to explicitly provide the \`palette.${o}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}const I=r=>{try{return r()}catch{}},Lt=(r="mui")=>Ct(r);function Bt(r={},...o){var n,i,s,l,d,m;const{colorSchemes:f={},cssVarPrefix:S="mui",shouldSkipGeneratingVar:b=Tt}=r,A=R(r,$t),M=Lt(S),v=Te(C({},A,f.light&&{palette:(n=f.light)==null?void 0:n.palette})),{palette:k}=v,$=R(v,xt),{palette:h}=Te({palette:C({mode:"dark"},(i=f.dark)==null?void 0:i.palette)});let c=C({},$,{cssVarPrefix:S,getCssVar:M,colorSchemes:C({},f,{light:C({},f.light,{palette:k,opacity:C({inputPlaceholder:.42,inputUnderline:.42,switchTrackDisabled:.12,switchTrack:.38},(s=f.light)==null?void 0:s.opacity),overlays:((l=f.light)==null?void 0:l.overlays)||[]}),dark:C({},f.dark,{palette:h,opacity:C({inputPlaceholder:.5,inputUnderline:.7,switchTrackDisabled:.2,switchTrack:.3},(d=f.dark)==null?void 0:d.opacity),overlays:((m=f.dark)==null?void 0:m.overlays)||At})})});Object.keys(c.colorSchemes).forEach(B=>{const e=c.colorSchemes[B].palette,u=p=>{const _=p.split("-"),q=_[1],P=_[2];return M(p,e[q][P])};if(B==="light"?(t(e.common,"background","#fff"),t(e.common,"onBackground","#000")):(t(e.common,"background","#000"),t(e.common,"onBackground","#fff")),Dt(e,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),B==="light"){t(e.Alert,"errorColor",a.private_safeDarken(e.error.light,.6)),t(e.Alert,"infoColor",a.private_safeDarken(e.info.light,.6)),t(e.Alert,"successColor",a.private_safeDarken(e.success.light,.6)),t(e.Alert,"warningColor",a.private_safeDarken(e.warning.light,.6)),t(e.Alert,"errorFilledBg",u("palette-error-main")),t(e.Alert,"infoFilledBg",u("palette-info-main")),t(e.Alert,"successFilledBg",u("palette-success-main")),t(e.Alert,"warningFilledBg",u("palette-warning-main")),t(e.Alert,"errorFilledColor",I(()=>k.getContrastText(e.error.main))),t(e.Alert,"infoFilledColor",I(()=>k.getContrastText(e.info.main))),t(e.Alert,"successFilledColor",I(()=>k.getContrastText(e.success.main))),t(e.Alert,"warningFilledColor",I(()=>k.getContrastText(e.warning.main))),t(e.Alert,"errorStandardBg",a.private_safeLighten(e.error.light,.9)),t(e.Alert,"infoStandardBg",a.private_safeLighten(e.info.light,.9)),t(e.Alert,"successStandardBg",a.private_safeLighten(e.success.light,.9)),t(e.Alert,"warningStandardBg",a.private_safeLighten(e.warning.light,.9)),t(e.Alert,"errorIconColor",u("palette-error-main")),t(e.Alert,"infoIconColor",u("palette-info-main")),t(e.Alert,"successIconColor",u("palette-success-main")),t(e.Alert,"warningIconColor",u("palette-warning-main")),t(e.AppBar,"defaultBg",u("palette-grey-100")),t(e.Avatar,"defaultBg",u("palette-grey-400")),t(e.Button,"inheritContainedBg",u("palette-grey-300")),t(e.Button,"inheritContainedHoverBg",u("palette-grey-A100")),t(e.Chip,"defaultBorder",u("palette-grey-400")),t(e.Chip,"defaultAvatarColor",u("palette-grey-700")),t(e.Chip,"defaultIconColor",u("palette-grey-700")),t(e.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),t(e.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),t(e.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),t(e.LinearProgress,"primaryBg",a.private_safeLighten(e.primary.main,.62)),t(e.LinearProgress,"secondaryBg",a.private_safeLighten(e.secondary.main,.62)),t(e.LinearProgress,"errorBg",a.private_safeLighten(e.error.main,.62)),t(e.LinearProgress,"infoBg",a.private_safeLighten(e.info.main,.62)),t(e.LinearProgress,"successBg",a.private_safeLighten(e.success.main,.62)),t(e.LinearProgress,"warningBg",a.private_safeLighten(e.warning.main,.62)),t(e.Skeleton,"bg",`rgba(${u("palette-text-primaryChannel")} / 0.11)`),t(e.Slider,"primaryTrack",a.private_safeLighten(e.primary.main,.62)),t(e.Slider,"secondaryTrack",a.private_safeLighten(e.secondary.main,.62)),t(e.Slider,"errorTrack",a.private_safeLighten(e.error.main,.62)),t(e.Slider,"infoTrack",a.private_safeLighten(e.info.main,.62)),t(e.Slider,"successTrack",a.private_safeLighten(e.success.main,.62)),t(e.Slider,"warningTrack",a.private_safeLighten(e.warning.main,.62));const p=a.private_safeEmphasize(e.background.default,.8);t(e.SnackbarContent,"bg",p),t(e.SnackbarContent,"color",I(()=>k.getContrastText(p))),t(e.SpeedDialAction,"fabHoverBg",a.private_safeEmphasize(e.background.paper,.15)),t(e.StepConnector,"border",u("palette-grey-400")),t(e.StepContent,"border",u("palette-grey-400")),t(e.Switch,"defaultColor",u("palette-common-white")),t(e.Switch,"defaultDisabledColor",u("palette-grey-100")),t(e.Switch,"primaryDisabledColor",a.private_safeLighten(e.primary.main,.62)),t(e.Switch,"secondaryDisabledColor",a.private_safeLighten(e.secondary.main,.62)),t(e.Switch,"errorDisabledColor",a.private_safeLighten(e.error.main,.62)),t(e.Switch,"infoDisabledColor",a.private_safeLighten(e.info.main,.62)),t(e.Switch,"successDisabledColor",a.private_safeLighten(e.success.main,.62)),t(e.Switch,"warningDisabledColor",a.private_safeLighten(e.warning.main,.62)),t(e.TableCell,"border",a.private_safeLighten(a.private_safeAlpha(e.divider,1),.88)),t(e.Tooltip,"bg",a.private_safeAlpha(e.grey[700],.92))}else{t(e.Alert,"errorColor",a.private_safeLighten(e.error.light,.6)),t(e.Alert,"infoColor",a.private_safeLighten(e.info.light,.6)),t(e.Alert,"successColor",a.private_safeLighten(e.success.light,.6)),t(e.Alert,"warningColor",a.private_safeLighten(e.warning.light,.6)),t(e.Alert,"errorFilledBg",u("palette-error-dark")),t(e.Alert,"infoFilledBg",u("palette-info-dark")),t(e.Alert,"successFilledBg",u("palette-success-dark")),t(e.Alert,"warningFilledBg",u("palette-warning-dark")),t(e.Alert,"errorFilledColor",I(()=>h.getContrastText(e.error.dark))),t(e.Alert,"infoFilledColor",I(()=>h.getContrastText(e.info.dark))),t(e.Alert,"successFilledColor",I(()=>h.getContrastText(e.success.dark))),t(e.Alert,"warningFilledColor",I(()=>h.getContrastText(e.warning.dark))),t(e.Alert,"errorStandardBg",a.private_safeDarken(e.error.light,.9)),t(e.Alert,"infoStandardBg",a.private_safeDarken(e.info.light,.9)),t(e.Alert,"successStandardBg",a.private_safeDarken(e.success.light,.9)),t(e.Alert,"warningStandardBg",a.private_safeDarken(e.warning.light,.9)),t(e.Alert,"errorIconColor",u("palette-error-main")),t(e.Alert,"infoIconColor",u("palette-info-main")),t(e.Alert,"successIconColor",u("palette-success-main")),t(e.Alert,"warningIconColor",u("palette-warning-main")),t(e.AppBar,"defaultBg",u("palette-grey-900")),t(e.AppBar,"darkBg",u("palette-background-paper")),t(e.AppBar,"darkColor",u("palette-text-primary")),t(e.Avatar,"defaultBg",u("palette-grey-600")),t(e.Button,"inheritContainedBg",u("palette-grey-800")),t(e.Button,"inheritContainedHoverBg",u("palette-grey-700")),t(e.Chip,"defaultBorder",u("palette-grey-700")),t(e.Chip,"defaultAvatarColor",u("palette-grey-300")),t(e.Chip,"defaultIconColor",u("palette-grey-300")),t(e.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),t(e.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),t(e.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),t(e.LinearProgress,"primaryBg",a.private_safeDarken(e.primary.main,.5)),t(e.LinearProgress,"secondaryBg",a.private_safeDarken(e.secondary.main,.5)),t(e.LinearProgress,"errorBg",a.private_safeDarken(e.error.main,.5)),t(e.LinearProgress,"infoBg",a.private_safeDarken(e.info.main,.5)),t(e.LinearProgress,"successBg",a.private_safeDarken(e.success.main,.5)),t(e.LinearProgress,"warningBg",a.private_safeDarken(e.warning.main,.5)),t(e.Skeleton,"bg",`rgba(${u("palette-text-primaryChannel")} / 0.13)`),t(e.Slider,"primaryTrack",a.private_safeDarken(e.primary.main,.5)),t(e.Slider,"secondaryTrack",a.private_safeDarken(e.secondary.main,.5)),t(e.Slider,"errorTrack",a.private_safeDarken(e.error.main,.5)),t(e.Slider,"infoTrack",a.private_safeDarken(e.info.main,.5)),t(e.Slider,"successTrack",a.private_safeDarken(e.success.main,.5)),t(e.Slider,"warningTrack",a.private_safeDarken(e.warning.main,.5));const p=a.private_safeEmphasize(e.background.default,.98);t(e.SnackbarContent,"bg",p),t(e.SnackbarContent,"color",I(()=>h.getContrastText(p))),t(e.SpeedDialAction,"fabHoverBg",a.private_safeEmphasize(e.background.paper,.15)),t(e.StepConnector,"border",u("palette-grey-600")),t(e.StepContent,"border",u("palette-grey-600")),t(e.Switch,"defaultColor",u("palette-grey-300")),t(e.Switch,"defaultDisabledColor",u("palette-grey-600")),t(e.Switch,"primaryDisabledColor",a.private_safeDarken(e.primary.main,.55)),t(e.Switch,"secondaryDisabledColor",a.private_safeDarken(e.secondary.main,.55)),t(e.Switch,"errorDisabledColor",a.private_safeDarken(e.error.main,.55)),t(e.Switch,"infoDisabledColor",a.private_safeDarken(e.info.main,.55)),t(e.Switch,"successDisabledColor",a.private_safeDarken(e.success.main,.55)),t(e.Switch,"warningDisabledColor",a.private_safeDarken(e.warning.main,.55)),t(e.TableCell,"border",a.private_safeDarken(a.private_safeAlpha(e.divider,1),.68)),t(e.Tooltip,"bg",a.private_safeAlpha(e.grey[700],.92))}F(e.background,"default"),F(e.background,"paper"),F(e.common,"background"),F(e.common,"onBackground"),F(e,"divider"),Object.keys(e).forEach(p=>{const _=e[p];_&&typeof _=="object"&&(_.main&&t(e[p],"mainChannel",a.private_safeColorChannel(W(_.main))),_.light&&t(e[p],"lightChannel",a.private_safeColorChannel(W(_.light))),_.dark&&t(e[p],"darkChannel",a.private_safeColorChannel(W(_.dark))),_.contrastText&&t(e[p],"contrastTextChannel",a.private_safeColorChannel(W(_.contrastText))),p==="text"&&(F(e[p],"primary"),F(e[p],"secondary")),p==="action"&&(_.active&&F(e[p],"active"),_.selected&&F(e[p],"selected")))})}),c=o.reduce((B,e)=>K(B,e),c);const g={prefix:S,shouldSkipGeneratingVar:b},{vars:w,generateCssVars:L}=wt(c,g);return c.vars=w,c.generateCssVars=L,c.shouldSkipGeneratingVar=b,c.unstable_sxConfig=C({},Xe,A==null?void 0:A.unstable_sxConfig),c.unstable_sx=function(e){return Le({sx:e,theme:this})},c}const Et=r=>[...[...Array(24)].map((o,n)=>`--${r?`${r}-`:""}overlays-${n+1}`),`--${r?`${r}-`:""}palette-AppBar-darkBg`,`--${r?`${r}-`:""}palette-AppBar-darkColor`],G={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},It=Bt(),{CssVarsProvider:Ot,useColorScheme:Gt,getInitColorSchemeScript:Mt}=St({themeId:et,theme:It,attribute:G.attribute,colorSchemeStorageKey:G.colorSchemeStorageKey,modeStorageKey:G.modeStorageKey,defaultColorScheme:{light:G.defaultLightColorScheme,dark:G.defaultDarkColorScheme},resolveTheme:r=>{const o=C({},r,{typography:tt(r.palette,r.typography)});return o.unstable_sx=function(i){return Le({sx:i,theme:this})},o},excludeVariablesFromRoot:Et}),Wt=Mt;export{Ot as C,at as G,ut as T,Et as a,Bt as e,Wt as g,Tt as s,Gt as u};
|
|
@@ -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-BIMCH_xH.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-dgWkyV5E.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as I,u as V,r as i,j as e}from"./react-yytiy0wi.js";import{a as D,t,d as O,u as K,b as g,s as d,z as A,w as L,C as q,q as Y}from"./index-C7swV0s7.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as $}from"./cart-checkout-N2i7gwjl.js";import{p as z,c as Q,i as W,C as J}from"./payments-BojP1AK1.js";import{C as X}from"./CircularProgress-DndPkIP8.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";const C="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/pack-chips--HnOpf5U.webp",ee="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/credit-coin-CmcTCd5i.webp",se="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg%20width='61'%20height='61'%20viewBox='0%200%2061%2061'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M30.5%2061C47.3447%2061%2061%2047.3447%2061%2030.5C61%2013.6553%2047.3447%200%2030.5%200C13.6553%200%200%2013.6553%200%2030.5C0%2047.3447%2013.6553%2061%2030.5%2061Z'%20fill='url(%23gc_paint0)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.2001%2054.8997C17.2935%2058.7274%2023.6375%2060.9997%2030.5%2060.9997C37.3625%2060.9997%2043.7065%2058.7274%2048.8%2054.8997H12.2001Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.10013%2048.7997C7.83863%2051.1024%209.89738%2053.1612%2012.2001%2054.8997H48.8001C51.1029%2053.1612%2053.1616%2051.1024%2054.9001%2048.7997H6.10013Z'%20fill='%23FFA25A'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2042.6998H2.5468C3.4923%2044.8805%204.69705%2046.924%206.10005%2048.7997H40.9311V42.6998H40.9158Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6094%2019.8247V42.6997H40.6719L21.6094%2019.8247Z'%20fill='url(%23gc_paint1)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.5468%2042.6997H21.6093V19.8248L2.5468%2042.6997Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2032.025V48.8H54.9L40.9158%2032.025Z'%20fill='url(%23gc_paint2)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9467%2048.8H40.9157V32.025L26.9467%2048.8Z'%20fill='%23FCFCFC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M40.9158%2027.4497C45.127%2027.4497%2048.5408%2024.0359%2048.5408%2019.8247C48.5408%2015.6136%2045.127%2012.1998%2040.9158%2012.1998C36.7046%2012.1998%2033.2908%2015.6136%2033.2908%2019.8247C33.2908%2024.0359%2036.7046%2027.4497%2040.9158%2027.4497Z'%20fill='%23FFC95B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.6092%2015.2497C23.7148%2015.2497%2025.4217%2013.5428%2025.4217%2011.4372C25.4217%209.33166%2023.7148%207.62475%2021.6092%207.62475C19.5036%207.62475%2017.7967%209.33166%2017.7967%2011.4372C17.7967%2013.5428%2019.5036%2015.2497%2021.6092%2015.2497Z'%20fill='%23FFC95B'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='gc_paint0'%20x1='30.5'%20y1='-12.6335'%20x2='-12.6335'%20y2='30.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint1'%20x1='21.6029'%20y1='19.8247'%20x2='21.6029'%20y2='42.6997'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3clinearGradient%20id='gc_paint2'%20x1='40.9111'%20y1='32.025'%20x2='40.9111'%20y2='48.8'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23A524B3'/%3e%3cstop%20offset='1'%20stop-color='%23FF2D55'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",_=W()?"mock":"stripe",re={pack_5:C,pack_10:C,pack_25:C,pack_50:C},ce="https://docs.decentraland.org";function P(o){const s=o;if((s==null?void 0:s.name)==="AbortError")return t("getCredits.errorCanceled");const h=((s==null?void 0:s.message)??"").toLowerCase();return h.includes("sign in")?t("getCredits.errorSignIn",{currency:d.name}):h.includes("timed out")?t("getCredits.errorTimeout",{currency:d.name}):t("getCredits.errorGeneric")}function _e(){D({title:t("nav.getCredits",{currency:d.name}),noindex:!0});const o=I(),{session:s,signIn:h}=O(),f=K(),[v,w]=V(),[p,l]=i.useState("select"),[a,S]=i.useState(null),[F,E]=i.useState(null),[H,m]=i.useState(null),[U,j]=i.useState(!1),N=i.useRef(null);i.useEffect(()=>()=>{var r;return(r=N.current)==null?void 0:r.abort()},[]);const B=i.useCallback(()=>{w(r=>{const c=new URLSearchParams(r);return c.delete("order"),c.delete("canceled"),c},{replace:!0})},[w]),y=i.useCallback(async r=>{l("processing");const c=new AbortController;N.current=c;try{const u=await z(r,{signal:c.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(u.status==="credited"){const x=u.creditsGranted??(a==null?void 0:a.credits)??0;E(x>0?x:null),l("success"),g("Shop Completed Buy Credits",{order_id:r,pack_usd:(a==null?void 0:a.usd)??null,credits:x>0?x:null,provider:_}),f.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem($)){o("/cart",{state:{resumeCheckout:!0}});return}}catch{}try{const R=sessionStorage.getItem(G);if(R){sessionStorage.removeItem(G);const n=JSON.parse(R),M=(n==null?void 0:n.tokenId)??(n==null?void 0:n.itemId);if(n!=null&&n.contractAddress&&M){o(`/item/${n.contractAddress}/${M}`,{state:{item:n,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(a==null?void 0:a.usd)??null}),f.invalidateQueries({queryKey:["usd-balance"]}),l("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(a==null?void 0:a.usd)??null}),m(u.error??t("getCredits.errorGrant",{currency:d.name})),l("error"))}catch(u){A(u,{flow:"get_credits",step:"grant",order_id:r}),g("Shop Buy Credits Failed",{step:"grant",error_code:L(u),pack_usd:(a==null?void 0:a.usd)??null}),m(P(u)),l("error")}},[a,s,f,o]),Z=i.useCallback(async r=>{if(!s){h();return}m(null),j(!1),S(r),l(_==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:r.usd,credits:r.credits,provider:_});try{const c=await Q(r.id,{address:s.address,identity:s.identity});if(c.mock)y(c.orderId);else if(c.url)g("Shop Redirected To Stripe",{order_id:c.orderId,pack_usd:r.usd,credits:r.credits}),window.location.href=c.url;else throw new Error("Checkout did not return a redirect url")}catch(c){A(c,{flow:"get_credits",step:"checkout",provider:_}),g("Shop Buy Credits Failed",{step:"checkout",error_code:L(c),pack_usd:r.usd}),m(P(c)),l("error")}},[s,h,y]),b=i.useRef(!1);i.useEffect(()=>{if(b.current)return;const r=v.get("order");if(v.get("canceled")!=null){b.current=!0,g("Shop Buy Credits Cancelled",{order_id:r,provider:_}),B(),j(!0),l("select");return}r&&(l("processing"),s&&(b.current=!0,B(),y(r)))},[v,s]);function k(){var r;(r=N.current)==null||r.abort(),l("select"),S(null),E(null),m(null),j(!1)}const T=p==="select";return e.jsxs("div",{className:"getcredits",children:[T&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:t("getCredits.title",{currency:d.name})}),e.jsxs("p",{className:"getcredits__sub",children:[t("getCredits.subtitle",{currency:d.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ce,target:"_blank",rel:"noreferrer",children:[t("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),p==="select"&&e.jsxs(e.Fragment,{children:[U&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:t("getCredits.canceledNote")}),e.jsx(ae,{onSelect:r=>void Z(r)})]}),p==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(X,{size:32}),e.jsx("p",{className:"muted",children:t("getCredits.redirecting")})]}),p==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:te,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:t("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),p==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:se,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:t("getCredits.successTitle")})," ",t("getCredits.successBody",{currency:d.name})]})]}),F!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:ee,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(q,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:t("getCredits.creditsAmount",{credits:F,currency:d.name})})," ",e.jsx("span",{className:"gc-credits__added",children:t("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:k,children:t("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:t("getCredits.startShopping")})]})]}),p==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:t("getCredits.pendingTitle",{currency:d.name})}),e.jsx("p",{className:"muted",children:t("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:t("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:k,children:t("getCredits.done")})]})]}),p==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:t("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:H}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:k,children:t("getCredits.tryAgain")})})]})]})}function ae({onSelect:o}){return e.jsx("div",{className:"packs",children:J.map(s=>e.jsxs("button",{type:"button",className:`pack${s.bestValue?" pack--best":""}`,onClick:()=>o(s),"aria-label":t("getCredits.packAria",{amount:Y(s.credits),usd:s.usd}),children:[s.bestValue&&e.jsx("span",{className:"pack__badge",children:t("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:t("getCredits.creditsAmount",{credits:s.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:re[s.id]??C,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",s.usd.toFixed(2)]})})]})]},s.id))})}export{_e as GetCredits,_e 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-C3fHjE5h.js";import{d as g,r as v}from"./index-dgWkyV5E.js";import{C as c}from"./ConstantsUtil-BbIzv5xN.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-BIMCH_xH.js";import{au as y}from"./NetworkUtil-CLSFaUe_.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as F,r as g,j as e,L as Q}from"./react-yytiy0wi.js";import{t as s,s as S,C as L,b as R,z as E,a as K,d as $,u as P,g as U,ac as W}from"./index-C7swV0s7.js";import{i as B,R as O,f as z}from"./import-CXHQHUHE.js";import{s as Y}from"./wallet-kind-B9P1TeIH.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./buy-C3XM-F5L.js";import"./trade-encoding-BkDaYyvb.js";import"./index-HN6Rk25C.js";import"./mana-rate-B7ShUGMF.js";function G({queue:n,session:C,onClose:j,onDone:h}){const N=F(),m=Y(C.providerType),[d,f]=g.useState(()=>n.map(()=>"pending")),[v,w]=g.useState("running"),T=g.useRef(!1);g.useEffect(()=>{if(T.current)return;T.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(p=>p.map((u,o)=>o===r?"active":u));try{await B(n[r].item,n[r].priceCredits,C),R("Shop Migrated Listing",{item_id:n[r].item.itemId??n[r].item.oldTradeId??null,contract_address:n[r].item.contractAddress,new_price_credits:n[r].priceCredits,new_price_usd:n[r].priceCredits/10}),t||f(p=>p.map((u,o)=>o===r?"done":u))}catch(p){if(p instanceof O)E(p,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(u=>u.map((o,k)=>k===r?"unlisted":o));else{const u=p,o=u.code===4001||/reject|denied|cancel/i.test(u.message??"");o||E(p,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(k=>k.map((a,l)=>l===r?o?"skipped":"failed":a))}}}t||w("finished")})(),()=>{t=!0}},[]);const _=d.filter(t=>t==="done").length,b=d.findIndex(t=>t==="active"),x=Math.round(d.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function y(){h(),j()}if(v==="finished"){const t=d.filter(r=>r==="skipped"||r==="failed").length,c=d.filter(r=>r==="unlisted").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:_>0?s("migrate.successTitle"):s("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[_>0?s("migrate.listedSummary",{count:_,currency:S.name}):s("migrate.noneListed"),t>0?" "+s("migrate.skippedSummary",{count:t}):"",c>0?" "+s("migrate.unlistedSummary",{count:c}):""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:y,children:s("getCredits.done")}),c>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{h(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{h(),j(),N("/assets")},children:s("migrate.viewInShop")}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:s("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[m?s("migrate.subConfirm"):s("migrate.subManaged")," ",b>=0?s("migrate.progressCount",{current:b+1,total:n.length}):""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${x}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((t,c)=>e.jsxs("li",{className:`migrate__row migrate__row--${d[c]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||s("migrate.itemFallback")}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(L,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:d[c]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",m?s("migrate.statusConfirm"):s("migrate.statusAdding")]}):d[c]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):d[c]==="skipped"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusSkipped")}):d[c]==="failed"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusFailed")}):d[c]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:s("migrate.unlistedTooltip"),children:s("migrate.statusUnlisted")}):e.jsx("span",{className:"migrate__wait",children:s("migrate.statusWaiting")})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:m?s("migrate.hintConfirm"):s("migrate.hintManaged")})]})})}const H=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub"}];function ne(){K({title:s("seo.import.title"),noindex:!0});const{session:n,signIn:C,restore:j}=$(),h=P(),N=n==null?void 0:n.address;g.useEffect(()=>{j()},[j]);const{data:m,isLoading:d}=U({queryKey:["importable",N],queryFn:()=>z(N),enabled:!!N}),[f,v]=g.useState({}),[w,T]=g.useState(new Set),[_,b]=g.useState(null),x=g.useMemo(()=>[...(m==null?void 0:m.creations)??[],...(m==null?void 0:m.owned)??[]],[m]);g.useEffect(()=>{x.length&&v(a=>{const l={...a};for(const i of x)l[i.oldTradeId]==null&&(l[i.oldTradeId]=i.suggestedCredits);return l})},[x]);const y=a=>!w.has(a),t=a=>f[a.oldTradeId]??a.suggestedCredits,c=x.filter(a=>y(a.oldTradeId)),r=c.reduce((a,l)=>a+t(l),0);function p(a,l){const i=l.replace(/[^\d]/g,"");v(I=>({...I,[a]:i===""?0:parseInt(i,10)}))}function u(a){T(l=>{const i=new Set(l);return i.has(a)?i.delete(a):i.add(a),i})}function o(a){return a.map(l=>({item:l,priceCredits:Math.max(1,t(l))}))}function k(){h.invalidateQueries({queryKey:["importable"]}),h.invalidateQueries({queryKey:["unified-listings"]}),h.invalidateQueries({queryKey:["my-assets"]}),h.invalidateQueries({queryKey:["collection-sale-state"]}),W.success(s("importListings.toastUpdated"))}return n?!d&&x.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:s("importListings.emptyTitle")}),e.jsx("p",{className:"muted",children:s("importListings.emptyBody")}),e.jsx(Q,{className:"btn btn--purple",to:"/my-assets",children:s("importListings.goToMyAssets")})]}):e.jsxs("div",{className:"imp",children:[e.jsxs("header",{className:"imp__head",children:[e.jsx("span",{className:"imp__eyebrow",children:s("importListings.eyebrow")}),e.jsxs("h1",{className:"imp__title",children:[s("importListings.titleLead")," ",e.jsx("span",{className:"imp__grad",children:s("importListings.titleAccent")})]}),e.jsx("p",{className:"imp__lede",children:s("importListings.lede",{currency:S.name})})]}),e.jsxs("div",{className:"imp__ratebar",children:[e.jsx(L,{className:"ccy-mark imp__diamond"})," ",s("importListings.rate",{currency:S.nameSingular})]}),d?e.jsx("div",{className:"imp__list",children:Array.from({length:4}).map((a,l)=>e.jsx("div",{className:"imp-row imp-row--skeleton"},l))}):H.map(a=>{const l=(m==null?void 0:m[a.key])??[];return l.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:s(a.title)}),e.jsx("span",{className:"imp__section-sub",children:s(a.sub)})]}),e.jsx("div",{className:"imp__list",children:l.map(i=>{const I=t(i),A=I!==i.suggestedCredits;return e.jsxs("article",{className:`imp-row${y(i.oldTradeId)?"":" is-off"}`,children:[e.jsx("input",{type:"checkbox",className:"imp-check",checked:y(i.oldTradeId),onChange:()=>u(i.oldTradeId),"aria-label":s("importListings.includeItem",{name:i.name})}),e.jsx("div",{className:"imp-thumb",children:i.thumbnail?e.jsx("img",{src:i.thumbnail,alt:""}):null}),e.jsxs("div",{className:"imp-meta",children:[e.jsx("div",{className:"imp-name",title:i.name,children:i.name||s("importListings.itemFallback")}),e.jsx("span",{className:"imp-chip",children:i.rarity})]}),e.jsxs("div",{className:"imp-price",children:[e.jsxs("div",{className:"imp-price__field",children:[e.jsx(L,{className:"ccy-mark imp-price__diamond"}),e.jsx("input",{className:"imp-price__input",inputMode:"numeric",value:I.toLocaleString(),onChange:M=>p(i.oldTradeId,M.target.value),"aria-label":s("importListings.priceAria",{currency:S.name,name:i.name})})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(I*.1).toFixed(2)]}),A?e.jsxs("button",{className:"imp-price__reset",onClick:()=>v(M=>({...M,[i.oldTradeId]:i.suggestedCredits})),children:[s("importListings.resetTo")," ",e.jsx(L,{className:"ccy-mark"}),i.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx("div",{className:"imp-action",children:e.jsx("button",{className:"btn btn--sm imp-row__list",disabled:!y(i.oldTradeId),onClick:()=>b(o([i])),children:s("importListings.list")})})]},i.oldTradeId)})})]},a.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(L,{className:"ccy-mark imp__diamond"})," ",r.toLocaleString()]}),e.jsx("div",{className:"imp-dock__sub",children:s("importListings.selectedSummary",{count:c.length,usd:(r*.1).toFixed(2)})})]}),e.jsx("span",{className:"imp-dock__spacer"}),e.jsx("button",{className:"btn btn--purple imp-dock__cta",disabled:c.length===0,onClick:()=>b(o(c)),children:s("importListings.listAll",{count:c.length})})]})}),_&&n?e.jsx(G,{queue:_,session:n,onClose:()=>b(null),onDone:k}):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:s("importListings.signInTitle")}),e.jsx("p",{className:"muted",children:s("importListings.signInBody")}),e.jsx("button",{className:"btn btn--purple",onClick:()=>C(),children:s("storeSettings.signIn")})]})}export{ne as ImportListings};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BB7DOq9K.js","assets/react-yytiy0wi.js","assets/dcl-schemas-BICTSpB5.js","assets/index-C7swV0s7.js","assets/sentry-BPJvc5GU.js","assets/ethers-w2AslR0v.js","assets/intl-CBcMB1D2.js","assets/index-DgcUoaxa.css","assets/emotion-styled.browser.esm-De8LzLi0.js","assets/useTheme-3xICgEAy.js","assets/CircularProgress-DndPkIP8.js","assets/index-BmjbHn2J.js","assets/useTheme-B8h6R_Xd.js","assets/CssVarsProvider-B8lKeq36.js","assets/getOverlayAlpha-DC6Z8-Ah.js","assets/index-CPHHOZWE.js","assets/colors-LINLm1ux.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as se,r as m,j as e,d as Se,b as Pe,L as Ee}from"./react-yytiy0wi.js";import{d as te,n as Fe,u as Le,t as s,ah as De,k as Te,l as Be,v as Re,o as J,b as z,w as me,x as ee,ai as $e,z as ue,C as M,ad as Z,_ as ae,F as We,I as Ve,H as Oe,ar as qe,W as ze,j as fe,as as Ke,at as Ue,ae as _e,c as he,g as q,au as Ge,av as He,aw as Qe,ax as Ye,ay as Je,ak as Ze,a as Xe,az as ea,aA as aa,aB as sa,af as ta,aC as be,aD as ia,an as ra,aE as la,aF as da,ao as na,aG as ca}from"./index-C7swV0s7.js";import{d as $}from"./dcl-schemas-BICTSpB5.js";import{b as pe}from"./buy-C3XM-F5L.js";import{g as oa,b as ma,w as ua,S as _a,G as ha}from"./buy-gasless-CgW1uOlT.js";import{C as ba,c as pa}from"./payments-BojP1AK1.js";import{R as ye}from"./resume-buy-Bf0zIH7y.js";import{C as ya}from"./CircularProgress-DndPkIP8.js";import{u as xa,M as ja}from"./MarketCheckout-BSyyg6RV.js";import{s as va}from"./address-DrURAr9O.js";import{C as fa}from"./CollectionCarousel-DttKFbs9.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BkDaYyvb.js";import"./index-HN6Rk25C.js";import"./mana-rate-B7ShUGMF.js";function xe(i){const l=i,t=(l.message??"").toLowerCase();return l.code===4001||t.includes("reject")||t.includes("denied")||t.includes("cancel")?s("getCredits.errorCanceled"):t.includes("not for sale")||t.includes("not found")||t.includes("404")?s("buyModal.error.soldOrRemoved"):t.includes("your own listing")?s("buyModal.error.cantBuyOwn"):s("buyModal.error.generic")}function Na(i){const l=i;return l.code===402||l.status===402||(l.message??"").toLowerCase().includes("insufficient")}const R=ba.slice(0,3);function ga({item:i,onClose:l,resume:t=!1}){var I,H;const{session:n}=te(),{data:c}=Fe(n),b=Le(),x=se(),[_,d]=m.useState("loading"),[j,a]=m.useState(null),[v,P]=m.useState(""),[f,L]=m.useState(i.priceCredits),[C,g]=m.useState(null),N=m.useRef(null),W=(C==null?void 0:C.credits)??f,k=(c==null?void 0:c.credits)??0;m.useEffect(()=>{let o=!1;if(!n){d("error"),a(s("buyModal.signInToCheckout"));return}const y=u=>{const h=u-((c==null?void 0:c.credits)??0),p=R.find(A=>A.credits>=h)??R[R.length-1];P(p.id),z("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:u,credits_balance:(c==null?void 0:c.credits)??0,shortfall:Math.max(0,h)}),d("nofunds")};return(async()=>{var u,h;try{const p=await De(i);if(!p)throw new Error("not for sale");if(Te(p,n.address))throw new Error("You can't buy your own listing.");const A=Be((h=(u=p.received)==null?void 0:u[0])==null?void 0:h.amount);if(!Number.isFinite(A)||A<=0)throw new Error("price unavailable");const T=Math.ceil(A/10);if(o)return;if(L(T),c!=null&&c.credits<T){y(T);return}try{const{credit:E,maxCreditedValue:V,usdCents:B}=await Re(n.identity,A,p.id);if(o){J(n.identity,[E.id]).catch(()=>{});return}N.current=E.id;const w=Math.ceil(B/10);L(w);const O={trade:p,credit:E,maxCreditedValue:V,usdCents:B,credits:w};g(O),t?K(O):d("ready")}catch(E){if(o)return;if(Na(E)){y(T);return}throw E}}catch(p){if(o)return;z(ee(p)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:me(p)}),d("error"),a(xe(p))}})(),()=>{o=!0,N.current&&n&&(J(n.identity,[N.current]).catch(()=>{}),N.current=null)}},[]);async function K(o=C){if(!n||!o)return;d("processing"),a(null);let y=!1;try{const u={trade:o.trade,buyer:n.address,signer:n.signer,credits:[o.credit],maxCreditedValue:o.maxCreditedValue};let h;if(oa())try{h=await ma(u),await ua(h),y=!0}catch(p){if(p instanceof _a)y=!0;else if(p instanceof ha)h=await pe(u);else throw p}else h=await pe(u);N.current=null,z("Shop Completed Purchase",{...$e([i]),payment_type:"credits",no_crypto_step:y,transaction_hash:h??null}),b.invalidateQueries({queryKey:["usd-balance"]}),d("complete")}catch(u){ee(u)||ue(u,{flow:"buy",step:"submit",gasless:y}),J(n.identity,[o.credit.id]).catch(()=>{}),N.current=null,z(ee(u)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:me(u)}),b.invalidateQueries({queryKey:["usd-balance"]}),a(xe(u)),d("error")}}async function U(){if(!(!v||!n)){try{sessionStorage.setItem(ye,JSON.stringify(i))}catch{}C&&J(n.identity,[C.credit.id]).catch(()=>{}),N.current=null,d("loading");try{const o=await pa(v,{address:n.address,identity:n.identity});if(o.url){window.location.href=o.url;return}x("/credits")}catch(o){ue(o,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(ye)}catch{}a(s("buyModal.error.creditsCheckout")),d("error")}}}const G=_==="processing",D=_==="complete"?s("buyModal.titleComplete"):_==="nofunds"?s("buyModal.titleNoFunds"):s("buyModal.titleBuy");return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":s("buyModal.dialogAria",{name:i.name}),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:G?void 0:l,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${_==="processing"||_==="loading"?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:D}),!G&&e.jsx("button",{className:"buy-modal__x",onClick:l,"aria-label":s("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:_==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(M,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:Z(k)})]})]}),_==="loading"&&e.jsx("div",{className:"buy-modal__body buy-modal__processing",children:e.jsx(ya,{size:44})}),_==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx("p",{className:"buy-modal__error",children:j}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:l,children:s("buyModal.close")})})]}),_==="nofunds"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,W-k)})})," ",s("buyModal.warningToPurchase",{count:1})]})]}),e.jsx(je,{item:i,priceCredits:W}),e.jsx("div",{className:"buy-modal__packs",children:R.map(o=>{const y=o.credits,u=o.id===v;return e.jsxs("button",{className:`buy-modal__pack${u?" buy-modal__pack--on":""}`,onClick:()=>P(o.id),children:[e.jsx(M,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:Z(y)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",o.usd.toFixed(2),")"]})]},o.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(M,{className:"buy-modal__total-ico"}),e.jsx("span",{children:Z(((I=R.find(o=>o.id===v))==null?void 0:I.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",(((H=R.find(o=>o.id===v))==null?void 0:H.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:l,children:s("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:U,children:s("buyModal.buy")})]})]}),_==="ready"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(je,{item:i,priceCredits:W}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient buy-modal__btn--full",onClick:()=>K(),children:s("buyModal.buy")})})]}),_==="processing"&&e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:"/icon-192.png",alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:t?s("buyModal.completingPurchase"):s("buyModal.completingTransaction")}),e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]}),_==="complete"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"64",height:"64","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce74"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:s("getCredits.successTitle")})," ",s("buyModal.successBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:()=>x("/assets?tab=mine"),children:s("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:l,children:[s("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]})]})}function je({item:i,priceCredits:l}){return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:i.thumbnail?e.jsx("img",{src:i.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsx("div",{className:"buy-modal__asset-name",title:i.name,children:i.name||s("buyModal.itemFallback")}),i.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:s("search.byCreator",{name:i.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(M,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:Z(l)})]})]})]})}const wa=m.lazy(async()=>{const[{EmoteControls:i},{Experimental_CssVarsProvider:l},{light:t}]=await Promise.all([ae(()=>import("./index-BB7DOq9K.js").then(n=>n.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),ae(()=>import("./index-BmjbHn2J.js"),__vite__mapDeps([11,3,1,2,4,5,6,7,12,9,13,14])),ae(()=>import("./index-CPHHOZWE.js"),__vite__mapDeps([15,3,1,2,4,5,6,7,16,14,13,9]))]);return{default:n=>e.jsx(l,{theme:t,children:e.jsx(i,{...n})})}});function Ca(i){return e.jsx(m.Suspense,{fallback:null,children:e.jsx(wa,{...i})})}function ka({item:i}){const l=te(g=>{var N;return(N=g.session)==null?void 0:N.address}),{data:t,isLoading:n}=We(l),c=l&&t?l:"default",b=i.category==="emote",[x,_]=m.useState("item"),d=!b&&x==="item",j=d||!n,[a,v]=m.useState(!0);m.useEffect(()=>{v(!0)},[i.id,d]);const P=!!l&&!!t,f=P&&Ve(i,Oe(t)),L=qe(i)[0],C=P&&!f&&!b;return e.jsxs(e.Fragment,{children:[j?e.jsx(ze,{id:"shop-item-preview",contractAddress:i.contractAddress,tokenId:i.tokenId??void 0,itemId:i.tokenId?void 0:i.itemId??void 0,profile:d?void 0:f?c:"default",bodyShape:d||f?void 0:L,type:b?void 0:d?$.PreviewType.WEARABLE:$.PreviewType.AVATAR,emote:b||d?void 0:$.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:b?1.5:void 0,wheelStart:b?100:void 0,dev:fe.chainId===80002,onLoad:()=>v(!1)}):null,!j||a?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":s("itemPreview.loading"),children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,C&&!d?e.jsx("p",{className:"item-preview__note",children:s("itemPreview.shownOnBody",{shape:Ke(L)})}):null,b?e.jsx("div",{className:"item-preview__emote-controls",children:e.jsx(Ca,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":s("itemPreview.previewMode"),children:[e.jsxs("button",{type:"button",className:x==="avatar"?"is-active":"","aria-pressed":x==="avatar","aria-label":s("itemPreview.onAvatar"),onClick:()=>_("avatar"),children:[e.jsxs("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[e.jsx("circle",{cx:"12",cy:"7.5",r:"4"}),e.jsx("path",{d:"M4 20c0-4.2 3.6-6.5 8-6.5s8 2.3 8 6.5v.5H4z"})]}),e.jsx("span",{className:"item-preview__toggle-label",children:s("itemPreview.onAvatar")})]}),e.jsxs("button",{type:"button",className:x==="item"?"is-active":"","aria-pressed":x==="item","aria-label":s("itemPreview.item"),onClick:()=>_("item"),children:[e.jsx("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M8.5 3 3 6l1.8 3.8 2.2-1V21h10V8.8l2.2 1L22 6l-5.5-3a2.6 2.6 0 0 1-4.5 1.4A2.6 2.6 0 0 1 8.5 3z"})}),e.jsx("span",{className:"item-preview__toggle-label",children:s("itemPreview.item")})]})]})]})}function Ia({contractAddress:i,name:l,items:t,className:n}){const c=se();if(!i||!l)return null;const b=(t??[]).map(d=>d.thumbnail).filter(d=>!!d).slice(0,4),x=b.slice(0,2),_=b.slice(2,4);return e.jsxs("button",{className:`creator creator--link${n?` ${n}`:""}`,onClick:d=>{d.stopPropagation(),c(`/collection/${i}`)},children:[b.length>0?e.jsxs("span",{className:"creator__ava collection-collage","aria-hidden":!0,children:[e.jsx("span",{className:`collection-collage__row${_.length===0?" collection-collage__row--full":""}`,children:x.map((d,j)=>e.jsx("img",{src:d,alt:""},j))}),_.length>0?e.jsx("span",{className:"collection-collage__row",children:_.map((d,j)=>e.jsx("img",{src:d,alt:""},j))}):null]}):null,e.jsx("span",{className:"creator__name",children:Ue(l)})]})}function Aa(i){return Object.values($.Rarity).includes(i)}function Ma(i){return i==="male"?s("itemDetail.genderMale"):i==="female"?s("itemDetail.genderFemale"):i==="unisex"?s("itemDetail.genderUnisex"):null}function ve(i){return i.wearableCategory?i.wearableCategory.replace(/_/g," "):i.category==="emote"?s("itemDetail.categoryEmote"):s("itemDetail.categoryWearable")}function Ha(){const{contractAddress:i,tokenId:l}=Se(),{state:t}=Pe(),n=se(),c=!!(t!=null&&t.market),b=(t==null?void 0:t.marketPriceCredits)??null,x=_e(r=>r.add),_=_e(r=>r.items),d=he(r=>r.toggle),{session:j}=te(),[a,v]=m.useState(()=>t!=null&&t.item?{...t.item,tradeId:t.tradeId??t.item.tradeId}:{id:`${i}-${l}`,name:"",creator:"",contractAddress:i??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:fe.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:l??void 0,tradeId:t==null?void 0:t.tradeId}),[P,f]=m.useState(!1),[L,C]=m.useState(!!(t!=null&&t.resumeBuy));m.useEffect(()=>{t!=null&&t.resumeBuy&&f(!0)},[t==null?void 0:t.resumeBuy]);const{data:g=[],isFetched:N}=q({queryKey:["collection-items",a.contractAddress],enabled:!!a.contractAddress,queryFn:()=>ra(a.contractAddress,{first:20}).then(r=>r.items)}),W=a.available==null&&!a.tokenId,{data:k,isLoading:K}=q({queryKey:["shop-item",a.contractAddress,l],enabled:!c&&!!a.contractAddress&&!!l&&(!(t!=null&&t.item)||W),queryFn:()=>la(a.contractAddress,l)});m.useEffect(()=>{k&&v(r=>r.tradeId?r.available!=null&&r.wearableCategory?r:{...r,available:r.available??k.available,wearableCategory:r.wearableCategory??k.wearableCategory}:{...k})},[k]);const[U,G]=m.useState(!1),{data:D=""}=q({queryKey:["item-desc",a.contractAddress,a.itemId],enabled:!!a.contractAddress&&!!a.itemId,staleTime:5*6e4,queryFn:()=>da(a.contractAddress,a.itemId)}),{data:I}=q({queryKey:["collection-meta",a.contractAddress],enabled:!!a.contractAddress,staleTime:5*6e4,queryFn:()=>na(a.contractAddress)});m.useEffect(()=>{if(a.name||k||g.length===0)return;const r=l&&g.find(S=>S.tokenId===l||S.itemId===l)||g.find(S=>S.contractAddress===a.contractAddress);r&&v(S=>({...r,tradeId:S.tradeId??r.tradeId}))},[g,k]);const H=m.useMemo(()=>{const r=new Set,S=[];for(const F of g){if(F.id===a.id||a.itemId&&F.itemId===a.itemId||a.tokenId&&F.tokenId===a.tokenId)continue;const oe=`${F.contractAddress}-${F.itemId??F.tokenId??F.id}`;r.has(oe)||(r.add(oe),S.push(F))}return S},[g,a.id,a.itemId,a.tokenId]),{data:o,isLoading:y}=q({queryKey:["detail-trade",a.id,a.tradeId,a.contractAddress,a.itemId],enabled:!!a.contractAddress,queryFn:async()=>{if(a.tradeId)return a.tradeId;if(a.itemId){const r=await ca(a.contractAddress,a.itemId);return(r==null?void 0:r.id)??null}return null}}),u=a.tradeId??o??void 0,h=!!u,{data:p}=xa(c),A=m.useMemo(()=>{if(!c||!(t!=null&&t.item))return null;const r=t.item;return r.manaWei?{tradeId:r.tradeId??r.id,listingType:"primary",contractAddress:r.contractAddress,itemId:r.itemId??"",name:r.name,thumbnail:r.thumbnail,rarity:r.rarity,category:r.category,wearableCategory:r.wearableCategory??null,creator:r.creator,manaWei:r.manaWei,available:1,network:r.network,chainId:r.chainId,createdAt:0}:null},[c,t==null?void 0:t.item]),T=c&&b!=null&&!!p&&!!A,E=Ge({priceCredits:a.priceCredits,compareAtCredits:a.compareAtCredits,saleEndsAt:a.saleEndsAt}),V=m.useMemo(()=>({...a,tradeId:u,id:u??a.id}),[a,u]),B=_.some(r=>r.id===V.id),w=he(r=>!!r.items[a.id]),O=m.useRef(null);m.useEffect(()=>{!a.name||y||O.current===a.id||(O.current=a.id,z("Shop Viewed Item",{...He(a),for_sale:h}),Qe(a))},[a.id,a.name,y,h]);const Q=`${i}/${l}`,ie=m.useRef(Q);m.useEffect(()=>{ie.current!==Q&&(ie.current=Q,t!=null&&t.item&&v({...t.item,tradeId:t.tradeId??t.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[Q]);function Ne(){!h||B||Y||x(V,"item_detail")}const X=Aa(a.rarity)?a.rarity:$.Rarity.COMMON,re=Ma(a.gender),le=Ye(a),de=Je(a.gender),ge=h&&E,we=s("itemDetail.moreFromCollection"),Y=Ze(a,j==null?void 0:j.address),ne=h?B?s("assetCard.inCart"):y?s("itemDetail.checking"):s("assetCard.addToCart"):s("itemDetail.notForSale"),Ce=typeof a.available=="number"&&a.available>0&&!a.tokenId&&!c,ke=!Y&&h&&!c,Ie=c||!Y,Ae=K||!!a.contractAddress&&!N,ce=!a.name&&!Ae,Me=/^https?:\/\//i.test(a.thumbnail);return Xe(ce?{title:s("seo.item.notFoundTitle"),noindex:!0}:a.name?{title:a.name,description:D||s("seo.item.fallbackDescription",{name:a.name,rarity:a.rarity,category:ve(a),creator:va(a.creator)}),image:Me?a.thumbnail:void 0,type:"product"}:{}),ce?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:s("itemDetail.notAvailableTitle")}),e.jsx("p",{className:"muted",children:s("itemDetail.notAvailableBody")}),e.jsx("button",{className:"btn btn--purple",onClick:()=>n("/assets"),children:s("notFound.cta")})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":s("itemDetail.breadcrumbAria"),children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>n("/assets"),children:s("nav.collectibles")}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:a.name||s("itemDetail.itemFallback")})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsxs("div",{className:"item-detail__preview",children:[a.name?e.jsx(ka,{item:a}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":s("itemPreview.loading"),children:e.jsx("span",{className:"skeleton item-preview__skeleton","aria-hidden":!0})}),e.jsx("button",{className:`item-detail__fav item-detail__fav--preview${w?" is-on":""}`,onClick:()=>d(a),"aria-pressed":w,"aria-label":w?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx("span",{className:`ico ${w?"ico-heart-solid":"ico-heart"}`,"aria-hidden":!0})})]}),e.jsx("div",{className:"item-detail__info",children:a.name?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:a.name}),e.jsx("button",{className:`item-detail__fav${w?" is-on":""}`,onClick:()=>d(a),"aria-pressed":w,"aria-label":w?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx("span",{className:`ico ${w?"ico-heart-solid":"ico-heart"}`,"aria-hidden":!0})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:sa(X),color:aa(X)},title:ea(a.rarity),children:a.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[le?e.jsx("span",{className:`ico ico-${le} item-detail__chip-ico`,"aria-hidden":!0}):null,ve(a)]}),re?e.jsxs("span",{className:"chip item-detail__chip",children:[de?e.jsx("span",{className:`ico ico-${de} item-detail__chip-ico`,"aria-hidden":!0}):null,re]}):null]}),D?e.jsxs("div",{className:"item-detail__section item-detail__description",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.description")}),e.jsx("p",{className:`item-detail__desc-text${U?" is-expanded":""}`,children:D}),D.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>G(r=>!r),children:U?s("itemDetail.showLess"):s("itemDetail.readMore")}):null]}):null,a.creator||I!=null&&I.name?e.jsxs("div",{className:"item-detail__meta",children:[a.creator?e.jsxs("div",{className:"item-detail__meta-col",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.creator")}),e.jsx(ta,{address:a.creator,className:"item-detail__creator",linkToProfile:!0,hidePrefix:!0})]}):null,I!=null&&I.name?e.jsxs("div",{className:"item-detail__meta-col item-detail__meta-col--collection",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.collection")}),e.jsx(Ia,{contractAddress:a.contractAddress,name:I.name,items:g,className:"item-detail__creator"})]}):null]}):null,e.jsx("hr",{className:"item-detail__divider"}),e.jsx("div",{className:"item-detail__price-block",children:e.jsxs("div",{className:"item-detail__price-row",children:[e.jsxs("div",{className:"item-detail__price-col",children:[e.jsx("div",{className:"item-detail__price-label",children:s("itemDetail.price")}),c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"item-detail__price item-detail__price--market",children:b==null?e.jsx("span",{className:"item-detail__price-value",children:"—"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"item-detail__approx","aria-hidden":!0,children:"≈"}),e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:b})]})}),e.jsx("div",{className:"item-detail__market-note muted",children:s("assetCard.marketPrice")})]}):h?ge?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(M,{className:"item-detail__diamond item-detail__diamond--was"}),a.compareAtCredits]}),be(a.compareAtCredits,a.priceCredits)>0?e.jsx("span",{className:"item-detail__sale-badge",children:s("assetCard.saleWithDiscount",{pct:be(a.compareAtCredits,a.priceCredits)})}):null,e.jsx(ia,{endsAt:a.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:s("itemDetail.notForSale")})]}),Ce?e.jsxs("div",{className:"item-detail__stock-col",children:[e.jsx("div",{className:"item-detail__price-label",children:s("itemDetail.stock")}),e.jsxs("div",{className:"item-detail__stock-value",children:[(a.available??0).toLocaleString(),"/",$.Rarity.getMaxSupply(X).toLocaleString()]})]}):null]})}),e.jsx("div",{className:`item-detail__ctas${Ie?" item-detail__ctas--buttons":""}${ke?" item-detail__ctas--dual":""}`,children:c?e.jsxs("button",{className:"btn btn--purple item-detail__cta",onClick:()=>f(!0),disabled:!T,children:[e.jsx("span",{className:"item-detail__cta-label",children:s("assetCard.buyNow")}),b!=null?e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(M,{className:"item-detail__cta-diamond"}),b]}):null]}):Y?e.jsxs("p",{className:"item-detail__own-note muted",children:[s("itemDetail.ownItemPrefix")," ",e.jsx(Ee,{to:"/my-assets",children:s("nav.myAssets")}),s("itemDetail.ownItemSuffix")]}):e.jsxs(e.Fragment,{children:[h?e.jsxs("button",{className:"btn btn--purple item-detail__cta",onClick:()=>f(!0),disabled:y,children:[e.jsx("span",{className:"item-detail__cta-label",children:s("assetCard.buyNow")}),e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(M,{className:"item-detail__cta-diamond"}),a.priceCredits]})]}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:Ne,disabled:!h||B||y,"aria-label":ne,children:[e.jsx("span",{className:"ico ico-cart-solid item-detail__addcart-ico","aria-hidden":!0}),e.jsx("span",{className:"item-detail__addcart-label",children:ne})]})]})})]}):e.jsx(Sa,{})})]}),e.jsx(fa,{title:we,items:H,onViewAll:a.contractAddress?()=>n(`/collection/${a.contractAddress}`):void 0}),P&&c&&A&&p?e.jsx(ja,{listing:A,rate:p,onClose:()=>f(!1),onSold:()=>f(!1)}):P&&!c?e.jsx(ga,{item:V,resume:L,onClose:()=>{f(!1),C(!1)}}):null]})}function Sa(){return e.jsxs("div",{className:"item-detail__info-skel","aria-hidden":!0,children:[e.jsx("span",{className:"skeleton id-skel__title"}),e.jsxs("div",{className:"id-skel__chips",children:[e.jsx("span",{className:"skeleton id-skel__chip"}),e.jsx("span",{className:"skeleton id-skel__chip"})]}),e.jsx("span",{className:"skeleton id-skel__line"}),e.jsx("span",{className:"skeleton id-skel__line id-skel__line--short"}),e.jsx("hr",{className:"item-detail__divider"}),e.jsx("span",{className:"skeleton id-skel__price"}),e.jsx("span",{className:"skeleton id-skel__btn"})]})}export{Ha as ItemDetail,Ha as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.item-detail{max-width:1721px;margin:0 auto}.item-detail__crumbs{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);margin-bottom:24px}.item-detail__crumb-link{background:none;border:0;padding:0;font:inherit;color:var(--muted)}.item-detail__crumb-link:hover{color:var(--text)}.item-detail__crumb-sep{color:var(--muted-2)}.item-detail__crumb-current{color:var(--text);font-weight:600}.item-detail__main{display:grid;grid-template-columns:minmax(0,1045fr) minmax(0,514fr);gap:48px;align-items:start;max-width:1607px;margin:0 auto}@media(max-width:900px){.item-detail__main{grid-template-columns:1fr;gap:24px;max-width:none}}.item-detail__preview{position:relative;aspect-ratio:1045 / 752;border-radius:16px;overflow:hidden;background:var(--media)}@media(max-width:900px){.item-detail__preview{aspect-ratio:1 / 1}}.item-detail__preview iframe,.item-detail__preview>*{width:100%;height:100%;border:0;display:block}.item-detail__preview>.item-preview__toggle{position:absolute;top:16px;left:16px;z-index:2;width:auto;height:auto;display:inline-flex;gap:2px;padding:3px;background:#ffffffeb;border:1px solid var(--line);border-radius:999px;box-shadow:0 1px 4px #0000001f}.item-preview__toggle button{border:0;background:none;cursor:pointer;padding:6px 16px;border-radius:999px;font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);transition:background .12s ease,color .12s ease}.item-preview__toggle button.is-active{background:var(--text);color:#fff}.item-preview__toggle button:not(.is-active):hover{color:var(--text)}.item-preview__toggle-ico{display:none;width:18px;height:18px}.item-detail__preview>.item-preview__emote-controls{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:2;width:min(360px,88%);height:auto;display:flex;align-items:center;background:#fffffff0;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);border:1px solid var(--line);border-radius:var(--radius-pill);padding:6px 12px;box-shadow:0 2px 10px #1615181f}.item-preview__emote-controls .MuiBox-root{position:static;width:100%;margin:0;padding:0;display:flex;align-items:center;gap:10px}.item-preview__emote-controls .MuiButtonBase-root{min-width:0;padding:0;margin:0;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:none!important;box-shadow:none!important;color:var(--muted);flex:0 0 auto;transition:background .12s ease,color .12s ease}.item-preview__emote-controls .MuiButtonBase-root .MuiSvgIcon-root{font-size:20px;margin:0}.item-preview__emote-controls .MuiBox-root>.MuiButtonBase-root:first-child{width:34px;height:34px;background:var(--accent)!important;color:#fff}.item-preview__emote-controls .MuiBox-root>.MuiButtonBase-root:first-child:hover{background:var(--text)!important}.item-preview__emote-controls .MuiBox-root>input+.MuiButtonBase-root{width:30px;height:30px;color:var(--muted)}.item-preview__emote-controls .MuiBox-root>input+.MuiButtonBase-root:hover{background:var(--media)!important;color:var(--text)}.item-preview__emote-controls input[type=range]{flex:1 1 auto;width:auto;min-width:0;height:4px;margin:0;padding:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;cursor:pointer}.item-preview__emote-controls input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:999px;background:var(--line-strong)}.item-preview__emote-controls input[type=range]::-moz-range-track{height:4px;border-radius:999px;background:var(--line-strong)}.item-preview__emote-controls input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:13px;height:13px;margin-top:-4.5px;border-radius:50%;background:var(--accent);border:2px solid #fff;box-shadow:0 1px 3px #1615184d;cursor:pointer}.item-preview__emote-controls input[type=range]::-moz-range-thumb{width:13px;height:13px;border-radius:50%;background:var(--accent);border:2px solid #fff;box-shadow:0 1px 3px #1615184d;cursor:pointer}.item-preview__emote-controls input[type=range]:focus-visible{outline:none}.item-preview__emote-controls input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--accent);outline-offset:2px}.item-detail__preview>.item-preview__note{position:absolute;bottom:14px;left:50%;transform:translate(-50%);z-index:2;width:auto;height:auto;max-width:88%;margin:0;text-align:center;background:#161518c7;color:#fff;font-size:12px;font-weight:500;padding:6px 12px;border-radius:999px}.item-detail__preview>.item-preview__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:transparent}.item-preview__spinner{width:34px;height:34px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:item-preview-spin .8s linear infinite}@keyframes item-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.item-preview__spinner{animation-duration:2.4s}}.item-detail__preview>.item-preview__loading .item-preview__skeleton{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border-radius:inherit}.item-detail__info-skel{display:flex;flex-direction:column;gap:16px}.id-skel__title{height:34px;width:70%;border-radius:8px}.id-skel__chips{display:flex;gap:8px}.id-skel__chip{height:24px;width:88px;border-radius:6px}.id-skel__line{height:14px;width:100%;border-radius:6px}.id-skel__line--short{width:55%}.id-skel__price{height:30px;width:40%;border-radius:8px}.id-skel__btn{height:48px;width:100%;border-radius:8px;margin-top:8px}.item-detail__info{display:flex;flex-direction:column;gap:0}.item-detail__info-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.item-detail__title{font-size:28px;font-weight:600;line-height:34px;color:var(--text-2)}.item-detail__fav{flex:none;width:40px;height:40px;border-radius:50%;border:0;background:var(--media);display:grid;place-items:center;color:var(--text-2);cursor:pointer;transition:color .12s ease,background .12s ease}.item-detail__fav:hover{background:var(--line)}.item-detail__fav.is-on{color:var(--dcl-red)}.item-detail__fav .ico-heart{width:18px;height:18px}.item-detail__preview>.item-detail__fav--preview{display:none}.item-detail__label{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:500;text-transform:uppercase;letter-spacing:0;color:var(--muted)}.item-detail__chips{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}.item-detail__chips .chip{height:24px;padding:0 8px;gap:3px;font-size:13px;font-weight:500;border-radius:4px;letter-spacing:.02em;text-transform:uppercase}.item-detail__chip{background:var(--chip);color:var(--text-2)}.item-detail__chip-ico{width:18px;height:18px;color:var(--text-2)}.item-detail__section{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.item-detail__description{margin-top:15px;gap:11px}.item-detail__desc-text{margin:0;color:var(--text-2);font-size:14px;line-height:30px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}.item-detail__desc-text.is-expanded{-webkit-line-clamp:unset;overflow:visible}.item-detail__desc-toggle{font-size:13px;align-self:flex-start}.item-detail__meta{display:flex;justify-content:space-between;gap:16px;margin-top:32px}.item-detail__meta-col{display:flex;flex-direction:column;gap:15px;min-width:0}.item-detail__meta-col--collection{align-items:flex-start}.item-detail__creator.creator{color:var(--accent);font-size:14px;gap:12px}.item-detail__creator .creator__ava{width:48px;height:48px}.item-detail__creator .creator__ava--letter{font-size:18px}.item-detail__creator .creator__name{color:var(--accent);font-weight:500;text-decoration:underline}.item-detail__creator.creator--link:hover .creator__name{color:var(--brand-violet)}.collection-collage{display:flex;flex-direction:column;overflow:hidden;gap:1px;background:var(--line-strong)}.collection-collage__row{display:flex;flex:1 1 50%;min-height:0;gap:1px}.collection-collage__row--full{flex-basis:100%}.collection-collage__row img{flex:1 1 0;min-width:0;width:100%;height:100%;object-fit:cover;display:block}.item-detail__divider{border:0;border-top:1px solid #cfcdd4;margin:24px 0 0;width:100%}.item-detail__price-block{margin-top:16px}.item-detail__price-row{display:flex;align-items:flex-start;gap:16px;width:100%}.item-detail__price-col{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:8px}.item-detail__stock-col{flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-end;gap:8px;text-align:right}.item-detail__stock-value{font-size:18px;font-weight:500;line-height:1;color:var(--text-2)}.item-detail__price-label{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:0;color:#5e5b67}.item-detail__price{display:flex;align-items:center;gap:10px;font-weight:700;color:var(--text)}.item-detail__diamond{width:30px;height:30px;color:var(--brand-violet)}.item-detail__price-value{font-size:30px;line-height:1}.item-detail__price--none{font-size:18px;color:var(--muted)}.item-detail__approx{font-size:24px;font-weight:700;color:var(--text);margin-right:-2px}.item-detail__market-note{font-size:13px;margin-top:6px}.item-detail__price--sale{flex-wrap:wrap;gap:10px 14px}.item-detail__price--sale .item-detail__price,.item-detail__price--sale .item-detail__price-value,.item-detail__price--sale .item-detail__diamond{color:var(--dcl-red)}.item-detail__price-was{display:inline-flex;align-items:center;gap:6px;color:var(--muted);text-decoration:line-through;font-weight:600;font-size:20px}.item-detail__diamond--was{width:18px;height:18px;color:var(--muted)}.item-detail__sale-badge{display:inline-flex;align-items:center;background:var(--dcl-red);color:#fff;font-weight:800;font-size:13px;letter-spacing:.03em;text-transform:uppercase;border-radius:6px;padding:4px 10px}.item-detail__countdown{display:inline-flex;align-items:center;gap:5px;background:var(--rarity-bg);color:var(--accent);font-size:13px;font-weight:700;border-radius:6px;padding:4px 10px;white-space:nowrap}.item-detail__countdown .sale-countdown__ico{width:14px;height:14px}.item-detail__ctas{display:flex;flex-direction:column;gap:12px;margin-top:20px}.item-detail__cta{width:100%;height:48px;border-radius:8px;font-size:15px;font-weight:600;letter-spacing:.46px;display:flex;align-items:center;justify-content:center;gap:8px}.item-detail__cta-price{display:none;align-items:center;gap:6px}.item-detail__cta-diamond{width:20px;height:20px;color:#fff}.item-detail__addcart{width:100%;height:48px;display:flex;align-items:center;justify-content:center;gap:8px;background:var(--black-btn);color:var(--soft-white);border:0;border-radius:8px;font-weight:600;font-size:15px;text-transform:uppercase;letter-spacing:.46px;cursor:pointer;transition:filter .15s ease}.item-detail__addcart:hover:not(:disabled){filter:brightness(1.35)}.item-detail__addcart:disabled{opacity:.55;cursor:default}.item-detail__addcart-ico{width:20px;height:20px}.item-detail__status{margin:0;font-size:13px}.item-detail__own-note{margin:0;font-size:14px}.item-detail__own-note a{color:var(--accent);font-weight:600}@media(max-width:900px){.item-detail__title{font-size:20px;line-height:24px}.item-detail__info-head{order:0}.item-detail__chips{order:1;margin-top:10px}.item-detail__meta{order:2;margin-top:20px}.item-detail__description{order:3;margin-top:20px}.item-detail__divider{order:4;margin-top:20px}.item-detail__price-block{order:5;margin-top:16px}.item-detail__ctas{order:6}.item-detail__status{order:7}.item-detail{padding-bottom:88px}.item-detail__ctas--buttons{position:fixed;left:0;right:0;bottom:0;z-index:40;margin-top:0;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:var(--soft-white);box-shadow:0 -4px 16px #1615181f}.item-detail__ctas--dual{flex-direction:row;align-items:stretch;gap:12px}.item-detail__ctas--dual .item-detail__cta{flex:1 1 auto;width:auto}.item-detail__ctas--dual .item-detail__cta-price{display:inline-flex}.item-detail__ctas--dual .item-detail__addcart{flex:0 0 auto;width:56px;padding:0}.item-detail__ctas--dual .item-detail__addcart-label{display:none}.item-detail__ctas--dual .item-detail__addcart-ico{margin:0}.item-detail__info-head .item-detail__fav{display:none}.item-detail__preview>.item-detail__fav--preview{display:grid;position:absolute;top:12px;right:12px;z-index:3;width:40px;height:40px;background:#ffffffeb;box-shadow:0 1px 4px #1615182e}.item-detail__preview>.item-detail__fav--preview:hover{background:#fff}.item-detail__preview>.item-preview__toggle{top:auto;left:auto;bottom:12px;right:12px;gap:0;padding:0;background:transparent;border:0;box-shadow:0 1px 4px #1615182e;overflow:hidden}.item-preview__toggle-label{display:none}.item-preview__toggle-ico{display:block}.item-preview__toggle button{padding:9px 13px;border-radius:0;background:#fff;color:var(--text-2)}.item-preview__toggle button.is-active{background:var(--text);color:#fff}.item-preview__toggle button:first-child{border-top-left-radius:999px;border-bottom-left-radius:999px}.item-preview__toggle button:last-child{border-top-right-radius:999px;border-bottom-right-radius:999px}}.item-detail--notfound{min-height:46vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:14px}.item-detail__notfound-ico{width:44px;height:44px;opacity:.4}.item-detail__notfound-title{font-size:22px}.item-detail--notfound .btn{margin-top:6px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as c,j as i}from"./react-yytiy0wi.js";import{t as u}from"./index-C7swV0s7.js";function m({hasNextPage:e,isFetching:r,onLoadMore:o}){const t=c.useRef(null);return c.useEffect(()=>{const n=t.current;if(!n||!e)return;const s=new IntersectionObserver(a=>{var l;(l=a[0])!=null&&l.isIntersecting&&!r&&o()},{rootMargin:"600px 0px"});return s.observe(n),()=>s.disconnect()},[e,r,o]),e?i.jsx("div",{className:"load-more",ref:t,children:i.jsx("button",{className:"btn btn--ghost",onClick:o,disabled:r,children:r?u("loadMore.loading"):u("loadMore.loadMore")})}):null}export{m as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as K,j as F,d as O,n as V,u as Y,t,o as k,C as x,q as R,r as H,s as w,i as $,k as D,v as J,b as C,w as U,x as q}from"./index-C7swV0s7.js";import{r as X,a as j}from"./mana-rate-B7ShUGMF.js";import{a as Z,r as h,j as r}from"./react-yytiy0wi.js";import{b as A}from"./buy-C3XM-F5L.js";import{g as ee,b as re,w as ae,S as te,G as se}from"./buy-gasless-CgW1uOlT.js";function ue(e=!0){return K({queryKey:["mana-rate",F.chainId],queryFn:()=>X(F.chainId),enabled:e,staleTime:6e4,refetchInterval:6e4,retry:1})}function W(e){const m=e,n=(m.message??"").toLowerCase();return m.code===4001||n.includes("reject")||n.includes("denied")||n.includes("cancel")?t("getCredits.errorCanceled"):n.includes("insufficient")?t("marketCheckout.error.insufficient",{currency:w.name}):n.includes("not found")||n.includes("no active listing")||n.includes("404")?t("marketCheckout.error.soldOrRemoved"):n.includes("your own listing")?t("buyModal.error.cantBuyOwn"):t("marketCheckout.error.generic")}function ce(e){return{id:e.tradeId,tradeId:e.tradeId,name:e.name,creator:e.creator,contractAddress:e.contractAddress,itemId:e.itemId,category:e.category,wearableCategory:e.wearableCategory??void 0,rarity:e.rarity,network:e.network,chainId:e.chainId,thumbnail:e.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function me({listing:e,rate:m,onClose:n,onSold:T}){const{session:c}=O(),{data:d,isError:B}=V(c),g=Y(),N=Z(),[I,_]=h.useState("confirm"),[p,P]=h.useState(t("marketCheckout.lockingPrice")),[E,f]=h.useState(null),[a,G]=h.useState(null),o=h.useRef(null),L=Math.ceil(j(e.manaWei,m)/10);h.useEffect(()=>{let l=!1;if(!c){_("error"),f(t("buyModal.signInToCheckout"));return}return(async()=>{try{const s=await $(e.tradeId);if(!s)throw new Error("not found");if(D(s,c.address))throw new Error("You can't buy your own listing.");const u=j(e.manaWei,m);if(!Number.isFinite(u)||u<=0)throw new Error("price unavailable");const{credit:b,maxCreditedValue:z,usdCents:S}=await J(c.identity,u,e.tradeId);if(l){k(c.identity,[b.id]).catch(()=>{});return}o.current=b.id,G({trade:s,credit:b,maxCreditedValue:z,usdCents:S,credits:Math.ceil(S/10)}),P("")}catch(s){if(l)return;console.error("[market] authorize failed",s),C(q(s)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:U(s),value_usd:Math.round(j(e.manaWei,m))/100}),_("error"),f(W(s))}})(),()=>{l=!0,o.current&&c&&(k(c.identity,[o.current]).catch(()=>{}),o.current=null)}},[]);const v=!!a&&d!=null&&d.credits<a.credits;async function Q(){if(!c||!a)return;if(v){C("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:a.credits,credits_balance:(d==null?void 0:d.credits)??0,shortfall:Math.max(0,a.credits-((d==null?void 0:d.credits)??0))}),k(c.identity,[a.credit.id]).catch(()=>{}),o.current=null,N("/credits");return}_("working"),f(null);let l=!1;try{P(t("marketCheckout.confirming"));const i={trade:a.trade,buyer:c.address,signer:c.signer,credits:[a.credit],maxCreditedValue:a.maxCreditedValue};let s;if(ee())try{s=await re(i),await ae(s),l=!0}catch(u){if(u instanceof te)l=!0;else if(u instanceof se)s=await A(i);else throw u}else s=await A(i);o.current=null,C("Shop Completed Purchase",{items:[{item_id:e.itemId??null,contract_address:e.contractAddress,token_id:null,price_usd:a.usdCents/100}],value_credits:a.credits,value_usd:a.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:l,transaction_hash:s??null}),g.invalidateQueries({queryKey:["usd-balance"]}),N("/success",{state:{items:[ce(e)],txHash:s}})}catch(i){console.error("[market] buy now failed",i),k(c.identity,[a.credit.id]).catch(()=>{}),o.current=null,C(q(i)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:U(i),value_usd:a.usdCents/100}),g.invalidateQueries({queryKey:["usd-balance"]}),f(W(i)),_("error");const s=(i.message??"").toLowerCase();(s.includes("not found")||s.includes("no active listing")||s.includes("404"))&&T()}}function M(){c&&a&&k(c.identity,[a.credit.id]).catch(()=>{}),o.current=null,n()}const y=I==="working";return r.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:e.name}),children:[r.jsx("div",{className:"mkt-modal__scrim",onClick:y?void 0:M,"aria-hidden":!0}),r.jsxs("div",{className:"mkt-modal__card",children:[r.jsxs("div",{className:"mkt-modal__head",children:[r.jsx("div",{className:"mkt-modal__thumb",children:e.thumbnail?r.jsx("img",{src:e.thumbnail,alt:""}):null}),r.jsxs("div",{children:[r.jsx("div",{className:"mkt-modal__name",title:e.name,children:e.name||t("buyModal.itemFallback")}),r.jsx("span",{className:"chip chip--rarity",children:e.rarity})]})]}),r.jsx("div",{className:"mkt-modal__price",children:a?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.finalPrice")}),r.jsxs("div",{className:"mkt-modal__price-value",children:[r.jsx(x,{className:"mkt-modal__diamond"}),R(a.credits)]}),r.jsxs("div",{className:"mkt-modal__price-sub muted",children:[t("marketCheckout.lockedForPurchase")," · $",(a.usdCents/100).toFixed(2)]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.todaysPrice")}),r.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[r.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),r.jsx(x,{className:"mkt-modal__diamond"}),R(L)]}),r.jsx("div",{className:"mkt-modal__price-sub muted",children:p||t("marketCheckout.lockingPrice")})]})}),c?r.jsxs("div",{className:"mkt-modal__balance muted",children:[t("marketCheckout.yourBalance")," ",r.jsx(x,{className:"ccy-mark"})," ",H(d,B)]}):null,v?r.jsx("p",{className:"muted mkt-modal__note",children:t("marketCheckout.needMore",{currency:w.name})}):null,p&&I==="working"?r.jsx("p",{className:"muted mkt-modal__note",children:p}):null,E?r.jsx("p",{className:"error mkt-modal__note",children:E}):null,r.jsxs("div",{className:"mkt-modal__actions",children:[r.jsx("button",{className:"btn btn--ghost",onClick:M,disabled:y,children:t("buyModal.cancel")}),r.jsx("button",{className:"btn btn--purple",onClick:()=>void Q(),disabled:y||!a,children:y?t("marketCheckout.buying"):v?t("nav.getCredits",{currency:w.name}):t("marketCheckout.confirmPurchase")})]})]})]})}export{me as M,ue as u};
|