import { f as s, g as o, a as c, b as l, c as m, d as u } from "../index-D2_J_-XS.js";
import { s as b, e as g } from "../colors-BmLYKmoH.js";
function f() {
  return Object.fromEntries(
    b.map((e) => [
      e,
      Object.fromEntries(
        g.map((t) => [
          t,
          `var(--color-${e}-${t})`
        ])
      )
    ])
  );
}
function d(e) {
  const { includeCoreTokens: t = !0, includeSemanticTokens: i = !0 } = e, a = {};
  if (t) {
    const r = s();
    e.baseSpacing && (r[l("base")] = e.baseSpacing), e.baseFontSize && (r[m()] = e.baseFontSize), e.baseMotionDuration && (r[u("base")] = e.baseMotionDuration), a[":root"] = r;
  }
  return i && (a[":root"] = {
    ...a[":root"] ?? {},
    ...o({
      colors: e.semanticColors,
      fonts: e.semanticFonts,
      radii: e.semanticRadii,
      shadows: e.semanticShadows,
      motion: e.semanticMotion,
      spacing: e.semanticSpacing,
      textShadows: e.semanticTextShadows
    })
  }), e.fontFamilies && (a[":root"] = {
    ...a[":root"] ?? {},
    ...c(e.fontFamilies)
  }), a;
}
const n = Object.assign(
  (e, t) => ({
    handler: e,
    config: t
  }),
  {
    withOptions(e, t = () => ({})) {
      const i = (a) => ({
        handler: e(a),
        config: t(a)
      });
      return i.__isOptionsFunction = !0, i;
    }
  }
);
function h(e = {}) {
  const t = d(e);
  return {
    darkMode: "class",
    theme: {
      extend: e.extendTheme ?? !0 ? {
        colors: f()
      } : {}
    },
    plugins: [
      n(({ addBase: r }) => {
        Object.keys(t).length > 0 && r(t);
      }),
      n(({ addVariant: r }) => {
        r("beatui-light", ".light &"), r("beatui-rtl", ".b-rtl &"), r("beatui-ltr", ".b-ltr &");
      })
    ]
  };
}
const T = h();
export {
  T as beatuiPreset,
  h as createBeatuiPreset
};
