import * as i from "react";
import y from "../../../classnames/index.mjs";
import "../config-provider/index.mjs";
import v from "./style/index.mjs";
import { ConfigContext as O } from "../config-provider/context.mjs";
var k = globalThis && globalThis.__rest || function(t, r) {
  var s = {};
  for (var e in t)
    Object.prototype.hasOwnProperty.call(t, e) && r.indexOf(e) < 0 && (s[e] = t[e]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
    for (var o = 0, e = Object.getOwnPropertySymbols(t); o < e.length; o++)
      r.indexOf(e[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[o]) && (s[e[o]] = t[e[o]]);
  return s;
};
const x = /* @__PURE__ */ i.forwardRef((t, r) => {
  const {
    prefixCls: s,
    style: e,
    className: o,
    checked: f,
    onChange: c,
    onClick: n
  } = t, m = k(t, ["prefixCls", "style", "className", "checked", "onChange", "onClick"]), {
    getPrefixCls: p,
    tag: l
  } = i.useContext(O), C = (u) => {
    c == null || c(!f), n == null || n(u);
  }, a = p("tag", s), [d, b, g] = v(a), h = y(a, `${a}-checkable`, {
    [`${a}-checkable-checked`]: f
  }, l == null ? void 0 : l.className, o, b, g);
  return d(/* @__PURE__ */ i.createElement("span", Object.assign({}, m, {
    ref: r,
    style: Object.assign(Object.assign({}, e), l == null ? void 0 : l.style),
    className: h,
    onClick: C
  })));
}), S = x;
export {
  S as default
};
