import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
const initialContext = {
    formValues: void 0,
    setFormValues: (_values)=>{
    // no op
    },
    formMethods: void 0,
    setFormMethods: (_values)=>{
    // no op
    }
};
const FormContext = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.createContext)(initialContext);
/**
 * @see https://react-hook-form.com/advanced-usage/#WizardFormFunnel
 */ const FormProvider = ({ children })=>{
    const [data, setData] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)({});
    const [methods, setMethods] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)();
    const setFormValues = (values)=>{
        setData((previousValues)=>({
                ...previousValues,
                ...values
            }));
    };
    const setFormMethods = (values)=>{
        setMethods((previousValues)=>({
                ...previousValues,
                ...values
            }));
    };
    return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(FormContext.Provider, {
        value: {
            formValues: data,
            setFormValues,
            formMethods: methods,
            setFormMethods
        }
    }, children);
};
/* ESM default export */ const FormProvider_rslib_entry_ = FormProvider;
export { FormContext, FormProvider_rslib_entry_ as default };
