import{y as p,b as E}from"./Typography-1.0.63-mecuj_Wl.js";import{r as f,b as g}from"./redux-1.0.63-Df-eBzJn.js";import{g as Q}from"./getThemeProps-1.0.63-5ZzcWe3G.js";import{u as S}from"./useEnhancedEffect-1.0.63-DnR0ZFqV.js";function y(n,r,e,s,c){const[t,m]=f.useState(()=>c&&e?e(n).matches:s?s(n).matches:r);return S(()=>{if(!e)return;const o=e(n),u=()=>{m(o.matches)};return u(),o.addEventListener("change",u),()=>{o.removeEventListener("change",u)}},[n,e]),t}const b={...g},l=b.useSyncExternalStore;function v(n,r,e,s,c){const t=f.useCallback(()=>r,[r]),m=f.useMemo(()=>{if(c&&e)return()=>e(n).matches;if(s!==null){const{matches:a}=s(n);return()=>a}return t},[t,n,s,c,e]),[o,u]=f.useMemo(()=>{if(e===null)return[t,()=>()=>{}];const a=e(n);return[()=>a.matches,i=>(a.addEventListener("change",i),()=>{a.removeEventListener("change",i)})]},[t,e,n]);return l(u,o,m)}function h(n={}){const{themeId:r}=n;return function(s,c={}){let t=p();t&&r&&(t=t[r]||t);const m=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:o=!1,matchMedia:u=m?window.matchMedia:null,ssrMatchMedia:d=null,noSsr:a=!1}=Q({name:"MuiUseMediaQuery",props:c,theme:t});let i=typeof s=="function"?s(t):s;return i=i.replace(/^@media( ?)/m,""),(l!==void 0?v:y)(i,o,u,d,a)}}h();const T=h({themeId:E});export{T as u};
