import { darken as c, cssVar as d, rgba as g, lighten as u } from "../node_modules/polished/dist/polished.esm.js";
import { css as m } from "styled-components";
const h = (t) => t.substring(4, t.length - 1), f = (t) => t.startsWith("var("), i = (t) => {
  if (f(t)) {
    const e = h(t);
    return String(d(e, "#000000"));
  }
  return t;
}, S = (t, e) => (r) => {
  try {
    const n = i(
      String(
        r.theme.mode === "dark" ? r.theme.alias.dark[t] : r.theme.alias.light[t]
      )
    ), o = l(e, r.theme);
    if (typeof o != "string") throw new Error("Invalid alias");
    const a = i(o);
    return c(n, a);
  } catch (n) {
    return console.warn(n), l(e, r.theme);
  }
}, b = (t, e) => (r) => {
  try {
    const n = i(
      String(
        r.theme.mode === "dark" ? r.theme.alias.dark[t] : r.theme.alias.light[t]
      )
    ), o = l(e, r.theme);
    if (typeof o != "string") throw new Error("Invalid alias");
    const a = i(o);
    return u(n, a);
  } catch (n) {
    return console.warn(n), l(e, r.theme);
  }
}, $ = (t, e) => (r) => {
  try {
    const n = typeof t == "number" ? t : i(
      String(
        r.theme.mode === "dark" ? r.theme.alias.dark[t] : r.theme.alias.light[t]
      )
    ), o = l(e, r.theme);
    if (typeof o != "string") throw new Error("Invalid alias");
    const a = i(o);
    return g(a, Number(n));
  } catch (n) {
    return console.warn(n), l(e, r.theme);
  }
}, C = (t) => m`
    ${(e) => {
  const r = e.theme.font[t];
  return `
        font-size: ${r.fontSize};
        line-height: ${r.lineHeight};
      `;
}}
  `, l = (t, e) => e ? e.mode === "dark" ? e.alias.dark[t] : e.alias.light[t] : (r) => r.theme.mode === "dark" ? r.theme.alias.dark[t] : r.theme.alias.light[t], E = () => {
}, I = (t) => t.toLowerCase().replace(/[^a-z0-9]/g, "-"), V = null, v = (t = "all") => m`
    transition: ${({ theme: e }) => `${t} ${e.motion.speed.defaultS} ${e.motion.easing.easeDefault}`};
  `, A = (...t) => (e) => {
  t.length > 4 && console.warn("You added to many values");
  const r = e.theme.spacing;
  return t.reduce((n, o) => `${n} ${r[o]}`, "");
}, D = (t) => (e) => t && e ? `${t}-${e}` : t || void 0;
function x(t) {
  return t != null;
}
const z = (t) => {
  let e;
  return t ? e = typeof t == "string" ? document.getElementById(t) : t : e = document.getElementById("main") || document.getElementById("react-root") || document.getElementById("root"), e !== null ? e : document.body;
}, B = (t) => [
  ...t ? t.querySelectorAll(
    'a, button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'
  ) : []
].filter((e) => !e.hasAttribute("disabled")), k = (t) => t === "dark", M = (t) => t === "light", L = (t, e) => (r) => {
  const n = k(r.theme.mode);
  try {
    const o = i(
      String(
        n ? r.theme.alias.dark[t] : r.theme.alias.light[t]
      )
    ), a = l(e, r.theme);
    if (typeof a != "string") throw new Error("Invalid alias");
    const s = i(a);
    return n ? u(o, s) : c(o, s);
  } catch (o) {
    return console.warn(o), l(e, r.theme);
  }
}, N = (t) => (e) => !t.includes(e);
export {
  N as convertToTransientProps,
  h as extractCSSVarName,
  l as getColorAlias,
  i as getColorAliasValue,
  z as getComponentRoot,
  S as getDarkenColor,
  v as getDefaultTransition,
  B as getFocusableElements,
  C as getFontSize,
  D as getId,
  b as getLightenColor,
  L as getModifiedColorByThemeMode,
  A as getSpacing,
  k as isDarkMode,
  x as isDifferentFromUndefinedOrNull,
  M as isLightMode,
  f as isUsingCssVar,
  E as noop,
  I as slugify,
  $ as transparentizeAliasColor,
  V as unitJSX
};
