"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index.cjs38.js"),n=require("react"),m=require("./index.cjs4.js"),p=require("./index.cjs3.js"),f=require("./index.cjs39.js"),o=require("./index.cjs6.js"),c=require("./index.cjs7.js"),u=n.createContext(void 0);function a(e){return Object.entries(e).map(([i,r])=>`${i}:${r}`).join(";")}const j=a(m.themeToCssVars(o.lightTheme)),v=a(m.themeToCssVars(c.darkTheme)),k=({theme:e="light",children:i})=>{const{fullTheme:r,themeName:h,themeStyles:d}=n.useMemo(()=>{let t,s;e==="light"?(t=o.lightTheme,s="light"):e==="dark"?(t=c.darkTheme,s="dark"):e&&typeof e=="object"&&"palette"in e&&e.palette&&"primary"in e.palette?(t=e,s=e===o.lightTheme?"light":e===c.darkTheme?"dark":"custom"):(t=p.mergeTheme(o.lightTheme,e),s="custom");const x=s==="custom"?`[data-color-scheme="custom"]{${a(m.themeToCssVars(t))}}`:"",g=`[data-color-scheme="light"]{${j}}[data-color-scheme="dark"]{${v}}${x}`;return{fullTheme:t,themeName:s,themeStyles:g}},[e]),T=n.useMemo(()=>({theme:r}),[r]);return l.jsxRuntimeExports.jsxs("div",{"data-color-scheme":h,className:f.default.wrapper,children:[l.jsxRuntimeExports.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),l.jsxRuntimeExports.jsx(u.Provider,{value:T,children:i})]})};function C(){const e=n.useContext(u);if(e===void 0)throw new Error("useThemeContext must be used within a ThemeProvider");return e}exports.ThemeProvider=k;exports.useThemeContext=C;
//# sourceMappingURL=index.cjs36.js.map
