import i from "chroma-js";
import { kebabCase } from "lodash-es";
import { css as E$1 } from "../../../../style-system/dist/twind.js";
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
var $ = { primary: "Primary color", secondary: "Secondary color", accent: "Accent color", neutral: "Neutral color", base100: "Base color", base200: "Base (level 2)", base300: "Base (level 3)" }, x = [900, 800, 700, 600, 500, 400, 300, 200, 100, 50], f = { 100: "subtle", 300: "light", 700: "dark" };
function p(t) {
  return typeof t != "string" ? false : t.startsWith("oklch") || t.startsWith("oklab") || t.startsWith("rgb") || t.startsWith("hsl") || t.startsWith("#") || t.startsWith("var(--");
}
function B(t, o) {
  if (!(typeof t > "u")) return p(t) || typeof t == "number" ? E$1({ [o]: t }) : t;
}
function g(t, o = 3.5) {
  let a = i(t), n = "#ffffff", e = "#000000", r = i.contrast(a, n), c = i.contrast(a, e);
  return r >= o && c >= o || r >= o ? n : c >= o ? e : r >= c ? n : e;
}
function E(t, o) {
  if (!(typeof t > "u")) return p(t) || typeof t == "number" ? `${o}-[${t}]` : t;
}
function w(t) {
  let o = {};
  return Object.keys($).forEach((n) => {
    let e = t.colors[n], r = kebabCase(n);
    o[`color-${r}`] = e, o[`color-${r}-500`] = e;
    let c = g(e);
    o[`color-${r}-content`] = c, o[`color-${r}-500-content`] = c;
    let l = i(e), d = l.darken(2.5), h = l.brighten(3.5), y = i.scale([h, l, d]).domain([50, 500, 900]).mode("oklch");
    r.startsWith("base") || x.forEach((s) => {
      if (s === 500) return;
      let u = `color-${r}-${s}`, m = y(s);
      o[u] = m.css("oklch");
      let b = g(m);
      o[`color-${r}-${s}-content`] = b, f[s] && (o[`color-${r}-${f[s]}`] = o[u], o[`color-${r}-${f[s]}-content`] = b);
    });
  }), o;
}
export {
  $ as baseColors,
  w as generateColorsVars,
  g as getContrastingTextColor,
  p as isStandardColor,
  E as propToClass,
  B as propToStyle,
  x as shadeNumbers
};
//# sourceMappingURL=color-system.js.map
