import{r as l,j as c,Y as i,ev as T,ew as x,ex as y,ey as E}from"./index-7ecf457b.js";const P=l.createContext(null),a=P;function d(){return l.useContext(a)}const _=typeof Symbol=="function"&&Symbol.for,g=_?Symbol.for("mui.nested"):"__THEME_NESTED__";function S(e,n){return typeof n=="function"?n(e):i({},e,n)}function C(e){const{children:n,theme:t}=e,o=d(),u=l.useMemo(()=>{const r=o===null?t:S(o,t);return r!=null&&(r[g]=o!==null),r},[t,o]);return c(a.Provider,{value:u,children:n})}const m={};function f(e,n,t,o=!1){return l.useMemo(()=>{const u=e&&n[e]||n;if(typeof t=="function"){const r=t(u),s=e?i({},n,{[e]:r}):r;return o?()=>s:s}return e?i({},n,{[e]:t}):i({},n,t)},[e,n,t,o])}function b(e){const{children:n,theme:t,themeId:o}=e,u=T(m),r=d()||m,s=f(o,u,t),h=f(o,r,t,!0),v=s.direction==="rtl";return c(C,{theme:h,children:c(x.Provider,{value:s,children:c(y,{value:v,children:c(E,{value:s==null?void 0:s.components,children:n})})})})}export{b as T,d as u};
