import { jsxs as t, jsx as r } from "react/jsx-runtime";
import k from "./assets/checkbox-error.svg.es.js";
import { cn as l } from "../../utils/cn/cn.es.js";
import e from "../../components/Checkbox/checkbox.module.css";
import { Typography as m } from "../Typography/Typography.es.js";
import { Icon as n } from "../Icon/Icon.es.js";
import { EIconName as i } from "../Icon/constants.es.js";
const j = ({
  label: d,
  checkboxSize: f = "lg",
  checkboxVariant: h = "default",
  isError: o = !1,
  errorText: c,
  disabled: s,
  checked: a,
  className: p,
  inverted: b,
  ...N
}) => {
  const u = (C) => {
    switch (C) {
      case "default":
        return /* @__PURE__ */ r(n, { name: i.CHECK, className: e.icon });
      case "undetermined":
        return /* @__PURE__ */ r(n, { name: i.REMOVE, className: e.icon });
    }
  }, x = l(p, e.root, {
    [e.error]: o,
    [e.disabled]: s,
    [e.inverted]: b
  });
  return /* @__PURE__ */ t("label", { className: x, children: [
    /* @__PURE__ */ r("input", { ...N, type: "checkbox", disabled: s, checked: a, className: e.checkbox }),
    /* @__PURE__ */ r("div", { className: l(e.visibleCustomCheckbox, e[f]), "data-checked": a, children: a && u(h) }),
    /* @__PURE__ */ r(m, { defaultVariant: "labelSm", className: e.label, children: d }),
    o && !!c && /* @__PURE__ */ t("div", { className: e.errorTextContainer, children: [
      /* @__PURE__ */ r(k, { className: e.errorIcon }),
      /* @__PURE__ */ r(m, { defaultVariant: "labelSm", className: e.errorText, children: c })
    ] })
  ] });
};
export {
  j as Checkbox
};
