import { jsxs as C, jsx as e, Fragment as u } from "react/jsx-runtime";
import { c as d } from "./index.CfM2L_w0.js";
import { a as f } from "./index.CfQlFjZU.js";
import { n as k } from "./index.B0wX8xO7.js";
import { useMemo as N } from "react";
import { g as B, h as v, i as I } from "./index.dWlEA7uO.js";
const E = "creator_checkboxContainer_LVE4J", M = "creator_input_66OrW", O = "creator_label_5v-9E", g = "creator_label__disabled_qxtpO", j = "creator_span_LmXtH", w = "creator_icon_tfjoN", z = "creator_icon__checked_8Tl1L", L = "creator_icon__disabled_60WE8", a = { checkboxContainer: E, input: M, label: O, label__disabled: g, span: j, icon: w, icon__checked: z, icon__disabled: L };
function y({
  label: n,
  name: o,
  checked: t = !1,
  indeterminate: r = !1,
  onChecked: _,
  disabled: c,
  ...s
}) {
  const i = N(() => `checkbox-${o}`, [o]), h = () => {
    c || _?.();
  };
  return {
    ...s,
    id: i,
    label: n,
    containerClassname: a.checkboxContainer,
    inputClassname: a.input,
    labelClassname: d(a.label, {
      [a.label__disabled]: c
    }),
    iconClassname: d(a.icon, {
      [a.icon__checked]: t,
      [a.icon__disabled]: c
    }),
    checkedIconClassname: d(a.icon, a.icon__checked, {
      [a.icon__disabled]: c
    }),
    iconContainerClassname: a.span,
    name: o,
    checked: t,
    indeterminate: r,
    onChecked: h,
    disabled: c
  };
}
const F = ({
  label: n,
  containerClassname: o,
  inputClassname: t,
  labelClassname: r,
  iconClassname: _,
  checkedIconClassname: c,
  iconContainerClassname: s,
  id: i,
  name: h,
  checked: m,
  indeterminate: p,
  onChecked: l,
  disabled: x,
  ...b
}) => /* @__PURE__ */ C("div", { className: o, children: [
  /* @__PURE__ */ e(
    "input",
    {
      id: i,
      name: h,
      type: "checkbox",
      "aria-checked": p ? "mixed" : m,
      onChange: l,
      className: t,
      "aria-disabled": x,
      disabled: x,
      checked: m,
      ...b
    }
  ),
  /* @__PURE__ */ e(
    k,
    {
      value: p,
      then: /* @__PURE__ */ e("span", { className: s, children: /* @__PURE__ */ e(
        I,
        {
          "data-testid": "IndeterminateCheckBoxIcon",
          size: 24,
          className: c,
          onClick: l
        }
      ) }),
      otherwise: /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(
        k,
        {
          value: m,
          then: /* @__PURE__ */ e("span", { className: s, children: /* @__PURE__ */ e(
            v,
            {
              "data-testid": "CheckBoxIcon",
              size: 24,
              className: c,
              onClick: l
            }
          ) }),
          otherwise: /* @__PURE__ */ e("span", { className: s, children: /* @__PURE__ */ e(
            B,
            {
              "data-testid": "CheckBoxOutlineBlankIcon",
              size: 24,
              className: _,
              onClick: l
            }
          ) })
        }
      ) })
    }
  ),
  /* @__PURE__ */ e(
    k,
    {
      value: n,
      then: /* @__PURE__ */ e("label", { className: r, htmlFor: i, children: n })
    }
  )
] }), X = f(F, y);
export {
  F as C,
  X as a,
  y as u
};
