import { jsx as n } from "../../../../../preact@10.29.0/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import x from "classnames";
import { z as I } from "./StoreProvider-CBB99upB.js";
import { Fragment as w } from "../../../../../preact@10.29.0/node_modules/preact/dist/preact.module.js";
try {
  let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, a = new e.Error().stack;
  a && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[a] = "4ba569d8-65d0-4fd5-8ad6-2ed8d139c488", e._sentryDebugIdIdentifier = "sentry-dbid-4ba569d8-65d0-4fd5-8ad6-2ed8d139c488");
} catch {
}
function F({
  id: e,
  name: a,
  value: c,
  className: s,
  label: l,
  isInvalid: i,
  onChange: y,
  helper: r,
  checked: t,
  readonly: b,
  disabled: f,
  enableTracking: u = !1,
  "aria-required": p,
  "aria-invalid": h,
  "aria-describedby": m
}) {
  const g = I(), k = (d) => {
    u && g.addFieldEvent("Interacted with form field", {
      actionType: "input",
      field: a,
      returnValue: String(d)
    }), y(d);
  }, o = `${e}-helper`, _ = `${r ? o : ""} ${m ?? ""}`.trim();
  return /* @__PURE__ */ n(w, { children: [
    /* @__PURE__ */ n(
      "input",
      {
        id: e,
        name: a,
        value: c,
        "aria-describedby": _,
        "aria-invalid": h || i,
        "aria-required": p,
        readOnly: b,
        disabled: f,
        checked: t,
        className: x([
          "adyen-kyc-checkbox__input",
          [s],
          { "adyen-kyc-checkbox__input--invalid": i }
        ]),
        type: "checkbox",
        onClick: (d) => {
          d.stopPropagation(), k(!t);
        }
      }
    ),
    /* @__PURE__ */ n("label", { htmlFor: e, className: "adyen-kyc-checkbox__label", children: l }),
    r && /* @__PURE__ */ n("span", { id: o, className: "adyen-kyc-checkbox__helper-text", children: r })
  ] });
}
export {
  F as C
};
