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.1.4 to 2.1.5-canary.0

2

dist/formik.cjs.production.min.js

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

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});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 p(){return(p=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 d(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 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,s=o(t);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]]===r?e:(void 0===r?delete i[s[u]]:i[s[u]]=r,0===u&&void 0===r&&delete n[s[u]],n)}function k(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)?[]:{},k(u,t,r,n[o])):n[o]=t}return n}var R=t.createContext(void 0),_=R.Provider,O=R.Consumer;function A(){var e=t.useContext(R);return e||u(!1),e}function C(e,t){switch(t.type){case"SET_VALUES":return p({},e,{values:t.payload});case"SET_TOUCHED":return p({},e,{touched:t.payload});case"SET_ERRORS":return r(e.errors,t.payload)?e:p({},e,{errors:t.payload});case"SET_STATUS":return p({},e,{status:t.payload});case"SET_ISSUBMITTING":return p({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return p({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return p({},e,{values:F(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return p({},e,{touched:F(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return p({},e,{errors:F(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return p({},e,{},t.payload);case"SET_FORMIK_STATE":return t.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),R=t.useRef(k.initialValues),_=t.useRef(k.initialErrors||I),O=t.useRef(k.initialTouched||P),A=t.useRef(k.initialStatus),x=t.useRef(!1),V=t.useRef({});t.useEffect((function(){}),[]),t.useEffect((function(){return x.current=!0,function(){x.current=!1}}),[]);var M=t.useReducer(C,{values:k.initialValues,errors:k.initialErrors||I,touched:k.initialTouched||P,status:k.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),L=M[0],N=M[1],B=t.useCallback((function(e,t){return new Promise((function(r,n){var i=k.validate(e,t);null==i?r(I):g(i)?i.then((function(e){r(e||I)}),(function(e){n(e)})):r(i)}))}),[k.validate]),q=t.useCallback((function(e,t){var r=k.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(I)}),(function(r){"ValidationError"===r.name?e(U(r)):t(r)}))}))}),[k.validationSchema]),G=t.useCallback((function(e,t){return new Promise((function(r){return r(V.current[e].validate(t))}))}),[]),H=t.useCallback((function(e){var t=Object.keys(V.current).filter((function(e){return m(V.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]),W=t.useCallback((function(e){return Promise.all([H(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,H,B,q]),K=j((function(e){return void 0===e&&(e=L.values),s.unstable_runWithPriority(s.LowPriority,(function(){return W(e).then((function(e){return x.current&&N({type:"SET_ERRORS",payload:e}),e})).catch((function(e){}))}))})),Y=j((function(e){return void 0===e&&(e=L.values),N({type:"SET_ISVALIDATING",payload:!0}),W(e).then((function(e){return x.current&&(N({type:"SET_ISVALIDATING",payload:!1}),r(L.errors,e)||N({type:"SET_ERRORS",payload:e})),e}))}));t.useEffect((function(){c&&!0===x.current&&K(R.current)}),[c,K]);var z=t.useCallback((function(e){var t=e&&e.values?e.values:R.current,r=e&&e.errors?e.errors:_.current?_.current:k.initialErrors||{},n=e&&e.touched?e.touched:O.current?O.current:k.initialTouched||{},i=e&&e.status?e.status:A.current?A.current:k.initialStatus;R.current=t,_.current=r,O.current=n,A.current=i;var a=function(){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}})};if(k.onReset){var o=k.onReset(L.values,fe);g(o)?o.then(a):a()}else a()}),[k.initialErrors,k.initialStatus,k.initialTouched]);t.useEffect((function(){h||(R.current=k.initialValues)}),[h,k.initialValues]),t.useEffect((function(){h&&!0===x.current&&!r(R.current,k.initialValues)&&(R.current=k.initialValues,z())}),[h,k.initialValues,z]),t.useEffect((function(){h&&!0===x.current&&!r(_.current,k.initialErrors)&&(_.current=k.initialErrors||I,N({type:"SET_ERRORS",payload:k.initialErrors||I}))}),[h,k.initialErrors]),t.useEffect((function(){h&&!0===x.current&&!r(O.current,k.initialTouched)&&(O.current=k.initialTouched||P,N({type:"SET_TOUCHED",payload:k.initialTouched||P}))}),[h,k.initialTouched]),t.useEffect((function(){h&&!0===x.current&&!r(A.current,k.initialStatus)&&(A.current=k.initialStatus,N({type:"SET_STATUS",payload:k.initialStatus}))}),[h,k.initialStatus,k.initialTouched]);var J=j((function(e){if(m(V.current[e].validate)){var t=b(L.values,e),r=V.current[e].validate(t);return g(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 k.validationSchema?(N({type:"SET_ISVALIDATING",payload:!0}),q(L.values,e).then((function(e){return e})).then((function(t){N({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),N({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),Q=t.useCallback((function(e,t){V.current[e]={validate:t.validate}}),[]),X=t.useCallback((function(e){delete V.current[e]}),[]),Z=j((function(e,t){return N({type:"SET_TOUCHED",payload:e}),(void 0===t?u:t)?K(L.values):Promise.resolve()})),$=t.useCallback((function(e){N({type:"SET_ERRORS",payload:e})}),[]),ee=j((function(e,t){return N({type:"SET_VALUES",payload:e}),(void 0===t?a:t)?K(e):Promise.resolve()})),te=t.useCallback((function(e,t){N({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),re=j((function(e,t,r){return N({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?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,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("boolean"==typeof e)return Boolean(t);var n=[],i=!1,a=-1;if(Array.isArray(e))n=e,i=(a=e.indexOf(r))>=0;else if(!r||"true"==r||"false"==r)return Boolean(t);return t&&r&&!i?n.concat(r):i?n.slice(0,a).concat(n.slice(a+1)):n}(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&&re(n,i)}),[re,L.values]),ie=j((function(e){if(S(e))return function(t){return ne(t,e)};ne(e)})),ae=j((function(e,t,r){return void 0===t&&(t=!0),N({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===r?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=j((function(e){if(S(e))return function(t){return oe(t,e)};oe(e)})),se=t.useCallback((function(e){m(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})}),[]),pe=j((function(){return N({type:"SUBMIT_ATTEMPT"}),Y().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var r;try{if(void 0===(r=ve()))return}catch(e){throw e}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&&(N({type:"SUBMIT_FAILURE"}),t))throw e}))})),de=j((function(e){e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),pe().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),fe={resetForm:z,validateForm:Y,validateField:J,setErrors:$,setFieldError:te,setFieldTouched:ae,setFieldValue:re,setStatus:le,setSubmitting:ce,setTouched:Z,setValues:ee,setFormikState:se,submitForm:pe},ve=j((function(){return E(L.values,fe)})),he=j((function(e){e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),z()})),me=t.useCallback((function(e){return{value:b(L.values,e),error:b(L.errors,e),touched:!!b(L.touched,e),initialValue:b(R.current,e),initialTouched:!!b(O.current,e),initialError:b(_.current,e)}}),[L.errors,L.touched,L.values]),ye=t.useCallback((function(e){return{setValue:function(t){return re(e,t)},setTouched:function(t){return ae(e,t)},setError:function(t){return te(e,t)}}}),[re,ae,te]),Ee=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,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]),Se=t.useMemo((function(){return!r(R.current,L.values)}),[R.current,L.values]),Te=t.useMemo((function(){return void 0!==d?Se?L.errors&&0===Object.keys(L.errors).length:!1!==d&&m(d)?d(k):d:L.errors&&0===Object.keys(L.errors).length}),[d,Se,L.errors,k]);return p({},L,{initialValues:R.current,initialErrors:_.current,initialTouched:O.current,initialStatus:A.current,handleBlur:ue,handleChange:ie,handleReset:he,handleSubmit:de,resetForm:z,setErrors:$,setFormikState:se,setFieldTouched:ae,setFieldValue:re,setFieldError:te,setStatus:le,setSubmitting:ce,setTouched:Z,setValues:ee,submitForm:pe,validateForm:Y,validateField:J,isValid:Te,dirty:Se,unregisterField:X,registerField:Q,getFieldProps:Ee,getFieldMeta:me,getFieldHelpers:ye,validateOnBlur:u,validateOnChange:a,validateOnMount:c})}function V(e){var r=x(e),n=e.component,i=e.children,a=e.render;return t.useImperativeHandle(e.innerRef,(function(){return r})),t.useEffect((function(){}),[]),t.createElement(_,{value:r},n?t.createElement(n,r):a?a(r):i?m(i)?i(r):T(i)?null:t.Children.only(i):null)}function U(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(Object.prototype.hasOwnProperty.call(e,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 w(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 j(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 N=t.forwardRef((function(e,r){var n=e.action,i=f(e,["action"]),a=n||"#",o=A();return t.createElement("form",Object.assign({onSubmit:o.handleSubmit,ref:r,onReset:o.handleReset,action:a},i))}));function B(e){var r=function(r){return t.createElement(O,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)}N.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},H=function(e,t,r){var n=K(e);return n.splice(t,0,r),n},W=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(p({},e,{length:t+1}))}return[]},Y=function(e){function n(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var i=r.props,a=i.name;(0,i.formik.setFormikState)((function(r){var i="function"==typeof n?n:e,o="function"==typeof t?t:e,u=F(r.values,a,e(b(r.values,a))),s=n?i(b(r.errors,a)):void 0,l=t?o(b(r.touched,a)):void 0;return h(s)&&(s=void 0),h(l)&&(l=void 0),p({},r,{values:u,errors:n?F(r.errors,a,s):r.errors,touched:t?F(r.touched,a,l):r.touched})}))},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 H(r,e,t)}),(function(t){return H(t,e,null)}),(function(t){return H(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}d(n,e);var i=n.prototype;return i.componentDidUpdate=function(e){!r(b(e.formik.values,e.name),b(this.props.formik.values,this.props.name))&&this.props.formik.validateOnChange&&this.props.formik.validateForm(this.props.formik.values)},i.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},i.pop=function(){var e;return this.updateArrayField((function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r}),!0,!0),e},i.render=function(){var e=this.props,r=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 r?t.createElement(r,o):n?n(o):i?"function"==typeof i?i(o):T(i)?null:t.Children.only(i):null},n}(t.Component);Y.defaultProps={validateOnChange:!0};var z=B(Y),J=B(function(e){function r(){return e.apply(this,arguments)||this}d(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?m(i)?i(l):null:a?m(a)?a(l):null:r?t.createElement(r,u,l):l:null},r}(t.Component)),Q=B(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}d(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,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,r),name:r,onChange:u.handleChange,onBlur:u.handleBlur},d={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: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 t.createElement(o,p({ref:v},c,{},h),a)}return t.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 t.createElement(y,p({ref:E},c,{},S),a)}return t.createElement(y,p({},c,{},s),a)},r}(t.Component));exports.ErrorMessage=J,exports.FastField=Q,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(A(),["validate","validationSchema"]);t.useEffect((function(){}),[]);var c=l.registerField,d=l.unregisterField;t.useEffect((function(){return c(n,{validate:r}),function(){d(n)}}),[c,d,n,r]);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 t.createElement(u,p({ref:E},v,{},S),a)}return t.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 t.createElement(T,p({ref:g},v,{},b),a)}return t.createElement(T,p({},v,{},s),a)},exports.FieldArray=z,exports.Form=N,exports.Formik=V,exports.FormikConsumer=O,exports.FormikContext=R,exports.FormikProvider=_,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(t){return e.body}},exports.getIn=b,exports.insert=H,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=M,exports.replace=W,exports.setIn=F,exports.setNestedObjectValues=k,exports.swap=G,exports.useField=function(e){var r=A(),n=r.getFieldProps,i=r.getFieldMeta,a=r.getFieldHelpers,o=r.registerField,s=r.unregisterField,l=y(e)?e:{name:e},c=l.name,p=l.validate;return t.useEffect((function(){return c&&o(c,{validate:p}),function(){c&&s(c)}}),[o,s,c,p]),c||u(!1),[n(l),i(c),a(c)]},exports.useFormik=x,exports.useFormikContext=A,exports.validateYupSchema=D,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 m(i.validationSchema)?i.validationSchema(n.props):i.validationSchema},n.handleSubmit=function(e,t){return i.handleSubmit(e,p({},t,{props:n.props}))},n.renderFormComponent=function(r){return t.createElement(e,Object.assign({},n.props,r))},n}return d(a,r),a.prototype.render=function(){var e=f(this.props,["children"]);return t.createElement(V,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}Object.defineProperty(exports,"__esModule",{value:!0});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?delete i[s[u]]:i[s[u]]=t,0===u&&void 0===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 _=r.createContext(void 0),R=_.Provider,O=_.Consumer;function A(){var e=r.useContext(_);return e||u(!1),e}function C(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),_=r.useRef(k.initialValues),R=r.useRef(k.initialErrors||I),O=r.useRef(k.initialTouched||P),A=r.useRef(k.initialStatus),x=r.useRef(!1),U=r.useRef({});r.useEffect((function(){return x.current=!0,function(){x.current=!1}}),[]);var M=r.useReducer(C,{values:k.initialValues,errors:k.initialErrors||I,touched:k.initialTouched||P,status:k.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),L=M[0],N=M[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):V(e,n);return new Promise((function(e,r){i.then((function(){e(I)}),(function(t){"ValidationError"===t.name?e(D(t)):r(t)}))}))}),[k.validationSchema]),G=r.useCallback((function(e,r){return new Promise((function(t){return t(U.current[e].validate(r))}))}),[]),H=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]),W=r.useCallback((function(e){return Promise.all([H(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,H,B,q]),K=j((function(e){return void 0===e&&(e=L.values),s.unstable_runWithPriority(s.unstable_LowPriority,(function(){return W(e).then((function(e){return x.current&&N({type:"SET_ERRORS",payload:e}),e})).catch((function(e){}))}))})),Y=j((function(e){return void 0===e&&(e=L.values),N({type:"SET_ISVALIDATING",payload:!0}),W(e).then((function(e){return x.current&&(N({type:"SET_ISVALIDATING",payload:!1}),t(L.errors,e)||N({type:"SET_ERRORS",payload:e})),e}))})),z=r.useCallback((function(e){var r=e&&e.values?e.values:_.current,t=e&&e.errors?e.errors:R.current?R.current:k.initialErrors||{},n=e&&e.touched?e.touched:O.current?O.current:k.initialTouched||{},i=e&&e.status?e.status:A.current?A.current:k.initialStatus;_.current=r,R.current=t,O.current=n,A.current=i;var a=function(){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}})};if(k.onReset){var o=k.onReset(L.values,fe);g(o)?o.then(a):a()}else a()}),[k.initialErrors,k.initialStatus,k.initialTouched]);r.useEffect((function(){!0!==x.current||t(_.current,k.initialValues)||(_.current=k.initialValues,h&&z(),c&&K(_.current))}),[h,k.initialValues,z,c,K]),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(O.current,k.initialTouched)&&(O.current=k.initialTouched||P,N({type:"SET_TOUCHED",payload:k.initialTouched||P}))}),[h,k.initialTouched]),r.useEffect((function(){h&&!0===x.current&&!t(A.current,k.initialStatus)&&(A.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 k.validationSchema?(N({type:"SET_ISVALIDATING",payload:!0}),q(L.values,e).then((function(e){return e})).then((function(r){N({type:"SET_FIELD_ERROR",payload:{field:e,value:r[e]}}),N({type:"SET_ISVALIDATING",payload:!1})}))):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,r){return N({type:"SET_TOUCHED",payload:e}),(void 0===r?u:r)?K(L.values):Promise.resolve()})),$=r.useCallback((function(e){N({type:"SET_ERRORS",payload:e})}),[]),ee=j((function(e,r){return N({type:"SET_VALUES",payload:e}),(void 0===r?a:r)?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 N({type:"SET_FIELD_VALUE",payload:{field:e,value:r}}),(void 0===t?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("boolean"==typeof e)return Boolean(r);var n=[],i=!1,a=-1;if(Array.isArray(e))n=e,i=(a=e.indexOf(t))>=0;else if(!t||"true"==t||"false"==t)return Boolean(r);return r&&t&&!i?n.concat(t):i?n.slice(0,a).concat(n.slice(a+1)):n}(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=j((function(e){if(S(e))return function(r){return ne(r,e)};ne(e)})),ae=j((function(e,r,t){return void 0===r&&(r=!0),N({type:"SET_FIELD_TOUCHED",payload:{field:e,value:r}}),(void 0===t?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=j((function(e){if(S(e))return function(r){return oe(r,e)};oe(e)})),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=j((function(){return N({type:"SUBMIT_ATTEMPT"}),Y().then((function(e){var r=e instanceof Error;if(!r&&0===Object.keys(e).length){var t;try{if(void 0===(t=ve()))return}catch(e){throw e}return Promise.resolve(t).then((function(e){return x.current&&N({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(x.current)throw N({type:"SUBMIT_FAILURE"}),e}))}if(x.current&&(N({type:"SUBMIT_FAILURE"}),r))throw e}))})),de=j((function(e){e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),pe().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),fe={resetForm:z,validateForm:Y,validateField:J,setErrors:$,setFieldError:re,setFieldTouched:ae,setFieldValue:te,setStatus:le,setSubmitting:ce,setTouched:Z,setValues:ee,setFormikState:se,submitForm:pe},ve=j((function(){return E(L.values,fe)})),he=j((function(e){e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),z()})),me=r.useCallback((function(e){return{value:b(L.values,e),error:b(L.errors,e),touched:!!b(L.touched,e),initialValue:b(_.current,e),initialTouched:!!b(O.current,e),initialError:b(R.current,e)}}),[L.errors,L.touched,L.values]),ye=r.useCallback((function(e){return{setValue:function(r,t){return te(e,r,t)},setTouched:function(r,t){return ae(e,r,t)},setError:function(r){return re(e,r)}}}),[te,ae,re]),Ee=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]),Se=r.useMemo((function(){return!t(_.current,L.values)}),[_.current,L.values]),Te=r.useMemo((function(){return void 0!==d?Se?L.errors&&0===Object.keys(L.errors).length:!1!==d&&m(d)?d(k):d:L.errors&&0===Object.keys(L.errors).length}),[d,Se,L.errors,k]);return p({},L,{initialValues:_.current,initialErrors:R.current,initialTouched:O.current,initialStatus:A.current,handleBlur:ue,handleChange:ie,handleReset:he,handleSubmit:de,resetForm:z,setErrors:$,setFormikState:se,setFieldTouched:ae,setFieldValue:te,setFieldError:re,setStatus:le,setSubmitting:ce,setTouched:Z,setValues:ee,submitForm:pe,validateForm:Y,validateField:J,isValid:Te,dirty:Se,unregisterField:X,registerField:Q,getFieldProps:Ee,getFieldMeta:me,getFieldHelpers:ye,validateOnBlur:u,validateOnChange:a,validateOnMount:c})}function U(e){var t=x(e),n=e.component,i=e.children,a=e.render;return r.useImperativeHandle(e.innerRef,(function(){return t})),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 D(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 V(e,r,t,n){void 0===t&&(t=!1),void 0===n&&(n={});var i=M(e);return r[t?"validateSync":"validate"](i,{abortEarly:!1,context:n})}function M(e){var r=Array.isArray(e)?[]:{};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=String(t);r[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 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=A();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(O,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},H=function(e,r,t){var n=K(e);return n.splice(r,0,t),n},W=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 n(r){var t;return(t=e.call(this,r)||this).updateArrayField=function(e,r,n){var i=t.props,a=i.name;(0,i.formik.setFormikState)((function(t){var i="function"==typeof n?n:e,o="function"==typeof r?r:e,u=F(t.values,a,e(b(t.values,a))),s=n?i(b(t.errors,a)):void 0,l=r?o(b(t.touched,a)):void 0;return h(s)&&(s=void 0),h(l)&&(l=void 0),p({},t,{values:u,errors:n?F(t.errors,a,s):t.errors,touched:r?F(t.touched,a,l):t.touched})}))},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 H(t,e,r)}),(function(r){return H(r,e,null)}),(function(r){return H(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 W(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(n,e);var i=n.prototype;return i.componentDidUpdate=function(e){!t(b(e.formik.values,e.name),b(this.props.formik.values,this.props.name))&&this.props.formik.validateOnChange&&this.props.formik.validateForm(this.props.formik.values)},i.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},i.pop=function(){var e;return this.updateArrayField((function(r){var t=r;return e||(e=t&&t.pop&&t.pop()),t}),!0,!0),e},i.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},n}(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(A(),["validate","validationSchema"]),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=O,exports.FormikContext=_,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=H,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=M,exports.replace=W,exports.setIn=F,exports.setNestedObjectValues=k,exports.swap=G,exports.useField=function(e){var t=A(),n=t.getFieldProps,i=t.getFieldMeta,a=t.getFieldHelpers,o=t.registerField,s=t.unregisterField,l=y(e)?e:{name:e},c=l.name,p=l.validate;return r.useEffect((function(){return c&&o(c,{validate:p}),function(){c&&s(c)}}),[o,s,c,p]),c||u(!1),[n(l),i(c),a(c)]},exports.useFormik=x,exports.useFormikContext=A,exports.validateYupSchema=V,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=D;
//# sourceMappingURL=formik.cjs.production.min.js.map

@@ -8,4 +8,10 @@ import * as React from 'react';

initialStatus: any;
handleBlur: (eventOrString: any) => void | ((e: any) => void);
handleChange: (eventOrPath: string | React.ChangeEvent<any>) => void | ((eventOrTextValue: string | React.ChangeEvent<any>) => void);
handleBlur: {
(e: React.FocusEvent<any>): void;
<T = any>(fieldOrEvent: T): T extends string ? (e: any) => void : void;
};
handleChange: {
(e: React.ChangeEvent<any>): void;
<T_1 = string | React.ChangeEvent<any>>(field: T_1): T_1 extends React.ChangeEvent<any> ? void : (e: string | React.ChangeEvent<any>) => void;
};
handleReset: (e: any) => void;

@@ -23,3 +29,3 @@ handleSubmit: (e?: React.FormEvent<HTMLFormElement> | undefined) => void;

setValues: (values: Values, shouldValidate?: boolean | undefined) => any;
submitForm: () => Promise<void | undefined>;
submitForm: () => Promise<any>;
validateForm: (values?: Values) => Promise<FormikErrors<Values>>;

@@ -26,0 +32,0 @@ validateField: (name: string) => Promise<void> | Promise<string | undefined>;

@@ -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 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?delete i[l[u]]:i[l[u]]=r,0===u&&void 0===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,_=k.Consumer;function A(){var e=t.useContext(k);return e||u(!1),e}function C(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 I={},P={};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||I),_=t.useRef(O.initialTouched||P),A=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 M=t.useReducer(C,{values:O.initialValues,errors:O.initialErrors||I,touched:O.initialTouched||P,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(I):g(i)?i.then((function(e){r(e||I)}),(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):U(e,n);return new Promise((function(e,t){i.then((function(){e(I)}),(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(D.current[e].validate(t))}))}),[]),H=t.useCallback((function(e){var t=Object.keys(D.current).filter((function(e){return m(D.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]),W=t.useCallback((function(e){return Promise.all([H(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,H,x,q]),K=N((function(e){return void 0===e&&(e=L.values),l.unstable_runWithPriority(l.LowPriority,(function(){return W(e).then((function(e){return w.current&&B({type:"SET_ERRORS",payload:e}),e})).catch((function(e){}))}))})),Y=N((function(e){return void 0===e&&(e=L.values),B({type:"SET_ISVALIDATING",payload:!0}),W(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(k.current)}),[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:_.current?_.current:O.initialTouched||{},i=e&&e.status?e.status:A.current?A.current:O.initialStatus;k.current=t,R.current=r,_.current=n,A.current=i;var a=function(){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}})};if(O.onReset){var o=O.onReset(L.values,pe);g(o)?o.then(a):a()}else a()}),[O.initialErrors,O.initialStatus,O.initialTouched]);t.useEffect((function(){v||(k.current=O.initialValues)}),[v,O.initialValues]),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||I,B({type:"SET_ERRORS",payload:O.initialErrors||I}))}),[v,O.initialErrors]),t.useEffect((function(){v&&!0===w.current&&!r(_.current,O.initialTouched)&&(_.current=O.initialTouched||P,B({type:"SET_TOUCHED",payload:O.initialTouched||P}))}),[v,O.initialTouched]),t.useEffect((function(){v&&!0===w.current&&!r(A.current,O.initialStatus)&&(A.current=O.initialStatus,B({type:"SET_STATUS",payload:O.initialStatus}))}),[v,O.initialStatus,O.initialTouched]);var J=N((function(e){if(m(D.current[e].validate)){var t=b(L.values,e),r=D.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 O.validationSchema?(B({type:"SET_ISVALIDATING",payload:!0}),q(L.values,e).then((function(e){return e})).then((function(t){B({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),B({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),Q=t.useCallback((function(e,t){D.current[e]={validate:t.validate}}),[]),X=t.useCallback((function(e){delete D.current[e]}),[]),Z=N((function(e,t){return B({type:"SET_TOUCHED",payload:e}),(void 0===t?u:t)?K(L.values):Promise.resolve()})),$=t.useCallback((function(e){B({type:"SET_ERRORS",payload:e})}),[]),ee=N((function(e,t){return B({type:"SET_VALUES",payload:e}),(void 0===t?a:t)?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 B({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?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("boolean"==typeof e)return Boolean(t);var n=[],i=!1,a=-1;if(Array.isArray(e))n=e,i=(a=e.indexOf(r))>=0;else if(!r||"true"==r||"false"==r)return Boolean(t);return t&&r&&!i?n.concat(r):i?n.slice(0,a).concat(n.slice(a+1)):n}(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=N((function(e){if(S(e))return function(t){return ne(t,e)};ne(e)})),ae=N((function(e,t,r){return void 0===t&&(t=!0),B({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===r?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=N((function(e){if(S(e))return function(t){return oe(t,e)};oe(e)})),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=N((function(){return B({type:"SUBMIT_ATTEMPT"}),Y().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var r;try{if(void 0===(r=he()))return}catch(e){throw e}return Promise.resolve(r).then((function(){w.current&&B({type:"SUBMIT_SUCCESS"})})).catch((function(e){if(w.current)throw B({type:"SUBMIT_FAILURE"}),e}))}if(w.current&&(B({type:"SUBMIT_FAILURE"}),t))throw e}))})),fe=N((function(e){e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),de().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),pe={resetForm:z,validateForm:Y,validateField:J,setErrors:$,setFieldError:te,setFieldTouched:ae,setFieldValue:re,setStatus:se,setSubmitting:ce,setTouched:Z,setValues:ee,setFormikState:le,submitForm:de},he=N((function(){return E(L.values,pe)})),ve=N((function(e){e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),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(_.current,e),initialError:b(R.current,e)}}),[L.errors,L.touched,L.values]),ye=t.useCallback((function(e){return{setValue:function(t){return re(e,t)},setTouched:function(t){return ae(e,t)},setError:function(t){return te(e,t)}}}),[re,ae,te]),Ee=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]),Se=t.useMemo((function(){return!r(k.current,L.values)}),[k.current,L.values]),Te=t.useMemo((function(){return void 0!==f?Se?L.errors&&0===Object.keys(L.errors).length:!1!==f&&m(f)?f(O):f:L.errors&&0===Object.keys(L.errors).length}),[f,Se,L.errors,O]);return d({},L,{initialValues:k.current,initialErrors:R.current,initialTouched:_.current,initialStatus:A.current,handleBlur:ue,handleChange:ie,handleReset:ve,handleSubmit:fe,resetForm:z,setErrors:$,setFormikState:le,setFieldTouched:ae,setFieldValue:re,setFieldError:te,setStatus:se,setSubmitting:ce,setTouched:Z,setValues:ee,submitForm:de,validateForm:Y,validateField:J,isValid:Te,dirty:Se,unregisterField:X,registerField:Q,getFieldProps:Ee,getFieldMeta:me,getFieldHelpers:ye,validateOnBlur:u,validateOnChange:a,validateOnMount:c})}function D(e){var r=w(e),n=e.component,i=e.children,a=e.render;return t.useImperativeHandle(e.innerRef,(function(){return r})),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 U(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(Object.prototype.hasOwnProperty.call(e,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=A();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(_,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},H=function(e,t,r){var n=K(e);return n.splice(t,0,r),n},W=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 n(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var i=r.props,a=i.name;(0,i.formik.setFormikState)((function(r){var i="function"==typeof n?n:e,o="function"==typeof t?t:e,u=F(r.values,a,e(b(r.values,a))),l=n?i(b(r.errors,a)):void 0,s=t?o(b(r.touched,a)):void 0;return v(l)&&(l=void 0),v(s)&&(s=void 0),d({},r,{values:u,errors:n?F(r.errors,a,l):r.errors,touched:t?F(r.touched,a,s):r.touched})}))},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 H(r,e,t)}),(function(t){return H(t,e,null)}),(function(t){return H(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(n,e);var i=n.prototype;return i.componentDidUpdate=function(e){!r(b(e.formik.values,e.name),b(this.props.formik.values,this.props.name))&&this.props.formik.validateOnChange&&this.props.formik.validateForm(this.props.formik.values)},i.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},i.pop=function(){var e;return this.updateArrayField((function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r}),!0,!0),e},i.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},n}(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(A(),["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=D,e.FormikConsumer=_,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=H,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=W,e.setIn=F,e.setNestedObjectValues=O,e.swap=G,e.useField=function(e){var r=A(),n=r.getFieldProps,i=r.getFieldMeta,a=r.getFieldHelpers,o=r.registerField,l=r.unregisterField,s=y(e)?e:{name:e},c=s.name,d=s.validate;return t.useEffect((function(){return c&&o(c,{validate:d}),function(){c&&l(c)}}),[o,l,c,d]),c||u(!1),[n(s),i(c),a(c)]},e.useFormik=w,e.useFormikContext=A,e.validateYupSchema=U,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(D,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,Object.defineProperty(e,"__esModule",{value:!0})}));
!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 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 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?delete i[l[u]]:i[l[u]]=r,0===u&&void 0===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,_=k.Consumer;function A(){var e=t.useContext(k);return e||u(!1),e}function C(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 I={},P={};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,p=e.isInitialValid,h=e.enableReinitialize,v=void 0!==h&&h,E=e.onSubmit,T=f(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||I),_=t.useRef(O.initialTouched||P),A=t.useRef(O.initialStatus),w=t.useRef(!1),D=t.useRef({});t.useEffect((function(){return w.current=!0,function(){w.current=!1}}),[]);var M=t.useReducer(C,{values:O.initialValues,errors:O.initialErrors||I,touched:O.initialTouched||P,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(I):g(i)?i.then((function(e){r(e||I)}),(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):V(e,n);return new Promise((function(e,t){i.then((function(){e(I)}),(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))}))}),[]),H=t.useCallback((function(e){var t=Object.keys(D.current).filter((function(e){return m(D.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]),W=t.useCallback((function(e){return Promise.all([H(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,H,x,q]),K=N((function(e){return void 0===e&&(e=L.values),l.unstable_runWithPriority(l.unstable_LowPriority,(function(){return W(e).then((function(e){return w.current&&B({type:"SET_ERRORS",payload:e}),e})).catch((function(e){}))}))})),Y=N((function(e){return void 0===e&&(e=L.values),B({type:"SET_ISVALIDATING",payload:!0}),W(e).then((function(e){return w.current&&(B({type:"SET_ISVALIDATING",payload:!1}),r(L.errors,e)||B({type:"SET_ERRORS",payload:e})),e}))})),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:_.current?_.current:O.initialTouched||{},i=e&&e.status?e.status:A.current?A.current:O.initialStatus;k.current=t,R.current=r,_.current=n,A.current=i;var a=function(){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}})};if(O.onReset){var o=O.onReset(L.values,fe);g(o)?o.then(a):a()}else a()}),[O.initialErrors,O.initialStatus,O.initialTouched]);t.useEffect((function(){!0!==w.current||r(k.current,O.initialValues)||(k.current=O.initialValues,v&&z(),c&&K(k.current))}),[v,O.initialValues,z,c,K]),t.useEffect((function(){v&&!0===w.current&&!r(R.current,O.initialErrors)&&(R.current=O.initialErrors||I,B({type:"SET_ERRORS",payload:O.initialErrors||I}))}),[v,O.initialErrors]),t.useEffect((function(){v&&!0===w.current&&!r(_.current,O.initialTouched)&&(_.current=O.initialTouched||P,B({type:"SET_TOUCHED",payload:O.initialTouched||P}))}),[v,O.initialTouched]),t.useEffect((function(){v&&!0===w.current&&!r(A.current,O.initialStatus)&&(A.current=O.initialStatus,B({type:"SET_STATUS",payload:O.initialStatus}))}),[v,O.initialStatus,O.initialTouched]);var J=N((function(e){if(m(D.current[e].validate)){var t=b(L.values,e),r=D.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 O.validationSchema?(B({type:"SET_ISVALIDATING",payload:!0}),q(L.values,e).then((function(e){return e})).then((function(t){B({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),B({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),Q=t.useCallback((function(e,t){D.current[e]={validate:t.validate}}),[]),X=t.useCallback((function(e){delete D.current[e]}),[]),Z=N((function(e,t){return B({type:"SET_TOUCHED",payload:e}),(void 0===t?u:t)?K(L.values):Promise.resolve()})),$=t.useCallback((function(e){B({type:"SET_ERRORS",payload:e})}),[]),ee=N((function(e,t){return B({type:"SET_VALUES",payload:e}),(void 0===t?a:t)?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 B({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?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("boolean"==typeof e)return Boolean(t);var n=[],i=!1,a=-1;if(Array.isArray(e))n=e,i=(a=e.indexOf(r))>=0;else if(!r||"true"==r||"false"==r)return Boolean(t);return t&&r&&!i?n.concat(r):i?n.slice(0,a).concat(n.slice(a+1)):n}(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=N((function(e){if(S(e))return function(t){return ne(t,e)};ne(e)})),ae=N((function(e,t,r){return void 0===t&&(t=!0),B({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===r?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=N((function(e){if(S(e))return function(t){return oe(t,e)};oe(e)})),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=N((function(){return B({type:"SUBMIT_ATTEMPT"}),Y().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var r;try{if(void 0===(r=he()))return}catch(e){throw e}return Promise.resolve(r).then((function(e){return w.current&&B({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(w.current)throw B({type:"SUBMIT_FAILURE"}),e}))}if(w.current&&(B({type:"SUBMIT_FAILURE"}),t))throw e}))})),pe=N((function(e){e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),de().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),fe={resetForm:z,validateForm:Y,validateField:J,setErrors:$,setFieldError:te,setFieldTouched:ae,setFieldValue:re,setStatus:se,setSubmitting:ce,setTouched:Z,setValues:ee,setFormikState:le,submitForm:de},he=N((function(){return E(L.values,fe)})),ve=N((function(e){e&&e.preventDefault&&m(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&m(e.stopPropagation)&&e.stopPropagation(),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(_.current,e),initialError:b(R.current,e)}}),[L.errors,L.touched,L.values]),ye=t.useCallback((function(e){return{setValue:function(t,r){return re(e,t,r)},setTouched:function(t,r){return ae(e,t,r)},setError:function(t){return te(e,t)}}}),[re,ae,te]),Ee=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]),Se=t.useMemo((function(){return!r(k.current,L.values)}),[k.current,L.values]),Te=t.useMemo((function(){return void 0!==p?Se?L.errors&&0===Object.keys(L.errors).length:!1!==p&&m(p)?p(O):p:L.errors&&0===Object.keys(L.errors).length}),[p,Se,L.errors,O]);return d({},L,{initialValues:k.current,initialErrors:R.current,initialTouched:_.current,initialStatus:A.current,handleBlur:ue,handleChange:ie,handleReset:ve,handleSubmit:pe,resetForm:z,setErrors:$,setFormikState:le,setFieldTouched:ae,setFieldValue:re,setFieldError:te,setStatus:se,setSubmitting:ce,setTouched:Z,setValues:ee,submitForm:de,validateForm:Y,validateField:J,isValid:Te,dirty:Se,unregisterField:X,registerField:Q,getFieldProps:Ee,getFieldMeta:me,getFieldHelpers:ye,validateOnBlur:u,validateOnChange:a,validateOnMount:c})}function D(e){var r=w(e),n=e.component,i=e.children,a=e.render;return t.useImperativeHandle(e.innerRef,(function(){return r})),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 U(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 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=Array.isArray(e)?[]:{};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,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=f(e,["action"]),a=n||"#",o=A();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(_,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},H=function(e,t,r){var n=K(e);return n.splice(t,0,r),n},W=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 n(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var i=r.props,a=i.name;(0,i.formik.setFormikState)((function(r){var i="function"==typeof n?n:e,o="function"==typeof t?t:e,u=F(r.values,a,e(b(r.values,a))),l=n?i(b(r.errors,a)):void 0,s=t?o(b(r.touched,a)):void 0;return v(l)&&(l=void 0),v(s)&&(s=void 0),d({},r,{values:u,errors:n?F(r.errors,a,l):r.errors,touched:t?F(r.touched,a,s):r.touched})}))},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 H(r,e,t)}),(function(t){return H(t,e,null)}),(function(t){return H(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}p(n,e);var i=n.prototype;return i.componentDidUpdate=function(e){!r(b(e.formik.values,e.name),b(this.props.formik.values,this.props.name))&&this.props.formik.validateOnChange&&this.props.formik.validateForm(this.props.formik.values)},i.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},i.pop=function(){var e;return this.updateArrayField((function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r}),!0,!0),e},i.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):T(i)?null:t.Children.only(i):null},n}(t.Component);Y.defaultProps={validateOnChange:!0};var z=x(Y),J=x(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"]),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}p(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=f(e,["validate","name","render","as","children","component","shouldUpdate","formik"]),s=f(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},p={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(p);if(m(a))return a(p);if(o){if("string"==typeof o){var h=l.innerRef,v=f(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=f(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=f(e,["validate","name","render","children","as","component"]),s=f(A(),["validate","validationSchema"]),c=s.registerField,p=s.unregisterField;t.useEffect((function(){return c(n,{validate:r}),function(){p(n)}}),[c,p,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=f(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=f(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=D,e.FormikConsumer=_,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=H,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=W,e.setIn=F,e.setNestedObjectValues=O,e.swap=G,e.useField=function(e){var r=A(),n=r.getFieldProps,i=r.getFieldMeta,a=r.getFieldHelpers,o=r.registerField,l=r.unregisterField,s=y(e)?e:{name:e},c=s.name,d=s.validate;return t.useEffect((function(){return c&&o(c,{validate:d}),function(){c&&l(c)}}),[o,l,c,d]),c||u(!1),[n(s),i(c),a(c)]},e.useFormik=w,e.useFormikContext=A,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=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 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 p(a,r),a.prototype.render=function(){var e=f(this.props,["children"]);return t.createElement(D,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,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=formik.umd.production.min.js.map

@@ -62,27 +62,27 @@ import * as React from 'react';

/** Manually set top level status. */
setStatus(status?: any): void;
setStatus: (status?: any) => void;
/** Manually set errors object */
setErrors(errors: FormikErrors<Values>): void;
setErrors: (errors: FormikErrors<Values>) => void;
/** Manually set isSubmitting */
setSubmitting(isSubmitting: boolean): void;
setSubmitting: (isSubmitting: boolean) => void;
/** Manually set touched object */
setTouched(touched: FormikTouched<Values>, shouldValidate?: boolean): void;
setTouched: (touched: FormikTouched<Values>, shouldValidate?: boolean) => void;
/** Manually set values object */
setValues(values: Values, shouldValidate?: boolean): void;
setValues: (values: Values, shouldValidate?: boolean) => void;
/** Set value of form field directly */
setFieldValue(field: string, value: any, shouldValidate?: boolean): void;
setFieldValue: (field: string, value: any, shouldValidate?: boolean) => void;
/** Set error message of a form field directly */
setFieldError(field: string, message: string): void;
setFieldError: (field: string, message: string) => void;
/** Set whether field has been touched directly */
setFieldTouched(field: string, isTouched?: boolean, shouldValidate?: boolean): void;
setFieldTouched: (field: string, isTouched?: boolean, shouldValidate?: boolean) => void;
/** Validate form values */
validateForm(values?: any): Promise<FormikErrors<Values>>;
validateForm: (values?: any) => Promise<FormikErrors<Values>>;
/** Validate field value */
validateField(field: string): void;
validateField: (field: string) => void;
/** Reset form */
resetForm(nextState?: Partial<FormikState<Values>>): void;
resetForm: (nextState?: Partial<FormikState<Values>>) => void;
/** Submit the form imperatively */
submitForm(): Promise<void>;
submitForm: () => Promise<void>;
/** Set Formik state, careful! */
setFormikState(f: FormikState<Values> | ((prevState: FormikState<Values>) => FormikState<Values>), cb?: () => void): void;
setFormikState: (f: FormikState<Values> | ((prevState: FormikState<Values>) => FormikState<Values>), cb?: () => void) => void;
}

@@ -105,5 +105,5 @@ /**

handleChange<T = string | React.ChangeEvent<any>>(field: T): T extends React.ChangeEvent<any> ? void : (e: string | React.ChangeEvent<any>) => void;
getFieldProps<Value = any>(props: any): FieldInputProps<Value>;
getFieldMeta<Value>(name: string): FieldMetaProps<Value>;
getFieldHelpers<Value = any>(name: string): FieldHelperProps<Value>;
getFieldProps: <Value = any>(props: any) => FieldInputProps<Value>;
getFieldMeta: <Value>(name: string) => FieldMetaProps<Value>;
getFieldHelpers: <Value = any>(name: string) => FieldHelperProps<Value>;
}

@@ -172,3 +172,3 @@ /**

/** Inner ref */
innerRef?: (instance: any) => void;
innerRef?: React.Ref<FormikProps<Values>>;
}

@@ -184,6 +184,6 @@ /**

export interface FormikRegistration {
registerField(name: string, fns: {
registerField: (name: string, fns: {
validate?: FieldValidator;
}): void;
unregisterField(name: string): void;
}) => void;
unregisterField: (name: string) => void;
}

@@ -227,7 +227,7 @@ /**

/** Set the field's value */
setValue(value: Value): void;
setValue: (value: Value, shouldValidate?: boolean) => void;
/** Set the field's touched value */
setTouched(value: boolean): void;
setTouched: (value: boolean, shouldValidate?: boolean) => void;
/** Set the field's error value */
setError(value: Value): void;
setError: (value: Value) => void;
}

@@ -234,0 +234,0 @@ /** Field input value, name, and event handlers */

{
"name": "formik",
"description": "Forms in React, without tears",
"version": "2.1.4",
"version": "2.1.5-canary.0",
"license": "MIT",
"author": "Jared Palmer <jared@palmer.net>",
"repository": "jaredpalmer/formik",
"repository": "formik/formik",
"keywords": [

@@ -27,3 +27,3 @@ "formik",

"peerDependencies": {
"react": ">=16.3.0"
"react": ">=16.8.0"
},

@@ -120,3 +120,3 @@ "scripts": {

],
"gitHead": "747fd8923c132a5d7d73d318c8e5df8dd292967e"
"gitHead": "a75757f24ea4acf8f9aa8ba0befc7641b9468828"
}

@@ -18,55 +18,4 @@ <p align="center">

**Visit [https://jaredpalmer.com/formik](https://jaredpalmer.com/formik) to get started with Formik.**
**Visit [https://formik.org](https://formik.org) to get started with Formik.**
---
**The below readme is the documentation for the `canary` (prerelease) version of Formik. To view the documentation for the latest stable Formik version visit [jaredpalmer.com/formik/docs](https://jaredpalmer.com/formik/docs/overview)**
---
Let's face it, forms are really verbose in
[React](https://github.com/facebook/react). To make matters worse, most form
helpers do wayyyy too much magic and often have a significant performance cost
associated with them. Formik is a small library that helps you with the 3 most
annoying parts:
1. Getting values in and out of form state
2. Validation and error messages
3. Handling form submission
By colocating all of the above in one place, Formik will keep things
organized--making testing, refactoring, and reasoning about your forms a breeze.
<div id="handleblur-e-any--void"></div>
<div id="handlechange-e-any--void"></div>
## Docs
- [Get Started](https://jaredpalmer.com/formik/docs/overview)
- [API Reference](https://jaredpalmer.com/formik/docs/api/formik)
- [Articles / Tutorials](https://jaredpalmer.com/formik/docs/resources)
- [Get Help](https://jaredpalmer.com/formik/help)
- [Release Notes](https://github.com/jaredpalmer/formik/releases)
## In-browser Playgrounds
You can play with Formik in your web browser with these live online playgrounds.
- CodeSandbox (ReactDOM) https://codesandbox.io/s/zKrK5YLDZ
- Expo Snack (React Native) https://snack.expo.io/@jaredpalmer/basic-formik-x-react-native-example
## Examples
- [Basics](https://codesandbox.io/s/zKrK5YLDZ)
- [Sync Validation](https://codesandbox.io/s/q8yRqQMp)
- [Building your own input primitives](https://codesandbox.io/s/qJR4ykJk)
- Working with 3rd-party inputs:
- [react-select-v1](https://codesandbox.io/s/jRzE53pqR)
- [react-select-v2](https://codesandbox.io/s/73jj9zom96)
- [Draft.js](https://codesandbox.io/s/QW1rqjBLl)
- [Accessing React lifecycle functions](https://codesandbox.io/s/pgD4DLypy)
- [React Native](https://snack.expo.io/@ferrannp/react-native-x-formik)
- [TypeScript](https://codesandbox.io/s/8y578o8152)
- [Handling API Errors](https://codesandbox.io/s/nw193yq32l)
## Organizations and projects using Formik

@@ -100,6 +49,6 @@

- [TSDX](https://github.com/jaredpalmer/tsdx) - Zero-config CLI for TypeScript used by this repo.
- [TSDX](https://github.com/jaredpalmer/tsdx) - Zero-config CLI for TypeScript used by this repo. (Formik's Rollup configuration as a CLI)
---
[MIT License.](https://github.com/jaredpalmer/formik/blob/master/LICENSE)
[Apache 2.0 License.](https://github.com/jaredpalmer/formik/blob/master/LICENSE)

Sorry, the diff of this file is too big to display

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 too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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