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.3 to 2.1.4-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}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),O=R.Provider,_=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),O=t.useRef(k.initialErrors||I),_=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(k.initialValues)},[k.initialValues,c,K]);var z=t.useCallback(function(e){var t=e&&e.values?e.values:R.current,r=e&&e.errors?e.errors:O.current?O.current:k.initialErrors||{},n=e&&e.touched?e.touched:_.current?_.current:k.initialTouched||{},i=e&&e.status?e.status:A.current?A.current:k.initialStatus;R.current=t,O.current=r,_.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&&!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(O.current,k.initialErrors)&&(O.current=k.initialErrors||I,N({type:"SET_ERRORS",payload:k.initialErrors||I}))},[h,k.initialErrors]),t.useEffect(function(){h&&!0===x.current&&!r(_.current,k.initialTouched)&&(_.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(_.current,e),initialError:b(O.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:O.current,initialTouched:_.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(O,{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(_,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=_,exports.FormikContext=R,exports.FormikProvider=O,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 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;
//# sourceMappingURL=formik.cjs.production.min.js.map

@@ -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 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 O=t.createContext(void 0),R=O.Provider,_=O.Consumer;function A(){var e=t.useContext(O);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:k(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"]),k=d({validateOnChange:a,validateOnBlur:u,validateOnMount:c,onSubmit:E},T),O=t.useRef(k.initialValues),R=t.useRef(k.initialErrors||I),_=t.useRef(k.initialTouched||P),A=t.useRef(k.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:k.initialValues,errors:k.initialErrors||I,touched:k.initialTouched||P,status:k.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),j=M[0],B=M[1],x=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):U(e,n);return new Promise(function(e,t){i.then(function(){e(I)},function(r){"ValidationError"===r.name?e(V(r)):t(r)})})},[k.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),k.validationSchema?q(e):{},k.validate?x(e):{}]).then(function(e){return n.all([e[0],e[1],e[2]],{arrayMerge:L})})},[k.validate,k.validationSchema,H,x,q]),K=N(function(e){return void 0===e&&(e=j.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=j.values),B({type:"SET_ISVALIDATING",payload:!0}),W(e).then(function(e){return w.current&&(B({type:"SET_ISVALIDATING",payload:!1}),r(j.errors,e)||B({type:"SET_ERRORS",payload:e})),e})});t.useEffect(function(){c&&!0===w.current&&K(k.initialValues)},[k.initialValues,c,K]);var z=t.useCallback(function(e){var t=e&&e.values?e.values:O.current,r=e&&e.errors?e.errors:R.current?R.current:k.initialErrors||{},n=e&&e.touched?e.touched:_.current?_.current:k.initialTouched||{},i=e&&e.status?e.status:A.current?A.current:k.initialStatus;O.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(k.onReset){var o=k.onReset(j.values,pe);g(o)?o.then(a):a()}else a()},[k.initialErrors,k.initialStatus,k.initialTouched]);t.useEffect(function(){v&&!0===w.current&&!r(O.current,k.initialValues)&&(O.current=k.initialValues,z())},[v,k.initialValues,z]),t.useEffect(function(){v&&!0===w.current&&!r(R.current,k.initialErrors)&&(R.current=k.initialErrors||I,B({type:"SET_ERRORS",payload:k.initialErrors||I}))},[v,k.initialErrors]),t.useEffect(function(){v&&!0===w.current&&!r(_.current,k.initialTouched)&&(_.current=k.initialTouched||P,B({type:"SET_TOUCHED",payload:k.initialTouched||P}))},[v,k.initialTouched]),t.useEffect(function(){v&&!0===w.current&&!r(A.current,k.initialStatus)&&(A.current=k.initialStatus,B({type:"SET_STATUS",payload:k.initialStatus}))},[v,k.initialStatus,k.initialTouched]);var J=N(function(e){if(m(D.current[e].validate)){var t=b(j.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 k.validationSchema?(B({type:"SET_ISVALIDATING",payload:!0}),q(j.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(j.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(j.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(j.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,j.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(j.values):Promise.resolve()}),oe=t.useCallback(function(e,t){e.persist&&e.persist();var r=e.target;ae(t||r.name||r.id,!0)},[ae]),ue=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(j.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(j.values,e),error:b(j.errors,e),touched:!!b(j.touched,e),initialValue:b(O.current,e),initialTouched:!!b(_.current,e),initialError:b(R.current,e)}},[j.errors,j.touched,j.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(j.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,j.values]),Se=t.useMemo(function(){return!r(O.current,j.values)},[O.current,j.values]),Te=t.useMemo(function(){return void 0!==f?Se?j.errors&&0===Object.keys(j.errors).length:!1!==f&&m(f)?f(k):f:j.errors&&0===Object.keys(j.errors).length},[f,Se,j.errors,k]);return d({},j,{initialValues:O.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 L(e,t,r){var i=e.slice();return t.forEach(function(t,a){if(void 0===i[a]){var o=!1!==r.clone&&r.isMergeableObject(t);i[a]=o?n(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?i[a]=n(e[a],t,r):-1===e.indexOf(t)&&i.push(t)}),i}var j="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function N(e){var r=t.useRef(e);return j(function(){r.current=e}),t.useCallback(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.current.apply(void 0,t)},[])}var 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=O,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=k,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});
!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})}));
//# sourceMappingURL=formik.umd.production.min.js.map

@@ -41,3 +41,3 @@ import * as React from 'react';

/**
* Map props to the form touched state
* Map props to the form errors state
*/

@@ -44,0 +44,0 @@ mapPropsToErrors?: (props: Props) => FormikErrors<Values>;

{
"name": "formik",
"description": "Forms in React, without tears",
"version": "2.1.3",
"version": "2.1.4-canary.0",
"license": "MIT",

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

"precommit": "lint-staged",
"storybook": "start-storybook -p 9001",
"addc": "all-contributors add",
"gen-docs": "all-contributors generate && doctoc README.md",
"size": "size-limit"
"size": "size-limit",
"lint": "tsdx lint"
},

@@ -59,6 +59,2 @@ "dependencies": {

"devDependencies": {
"@babel/core": "^7.1.2",
"@storybook/addon-options": "^5.0.11",
"@storybook/addons": "^5.0.11",
"@storybook/react": "^5.0.11",
"@types/hoist-non-react-statics": "^3.3.1",

@@ -71,20 +67,6 @@ "@types/jest": "^24.0.5",

"@types/yup": "^0.24.9",
"@typescript-eslint/eslint-plugin": "^1.9.0",
"@typescript-eslint/parser": "^1.9.0",
"all-contributors-cli": "^4.4.0",
"awesome-typescript-loader": "^5.2.1",
"babel-eslint": "10.0.1",
"babel-loader": "^8.0.6",
"cp-cli": "^1.1.2",
"cross-env": "5.0.5",
"doctoc": "^1.3.0",
"eslint": "5.x",
"eslint-config-prettier": "^4.3.0",
"eslint-config-react-app": "^4.0.1",
"eslint-plugin-flowtype": "2.x",
"eslint-plugin-import": "2.x",
"eslint-plugin-jsx-a11y": "6.x",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "7.x",
"eslint-plugin-react-hooks": "1.5.0",
"husky": "0.14.3",

@@ -94,3 +76,2 @@ "just-debounce-it": "^1.1.0",

"prettier": "^1.19.1",
"raw-loader": "^2.0.0",
"react": "^16.12.0",

@@ -100,6 +81,5 @@ "react-dom": "^16.12.0",

"rimraf": "^2.6.2",
"tsdx": "0.9",
"tsdx": "0.12.3",
"typescript": "^3.7.4",
"webpack": "^4.31.0",
"yup": "^0.28.0"
"yup": "^0.28.1"
},

@@ -109,2 +89,3 @@ "lint-staged": {

"prettier --trailing-comma es5 --single-quote --write 'src/**/*' 'test/**/*' 'README.md' '/docs/**/*.md'",
"tsdx lint",
"git add"

@@ -144,3 +125,3 @@ ]

],
"gitHead": "2852cdb8ded18f5840dc3dac4cac4c4859120130"
"gitHead": "197f82824cae129855a476430ef7025d8cec43f0"
}

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

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