'use strict';

var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var formik = require('formik');
var ramda = require('ramda');
var MultiEmailInput = require('../MultiEmailInput-l0_YVjbp.js');
require('../utils-CTr7wn5d.js');
require('../primitives/Field.js');
require('../index-BZhTddX0.js');
require('../label-Bdc9ytTI.js');
require('../index-DMbj7vXd.js');
require('react-dom');
require('../index-D-iDn9RI.js');
require('../separator-CPy2gyg1.js');
require('../x-Brw3FJst.js');
require('../createLucideIcon-D0tRgV6l.js');

const FormikMultiEmailInput = React.forwardRef(({ name, onChange: onChangeProp, ...otherProps }, ref) => {
    const [field, meta, { setValue, setTouched }] = formik.useField(name);
    const { status = {}, setStatus } = formik.useFormikContext();
    const fieldStatus = formik.getIn(status, name);
    return (jsxRuntime.jsx(MultiEmailInput.MultiEmailInput, { ref: ref, error: meta.touched ? meta.error || fieldStatus : "", value: field.value, onBlur: () => setTouched(true), onChange: value => {
            setStatus(ramda.dissoc(name, status));
            setValue(value);
            onChangeProp?.(value);
        }, ...otherProps }));
});
FormikMultiEmailInput.displayName = "FormikMultiEmailInput";

exports.FormikMultiEmailInput = FormikMultiEmailInput;
//# sourceMappingURL=MultiEmailInput.js.map
