Socket
Socket
Sign inDemoInstall

formik

Package Overview
Dependencies
Maintainers
1
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formik - npm Package Compare versions

Comparing version 2.0.6 to 2.0.7

12

dist/FastField.d.ts
import * as React from 'react';
import { FormikProps, GenericFieldHTMLAttributes, FormikContextType, FieldMetaProps, FieldInputProps } from './types';
import { FormikProps, GenericFieldHTMLAttributes, FieldMetaProps, FieldInputProps } from './types';
import { FieldConfig } from './Field';

@@ -13,10 +13,2 @@ export interface FastFieldProps<V = any> {

export declare type FastFieldAttributes<T> = GenericFieldHTMLAttributes & FastFieldConfig<T> & T;
export declare class FastField<Values = {}, Props = {}> extends React.Component<FastFieldAttributes<Props>, {}> {
static contextType: React.Context<FormikContextType<any>>;
constructor(props: FastFieldAttributes<Props>);
shouldComponentUpdate(props: FastFieldAttributes<Props>, _state: {}, context: FormikContextType<Values>): boolean;
componentDidMount(): void;
componentDidUpdate(prevProps: FastFieldAttributes<Props>): void;
componentWillUnmount(): void;
render(): any;
}
export declare const FastField: React.ComponentType<any>;

68

dist/formik.cjs.development.js

@@ -63,2 +63,5 @@ 'use strict';

var isEmptyArray = function isEmptyArray(value) {
return Array.isArray(value) && value.length === 0;
};
var isFunction = function isFunction(obj) {

@@ -136,3 +139,3 @@ return typeof obj === 'function';

if (value === undefined) {
if (value === undefined || isEmptyArray(value)) {
delete resVal[pathArray[i]];

@@ -143,3 +146,3 @@ } else {

if (i === 0 && value === undefined) {
if (i === 0 && value === undefined || isEmptyArray(value)) {
delete res[pathArray[i]];

@@ -201,2 +204,6 @@ }

case 'SET_ERRORS':
if (isEqual(state.errors, msg.payload)) {
return state;
}
return _extends({}, state, {

@@ -600,11 +607,11 @@ errors: msg.payload

var _eventOrTextValue$tar = eventOrTextValue.target,
type = _eventOrTextValue$tar.type,
name = _eventOrTextValue$tar.name,
id = _eventOrTextValue$tar.id,
value = _eventOrTextValue$tar.value,
checked = _eventOrTextValue$tar.checked,
outerHTML = _eventOrTextValue$tar.outerHTML,
options = _eventOrTextValue$tar.options,
multiple = _eventOrTextValue$tar.multiple;
var target = eventOrTextValue.target ? eventOrTextValue.target : eventOrTextValue.currentTarget;
var type = target.type,
name = target.name,
id = target.id,
value = target.value,
checked = target.checked,
outerHTML = target.outerHTML,
options = target.options,
multiple = target.multiple;
field = maybePath ? maybePath : name ? name : id;

@@ -760,3 +767,3 @@

});
return;
throw combinedErrors;
}

@@ -854,3 +861,3 @@

return !isEqual(initialValues.current, state.values);
}, [state.values]);
}, [initialValues.current, state.values]);
var isValid = React.useMemo(function () {

@@ -1597,8 +1604,8 @@ return typeof isInitialValid !== 'undefined' ? dirty ? state.errors && Object.keys(state.errors).length === 0 : isInitialValid !== false && isFunction(isInitialValid) ? isInitialValid(props) : isInitialValid : state.errors && Object.keys(state.errors).length === 0;

var FastField =
var FastFieldInner =
/*#__PURE__*/
function (_React$Component) {
_inheritsLoose(FastField, _React$Component);
_inheritsLoose(FastFieldInner, _React$Component);
function FastField(props) {
function FastFieldInner(props) {
var _this;

@@ -1620,8 +1627,8 @@

var _proto = FastField.prototype;
var _proto = FastFieldInner.prototype;
_proto.shouldComponentUpdate = function shouldComponentUpdate(props, _state, context) {
_proto.shouldComponentUpdate = function shouldComponentUpdate(props) {
if (this.props.shouldUpdate) {
return this.props.shouldUpdate(props, this.props);
} else if (getIn(this.context.values, this.props.name) !== getIn(context.values, this.props.name) || getIn(this.context.errors, this.props.name) !== getIn(context.errors, this.props.name) || getIn(this.context.touched, this.props.name) !== getIn(context.touched, this.props.name) || Object.keys(this.props).length !== Object.keys(props).length || this.context.isSubmitting !== context.isSubmitting) {
} else if (props.name !== this.props.name || getIn(props.formik.values, this.props.name) !== getIn(this.props.formik.values, this.props.name) || getIn(props.formik.errors, this.props.name) !== getIn(this.props.formik.errors, this.props.name) || getIn(props.formik.touched, this.props.name) !== getIn(this.props.formik.touched, this.props.name) || Object.keys(this.props).length !== Object.keys(props).length || props.formik.isSubmitting !== this.props.formik.isSubmitting) {
return true;

@@ -1634,3 +1641,3 @@ } else {

_proto.componentDidMount = function componentDidMount() {
this.context.registerField(this.props.name, {
this.props.formik.registerField(this.props.name, {
validate: this.props.validate

@@ -1642,4 +1649,4 @@ });

if (this.props.name !== prevProps.name) {
this.context.unregisterField(prevProps.name);
this.context.registerField(this.props.name, {
this.props.formik.unregisterField(prevProps.name);
this.props.formik.registerField(this.props.name, {
validate: this.props.validate

@@ -1650,3 +1657,3 @@ });

if (this.props.validate !== prevProps.validate) {
this.context.registerField(this.props.name, {
this.props.formik.registerField(this.props.name, {
validate: this.props.validate

@@ -1658,3 +1665,3 @@ });

_proto.componentWillUnmount = function componentWillUnmount() {
this.context.unregisterField(this.props.name);
this.props.formik.unregisterField(this.props.name);
};

@@ -1671,6 +1678,5 @@

shouldUpdate = _this$props.shouldUpdate,
props = _objectWithoutPropertiesLoose(_this$props, ["validate", "name", "render", "as", "children", "component", "shouldUpdate"]);
formik = _this$props.formik,
props = _objectWithoutPropertiesLoose(_this$props, ["validate", "name", "render", "as", "children", "component", "shouldUpdate", "formik"]);
var formik = this.context;
var _validate = formik.validate,

@@ -1738,6 +1744,9 @@ _validationSchema = formik.validationSchema,

return FastField;
return FastFieldInner;
}(React.Component);
FastField.contextType = FormikContext;
var FastField =
/*#__PURE__*/
connect(FastFieldInner);
exports.ErrorMessage = ErrorMessage;

@@ -1756,2 +1765,3 @@ exports.FastField = FastField;

exports.insert = insert;
exports.isEmptyArray = isEmptyArray;
exports.isEmptyChildren = isEmptyChildren;

@@ -1758,0 +1768,0 @@ exports.isFunction = isFunction;

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),r=e(require("react-fast-compare")),n=e(require("deepmerge")),i=e(require("lodash/isPlainObject")),a=e(require("lodash/clone")),o=e(require("lodash/toPath")),u=e(require("tiny-warning")),s=require("scheduler"),l=e(require("hoist-non-react-statics")),c=e(require("lodash/cloneDeep"));function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function f(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(i[r]=e[r]);return i}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var h=function(e){return"function"==typeof e},m=function(e){return null!==e&&"object"==typeof e},y=function(e){return String(Math.floor(Number(e)))===e},E=function(e){return"[object String]"===Object.prototype.toString.call(e)},S=function(e){return 0===t.Children.count(e)},T=function(e){return m(e)&&h(e.then)};function b(e,t,r,n){void 0===n&&(n=0);for(var i=o(t);e&&n<i.length;)e=e[i[n++]];return void 0===e?r:e}function g(e,t,r){for(var n=a(e),i=n,u=0,s=o(t);u<s.length-1;u++){var l=s[u],c=b(e,s.slice(0,u+1));if(c&&(m(c)||Array.isArray(c)))i=i[l]=a(c);else{var d=s[u+1];i=i[l]=y(d)&&Number(d)>=0?[]:{}}}return(0===u?e:i)[s[u]]===r?e:(void 0===r?delete i[s[u]]:i[s[u]]=r,0===u&&void 0===r&&delete n[s[u]],n)}function F(e,t,r,n){void 0===r&&(r=new WeakMap),void 0===n&&(n={});for(var i=0,a=Object.keys(e);i<a.length;i++){var o=a[i],u=e[o];m(u)?r.get(u)||(r.set(u,!0),n[o]=Array.isArray(u)?[]:{},F(u,t,r,n[o])):n[o]=t}return n}var O=t.createContext(void 0),R=O.Provider,C=O.Consumer;function _(){var e=t.useContext(O);return e||u(!1),e}function k(e,t){switch(t.type){case"SET_VALUES":return d({},e,{values:t.payload});case"SET_TOUCHED":return d({},e,{touched:t.payload});case"SET_ERRORS":return d({},e,{errors:t.payload});case"SET_STATUS":return d({},e,{status:t.payload});case"SET_ISSUBMITTING":return d({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return d({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return d({},e,{values:g(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return d({},e,{touched:g(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return d({},e,{errors:g(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return d({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return d({},e,{touched:F(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return d({},e,{isSubmitting:!1});default:return e}}var A={},x={};function I(e){var i=e.validateOnChange,a=void 0===i||i,o=e.validateOnBlur,u=void 0===o||o,l=e.validateOnMount,c=void 0!==l&&l,p=e.isInitialValid,v=e.enableReinitialize,y=void 0!==v&&v,S=e.onSubmit,F=f(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),O=d({validateOnChange:a,validateOnBlur:u,validateOnMount:c,onSubmit:S},F),R=t.useRef(O.initialValues),C=t.useRef(O.initialErrors||A),_=t.useRef(O.initialTouched||x),I=t.useRef(O.initialStatus),P=t.useRef(!1),M=t.useRef({});t.useEffect(function(){},[]),t.useEffect(function(){return P.current=!0,function(){P.current=!1}},[]);var w=t.useReducer(k,{values:O.initialValues,errors:O.initialErrors||A,touched:O.initialTouched||x,status:O.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),j=w[0],N=w[1],B=t.useCallback(function(e,t){return new Promise(function(r,n){var i=O.validate(e,t);null==i?r(A):T(i)?i.then(function(e){r(e||A)},function(e){n(e)}):r(i)})},[O.validate]),q=t.useCallback(function(e,t){var r=O.validationSchema,n=h(r)?r(t):r,i=t&&n.validateAt?n.validateAt(t,e):V(e,n);return new Promise(function(e,t){i.then(function(){e(A)},function(r){"ValidationError"===r.name?e(U(r)):t(r)})})},[O.validationSchema]),G=t.useCallback(function(e,t){return new Promise(function(r){return r(M.current[e].validate(t))})},[]),W=t.useCallback(function(e){var t=Object.keys(M.current).filter(function(e){return h(M.current[e].validate)}),r=t.length>0?t.map(function(t){return G(t,b(e,t))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(r).then(function(e){return e.reduce(function(e,r,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===r?e:(r&&(e=g(e,t[n],r)),e)},{})})},[G]),H=t.useCallback(function(e){return Promise.all([W(e),O.validationSchema?q(e):{},O.validate?B(e):{}]).then(function(e){return n.all([e[0],e[1],e[2]],{arrayMerge:D})})},[O.validate,O.validationSchema,W,B,q]),K=L(function(e){return void 0===e&&(e=j.values),s.unstable_runWithPriority(s.LowPriority,function(){return H(e).then(function(e){return P.current&&N({type:"SET_ERRORS",payload:e}),e})})}),Y=L(function(e){return void 0===e&&(e=j.values),N({type:"SET_ISVALIDATING",payload:!0}),H(e).then(function(e){return P.current&&(N({type:"SET_ISVALIDATING",payload:!1}),r(j.errors,e)||N({type:"SET_ERRORS",payload:e})),e})});t.useEffect(function(){c&&!0===P.current&&K(O.initialValues)},[O.initialValues,c,K]);var z=t.useCallback(function(e){var t=e&&e.values?e.values:R.current,r=e&&e.errors?e.errors:C.current?C.current:O.initialErrors||{},n=e&&e.touched?e.touched:_.current?_.current:O.initialTouched||{},i=e&&e.status?e.status:I.current?I.current:O.initialStatus;R.current=t,C.current=r,_.current=n,I.current=i,N({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:r,touched:n,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})},[O.initialErrors,O.initialStatus,O.initialTouched]);t.useEffect(function(){y&&!0===P.current&&!r(R.current,O.initialValues)&&(R.current=O.initialValues,z())},[y,O.initialValues,z]),t.useEffect(function(){y&&!0===P.current&&!r(C.current,O.initialErrors)&&(C.current=O.initialErrors||A,N({type:"SET_ERRORS",payload:O.initialErrors||A}))},[y,O.initialErrors]),t.useEffect(function(){y&&!0===P.current&&!r(_.current,O.initialTouched)&&(_.current=O.initialTouched||x,N({type:"SET_TOUCHED",payload:O.initialTouched||x}))},[y,O.initialTouched]),t.useEffect(function(){y&&!0===P.current&&!r(I.current,O.initialStatus)&&(I.current=O.initialStatus,N({type:"SET_STATUS",payload:O.initialStatus}))},[y,O.initialStatus,O.initialTouched]);var J=L(function(e){if(h(M.current[e].validate)){var t=b(j.values,e),r=M.current[e].validate(t);return T(r)?(N({type:"SET_ISVALIDATING",payload:!0}),r.then(function(e){return e}).then(function(t){N({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),N({type:"SET_ISVALIDATING",payload:!1})})):(N({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),Promise.resolve(r))}return Promise.resolve()}),Q=t.useCallback(function(e,t){M.current[e]={validate:t.validate}},[]),X=t.useCallback(function(e){delete M.current[e]},[]),Z=L(function(e){return N({type:"SET_TOUCHED",payload:e}),u?K(j.values):Promise.resolve()}),$=t.useCallback(function(e){N({type:"SET_ERRORS",payload:e})},[]),ee=L(function(e){return N({type:"SET_VALUES",payload:e}),a?K(e):Promise.resolve()}),te=t.useCallback(function(e,t){N({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})},[]),re=L(function(e,t,r){return void 0===r&&(r=!0),N({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),a&&r?K(g(j.values,e,t)):Promise.resolve()}),ne=t.useCallback(function(e,t){var r,n=t,i=e;if(!E(e)){e.persist&&e.persist();var a=e.target,o=a.type,u=a.value,s=a.checked,l=a.options,c=a.multiple;n=t||a.name||a.id,i=/number|range/.test(o)?(r=parseFloat(u),isNaN(r)?"":r):/checkbox/.test(o)?function(e,t,r){if("true"==r||"false"==r)return!!t;if(t&&r)return Array.isArray(e)?e.concat(r):[r];if(!Array.isArray(e))return!e;var n=e.indexOf(r);return n<0?e:e.slice(0,n).concat(e.slice(n+1))}(b(j.values,n),s,u):c?function(e){return Array.from(e).filter(function(e){return e.selected}).map(function(e){return e.value})}(l):u}n&&re(n,i)},[re,j.values]),ie=t.useCallback(function(e){if(E(e))return function(t){return ne(t,e)};ne(e)},[ne]),ae=L(function(e,t,r){return void 0===t&&(t=!0),void 0===r&&(r=!0),N({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),u&&r?K(j.values):Promise.resolve()}),oe=t.useCallback(function(e,t){e.persist&&e.persist();var r=e.target;ae(t||r.name||r.id,!0)},[ae]),ue=t.useCallback(function(e){if(E(e))return function(t){return oe(t,e)};oe(e)},[oe]),se=t.useCallback(function(e){h(e)?N({type:"SET_FORMIK_STATE",payload:e}):N({type:"SET_FORMIK_STATE",payload:function(){return e}})},[]),le=t.useCallback(function(e){N({type:"SET_STATUS",payload:e})},[]),ce=t.useCallback(function(e){N({type:"SET_ISSUBMITTING",payload:e})},[]),de={resetForm:z,validateForm:Y,validateField:J,setErrors:$,setFieldError:te,setFieldTouched:ae,setFieldValue:re,setStatus:le,setSubmitting:ce,setTouched:Z,setValues:ee,setFormikState:se},pe=L(function(){return S(j.values,de)}),fe=L(function(){return N({type:"SUBMIT_ATTEMPT"}),Y().then(function(e){if(0===Object.keys(e).length){var t=pe();if(void 0===t)return;return Promise.resolve(t).then(function(){P.current&&N({type:"SUBMIT_SUCCESS"})}).catch(function(e){if(P.current)throw N({type:"SUBMIT_FAILURE"}),e})}P.current&&N({type:"SUBMIT_FAILURE"})})}),ve=L(function(e){e&&e.preventDefault&&h(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&h(e.stopPropagation)&&e.stopPropagation(),fe()}),he=L(function(e){if(e&&e.preventDefault&&h(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&h(e.stopPropagation)&&e.stopPropagation(),O.onReset){var t=O.onReset(j.values,de);T(t)?t.then(z):z()}else z()}),me=t.useCallback(function(e){return{value:b(j.values,e),error:b(j.errors,e),touched:!!b(j.touched,e),initialValue:b(R.current,e),initialTouched:!!b(_.current,e),initialError:b(C.current,e)}},[j.errors,j.touched,j.values]),ye=t.useCallback(function(e){var t=m(e),r=t?e.name:e,n=b(j.values,r),i={name:r,value:n,onChange:ie,onBlur:ue};if(t){var a=e.type,o=e.value,u=e.as,s=e.multiple;"checkbox"===a?void 0===o?i.checked=!!n:(i.checked=!(!Array.isArray(n)||!~n.indexOf(o)),i.value=o):"radio"===a?(i.checked=n===o,i.value=o):"select"===u&&s&&(i.value=i.value||[],i.multiple=!0)}return i},[ue,ie,j.values]),Ee=t.useMemo(function(){return!r(R.current,j.values)},[j.values]),Se=t.useMemo(function(){return void 0!==p?Ee?j.errors&&0===Object.keys(j.errors).length:!1!==p&&h(p)?p(O):p:j.errors&&0===Object.keys(j.errors).length},[p,Ee,j.errors,O]);return d({},j,{initialValues:R.current,initialErrors:C.current,initialTouched:_.current,initialStatus:I.current,handleBlur:ue,handleChange:ie,handleReset:he,handleSubmit:ve,resetForm:z,setErrors:$,setFormikState:se,setFieldTouched:ae,setFieldValue:re,setFieldError:te,setStatus:le,setSubmitting:ce,setTouched:Z,setValues:ee,submitForm:fe,validateForm:Y,validateField:J,isValid:Se,dirty:Ee,unregisterField:X,registerField:Q,getFieldProps:ye,getFieldMeta:me,validateOnBlur:u,validateOnChange:a,validateOnMount:c})}function P(e){var r=I(e),n=e.component,i=e.children,a=e.render;return t.useEffect(function(){},[]),t.createElement(R,{value:r},n?t.createElement(n,r):a?a(r):i?h(i)?i(r):S(i)?null:t.Children.only(i):null)}function U(e){var t={};if(e.inner){if(0===e.inner.length)return g(t,e.path,e.message);var r=e.inner,n=Array.isArray(r),i=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}var o=a;b(t,o.path)||(t=g(t,o.path,o.message))}}return t}function V(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n={});var i=M(e);return t[r?"validateSync":"validate"](i,{abortEarly:!1,context:n})}function M(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=String(r);t[n]=!0===Array.isArray(e[n])?e[n].map(function(e){return!0===Array.isArray(e)||i(e)?M(e):""!==e?e:void 0}):i(e[n])?M(e[n]):""!==e[n]?e[n]:void 0}return t}function D(e,t,r){var i=e.slice();return t.forEach(function(t,a){if(void 0===i[a]){var o=!1!==r.clone&&r.isMergeableObject(t);i[a]=o?n(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?i[a]=n(e[a],t,r):-1===e.indexOf(t)&&i.push(t)}),i}var w="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function L(e){var r=t.useRef(e);return w(function(){r.current=e}),t.useCallback(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.current.apply(void 0,t)},[])}var j=t.forwardRef(function(e,r){var n=e.action,i=f(e,["action"]),a=n||"#",o=_();return t.createElement("form",Object.assign({onSubmit:o.handleSubmit,ref:r,onReset:o.handleReset,action:a},i))});function N(e){var r=function(r){return t.createElement(C,null,function(n){return n||u(!1),t.createElement(e,Object.assign({},r,{formik:n}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return r.WrappedComponent=e,r.displayName="FormikConnect("+n+")",l(r,e)}j.displayName="Form";var B=function(e,t,r){var n=H(e),i=n[t];return n.splice(t,1),n.splice(r,0,i),n},q=function(e,t,r){var n=H(e),i=n[t];return n[t]=n[r],n[r]=i,n},G=function(e,t,r){var n=H(e);return n.splice(t,0,r),n},W=function(e,t,r){var n=H(e);return n[t]=r,n},H=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map(function(e){return parseInt(e)}).reduce(function(e,t){return t>e?t:e},0);return Array.from(d({},e,{length:t+1}))}return[]},K=function(e){function r(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var i=r.props,a=i.name,o=i.validateOnChange,u=i.formik,s=u.validateForm;(0,u.setFormikState)(function(r){var i="function"==typeof n?n:e,o="function"==typeof t?t:e;return d({},r,{values:g(r.values,a,e(b(r.values,a))),errors:n?g(r.errors,a,i(b(r.errors,a))):r.errors,touched:t?g(r.touched,a,o(b(r.touched,a))):r.touched})},function(){o&&s()})},r.push=function(e){return r.updateArrayField(function(t){return[].concat(H(t),[c(e)])},!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField(function(r){return q(r,e,t)},!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField(function(r){return B(r,e,t)},!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField(function(r){return G(r,e,t)},function(t){return G(t,e,null)},function(t){return G(t,e,null)})},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField(function(r){return W(r,e,t)},!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField(function(r){var n=r?[e].concat(r):[e];return t<0&&(t=n.length),n},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r}),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(v(r)),r.pop=r.pop.bind(v(r)),r}p(r,e);var n=r.prototype;return n.remove=function(e){var t;return this.updateArrayField(function(r){var n=r?H(r):[];return t||(t=n[e]),h(n.splice)&&n.splice(e,1),n},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r},!0,!0),e},n.render=function(){var e=this.props,r=e.component,n=e.render,i=e.children,a=e.name,o=d({},{push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},{form:f(e.formik,["validate","validationSchema"]),name:a});return r?t.createElement(r,o):n?n(o):i?"function"==typeof i?i(o):S(i)?null:t.Children.only(i):null},r}(t.Component);K.defaultProps={validateOnChange:!0};var Y=N(K),z=N(function(e){function r(){return e.apply(this,arguments)||this}p(r,e);var n=r.prototype;return n.shouldComponentUpdate=function(e){return b(this.props.formik.errors,this.props.name)!==b(e.formik.errors,this.props.name)||b(this.props.formik.touched,this.props.name)!==b(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,r=e.component,n=e.formik,i=e.render,a=e.children,o=e.name,u=f(e,["component","formik","render","children","name"]),s=b(n.touched,o),l=b(n.errors,o);return s&&l?i?h(i)?i(l):null:a?h(a)?a(l):null:r?t.createElement(r,u,l):l:null},r}(t.Component)),J=function(e){function r(t){var r;r=e.call(this,t)||this;var n=t.render,i=t.children,a=t.component,o=t.as;return n&&u(!1),a&&n&&u(!1),o&&i&&h(i)&&u(!1),a&&i&&h(i)&&u(!1),n&&i&&!S(i)&&u(!1),r}p(r,e);var n=r.prototype;return n.shouldComponentUpdate=function(e,t,r){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):b(this.context.values,this.props.name)!==b(r.values,this.props.name)||b(this.context.errors,this.props.name)!==b(r.errors,this.props.name)||b(this.context.touched,this.props.name)!==b(r.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||this.context.isSubmitting!==r.isSubmitting},n.componentDidMount=function(){this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(e){this.props.name!==e.name&&(this.context.unregisterField(e.name),this.context.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.context.unregisterField(this.props.name)},n.render=function(){var e=this.props,r=e.name,n=e.render,i=e.as,a=e.children,o=e.component,u=f(e,["validate","name","render","as","children","component","shouldUpdate"]),s=this.context,l=f(s,["validate","validationSchema"]),c={value:"radio"===u.type||"checkbox"===u.type?u.value:b(s.values,r),name:r,onChange:s.handleChange,onBlur:s.handleBlur},p={field:c,meta:{value:b(s.values,r),error:b(s.errors,r),touched:!!b(s.touched,r),initialValue:b(s.initialValues,r),initialTouched:!!b(s.initialTouched,r),initialError:b(s.initialErrors,r)},form:l};if(n)return n(p);if(h(a))return a(p);if(o){if("string"==typeof o){var v=u.innerRef,m=f(u,["innerRef"]);return t.createElement(o,d({ref:v},c,m),a)}return t.createElement(o,d({field:c,form:s},u),a)}var y=i||"input";if("string"==typeof y){var E=u.innerRef,S=f(u,["innerRef"]);return t.createElement(y,d({ref:E},c,S),a)}return t.createElement(y,d({},c,u),a)},r}(t.Component);J.contextType=O,exports.ErrorMessage=z,exports.FastField=J,exports.Field=function(e){var r=e.validate,n=e.name,i=e.render,a=e.children,o=e.as,u=e.component,s=f(e,["validate","name","render","children","as","component"]),l=f(_(),["validate","validationSchema"]);t.useEffect(function(){},[]);var c=l.registerField,p=l.unregisterField;t.useEffect(function(){return c(n,{validate:r}),function(){p(n)}},[c,p,n,r]);var v=l.getFieldProps(d({name:n},s)),m=l.getFieldMeta(n),y={field:v,form:l};if(i)return i(d({},y,{meta:m}));if(h(a))return a(d({},y,{meta:m}));if(u){if("string"==typeof u){var E=s.innerRef,S=f(s,["innerRef"]);return t.createElement(u,d({ref:E},v,S),a)}return t.createElement(u,d({field:v,form:l},s),a)}var T=o||"input";if("string"==typeof T){var b=s.innerRef,g=f(s,["innerRef"]);return t.createElement(T,d({ref:b},v,g),a)}return t.createElement(T,d({},v,s),a)},exports.FieldArray=Y,exports.Form=j,exports.Formik=P,exports.FormikConsumer=C,exports.FormikContext=O,exports.FormikProvider=R,exports.connect=N,exports.getActiveElement=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}},exports.getIn=b,exports.insert=G,exports.isEmptyChildren=S,exports.isFunction=h,exports.isInputEvent=function(e){return e&&m(e)&&m(e.target)},exports.isInteger=y,exports.isNaN=function(e){return e!=e},exports.isObject=m,exports.isPromise=T,exports.isString=E,exports.move=B,exports.prepareDataForValidation=M,exports.replace=W,exports.setIn=g,exports.setNestedObjectValues=F,exports.swap=q,exports.useField=function(e){var r=_(),n=r.getFieldProps,i=r.getFieldMeta,a=r.registerField,o=r.unregisterField,s=m(e),l=s?e.name:e,c=s?e.validate:void 0;return t.useEffect(function(){return l&&a(l,{validate:c}),function(){l&&o(l)}},[a,o,l,c]),m(e)?(e.name||u(!1),[n(e),i(e.name)]):[n({name:e}),i(e)]},exports.useFormik=I,exports.useFormikContext=_,exports.validateYupSchema=V,exports.withFormik=function(e){var r=e.mapPropsToValues,n=void 0===r?function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&"function"!=typeof e[r]&&(t[r]=e[r]);return t}:r,i=f(e,["mapPropsToValues"]);return function(e){var r=e.displayName||e.name||e.constructor&&e.constructor.name||"Component",a=function(r){function a(){var n;return(n=r.apply(this,arguments)||this).validate=function(e){return i.validate(e,n.props)},n.validationSchema=function(){return h(i.validationSchema)?i.validationSchema(n.props):i.validationSchema},n.handleSubmit=function(e,t){return i.handleSubmit(e,d({},t,{props:n.props}))},n.renderFormComponent=function(r){return t.createElement(e,Object.assign({},n.props,r))},n}return p(a,r),a.prototype.render=function(){var e=f(this.props,["children"]);return t.createElement(P,Object.assign({},e,i,{validate:i.validate&&this.validate,validationSchema:i.validationSchema&&this.validationSchema,initialValues:n(this.props),initialStatus:i.mapPropsToStatus&&i.mapPropsToStatus(this.props),initialErrors:i.mapPropsToErrors&&i.mapPropsToErrors(this.props),initialTouched:i.mapPropsToTouched&&i.mapPropsToTouched(this.props),onSubmit:this.handleSubmit,children:this.renderFormComponent}))},a}(t.Component);return a.displayName="WithFormik("+r+")",l(a,e)}},exports.yupToFormErrors=U;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var r=require("react"),t=e(require("react-fast-compare")),n=e(require("deepmerge")),i=e(require("lodash/isPlainObject")),a=e(require("lodash/clone")),o=e(require("lodash/toPath")),u=e(require("tiny-warning")),s=require("scheduler"),l=e(require("hoist-non-react-statics")),c=e(require("lodash/cloneDeep"));function p(){return(p=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function d(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}function f(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(t=a[n])>=0||(i[t]=e[t]);return i}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var h=function(e){return Array.isArray(e)&&0===e.length},m=function(e){return"function"==typeof e},y=function(e){return null!==e&&"object"==typeof e},E=function(e){return String(Math.floor(Number(e)))===e},S=function(e){return"[object String]"===Object.prototype.toString.call(e)},T=function(e){return 0===r.Children.count(e)},g=function(e){return y(e)&&m(e.then)};function b(e,r,t,n){void 0===n&&(n=0);for(var i=o(r);e&&n<i.length;)e=e[i[n++]];return void 0===e?t:e}function F(e,r,t){for(var n=a(e),i=n,u=0,s=o(r);u<s.length-1;u++){var l=s[u],c=b(e,s.slice(0,u+1));if(c&&(y(c)||Array.isArray(c)))i=i[l]=a(c);else{var p=s[u+1];i=i[l]=E(p)&&Number(p)>=0?[]:{}}}return(0===u?e:i)[s[u]]===t?e:(void 0===t||h(t)?delete i[s[u]]:i[s[u]]=t,(0===u&&void 0===t||h(t))&&delete n[s[u]],n)}function k(e,r,t,n){void 0===t&&(t=new WeakMap),void 0===n&&(n={});for(var i=0,a=Object.keys(e);i<a.length;i++){var o=a[i],u=e[o];y(u)?t.get(u)||(t.set(u,!0),n[o]=Array.isArray(u)?[]:{},k(u,r,t,n[o])):n[o]=r}return n}var O=r.createContext(void 0),R=O.Provider,C=O.Consumer;function _(){var e=r.useContext(O);return e||u(!1),e}function A(e,r){switch(r.type){case"SET_VALUES":return p({},e,{values:r.payload});case"SET_TOUCHED":return p({},e,{touched:r.payload});case"SET_ERRORS":return t(e.errors,r.payload)?e:p({},e,{errors:r.payload});case"SET_STATUS":return p({},e,{status:r.payload});case"SET_ISSUBMITTING":return p({},e,{isSubmitting:r.payload});case"SET_ISVALIDATING":return p({},e,{isValidating:r.payload});case"SET_FIELD_VALUE":return p({},e,{values:F(e.values,r.payload.field,r.payload.value)});case"SET_FIELD_TOUCHED":return p({},e,{touched:F(e.touched,r.payload.field,r.payload.value)});case"SET_FIELD_ERROR":return p({},e,{errors:F(e.errors,r.payload.field,r.payload.value)});case"RESET_FORM":return p({},e,r.payload);case"SET_FORMIK_STATE":return r.payload(e);case"SUBMIT_ATTEMPT":return p({},e,{touched:k(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return p({},e,{isSubmitting:!1});default:return e}}var I={},P={};function x(e){var i=e.validateOnChange,a=void 0===i||i,o=e.validateOnBlur,u=void 0===o||o,l=e.validateOnMount,c=void 0!==l&&l,d=e.isInitialValid,v=e.enableReinitialize,h=void 0!==v&&v,E=e.onSubmit,T=f(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),k=p({validateOnChange:a,validateOnBlur:u,validateOnMount:c,onSubmit:E},T),O=r.useRef(k.initialValues),R=r.useRef(k.initialErrors||I),C=r.useRef(k.initialTouched||P),_=r.useRef(k.initialStatus),x=r.useRef(!1),U=r.useRef({});r.useEffect(function(){},[]),r.useEffect(function(){return x.current=!0,function(){x.current=!1}},[]);var D=r.useReducer(A,{values:k.initialValues,errors:k.initialErrors||I,touched:k.initialTouched||P,status:k.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),L=D[0],N=D[1],B=r.useCallback(function(e,r){return new Promise(function(t,n){var i=k.validate(e,r);null==i?t(I):g(i)?i.then(function(e){t(e||I)},function(e){n(e)}):t(i)})},[k.validate]),q=r.useCallback(function(e,r){var t=k.validationSchema,n=m(t)?t(r):t,i=r&&n.validateAt?n.validateAt(r,e):M(e,n);return new Promise(function(e,r){i.then(function(){e(I)},function(t){"ValidationError"===t.name?e(V(t)):r(t)})})},[k.validationSchema]),G=r.useCallback(function(e,r){return new Promise(function(t){return t(U.current[e].validate(r))})},[]),W=r.useCallback(function(e){var r=Object.keys(U.current).filter(function(e){return m(U.current[e].validate)}),t=r.length>0?r.map(function(r){return G(r,b(e,r))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(t).then(function(e){return e.reduce(function(e,t,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===t?e:(t&&(e=F(e,r[n],t)),e)},{})})},[G]),H=r.useCallback(function(e){return Promise.all([W(e),k.validationSchema?q(e):{},k.validate?B(e):{}]).then(function(e){return n.all([e[0],e[1],e[2]],{arrayMerge:w})})},[k.validate,k.validationSchema,W,B,q]),K=j(function(e){return void 0===e&&(e=L.values),s.unstable_runWithPriority(s.LowPriority,function(){return H(e).then(function(e){return x.current&&N({type:"SET_ERRORS",payload:e}),e})})}),Y=j(function(e){return void 0===e&&(e=L.values),N({type:"SET_ISVALIDATING",payload:!0}),H(e).then(function(e){return x.current&&(N({type:"SET_ISVALIDATING",payload:!1}),t(L.errors,e)||N({type:"SET_ERRORS",payload:e})),e})});r.useEffect(function(){c&&!0===x.current&&K(k.initialValues)},[k.initialValues,c,K]);var z=r.useCallback(function(e){var r=e&&e.values?e.values:O.current,t=e&&e.errors?e.errors:R.current?R.current:k.initialErrors||{},n=e&&e.touched?e.touched:C.current?C.current:k.initialTouched||{},i=e&&e.status?e.status:_.current?_.current:k.initialStatus;O.current=r,R.current=t,C.current=n,_.current=i,N({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:t,touched:n,status:i,values:r,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})},[k.initialErrors,k.initialStatus,k.initialTouched]);r.useEffect(function(){h&&!0===x.current&&!t(O.current,k.initialValues)&&(O.current=k.initialValues,z())},[h,k.initialValues,z]),r.useEffect(function(){h&&!0===x.current&&!t(R.current,k.initialErrors)&&(R.current=k.initialErrors||I,N({type:"SET_ERRORS",payload:k.initialErrors||I}))},[h,k.initialErrors]),r.useEffect(function(){h&&!0===x.current&&!t(C.current,k.initialTouched)&&(C.current=k.initialTouched||P,N({type:"SET_TOUCHED",payload:k.initialTouched||P}))},[h,k.initialTouched]),r.useEffect(function(){h&&!0===x.current&&!t(_.current,k.initialStatus)&&(_.current=k.initialStatus,N({type:"SET_STATUS",payload:k.initialStatus}))},[h,k.initialStatus,k.initialTouched]);var J=j(function(e){if(m(U.current[e].validate)){var r=b(L.values,e),t=U.current[e].validate(r);return g(t)?(N({type:"SET_ISVALIDATING",payload:!0}),t.then(function(e){return e}).then(function(r){N({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),N({type:"SET_ISVALIDATING",payload:!1})})):(N({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),Promise.resolve(t))}return Promise.resolve()}),Q=r.useCallback(function(e,r){U.current[e]={validate:r.validate}},[]),X=r.useCallback(function(e){delete U.current[e]},[]),Z=j(function(e){return N({type:"SET_TOUCHED",payload:e}),u?K(L.values):Promise.resolve()}),$=r.useCallback(function(e){N({type:"SET_ERRORS",payload:e})},[]),ee=j(function(e){return N({type:"SET_VALUES",payload:e}),a?K(e):Promise.resolve()}),re=r.useCallback(function(e,r){N({type:"SET_FIELD_ERROR",payload:{field:e,value:r}})},[]),te=j(function(e,r,t){return void 0===t&&(t=!0),N({type:"SET_FIELD_VALUE",payload:{field:e,value:r}}),a&&t?K(F(L.values,e,r)):Promise.resolve()}),ne=r.useCallback(function(e,r){var t,n=r,i=e;if(!S(e)){e.persist&&e.persist();var a=e.target?e.target:e.currentTarget,o=a.type,u=a.value,s=a.checked,l=a.options,c=a.multiple;n=r||a.name||a.id,i=/number|range/.test(o)?(t=parseFloat(u),isNaN(t)?"":t):/checkbox/.test(o)?function(e,r,t){if("true"==t||"false"==t)return!!r;if(r&&t)return Array.isArray(e)?e.concat(t):[t];if(!Array.isArray(e))return!e;var n=e.indexOf(t);return n<0?e:e.slice(0,n).concat(e.slice(n+1))}(b(L.values,n),s,u):c?function(e){return Array.from(e).filter(function(e){return e.selected}).map(function(e){return e.value})}(l):u}n&&te(n,i)},[te,L.values]),ie=r.useCallback(function(e){if(S(e))return function(r){return ne(r,e)};ne(e)},[ne]),ae=j(function(e,r,t){return void 0===r&&(r=!0),void 0===t&&(t=!0),N({type:"SET_FIELD_TOUCHED",payload:{field:e,value:r}}),u&&t?K(L.values):Promise.resolve()}),oe=r.useCallback(function(e,r){e.persist&&e.persist();var t=e.target;ae(r||t.name||t.id,!0)},[ae]),ue=r.useCallback(function(e){if(S(e))return function(r){return oe(r,e)};oe(e)},[oe]),se=r.useCallback(function(e){m(e)?N({type:"SET_FORMIK_STATE",payload:e}):N({type:"SET_FORMIK_STATE",payload:function(){return e}})},[]),le=r.useCallback(function(e){N({type:"SET_STATUS",payload:e})},[]),ce=r.useCallback(function(e){N({type:"SET_ISSUBMITTING",payload:e})},[]),pe={resetForm:z,validateForm:Y,validateField:J,setErrors:$,setFieldError:re,setFieldTouched:ae,setFieldValue:te,setStatus:le,setSubmitting:ce,setTouched:Z,setValues:ee,setFormikState:se},de=j(function(){return E(L.values,pe)}),fe=j(function(){return N({type:"SUBMIT_ATTEMPT"}),Y().then(function(e){if(0===Object.keys(e).length){var r=de();if(void 0===r)return;return Promise.resolve(r).then(function(){x.current&&N({type:"SUBMIT_SUCCESS"})}).catch(function(e){if(x.current)throw N({type:"SUBMIT_FAILURE"}),e})}if(x.current)throw N({type:"SUBMIT_FAILURE"}),e})}),ve=j(function(e){e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),fe()}),he=j(function(e){if(e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),k.onReset){var r=k.onReset(L.values,pe);g(r)?r.then(z):z()}else z()}),me=r.useCallback(function(e){return{value:b(L.values,e),error:b(L.errors,e),touched:!!b(L.touched,e),initialValue:b(O.current,e),initialTouched:!!b(C.current,e),initialError:b(R.current,e)}},[L.errors,L.touched,L.values]),ye=r.useCallback(function(e){var r=y(e),t=r?e.name:e,n=b(L.values,t),i={name:t,value:n,onChange:ie,onBlur:ue};if(r){var a=e.type,o=e.value,u=e.as,s=e.multiple;"checkbox"===a?void 0===o?i.checked=!!n:(i.checked=!(!Array.isArray(n)||!~n.indexOf(o)),i.value=o):"radio"===a?(i.checked=n===o,i.value=o):"select"===u&&s&&(i.value=i.value||[],i.multiple=!0)}return i},[ue,ie,L.values]),Ee=r.useMemo(function(){return!t(O.current,L.values)},[O.current,L.values]),Se=r.useMemo(function(){return void 0!==d?Ee?L.errors&&0===Object.keys(L.errors).length:!1!==d&&m(d)?d(k):d:L.errors&&0===Object.keys(L.errors).length},[d,Ee,L.errors,k]);return p({},L,{initialValues:O.current,initialErrors:R.current,initialTouched:C.current,initialStatus:_.current,handleBlur:ue,handleChange:ie,handleReset:he,handleSubmit:ve,resetForm:z,setErrors:$,setFormikState:se,setFieldTouched:ae,setFieldValue:te,setFieldError:re,setStatus:le,setSubmitting:ce,setTouched:Z,setValues:ee,submitForm:fe,validateForm:Y,validateField:J,isValid:Se,dirty:Ee,unregisterField:X,registerField:Q,getFieldProps:ye,getFieldMeta:me,validateOnBlur:u,validateOnChange:a,validateOnMount:c})}function U(e){var t=x(e),n=e.component,i=e.children,a=e.render;return r.useEffect(function(){},[]),r.createElement(R,{value:t},n?r.createElement(n,t):a?a(t):i?m(i)?i(t):T(i)?null:r.Children.only(i):null)}function V(e){var r={};if(e.inner){if(0===e.inner.length)return F(r,e.path,e.message);var t=e.inner,n=Array.isArray(t),i=0;for(t=n?t:t[Symbol.iterator]();;){var a;if(n){if(i>=t.length)break;a=t[i++]}else{if((i=t.next()).done)break;a=i.value}var o=a;b(r,o.path)||(r=F(r,o.path,o.message))}}return r}function M(e,r,t,n){void 0===t&&(t=!1),void 0===n&&(n={});var i=D(e);return r[t?"validateSync":"validate"](i,{abortEarly:!1,context:n})}function D(e){var r={};for(var t in e)if(e.hasOwnProperty(t)){var n=String(t);r[n]=!0===Array.isArray(e[n])?e[n].map(function(e){return!0===Array.isArray(e)||i(e)?D(e):""!==e?e:void 0}):i(e[n])?D(e[n]):""!==e[n]?e[n]:void 0}return r}function w(e,r,t){var i=e.slice();return r.forEach(function(r,a){if(void 0===i[a]){var o=!1!==t.clone&&t.isMergeableObject(r);i[a]=o?n(Array.isArray(r)?[]:{},r,t):r}else t.isMergeableObject(r)?i[a]=n(e[a],r,t):-1===e.indexOf(r)&&i.push(r)}),i}var L="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect;function j(e){var t=r.useRef(e);return L(function(){t.current=e}),r.useCallback(function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.current.apply(void 0,r)},[])}var N=r.forwardRef(function(e,t){var n=e.action,i=f(e,["action"]),a=n||"#",o=_();return r.createElement("form",Object.assign({onSubmit:o.handleSubmit,ref:t,onReset:o.handleReset,action:a},i))});function B(e){var t=function(t){return r.createElement(C,null,function(n){return n||u(!1),r.createElement(e,Object.assign({},t,{formik:n}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t.WrappedComponent=e,t.displayName="FormikConnect("+n+")",l(t,e)}N.displayName="Form";var q=function(e,r,t){var n=K(e),i=n[r];return n.splice(r,1),n.splice(t,0,i),n},G=function(e,r,t){var n=K(e),i=n[r];return n[r]=n[t],n[t]=i,n},W=function(e,r,t){var n=K(e);return n.splice(r,0,t),n},H=function(e,r,t){var n=K(e);return n[r]=t,n},K=function(e){if(e){if(Array.isArray(e))return[].concat(e);var r=Object.keys(e).map(function(e){return parseInt(e)}).reduce(function(e,r){return r>e?r:e},0);return Array.from(p({},e,{length:r+1}))}return[]},Y=function(e){function t(r){var t;return(t=e.call(this,r)||this).updateArrayField=function(e,r,n){var i=t.props,a=i.name,o=i.validateOnChange,u=i.formik,s=u.validateForm;(0,u.setFormikState)(function(t){var i="function"==typeof n?n:e,o="function"==typeof r?r:e;return p({},t,{values:F(t.values,a,e(b(t.values,a))),errors:n?F(t.errors,a,i(b(t.errors,a))):t.errors,touched:r?F(t.touched,a,o(b(t.touched,a))):t.touched})},function(){o&&s()})},t.push=function(e){return t.updateArrayField(function(r){return[].concat(K(r),[c(e)])},!1,!1)},t.handlePush=function(e){return function(){return t.push(e)}},t.swap=function(e,r){return t.updateArrayField(function(t){return G(t,e,r)},!0,!0)},t.handleSwap=function(e,r){return function(){return t.swap(e,r)}},t.move=function(e,r){return t.updateArrayField(function(t){return q(t,e,r)},!0,!0)},t.handleMove=function(e,r){return function(){return t.move(e,r)}},t.insert=function(e,r){return t.updateArrayField(function(t){return W(t,e,r)},function(r){return W(r,e,null)},function(r){return W(r,e,null)})},t.handleInsert=function(e,r){return function(){return t.insert(e,r)}},t.replace=function(e,r){return t.updateArrayField(function(t){return H(t,e,r)},!1,!1)},t.handleReplace=function(e,r){return function(){return t.replace(e,r)}},t.unshift=function(e){var r=-1;return t.updateArrayField(function(t){var n=t?[e].concat(t):[e];return r<0&&(r=n.length),n},function(e){var t=e?[null].concat(e):[null];return r<0&&(r=t.length),t},function(e){var t=e?[null].concat(e):[null];return r<0&&(r=t.length),t}),r},t.handleUnshift=function(e){return function(){return t.unshift(e)}},t.handleRemove=function(e){return function(){return t.remove(e)}},t.handlePop=function(){return function(){return t.pop()}},t.remove=t.remove.bind(v(t)),t.pop=t.pop.bind(v(t)),t}d(t,e);var n=t.prototype;return n.remove=function(e){var r;return this.updateArrayField(function(t){var n=t?K(t):[];return r||(r=n[e]),m(n.splice)&&n.splice(e,1),n},!0,!0),r},n.pop=function(){var e;return this.updateArrayField(function(r){var t=r;return e||(e=t&&t.pop&&t.pop()),t},!0,!0),e},n.render=function(){var e=this.props,t=e.component,n=e.render,i=e.children,a=e.name,o=p({},{push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},{form:f(e.formik,["validate","validationSchema"]),name:a});return t?r.createElement(t,o):n?n(o):i?"function"==typeof i?i(o):T(i)?null:r.Children.only(i):null},t}(r.Component);Y.defaultProps={validateOnChange:!0};var z=B(Y),J=B(function(e){function t(){return e.apply(this,arguments)||this}d(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return b(this.props.formik.errors,this.props.name)!==b(e.formik.errors,this.props.name)||b(this.props.formik.touched,this.props.name)!==b(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,t=e.component,n=e.formik,i=e.render,a=e.children,o=e.name,u=f(e,["component","formik","render","children","name"]),s=b(n.touched,o),l=b(n.errors,o);return s&&l?i?m(i)?i(l):null:a?m(a)?a(l):null:t?r.createElement(t,u,l):l:null},t}(r.Component)),Q=B(function(e){function t(r){var t;t=e.call(this,r)||this;var n=r.render,i=r.children,a=r.component,o=r.as;return n&&u(!1),a&&n&&u(!1),o&&i&&m(i)&&u(!1),a&&i&&m(i)&&u(!1),n&&i&&!T(i)&&u(!1),t}d(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):e.name!==this.props.name||b(e.formik.values,this.props.name)!==b(this.props.formik.values,this.props.name)||b(e.formik.errors,this.props.name)!==b(this.props.formik.errors,this.props.name)||b(e.formik.touched,this.props.name)!==b(this.props.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||e.formik.isSubmitting!==this.props.formik.isSubmitting},n.componentDidMount=function(){this.props.formik.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(e){this.props.name!==e.name&&(this.props.formik.unregisterField(e.name),this.props.formik.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.props.formik.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.props.formik.unregisterField(this.props.name)},n.render=function(){var e=this.props,t=e.name,n=e.render,i=e.as,a=e.children,o=e.component,u=e.formik,s=f(e,["validate","name","render","as","children","component","shouldUpdate","formik"]),l=f(u,["validate","validationSchema"]),c={value:"radio"===s.type||"checkbox"===s.type?s.value:b(u.values,t),name:t,onChange:u.handleChange,onBlur:u.handleBlur},d={field:c,meta:{value:b(u.values,t),error:b(u.errors,t),touched:!!b(u.touched,t),initialValue:b(u.initialValues,t),initialTouched:!!b(u.initialTouched,t),initialError:b(u.initialErrors,t)},form:l};if(n)return n(d);if(m(a))return a(d);if(o){if("string"==typeof o){var v=s.innerRef,h=f(s,["innerRef"]);return r.createElement(o,p({ref:v},c,h),a)}return r.createElement(o,p({field:c,form:u},s),a)}var y=i||"input";if("string"==typeof y){var E=s.innerRef,S=f(s,["innerRef"]);return r.createElement(y,p({ref:E},c,S),a)}return r.createElement(y,p({},c,s),a)},t}(r.Component));exports.ErrorMessage=J,exports.FastField=Q,exports.Field=function(e){var t=e.validate,n=e.name,i=e.render,a=e.children,o=e.as,u=e.component,s=f(e,["validate","name","render","children","as","component"]),l=f(_(),["validate","validationSchema"]);r.useEffect(function(){},[]);var c=l.registerField,d=l.unregisterField;r.useEffect(function(){return c(n,{validate:t}),function(){d(n)}},[c,d,n,t]);var v=l.getFieldProps(p({name:n},s)),h=l.getFieldMeta(n),y={field:v,form:l};if(i)return i(p({},y,{meta:h}));if(m(a))return a(p({},y,{meta:h}));if(u){if("string"==typeof u){var E=s.innerRef,S=f(s,["innerRef"]);return r.createElement(u,p({ref:E},v,S),a)}return r.createElement(u,p({field:v,form:l},s),a)}var T=o||"input";if("string"==typeof T){var g=s.innerRef,b=f(s,["innerRef"]);return r.createElement(T,p({ref:g},v,b),a)}return r.createElement(T,p({},v,s),a)},exports.FieldArray=z,exports.Form=N,exports.Formik=U,exports.FormikConsumer=C,exports.FormikContext=O,exports.FormikProvider=R,exports.connect=B,exports.getActiveElement=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(r){return e.body}},exports.getIn=b,exports.insert=W,exports.isEmptyArray=h,exports.isEmptyChildren=T,exports.isFunction=m,exports.isInputEvent=function(e){return e&&y(e)&&y(e.target)},exports.isInteger=E,exports.isNaN=function(e){return e!=e},exports.isObject=y,exports.isPromise=g,exports.isString=S,exports.move=q,exports.prepareDataForValidation=D,exports.replace=H,exports.setIn=F,exports.setNestedObjectValues=k,exports.swap=G,exports.useField=function(e){var t=_(),n=t.getFieldProps,i=t.getFieldMeta,a=t.registerField,o=t.unregisterField,s=y(e),l=s?e.name:e,c=s?e.validate:void 0;return r.useEffect(function(){return l&&a(l,{validate:c}),function(){l&&o(l)}},[a,o,l,c]),y(e)?(e.name||u(!1),[n(e),i(e.name)]):[n({name:e}),i(e)]},exports.useFormik=x,exports.useFormikContext=_,exports.validateYupSchema=M,exports.withFormik=function(e){var t=e.mapPropsToValues,n=void 0===t?function(e){var r={};for(var t in e)e.hasOwnProperty(t)&&"function"!=typeof e[t]&&(r[t]=e[t]);return r}:t,i=f(e,["mapPropsToValues"]);return function(e){var t=e.displayName||e.name||e.constructor&&e.constructor.name||"Component",a=function(t){function a(){var n;return(n=t.apply(this,arguments)||this).validate=function(e){return i.validate(e,n.props)},n.validationSchema=function(){return m(i.validationSchema)?i.validationSchema(n.props):i.validationSchema},n.handleSubmit=function(e,r){return i.handleSubmit(e,p({},r,{props:n.props}))},n.renderFormComponent=function(t){return r.createElement(e,Object.assign({},n.props,t))},n}return d(a,t),a.prototype.render=function(){var e=f(this.props,["children"]);return r.createElement(U,Object.assign({},e,i,{validate:i.validate&&this.validate,validationSchema:i.validationSchema&&this.validationSchema,initialValues:n(this.props),initialStatus:i.mapPropsToStatus&&i.mapPropsToStatus(this.props),initialErrors:i.mapPropsToErrors&&i.mapPropsToErrors(this.props),initialTouched:i.mapPropsToTouched&&i.mapPropsToTouched(this.props),onSubmit:this.handleSubmit,children:this.renderFormComponent}))},a}(r.Component);return a.displayName="WithFormik("+t+")",l(a,e)}},exports.yupToFormErrors=V;
//# sourceMappingURL=formik.cjs.production.min.js.map

@@ -60,2 +60,5 @@ import * as React from 'react';

var isEmptyArray = function isEmptyArray(value) {
return Array.isArray(value) && value.length === 0;
};
var isFunction = function isFunction(obj) {

@@ -133,3 +136,3 @@ return typeof obj === 'function';

if (value === undefined) {
if (value === undefined || isEmptyArray(value)) {
delete resVal[pathArray[i]];

@@ -140,3 +143,3 @@ } else {

if (i === 0 && value === undefined) {
if (i === 0 && value === undefined || isEmptyArray(value)) {
delete res[pathArray[i]];

@@ -198,2 +201,6 @@ }

case 'SET_ERRORS':
if (isEqual(state.errors, msg.payload)) {
return state;
}
return _extends({}, state, {

@@ -597,11 +604,11 @@ errors: msg.payload

var _eventOrTextValue$tar = eventOrTextValue.target,
type = _eventOrTextValue$tar.type,
name = _eventOrTextValue$tar.name,
id = _eventOrTextValue$tar.id,
value = _eventOrTextValue$tar.value,
checked = _eventOrTextValue$tar.checked,
outerHTML = _eventOrTextValue$tar.outerHTML,
options = _eventOrTextValue$tar.options,
multiple = _eventOrTextValue$tar.multiple;
var target = eventOrTextValue.target ? eventOrTextValue.target : eventOrTextValue.currentTarget;
var type = target.type,
name = target.name,
id = target.id,
value = target.value,
checked = target.checked,
outerHTML = target.outerHTML,
options = target.options,
multiple = target.multiple;
field = maybePath ? maybePath : name ? name : id;

@@ -757,3 +764,3 @@

});
return;
throw combinedErrors;
}

@@ -851,3 +858,3 @@

return !isEqual(initialValues.current, state.values);
}, [state.values]);
}, [initialValues.current, state.values]);
var isValid = useMemo(function () {

@@ -1594,8 +1601,8 @@ return typeof isInitialValid !== 'undefined' ? dirty ? state.errors && Object.keys(state.errors).length === 0 : isInitialValid !== false && isFunction(isInitialValid) ? isInitialValid(props) : isInitialValid : state.errors && Object.keys(state.errors).length === 0;

var FastField =
var FastFieldInner =
/*#__PURE__*/
function (_React$Component) {
_inheritsLoose(FastField, _React$Component);
_inheritsLoose(FastFieldInner, _React$Component);
function FastField(props) {
function FastFieldInner(props) {
var _this;

@@ -1617,8 +1624,8 @@

var _proto = FastField.prototype;
var _proto = FastFieldInner.prototype;
_proto.shouldComponentUpdate = function shouldComponentUpdate(props, _state, context) {
_proto.shouldComponentUpdate = function shouldComponentUpdate(props) {
if (this.props.shouldUpdate) {
return this.props.shouldUpdate(props, this.props);
} else if (getIn(this.context.values, this.props.name) !== getIn(context.values, this.props.name) || getIn(this.context.errors, this.props.name) !== getIn(context.errors, this.props.name) || getIn(this.context.touched, this.props.name) !== getIn(context.touched, this.props.name) || Object.keys(this.props).length !== Object.keys(props).length || this.context.isSubmitting !== context.isSubmitting) {
} else if (props.name !== this.props.name || getIn(props.formik.values, this.props.name) !== getIn(this.props.formik.values, this.props.name) || getIn(props.formik.errors, this.props.name) !== getIn(this.props.formik.errors, this.props.name) || getIn(props.formik.touched, this.props.name) !== getIn(this.props.formik.touched, this.props.name) || Object.keys(this.props).length !== Object.keys(props).length || props.formik.isSubmitting !== this.props.formik.isSubmitting) {
return true;

@@ -1631,3 +1638,3 @@ } else {

_proto.componentDidMount = function componentDidMount() {
this.context.registerField(this.props.name, {
this.props.formik.registerField(this.props.name, {
validate: this.props.validate

@@ -1639,4 +1646,4 @@ });

if (this.props.name !== prevProps.name) {
this.context.unregisterField(prevProps.name);
this.context.registerField(this.props.name, {
this.props.formik.unregisterField(prevProps.name);
this.props.formik.registerField(this.props.name, {
validate: this.props.validate

@@ -1647,3 +1654,3 @@ });

if (this.props.validate !== prevProps.validate) {
this.context.registerField(this.props.name, {
this.props.formik.registerField(this.props.name, {
validate: this.props.validate

@@ -1655,3 +1662,3 @@ });

_proto.componentWillUnmount = function componentWillUnmount() {
this.context.unregisterField(this.props.name);
this.props.formik.unregisterField(this.props.name);
};

@@ -1668,6 +1675,5 @@

shouldUpdate = _this$props.shouldUpdate,
props = _objectWithoutPropertiesLoose(_this$props, ["validate", "name", "render", "as", "children", "component", "shouldUpdate"]);
formik = _this$props.formik,
props = _objectWithoutPropertiesLoose(_this$props, ["validate", "name", "render", "as", "children", "component", "shouldUpdate", "formik"]);
var formik = this.context;
var _validate = formik.validate,

@@ -1735,7 +1741,10 @@ _validationSchema = formik.validationSchema,

return FastField;
return FastFieldInner;
}(Component);
FastField.contextType = FormikContext;
export { ErrorMessage, FastField, Field, FieldArray, Form, Formik, FormikConsumer, FormikContext, FormikProvider, connect, getActiveElement, getIn, insert, isEmptyChildren, isFunction, isInputEvent, isInteger, isNaN$1 as isNaN, isObject, isPromise, isString, move, prepareDataForValidation, replace, setIn, setNestedObjectValues, swap, useField, useFormik, useFormikContext, validateYupSchema, withFormik, yupToFormErrors };
var FastField =
/*#__PURE__*/
connect(FastFieldInner);
export { ErrorMessage, FastField, Field, FieldArray, Form, Formik, FormikConsumer, FormikContext, FormikProvider, connect, getActiveElement, getIn, insert, isEmptyArray, isEmptyChildren, isFunction, isInputEvent, isInteger, isNaN$1 as isNaN, isObject, isPromise, isString, move, prepareDataForValidation, replace, setIn, setNestedObjectValues, swap, useField, useFormik, useFormikContext, validateYupSchema, withFormik, yupToFormErrors };
//# sourceMappingURL=formik.esm.js.map

@@ -63,2 +63,5 @@ (function (global, factory) {

var isEmptyArray = function isEmptyArray(value) {
return Array.isArray(value) && value.length === 0;
};
var isFunction = function isFunction(obj) {

@@ -136,3 +139,3 @@ return typeof obj === 'function';

if (value === undefined) {
if (value === undefined || isEmptyArray(value)) {
delete resVal[pathArray[i]];

@@ -143,3 +146,3 @@ } else {

if (i === 0 && value === undefined) {
if (i === 0 && value === undefined || isEmptyArray(value)) {
delete res[pathArray[i]];

@@ -201,2 +204,6 @@ }

case 'SET_ERRORS':
if (isEqual(state.errors, msg.payload)) {
return state;
}
return _extends({}, state, {

@@ -600,11 +607,11 @@ errors: msg.payload

var _eventOrTextValue$tar = eventOrTextValue.target,
type = _eventOrTextValue$tar.type,
name = _eventOrTextValue$tar.name,
id = _eventOrTextValue$tar.id,
value = _eventOrTextValue$tar.value,
checked = _eventOrTextValue$tar.checked,
outerHTML = _eventOrTextValue$tar.outerHTML,
options = _eventOrTextValue$tar.options,
multiple = _eventOrTextValue$tar.multiple;
var target = eventOrTextValue.target ? eventOrTextValue.target : eventOrTextValue.currentTarget;
var type = target.type,
name = target.name,
id = target.id,
value = target.value,
checked = target.checked,
outerHTML = target.outerHTML,
options = target.options,
multiple = target.multiple;
field = maybePath ? maybePath : name ? name : id;

@@ -760,3 +767,3 @@

});
return;
throw combinedErrors;
}

@@ -854,3 +861,3 @@

return !isEqual(initialValues.current, state.values);
}, [state.values]);
}, [initialValues.current, state.values]);
var isValid = React.useMemo(function () {

@@ -1597,8 +1604,8 @@ return typeof isInitialValid !== 'undefined' ? dirty ? state.errors && Object.keys(state.errors).length === 0 : isInitialValid !== false && isFunction(isInitialValid) ? isInitialValid(props) : isInitialValid : state.errors && Object.keys(state.errors).length === 0;

var FastField =
var FastFieldInner =
/*#__PURE__*/
function (_React$Component) {
_inheritsLoose(FastField, _React$Component);
_inheritsLoose(FastFieldInner, _React$Component);
function FastField(props) {
function FastFieldInner(props) {
var _this;

@@ -1620,8 +1627,8 @@

var _proto = FastField.prototype;
var _proto = FastFieldInner.prototype;
_proto.shouldComponentUpdate = function shouldComponentUpdate(props, _state, context) {
_proto.shouldComponentUpdate = function shouldComponentUpdate(props) {
if (this.props.shouldUpdate) {
return this.props.shouldUpdate(props, this.props);
} else if (getIn(this.context.values, this.props.name) !== getIn(context.values, this.props.name) || getIn(this.context.errors, this.props.name) !== getIn(context.errors, this.props.name) || getIn(this.context.touched, this.props.name) !== getIn(context.touched, this.props.name) || Object.keys(this.props).length !== Object.keys(props).length || this.context.isSubmitting !== context.isSubmitting) {
} else if (props.name !== this.props.name || getIn(props.formik.values, this.props.name) !== getIn(this.props.formik.values, this.props.name) || getIn(props.formik.errors, this.props.name) !== getIn(this.props.formik.errors, this.props.name) || getIn(props.formik.touched, this.props.name) !== getIn(this.props.formik.touched, this.props.name) || Object.keys(this.props).length !== Object.keys(props).length || props.formik.isSubmitting !== this.props.formik.isSubmitting) {
return true;

@@ -1634,3 +1641,3 @@ } else {

_proto.componentDidMount = function componentDidMount() {
this.context.registerField(this.props.name, {
this.props.formik.registerField(this.props.name, {
validate: this.props.validate

@@ -1642,4 +1649,4 @@ });

if (this.props.name !== prevProps.name) {
this.context.unregisterField(prevProps.name);
this.context.registerField(this.props.name, {
this.props.formik.unregisterField(prevProps.name);
this.props.formik.registerField(this.props.name, {
validate: this.props.validate

@@ -1650,3 +1657,3 @@ });

if (this.props.validate !== prevProps.validate) {
this.context.registerField(this.props.name, {
this.props.formik.registerField(this.props.name, {
validate: this.props.validate

@@ -1658,3 +1665,3 @@ });

_proto.componentWillUnmount = function componentWillUnmount() {
this.context.unregisterField(this.props.name);
this.props.formik.unregisterField(this.props.name);
};

@@ -1671,6 +1678,5 @@

shouldUpdate = _this$props.shouldUpdate,
props = _objectWithoutPropertiesLoose(_this$props, ["validate", "name", "render", "as", "children", "component", "shouldUpdate"]);
formik = _this$props.formik,
props = _objectWithoutPropertiesLoose(_this$props, ["validate", "name", "render", "as", "children", "component", "shouldUpdate", "formik"]);
var formik = this.context;
var _validate = formik.validate,

@@ -1738,6 +1744,9 @@ _validationSchema = formik.validationSchema,

return FastField;
return FastFieldInner;
}(React.Component);
FastField.contextType = FormikContext;
var FastField =
/*#__PURE__*/
connect(FastFieldInner);
exports.ErrorMessage = ErrorMessage;

@@ -1756,2 +1765,3 @@ exports.FastField = FastField;

exports.insert = insert;
exports.isEmptyArray = isEmptyArray;
exports.isEmptyChildren = isEmptyChildren;

@@ -1758,0 +1768,0 @@ exports.isFunction = isFunction;

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-fast-compare"),require("deepmerge"),require("lodash-es/isPlainObject"),require("lodash-es/clone"),require("lodash-es/toPath"),require("tiny-warning"),require("scheduler"),require("hoist-non-react-statics"),require("lodash-es/cloneDeep")):"function"==typeof define&&define.amd?define(["exports","react","react-fast-compare","deepmerge","lodash-es/isPlainObject","lodash-es/clone","lodash-es/toPath","tiny-warning","scheduler","hoist-non-react-statics","lodash-es/cloneDeep"],t):t((e=e||self).formik={},e.React,e.isEqual,e.deepmerge,e.isPlainObject,e.clone,e.toPath,e.invariant,e.scheduler,e.hoistNonReactStatics,e.cloneDeep)}(this,function(e,t,r,n,i,a,o,u,l,s,c){"use strict";function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function f(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function p(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(i[r]=e[r]);return i}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r=r&&r.hasOwnProperty("default")?r.default:r,n=n&&n.hasOwnProperty("default")?n.default:n,i=i&&i.hasOwnProperty("default")?i.default:i,a=a&&a.hasOwnProperty("default")?a.default:a,o=o&&o.hasOwnProperty("default")?o.default:o,u=u&&u.hasOwnProperty("default")?u.default:u,s=s&&s.hasOwnProperty("default")?s.default:s,c=c&&c.hasOwnProperty("default")?c.default:c;var v=function(e){return"function"==typeof e},m=function(e){return null!==e&&"object"==typeof e},y=function(e){return String(Math.floor(Number(e)))===e},E=function(e){return"[object String]"===Object.prototype.toString.call(e)},S=function(e){return 0===t.Children.count(e)},T=function(e){return m(e)&&v(e.then)};function g(e,t,r,n){void 0===n&&(n=0);for(var i=o(t);e&&n<i.length;)e=e[i[n++]];return void 0===e?r:e}function b(e,t,r){for(var n=a(e),i=n,u=0,l=o(t);u<l.length-1;u++){var s=l[u],c=g(e,l.slice(0,u+1));if(c&&(m(c)||Array.isArray(c)))i=i[s]=a(c);else{var d=l[u+1];i=i[s]=y(d)&&Number(d)>=0?[]:{}}}return(0===u?e:i)[l[u]]===r?e:(void 0===r?delete i[l[u]]:i[l[u]]=r,0===u&&void 0===r&&delete n[l[u]],n)}function F(e,t,r,n){void 0===r&&(r=new WeakMap),void 0===n&&(n={});for(var i=0,a=Object.keys(e);i<a.length;i++){var o=a[i],u=e[o];m(u)?r.get(u)||(r.set(u,!0),n[o]=Array.isArray(u)?[]:{},F(u,t,r,n[o])):n[o]=t}return n}var O=t.createContext(void 0),R=O.Provider,C=O.Consumer;function _(){var e=t.useContext(O);return e||u(!1),e}function k(e,t){switch(t.type){case"SET_VALUES":return d({},e,{values:t.payload});case"SET_TOUCHED":return d({},e,{touched:t.payload});case"SET_ERRORS":return d({},e,{errors:t.payload});case"SET_STATUS":return d({},e,{status:t.payload});case"SET_ISSUBMITTING":return d({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return d({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return d({},e,{values:b(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return d({},e,{touched:b(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return d({},e,{errors:b(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return d({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return d({},e,{touched:F(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return d({},e,{isSubmitting:!1});default:return e}}var A={},P={};function I(e){var i=e.validateOnChange,a=void 0===i||i,o=e.validateOnBlur,u=void 0===o||o,s=e.validateOnMount,c=void 0!==s&&s,f=e.isInitialValid,h=e.enableReinitialize,y=void 0!==h&&h,S=e.onSubmit,F=p(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),O=d({validateOnChange:a,validateOnBlur:u,validateOnMount:c,onSubmit:S},F),R=t.useRef(O.initialValues),C=t.useRef(O.initialErrors||A),_=t.useRef(O.initialTouched||P),I=t.useRef(O.initialStatus),w=t.useRef(!1),D=t.useRef({});t.useEffect(function(){},[]),t.useEffect(function(){return w.current=!0,function(){w.current=!1}},[]);var j=t.useReducer(k,{values:O.initialValues,errors:O.initialErrors||A,touched:O.initialTouched||P,status:O.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),x=j[0],N=j[1],B=t.useCallback(function(e,t){return new Promise(function(r,n){var i=O.validate(e,t);null==i?r(A):T(i)?i.then(function(e){r(e||A)},function(e){n(e)}):r(i)})},[O.validate]),q=t.useCallback(function(e,t){var r=O.validationSchema,n=v(r)?r(t):r,i=t&&n.validateAt?n.validateAt(t,e):V(e,n);return new Promise(function(e,t){i.then(function(){e(A)},function(r){"ValidationError"===r.name?e(U(r)):t(r)})})},[O.validationSchema]),G=t.useCallback(function(e,t){return new Promise(function(r){return r(D.current[e].validate(t))})},[]),W=t.useCallback(function(e){var t=Object.keys(D.current).filter(function(e){return v(D.current[e].validate)}),r=t.length>0?t.map(function(t){return G(t,g(e,t))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(r).then(function(e){return e.reduce(function(e,r,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===r?e:(r&&(e=b(e,t[n],r)),e)},{})})},[G]),H=t.useCallback(function(e){return Promise.all([W(e),O.validationSchema?q(e):{},O.validate?B(e):{}]).then(function(e){return n.all([e[0],e[1],e[2]],{arrayMerge:M})})},[O.validate,O.validationSchema,W,B,q]),K=L(function(e){return void 0===e&&(e=x.values),l.unstable_runWithPriority(l.LowPriority,function(){return H(e).then(function(e){return w.current&&N({type:"SET_ERRORS",payload:e}),e})})}),Y=L(function(e){return void 0===e&&(e=x.values),N({type:"SET_ISVALIDATING",payload:!0}),H(e).then(function(e){return w.current&&(N({type:"SET_ISVALIDATING",payload:!1}),r(x.errors,e)||N({type:"SET_ERRORS",payload:e})),e})});t.useEffect(function(){c&&!0===w.current&&K(O.initialValues)},[O.initialValues,c,K]);var z=t.useCallback(function(e){var t=e&&e.values?e.values:R.current,r=e&&e.errors?e.errors:C.current?C.current:O.initialErrors||{},n=e&&e.touched?e.touched:_.current?_.current:O.initialTouched||{},i=e&&e.status?e.status:I.current?I.current:O.initialStatus;R.current=t,C.current=r,_.current=n,I.current=i,N({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:r,touched:n,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})},[O.initialErrors,O.initialStatus,O.initialTouched]);t.useEffect(function(){y&&!0===w.current&&!r(R.current,O.initialValues)&&(R.current=O.initialValues,z())},[y,O.initialValues,z]),t.useEffect(function(){y&&!0===w.current&&!r(C.current,O.initialErrors)&&(C.current=O.initialErrors||A,N({type:"SET_ERRORS",payload:O.initialErrors||A}))},[y,O.initialErrors]),t.useEffect(function(){y&&!0===w.current&&!r(_.current,O.initialTouched)&&(_.current=O.initialTouched||P,N({type:"SET_TOUCHED",payload:O.initialTouched||P}))},[y,O.initialTouched]),t.useEffect(function(){y&&!0===w.current&&!r(I.current,O.initialStatus)&&(I.current=O.initialStatus,N({type:"SET_STATUS",payload:O.initialStatus}))},[y,O.initialStatus,O.initialTouched]);var J=L(function(e){if(v(D.current[e].validate)){var t=g(x.values,e),r=D.current[e].validate(t);return T(r)?(N({type:"SET_ISVALIDATING",payload:!0}),r.then(function(e){return e}).then(function(t){N({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),N({type:"SET_ISVALIDATING",payload:!1})})):(N({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),Promise.resolve(r))}return Promise.resolve()}),Q=t.useCallback(function(e,t){D.current[e]={validate:t.validate}},[]),X=t.useCallback(function(e){delete D.current[e]},[]),Z=L(function(e){return N({type:"SET_TOUCHED",payload:e}),u?K(x.values):Promise.resolve()}),$=t.useCallback(function(e){N({type:"SET_ERRORS",payload:e})},[]),ee=L(function(e){return N({type:"SET_VALUES",payload:e}),a?K(e):Promise.resolve()}),te=t.useCallback(function(e,t){N({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})},[]),re=L(function(e,t,r){return void 0===r&&(r=!0),N({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),a&&r?K(b(x.values,e,t)):Promise.resolve()}),ne=t.useCallback(function(e,t){var r,n=t,i=e;if(!E(e)){e.persist&&e.persist();var a=e.target,o=a.type,u=a.value,l=a.checked,s=a.options,c=a.multiple;n=t||a.name||a.id,i=/number|range/.test(o)?(r=parseFloat(u),isNaN(r)?"":r):/checkbox/.test(o)?function(e,t,r){if("true"==r||"false"==r)return!!t;if(t&&r)return Array.isArray(e)?e.concat(r):[r];if(!Array.isArray(e))return!e;var n=e.indexOf(r);return n<0?e:e.slice(0,n).concat(e.slice(n+1))}(g(x.values,n),l,u):c?function(e){return Array.from(e).filter(function(e){return e.selected}).map(function(e){return e.value})}(s):u}n&&re(n,i)},[re,x.values]),ie=t.useCallback(function(e){if(E(e))return function(t){return ne(t,e)};ne(e)},[ne]),ae=L(function(e,t,r){return void 0===t&&(t=!0),void 0===r&&(r=!0),N({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),u&&r?K(x.values):Promise.resolve()}),oe=t.useCallback(function(e,t){e.persist&&e.persist();var r=e.target;ae(t||r.name||r.id,!0)},[ae]),ue=t.useCallback(function(e){if(E(e))return function(t){return oe(t,e)};oe(e)},[oe]),le=t.useCallback(function(e){v(e)?N({type:"SET_FORMIK_STATE",payload:e}):N({type:"SET_FORMIK_STATE",payload:function(){return e}})},[]),se=t.useCallback(function(e){N({type:"SET_STATUS",payload:e})},[]),ce=t.useCallback(function(e){N({type:"SET_ISSUBMITTING",payload:e})},[]),de={resetForm:z,validateForm:Y,validateField:J,setErrors:$,setFieldError:te,setFieldTouched:ae,setFieldValue:re,setStatus:se,setSubmitting:ce,setTouched:Z,setValues:ee,setFormikState:le},fe=L(function(){return S(x.values,de)}),pe=L(function(){return N({type:"SUBMIT_ATTEMPT"}),Y().then(function(e){if(0===Object.keys(e).length){var t=fe();if(void 0===t)return;return Promise.resolve(t).then(function(){w.current&&N({type:"SUBMIT_SUCCESS"})}).catch(function(e){if(w.current)throw N({type:"SUBMIT_FAILURE"}),e})}w.current&&N({type:"SUBMIT_FAILURE"})})}),he=L(function(e){e&&e.preventDefault&&v(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&v(e.stopPropagation)&&e.stopPropagation(),pe()}),ve=L(function(e){if(e&&e.preventDefault&&v(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&v(e.stopPropagation)&&e.stopPropagation(),O.onReset){var t=O.onReset(x.values,de);T(t)?t.then(z):z()}else z()}),me=t.useCallback(function(e){return{value:g(x.values,e),error:g(x.errors,e),touched:!!g(x.touched,e),initialValue:g(R.current,e),initialTouched:!!g(_.current,e),initialError:g(C.current,e)}},[x.errors,x.touched,x.values]),ye=t.useCallback(function(e){var t=m(e),r=t?e.name:e,n=g(x.values,r),i={name:r,value:n,onChange:ie,onBlur:ue};if(t){var a=e.type,o=e.value,u=e.as,l=e.multiple;"checkbox"===a?void 0===o?i.checked=!!n:(i.checked=!(!Array.isArray(n)||!~n.indexOf(o)),i.value=o):"radio"===a?(i.checked=n===o,i.value=o):"select"===u&&l&&(i.value=i.value||[],i.multiple=!0)}return i},[ue,ie,x.values]),Ee=t.useMemo(function(){return!r(R.current,x.values)},[x.values]),Se=t.useMemo(function(){return void 0!==f?Ee?x.errors&&0===Object.keys(x.errors).length:!1!==f&&v(f)?f(O):f:x.errors&&0===Object.keys(x.errors).length},[f,Ee,x.errors,O]);return d({},x,{initialValues:R.current,initialErrors:C.current,initialTouched:_.current,initialStatus:I.current,handleBlur:ue,handleChange:ie,handleReset:ve,handleSubmit:he,resetForm:z,setErrors:$,setFormikState:le,setFieldTouched:ae,setFieldValue:re,setFieldError:te,setStatus:se,setSubmitting:ce,setTouched:Z,setValues:ee,submitForm:pe,validateForm:Y,validateField:J,isValid:Se,dirty:Ee,unregisterField:X,registerField:Q,getFieldProps:ye,getFieldMeta:me,validateOnBlur:u,validateOnChange:a,validateOnMount:c})}function w(e){var r=I(e),n=e.component,i=e.children,a=e.render;return t.useEffect(function(){},[]),t.createElement(R,{value:r},n?t.createElement(n,r):a?a(r):i?v(i)?i(r):S(i)?null:t.Children.only(i):null)}function U(e){var t={};if(e.inner){if(0===e.inner.length)return b(t,e.path,e.message);var r=e.inner,n=Array.isArray(r),i=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}var o=a;g(t,o.path)||(t=b(t,o.path,o.message))}}return t}function V(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n={});var i=D(e);return t[r?"validateSync":"validate"](i,{abortEarly:!1,context:n})}function D(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=String(r);t[n]=!0===Array.isArray(e[n])?e[n].map(function(e){return!0===Array.isArray(e)||i(e)?D(e):""!==e?e:void 0}):i(e[n])?D(e[n]):""!==e[n]?e[n]:void 0}return t}function M(e,t,r){var i=e.slice();return t.forEach(function(t,a){if(void 0===i[a]){var o=!1!==r.clone&&r.isMergeableObject(t);i[a]=o?n(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?i[a]=n(e[a],t,r):-1===e.indexOf(t)&&i.push(t)}),i}var j="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function L(e){var r=t.useRef(e);return j(function(){r.current=e}),t.useCallback(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.current.apply(void 0,t)},[])}var x=t.forwardRef(function(e,r){var n=e.action,i=p(e,["action"]),a=n||"#",o=_();return t.createElement("form",Object.assign({onSubmit:o.handleSubmit,ref:r,onReset:o.handleReset,action:a},i))});function N(e){var r=function(r){return t.createElement(C,null,function(n){return n||u(!1),t.createElement(e,Object.assign({},r,{formik:n}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return r.WrappedComponent=e,r.displayName="FormikConnect("+n+")",s(r,e)}x.displayName="Form";var B=function(e,t,r){var n=H(e),i=n[t];return n.splice(t,1),n.splice(r,0,i),n},q=function(e,t,r){var n=H(e),i=n[t];return n[t]=n[r],n[r]=i,n},G=function(e,t,r){var n=H(e);return n.splice(t,0,r),n},W=function(e,t,r){var n=H(e);return n[t]=r,n},H=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map(function(e){return parseInt(e)}).reduce(function(e,t){return t>e?t:e},0);return Array.from(d({},e,{length:t+1}))}return[]},K=function(e){function r(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var i=r.props,a=i.name,o=i.validateOnChange,u=i.formik,l=u.validateForm;(0,u.setFormikState)(function(r){var i="function"==typeof n?n:e,o="function"==typeof t?t:e;return d({},r,{values:b(r.values,a,e(g(r.values,a))),errors:n?b(r.errors,a,i(g(r.errors,a))):r.errors,touched:t?b(r.touched,a,o(g(r.touched,a))):r.touched})},function(){o&&l()})},r.push=function(e){return r.updateArrayField(function(t){return[].concat(H(t),[c(e)])},!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField(function(r){return q(r,e,t)},!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField(function(r){return B(r,e,t)},!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField(function(r){return G(r,e,t)},function(t){return G(t,e,null)},function(t){return G(t,e,null)})},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField(function(r){return W(r,e,t)},!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField(function(r){var n=r?[e].concat(r):[e];return t<0&&(t=n.length),n},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r}),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(h(r)),r.pop=r.pop.bind(h(r)),r}f(r,e);var n=r.prototype;return n.remove=function(e){var t;return this.updateArrayField(function(r){var n=r?H(r):[];return t||(t=n[e]),v(n.splice)&&n.splice(e,1),n},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r},!0,!0),e},n.render=function(){var e=this.props,r=e.component,n=e.render,i=e.children,a=e.name,o=d({},{push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},{form:p(e.formik,["validate","validationSchema"]),name:a});return r?t.createElement(r,o):n?n(o):i?"function"==typeof i?i(o):S(i)?null:t.Children.only(i):null},r}(t.Component);K.defaultProps={validateOnChange:!0};var Y=N(K),z=N(function(e){function r(){return e.apply(this,arguments)||this}f(r,e);var n=r.prototype;return n.shouldComponentUpdate=function(e){return g(this.props.formik.errors,this.props.name)!==g(e.formik.errors,this.props.name)||g(this.props.formik.touched,this.props.name)!==g(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,r=e.component,n=e.formik,i=e.render,a=e.children,o=e.name,u=p(e,["component","formik","render","children","name"]),l=g(n.touched,o),s=g(n.errors,o);return l&&s?i?v(i)?i(s):null:a?v(a)?a(s):null:r?t.createElement(r,u,s):s:null},r}(t.Component)),J=function(e){function r(t){var r;r=e.call(this,t)||this;var n=t.render,i=t.children,a=t.component,o=t.as;return n&&u(!1),a&&n&&u(!1),o&&i&&v(i)&&u(!1),a&&i&&v(i)&&u(!1),n&&i&&!S(i)&&u(!1),r}f(r,e);var n=r.prototype;return n.shouldComponentUpdate=function(e,t,r){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):g(this.context.values,this.props.name)!==g(r.values,this.props.name)||g(this.context.errors,this.props.name)!==g(r.errors,this.props.name)||g(this.context.touched,this.props.name)!==g(r.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||this.context.isSubmitting!==r.isSubmitting},n.componentDidMount=function(){this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(e){this.props.name!==e.name&&(this.context.unregisterField(e.name),this.context.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.context.unregisterField(this.props.name)},n.render=function(){var e=this.props,r=e.name,n=e.render,i=e.as,a=e.children,o=e.component,u=p(e,["validate","name","render","as","children","component","shouldUpdate"]),l=this.context,s=p(l,["validate","validationSchema"]),c={value:"radio"===u.type||"checkbox"===u.type?u.value:g(l.values,r),name:r,onChange:l.handleChange,onBlur:l.handleBlur},f={field:c,meta:{value:g(l.values,r),error:g(l.errors,r),touched:!!g(l.touched,r),initialValue:g(l.initialValues,r),initialTouched:!!g(l.initialTouched,r),initialError:g(l.initialErrors,r)},form:s};if(n)return n(f);if(v(a))return a(f);if(o){if("string"==typeof o){var h=u.innerRef,m=p(u,["innerRef"]);return t.createElement(o,d({ref:h},c,m),a)}return t.createElement(o,d({field:c,form:l},u),a)}var y=i||"input";if("string"==typeof y){var E=u.innerRef,S=p(u,["innerRef"]);return t.createElement(y,d({ref:E},c,S),a)}return t.createElement(y,d({},c,u),a)},r}(t.Component);J.contextType=O,e.ErrorMessage=z,e.FastField=J,e.Field=function(e){var r=e.validate,n=e.name,i=e.render,a=e.children,o=e.as,u=e.component,l=p(e,["validate","name","render","children","as","component"]),s=p(_(),["validate","validationSchema"]);t.useEffect(function(){},[]);var c=s.registerField,f=s.unregisterField;t.useEffect(function(){return c(n,{validate:r}),function(){f(n)}},[c,f,n,r]);var h=s.getFieldProps(d({name:n},l)),m=s.getFieldMeta(n),y={field:h,form:s};if(i)return i(d({},y,{meta:m}));if(v(a))return a(d({},y,{meta:m}));if(u){if("string"==typeof u){var E=l.innerRef,S=p(l,["innerRef"]);return t.createElement(u,d({ref:E},h,S),a)}return t.createElement(u,d({field:h,form:s},l),a)}var T=o||"input";if("string"==typeof T){var g=l.innerRef,b=p(l,["innerRef"]);return t.createElement(T,d({ref:g},h,b),a)}return t.createElement(T,d({},h,l),a)},e.FieldArray=Y,e.Form=x,e.Formik=w,e.FormikConsumer=C,e.FormikContext=O,e.FormikProvider=R,e.connect=N,e.getActiveElement=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}},e.getIn=g,e.insert=G,e.isEmptyChildren=S,e.isFunction=v,e.isInputEvent=function(e){return e&&m(e)&&m(e.target)},e.isInteger=y,e.isNaN=function(e){return e!=e},e.isObject=m,e.isPromise=T,e.isString=E,e.move=B,e.prepareDataForValidation=D,e.replace=W,e.setIn=b,e.setNestedObjectValues=F,e.swap=q,e.useField=function(e){var r=_(),n=r.getFieldProps,i=r.getFieldMeta,a=r.registerField,o=r.unregisterField,l=m(e),s=l?e.name:e,c=l?e.validate:void 0;return t.useEffect(function(){return s&&a(s,{validate:c}),function(){s&&o(s)}},[a,o,s,c]),m(e)?(e.name||u(!1),[n(e),i(e.name)]):[n({name:e}),i(e)]},e.useFormik=I,e.useFormikContext=_,e.validateYupSchema=V,e.withFormik=function(e){var r=e.mapPropsToValues,n=void 0===r?function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&"function"!=typeof e[r]&&(t[r]=e[r]);return t}:r,i=p(e,["mapPropsToValues"]);return function(e){var r=e.displayName||e.name||e.constructor&&e.constructor.name||"Component",a=function(r){function a(){var n;return(n=r.apply(this,arguments)||this).validate=function(e){return i.validate(e,n.props)},n.validationSchema=function(){return v(i.validationSchema)?i.validationSchema(n.props):i.validationSchema},n.handleSubmit=function(e,t){return i.handleSubmit(e,d({},t,{props:n.props}))},n.renderFormComponent=function(r){return t.createElement(e,Object.assign({},n.props,r))},n}return f(a,r),a.prototype.render=function(){var e=p(this.props,["children"]);return t.createElement(w,Object.assign({},e,i,{validate:i.validate&&this.validate,validationSchema:i.validationSchema&&this.validationSchema,initialValues:n(this.props),initialStatus:i.mapPropsToStatus&&i.mapPropsToStatus(this.props),initialErrors:i.mapPropsToErrors&&i.mapPropsToErrors(this.props),initialTouched:i.mapPropsToTouched&&i.mapPropsToTouched(this.props),onSubmit:this.handleSubmit,children:this.renderFormComponent}))},a}(t.Component);return a.displayName="WithFormik("+r+")",s(a,e)}},e.yupToFormErrors=U});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-fast-compare"),require("deepmerge"),require("lodash-es/isPlainObject"),require("lodash-es/clone"),require("lodash-es/toPath"),require("tiny-warning"),require("scheduler"),require("hoist-non-react-statics"),require("lodash-es/cloneDeep")):"function"==typeof define&&define.amd?define(["exports","react","react-fast-compare","deepmerge","lodash-es/isPlainObject","lodash-es/clone","lodash-es/toPath","tiny-warning","scheduler","hoist-non-react-statics","lodash-es/cloneDeep"],t):t((e=e||self).formik={},e.React,e.isEqual,e.deepmerge,e.isPlainObject,e.clone,e.toPath,e.invariant,e.scheduler,e.hoistNonReactStatics,e.cloneDeep)}(this,function(e,t,r,n,i,a,o,u,l,s,c){"use strict";function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function f(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function p(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(i[r]=e[r]);return i}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r=r&&r.hasOwnProperty("default")?r.default:r,n=n&&n.hasOwnProperty("default")?n.default:n,i=i&&i.hasOwnProperty("default")?i.default:i,a=a&&a.hasOwnProperty("default")?a.default:a,o=o&&o.hasOwnProperty("default")?o.default:o,u=u&&u.hasOwnProperty("default")?u.default:u,s=s&&s.hasOwnProperty("default")?s.default:s,c=c&&c.hasOwnProperty("default")?c.default:c;var v=function(e){return Array.isArray(e)&&0===e.length},m=function(e){return"function"==typeof e},y=function(e){return null!==e&&"object"==typeof e},E=function(e){return String(Math.floor(Number(e)))===e},S=function(e){return"[object String]"===Object.prototype.toString.call(e)},T=function(e){return 0===t.Children.count(e)},g=function(e){return y(e)&&m(e.then)};function b(e,t,r,n){void 0===n&&(n=0);for(var i=o(t);e&&n<i.length;)e=e[i[n++]];return void 0===e?r:e}function F(e,t,r){for(var n=a(e),i=n,u=0,l=o(t);u<l.length-1;u++){var s=l[u],c=b(e,l.slice(0,u+1));if(c&&(y(c)||Array.isArray(c)))i=i[s]=a(c);else{var d=l[u+1];i=i[s]=E(d)&&Number(d)>=0?[]:{}}}return(0===u?e:i)[l[u]]===r?e:(void 0===r||v(r)?delete i[l[u]]:i[l[u]]=r,(0===u&&void 0===r||v(r))&&delete n[l[u]],n)}function O(e,t,r,n){void 0===r&&(r=new WeakMap),void 0===n&&(n={});for(var i=0,a=Object.keys(e);i<a.length;i++){var o=a[i],u=e[o];y(u)?r.get(u)||(r.set(u,!0),n[o]=Array.isArray(u)?[]:{},O(u,t,r,n[o])):n[o]=t}return n}var k=t.createContext(void 0),R=k.Provider,C=k.Consumer;function _(){var e=t.useContext(k);return e||u(!1),e}function A(e,t){switch(t.type){case"SET_VALUES":return d({},e,{values:t.payload});case"SET_TOUCHED":return d({},e,{touched:t.payload});case"SET_ERRORS":return r(e.errors,t.payload)?e:d({},e,{errors:t.payload});case"SET_STATUS":return d({},e,{status:t.payload});case"SET_ISSUBMITTING":return d({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return d({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return d({},e,{values:F(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return d({},e,{touched:F(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return d({},e,{errors:F(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return d({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return d({},e,{touched:O(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return d({},e,{isSubmitting:!1});default:return e}}var P={},I={};function w(e){var i=e.validateOnChange,a=void 0===i||i,o=e.validateOnBlur,u=void 0===o||o,s=e.validateOnMount,c=void 0!==s&&s,f=e.isInitialValid,h=e.enableReinitialize,v=void 0!==h&&h,E=e.onSubmit,T=p(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),O=d({validateOnChange:a,validateOnBlur:u,validateOnMount:c,onSubmit:E},T),k=t.useRef(O.initialValues),R=t.useRef(O.initialErrors||P),C=t.useRef(O.initialTouched||I),_=t.useRef(O.initialStatus),w=t.useRef(!1),U=t.useRef({});t.useEffect(function(){},[]),t.useEffect(function(){return w.current=!0,function(){w.current=!1}},[]);var M=t.useReducer(A,{values:O.initialValues,errors:O.initialErrors||P,touched:O.initialTouched||I,status:O.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),L=M[0],B=M[1],x=t.useCallback(function(e,t){return new Promise(function(r,n){var i=O.validate(e,t);null==i?r(P):g(i)?i.then(function(e){r(e||P)},function(e){n(e)}):r(i)})},[O.validate]),q=t.useCallback(function(e,t){var r=O.validationSchema,n=m(r)?r(t):r,i=t&&n.validateAt?n.validateAt(t,e):D(e,n);return new Promise(function(e,t){i.then(function(){e(P)},function(r){"ValidationError"===r.name?e(V(r)):t(r)})})},[O.validationSchema]),G=t.useCallback(function(e,t){return new Promise(function(r){return r(U.current[e].validate(t))})},[]),W=t.useCallback(function(e){var t=Object.keys(U.current).filter(function(e){return m(U.current[e].validate)}),r=t.length>0?t.map(function(t){return G(t,b(e,t))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(r).then(function(e){return e.reduce(function(e,r,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===r?e:(r&&(e=F(e,t[n],r)),e)},{})})},[G]),H=t.useCallback(function(e){return Promise.all([W(e),O.validationSchema?q(e):{},O.validate?x(e):{}]).then(function(e){return n.all([e[0],e[1],e[2]],{arrayMerge:j})})},[O.validate,O.validationSchema,W,x,q]),K=N(function(e){return void 0===e&&(e=L.values),l.unstable_runWithPriority(l.LowPriority,function(){return H(e).then(function(e){return w.current&&B({type:"SET_ERRORS",payload:e}),e})})}),Y=N(function(e){return void 0===e&&(e=L.values),B({type:"SET_ISVALIDATING",payload:!0}),H(e).then(function(e){return w.current&&(B({type:"SET_ISVALIDATING",payload:!1}),r(L.errors,e)||B({type:"SET_ERRORS",payload:e})),e})});t.useEffect(function(){c&&!0===w.current&&K(O.initialValues)},[O.initialValues,c,K]);var z=t.useCallback(function(e){var t=e&&e.values?e.values:k.current,r=e&&e.errors?e.errors:R.current?R.current:O.initialErrors||{},n=e&&e.touched?e.touched:C.current?C.current:O.initialTouched||{},i=e&&e.status?e.status:_.current?_.current:O.initialStatus;k.current=t,R.current=r,C.current=n,_.current=i,B({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:r,touched:n,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})},[O.initialErrors,O.initialStatus,O.initialTouched]);t.useEffect(function(){v&&!0===w.current&&!r(k.current,O.initialValues)&&(k.current=O.initialValues,z())},[v,O.initialValues,z]),t.useEffect(function(){v&&!0===w.current&&!r(R.current,O.initialErrors)&&(R.current=O.initialErrors||P,B({type:"SET_ERRORS",payload:O.initialErrors||P}))},[v,O.initialErrors]),t.useEffect(function(){v&&!0===w.current&&!r(C.current,O.initialTouched)&&(C.current=O.initialTouched||I,B({type:"SET_TOUCHED",payload:O.initialTouched||I}))},[v,O.initialTouched]),t.useEffect(function(){v&&!0===w.current&&!r(_.current,O.initialStatus)&&(_.current=O.initialStatus,B({type:"SET_STATUS",payload:O.initialStatus}))},[v,O.initialStatus,O.initialTouched]);var J=N(function(e){if(m(U.current[e].validate)){var t=b(L.values,e),r=U.current[e].validate(t);return g(r)?(B({type:"SET_ISVALIDATING",payload:!0}),r.then(function(e){return e}).then(function(t){B({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),B({type:"SET_ISVALIDATING",payload:!1})})):(B({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),Promise.resolve(r))}return Promise.resolve()}),Q=t.useCallback(function(e,t){U.current[e]={validate:t.validate}},[]),X=t.useCallback(function(e){delete U.current[e]},[]),Z=N(function(e){return B({type:"SET_TOUCHED",payload:e}),u?K(L.values):Promise.resolve()}),$=t.useCallback(function(e){B({type:"SET_ERRORS",payload:e})},[]),ee=N(function(e){return B({type:"SET_VALUES",payload:e}),a?K(e):Promise.resolve()}),te=t.useCallback(function(e,t){B({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})},[]),re=N(function(e,t,r){return void 0===r&&(r=!0),B({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),a&&r?K(F(L.values,e,t)):Promise.resolve()}),ne=t.useCallback(function(e,t){var r,n=t,i=e;if(!S(e)){e.persist&&e.persist();var a=e.target?e.target:e.currentTarget,o=a.type,u=a.value,l=a.checked,s=a.options,c=a.multiple;n=t||a.name||a.id,i=/number|range/.test(o)?(r=parseFloat(u),isNaN(r)?"":r):/checkbox/.test(o)?function(e,t,r){if("true"==r||"false"==r)return!!t;if(t&&r)return Array.isArray(e)?e.concat(r):[r];if(!Array.isArray(e))return!e;var n=e.indexOf(r);return n<0?e:e.slice(0,n).concat(e.slice(n+1))}(b(L.values,n),l,u):c?function(e){return Array.from(e).filter(function(e){return e.selected}).map(function(e){return e.value})}(s):u}n&&re(n,i)},[re,L.values]),ie=t.useCallback(function(e){if(S(e))return function(t){return ne(t,e)};ne(e)},[ne]),ae=N(function(e,t,r){return void 0===t&&(t=!0),void 0===r&&(r=!0),B({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),u&&r?K(L.values):Promise.resolve()}),oe=t.useCallback(function(e,t){e.persist&&e.persist();var r=e.target;ae(t||r.name||r.id,!0)},[ae]),ue=t.useCallback(function(e){if(S(e))return function(t){return oe(t,e)};oe(e)},[oe]),le=t.useCallback(function(e){m(e)?B({type:"SET_FORMIK_STATE",payload:e}):B({type:"SET_FORMIK_STATE",payload:function(){return e}})},[]),se=t.useCallback(function(e){B({type:"SET_STATUS",payload:e})},[]),ce=t.useCallback(function(e){B({type:"SET_ISSUBMITTING",payload:e})},[]),de={resetForm:z,validateForm:Y,validateField:J,setErrors:$,setFieldError:te,setFieldTouched:ae,setFieldValue:re,setStatus:se,setSubmitting:ce,setTouched:Z,setValues:ee,setFormikState:le},fe=N(function(){return E(L.values,de)}),pe=N(function(){return B({type:"SUBMIT_ATTEMPT"}),Y().then(function(e){if(0===Object.keys(e).length){var t=fe();if(void 0===t)return;return Promise.resolve(t).then(function(){w.current&&B({type:"SUBMIT_SUCCESS"})}).catch(function(e){if(w.current)throw B({type:"SUBMIT_FAILURE"}),e})}if(w.current)throw B({type:"SUBMIT_FAILURE"}),e})}),he=N(function(e){e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),pe()}),ve=N(function(e){if(e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),O.onReset){var t=O.onReset(L.values,de);g(t)?t.then(z):z()}else z()}),me=t.useCallback(function(e){return{value:b(L.values,e),error:b(L.errors,e),touched:!!b(L.touched,e),initialValue:b(k.current,e),initialTouched:!!b(C.current,e),initialError:b(R.current,e)}},[L.errors,L.touched,L.values]),ye=t.useCallback(function(e){var t=y(e),r=t?e.name:e,n=b(L.values,r),i={name:r,value:n,onChange:ie,onBlur:ue};if(t){var a=e.type,o=e.value,u=e.as,l=e.multiple;"checkbox"===a?void 0===o?i.checked=!!n:(i.checked=!(!Array.isArray(n)||!~n.indexOf(o)),i.value=o):"radio"===a?(i.checked=n===o,i.value=o):"select"===u&&l&&(i.value=i.value||[],i.multiple=!0)}return i},[ue,ie,L.values]),Ee=t.useMemo(function(){return!r(k.current,L.values)},[k.current,L.values]),Se=t.useMemo(function(){return void 0!==f?Ee?L.errors&&0===Object.keys(L.errors).length:!1!==f&&m(f)?f(O):f:L.errors&&0===Object.keys(L.errors).length},[f,Ee,L.errors,O]);return d({},L,{initialValues:k.current,initialErrors:R.current,initialTouched:C.current,initialStatus:_.current,handleBlur:ue,handleChange:ie,handleReset:ve,handleSubmit:he,resetForm:z,setErrors:$,setFormikState:le,setFieldTouched:ae,setFieldValue:re,setFieldError:te,setStatus:se,setSubmitting:ce,setTouched:Z,setValues:ee,submitForm:pe,validateForm:Y,validateField:J,isValid:Se,dirty:Ee,unregisterField:X,registerField:Q,getFieldProps:ye,getFieldMeta:me,validateOnBlur:u,validateOnChange:a,validateOnMount:c})}function U(e){var r=w(e),n=e.component,i=e.children,a=e.render;return t.useEffect(function(){},[]),t.createElement(R,{value:r},n?t.createElement(n,r):a?a(r):i?m(i)?i(r):T(i)?null:t.Children.only(i):null)}function V(e){var t={};if(e.inner){if(0===e.inner.length)return F(t,e.path,e.message);var r=e.inner,n=Array.isArray(r),i=0;for(r=n?r:r[Symbol.iterator]();;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}var o=a;b(t,o.path)||(t=F(t,o.path,o.message))}}return t}function D(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n={});var i=M(e);return t[r?"validateSync":"validate"](i,{abortEarly:!1,context:n})}function M(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=String(r);t[n]=!0===Array.isArray(e[n])?e[n].map(function(e){return!0===Array.isArray(e)||i(e)?M(e):""!==e?e:void 0}):i(e[n])?M(e[n]):""!==e[n]?e[n]:void 0}return t}function j(e,t,r){var i=e.slice();return t.forEach(function(t,a){if(void 0===i[a]){var o=!1!==r.clone&&r.isMergeableObject(t);i[a]=o?n(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?i[a]=n(e[a],t,r):-1===e.indexOf(t)&&i.push(t)}),i}var L="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function N(e){var r=t.useRef(e);return L(function(){r.current=e}),t.useCallback(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.current.apply(void 0,t)},[])}var B=t.forwardRef(function(e,r){var n=e.action,i=p(e,["action"]),a=n||"#",o=_();return t.createElement("form",Object.assign({onSubmit:o.handleSubmit,ref:r,onReset:o.handleReset,action:a},i))});function x(e){var r=function(r){return t.createElement(C,null,function(n){return n||u(!1),t.createElement(e,Object.assign({},r,{formik:n}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return r.WrappedComponent=e,r.displayName="FormikConnect("+n+")",s(r,e)}B.displayName="Form";var q=function(e,t,r){var n=K(e),i=n[t];return n.splice(t,1),n.splice(r,0,i),n},G=function(e,t,r){var n=K(e),i=n[t];return n[t]=n[r],n[r]=i,n},W=function(e,t,r){var n=K(e);return n.splice(t,0,r),n},H=function(e,t,r){var n=K(e);return n[t]=r,n},K=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map(function(e){return parseInt(e)}).reduce(function(e,t){return t>e?t:e},0);return Array.from(d({},e,{length:t+1}))}return[]},Y=function(e){function r(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var i=r.props,a=i.name,o=i.validateOnChange,u=i.formik,l=u.validateForm;(0,u.setFormikState)(function(r){var i="function"==typeof n?n:e,o="function"==typeof t?t:e;return d({},r,{values:F(r.values,a,e(b(r.values,a))),errors:n?F(r.errors,a,i(b(r.errors,a))):r.errors,touched:t?F(r.touched,a,o(b(r.touched,a))):r.touched})},function(){o&&l()})},r.push=function(e){return r.updateArrayField(function(t){return[].concat(K(t),[c(e)])},!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField(function(r){return G(r,e,t)},!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField(function(r){return q(r,e,t)},!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField(function(r){return W(r,e,t)},function(t){return W(t,e,null)},function(t){return W(t,e,null)})},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField(function(r){return H(r,e,t)},!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField(function(r){var n=r?[e].concat(r):[e];return t<0&&(t=n.length),n},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r}),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(h(r)),r.pop=r.pop.bind(h(r)),r}f(r,e);var n=r.prototype;return n.remove=function(e){var t;return this.updateArrayField(function(r){var n=r?K(r):[];return t||(t=n[e]),m(n.splice)&&n.splice(e,1),n},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r},!0,!0),e},n.render=function(){var e=this.props,r=e.component,n=e.render,i=e.children,a=e.name,o=d({},{push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},{form:p(e.formik,["validate","validationSchema"]),name:a});return r?t.createElement(r,o):n?n(o):i?"function"==typeof i?i(o):T(i)?null:t.Children.only(i):null},r}(t.Component);Y.defaultProps={validateOnChange:!0};var z=x(Y),J=x(function(e){function r(){return e.apply(this,arguments)||this}f(r,e);var n=r.prototype;return n.shouldComponentUpdate=function(e){return b(this.props.formik.errors,this.props.name)!==b(e.formik.errors,this.props.name)||b(this.props.formik.touched,this.props.name)!==b(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,r=e.component,n=e.formik,i=e.render,a=e.children,o=e.name,u=p(e,["component","formik","render","children","name"]),l=b(n.touched,o),s=b(n.errors,o);return l&&s?i?m(i)?i(s):null:a?m(a)?a(s):null:r?t.createElement(r,u,s):s:null},r}(t.Component)),Q=x(function(e){function r(t){var r;r=e.call(this,t)||this;var n=t.render,i=t.children,a=t.component,o=t.as;return n&&u(!1),a&&n&&u(!1),o&&i&&m(i)&&u(!1),a&&i&&m(i)&&u(!1),n&&i&&!T(i)&&u(!1),r}f(r,e);var n=r.prototype;return n.shouldComponentUpdate=function(e){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):e.name!==this.props.name||b(e.formik.values,this.props.name)!==b(this.props.formik.values,this.props.name)||b(e.formik.errors,this.props.name)!==b(this.props.formik.errors,this.props.name)||b(e.formik.touched,this.props.name)!==b(this.props.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||e.formik.isSubmitting!==this.props.formik.isSubmitting},n.componentDidMount=function(){this.props.formik.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(e){this.props.name!==e.name&&(this.props.formik.unregisterField(e.name),this.props.formik.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.props.formik.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.props.formik.unregisterField(this.props.name)},n.render=function(){var e=this.props,r=e.name,n=e.render,i=e.as,a=e.children,o=e.component,u=e.formik,l=p(e,["validate","name","render","as","children","component","shouldUpdate","formik"]),s=p(u,["validate","validationSchema"]),c={value:"radio"===l.type||"checkbox"===l.type?l.value:b(u.values,r),name:r,onChange:u.handleChange,onBlur:u.handleBlur},f={field:c,meta:{value:b(u.values,r),error:b(u.errors,r),touched:!!b(u.touched,r),initialValue:b(u.initialValues,r),initialTouched:!!b(u.initialTouched,r),initialError:b(u.initialErrors,r)},form:s};if(n)return n(f);if(m(a))return a(f);if(o){if("string"==typeof o){var h=l.innerRef,v=p(l,["innerRef"]);return t.createElement(o,d({ref:h},c,v),a)}return t.createElement(o,d({field:c,form:u},l),a)}var y=i||"input";if("string"==typeof y){var E=l.innerRef,S=p(l,["innerRef"]);return t.createElement(y,d({ref:E},c,S),a)}return t.createElement(y,d({},c,l),a)},r}(t.Component));e.ErrorMessage=J,e.FastField=Q,e.Field=function(e){var r=e.validate,n=e.name,i=e.render,a=e.children,o=e.as,u=e.component,l=p(e,["validate","name","render","children","as","component"]),s=p(_(),["validate","validationSchema"]);t.useEffect(function(){},[]);var c=s.registerField,f=s.unregisterField;t.useEffect(function(){return c(n,{validate:r}),function(){f(n)}},[c,f,n,r]);var h=s.getFieldProps(d({name:n},l)),v=s.getFieldMeta(n),y={field:h,form:s};if(i)return i(d({},y,{meta:v}));if(m(a))return a(d({},y,{meta:v}));if(u){if("string"==typeof u){var E=l.innerRef,S=p(l,["innerRef"]);return t.createElement(u,d({ref:E},h,S),a)}return t.createElement(u,d({field:h,form:s},l),a)}var T=o||"input";if("string"==typeof T){var g=l.innerRef,b=p(l,["innerRef"]);return t.createElement(T,d({ref:g},h,b),a)}return t.createElement(T,d({},h,l),a)},e.FieldArray=z,e.Form=B,e.Formik=U,e.FormikConsumer=C,e.FormikContext=k,e.FormikProvider=R,e.connect=x,e.getActiveElement=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}},e.getIn=b,e.insert=W,e.isEmptyArray=v,e.isEmptyChildren=T,e.isFunction=m,e.isInputEvent=function(e){return e&&y(e)&&y(e.target)},e.isInteger=E,e.isNaN=function(e){return e!=e},e.isObject=y,e.isPromise=g,e.isString=S,e.move=q,e.prepareDataForValidation=M,e.replace=H,e.setIn=F,e.setNestedObjectValues=O,e.swap=G,e.useField=function(e){var r=_(),n=r.getFieldProps,i=r.getFieldMeta,a=r.registerField,o=r.unregisterField,l=y(e),s=l?e.name:e,c=l?e.validate:void 0;return t.useEffect(function(){return s&&a(s,{validate:c}),function(){s&&o(s)}},[a,o,s,c]),y(e)?(e.name||u(!1),[n(e),i(e.name)]):[n({name:e}),i(e)]},e.useFormik=w,e.useFormikContext=_,e.validateYupSchema=D,e.withFormik=function(e){var r=e.mapPropsToValues,n=void 0===r?function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&"function"!=typeof e[r]&&(t[r]=e[r]);return t}:r,i=p(e,["mapPropsToValues"]);return function(e){var r=e.displayName||e.name||e.constructor&&e.constructor.name||"Component",a=function(r){function a(){var n;return(n=r.apply(this,arguments)||this).validate=function(e){return i.validate(e,n.props)},n.validationSchema=function(){return m(i.validationSchema)?i.validationSchema(n.props):i.validationSchema},n.handleSubmit=function(e,t){return i.handleSubmit(e,d({},t,{props:n.props}))},n.renderFormComponent=function(r){return t.createElement(e,Object.assign({},n.props,r))},n}return f(a,r),a.prototype.render=function(){var e=p(this.props,["children"]);return t.createElement(U,Object.assign({},e,i,{validate:i.validate&&this.validate,validationSchema:i.validationSchema&&this.validationSchema,initialValues:n(this.props),initialStatus:i.mapPropsToStatus&&i.mapPropsToStatus(this.props),initialErrors:i.mapPropsToErrors&&i.mapPropsToErrors(this.props),initialTouched:i.mapPropsToTouched&&i.mapPropsToTouched(this.props),onSubmit:this.handleSubmit,children:this.renderFormComponent}))},a}(t.Component);return a.displayName="WithFormik("+r+")",s(a,e)}},e.yupToFormErrors=V});
//# sourceMappingURL=formik.umd.production.min.js.map

@@ -34,5 +34,5 @@ import * as React from 'react';

setValues(values: Values): void;
setFieldValue(field: keyof Values & string, value: any, shouldValidate?: boolean): void;
setFieldError(field: keyof Values & string, message: string): void;
setFieldTouched(field: keyof Values & string, isTouched?: boolean, shouldValidate?: boolean): void;
setFieldValue(field: string, value: any, shouldValidate?: boolean): void;
setFieldError(field: string, message: string): void;
setFieldTouched(field: string, isTouched?: boolean, shouldValidate?: boolean): void;
validateForm(values?: any): Promise<FormikErrors<Values>>;

@@ -39,0 +39,0 @@ validateField(field: string): void;

import * as React from 'react';
export declare const isEmptyArray: (value?: any) => boolean;
export declare const isFunction: (obj: any) => obj is Function;

@@ -3,0 +4,0 @@ export declare const isObject: (obj: any) => obj is Object;

{
"name": "formik",
"description": "Forms in React, without tears",
"version": "2.0.6",
"version": "2.0.7",
"license": "MIT",

@@ -6,0 +6,0 @@ "author": "Jared Palmer <jared@palmer.net>",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc