import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { Field, getIn } from 'formik';
import { dissoc } from 'ramda';
import { C as Checkbox } from '../Checkbox-m4rEnxUz.js';
import '../utils-BJnb9o5c.js';
import '../primitives/Checkbox.js';
import '../check-Cpkv29p1.js';
import '../createLucideIcon-C8ycilSN.js';
import '../index-BtkPdosV.js';
import '../index-CiyxEyB0.js';
import '../index-DNzunGHb.js';
import '../index-Cor698lu.js';
import '../index-DOzu5J1s.js';
import '../index-30QpKM0j.js';
import '../index-BYZaLNq1.js';
import '../index-yFgkK_AM.js';
import '../index-DhnfW8wQ.js';
import 'react-dom';
import '../primitives/Field.js';
import '../HelpIcon-Cm3ZgoCx.js';
import '../primitives/Tooltip.js';
import '../tooltip-ChQ9xD1j.js';
import '../index-BNPynZWM.js';
import '../index-CSUSJzOJ.js';
import '../index-zW4GjM5L.js';
import '../index-C3hByjk3.js';
import '../floating-ui.react-dom-D8_f_WWh.js';
import '../index-fV_U4ZJM.js';
import '../index-CSggBaQF.js';
import '../renderIcon-C6twJSqH.js';
import '../Popover-C1FNlRtU.js';
import '../index-Bo3AAQJp.js';
import '../primitives/HoverCard.js';
import '../Typography-CmILccNh.js';
import '../index-CfriMyrd.js';
import '../Button-DV9xCqlc.js';
import 'react-router-dom';
import '../primitives/Button.js';
import '../button-CrEMzWKw.js';
import '../primitives/Spinner.js';
import 'react-i18next';
import '../loader-circle-DycHUAWN.js';
import '../label-YEsizr2c.js';
import '../separator-ByRsc-y-.js';

const FormikCheckbox = forwardRef(
  ({
    name,
    onCheckedChange: onCheckedChangeProp,
    onChange: onChangeProp,
    ...rest
  }, ref) => /* @__PURE__ */ jsx(Field, { name, children: ({ field, meta, form }) => {
    const { status = {}, setStatus } = form;
    const fieldStatus = getIn(status, name);
    return /* @__PURE__ */ jsx(
      Checkbox,
      {
        ref,
        checked: !!field.value,
        error: meta.touched ? meta.error || fieldStatus : "",
        name: field.name,
        onBlur: field.onBlur,
        onCheckedChange: (checked) => {
          setStatus(dissoc(name, status));
          form.setFieldValue(name, checked);
          onCheckedChangeProp?.(checked);
          onChangeProp?.();
        },
        ...rest
      }
    );
  } })
);
FormikCheckbox.displayName = "FormikCheckbox";

export { FormikCheckbox };
//# sourceMappingURL=Checkbox.js.map
