text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):t["react-local-form"]=e(t.React)}(this,function(o){"use strict";var i="default"in o?o.default:o;function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function c(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(){return(l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(t){c(e,t,r[t])})}return e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)r=a[n],0<=e.indexOf(r)||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],0<=e.indexOf(r)||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function y(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var u,i=t[Symbol.iterator]();!(n=(u=i.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e="Expected a function",n="__lodash_hash_undefined__",r=1/0,u=9007199254740991,_="[object Function]",d="[object GeneratorFunction]",b="[object Symbol]",g=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,m=/^\w*$/,j=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,w=/\\(\\)?/g,S=/^\[object .+?Constructor\]$/,P=/^(?:0|[1-9]\d*)$/,E="object"==typeof t&&t&&t.Object===Object&&t,$="object"==typeof self&&self&&self.Object===Object&&self,x=E||$||Function("return this")();var A,C=Array.prototype,F=Function.prototype,k=Object.prototype,T=x["__core-js_shared__"],V=(A=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",R=F.toString,I=k.hasOwnProperty,D=k.toString,M=RegExp("^"+R.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G=x.Symbol,q=C.splice,B=Y(x,"Map"),z=Y(Object,"create"),H=G?G.prototype:void 0,J=H?H.toString:void 0;function K(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function L(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function N(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Q(t,e){for(var r=t.length;r--;)if(nt(t[r][0],e))return r;return-1}function U(t){return!(!at(t)||(e=t,V&&V in e))&&((n=at(r=t)?D.call(r):"")==_||n==d||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?M:S).test(function(t){if(null!=t){try{return R.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e,r,n}function W(t,e,r,n){if(!at(t))return t;for(var o,a,u,i,c,l=-1,f=(e=function(t,e){if(ot(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||ut(t))return!0;return m.test(t)||!g.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:ot(o=e)?o:tt(o)).length,s=f-1,p=t;null!=p&&++l<f;){var h=et(e[l]),y=r;if(l!=s){var v=p[h];void 0===(y=n?n(v,h,p):void 0)&&(y=at(v)?v:Z(e[l+1])?[]:{})}i=y,void 0,c=(a=p)[u=h],I.call(a,u)&&nt(c,i)&&(void 0!==i||u in a)||(a[u]=i),p=p[h]}return t}function X(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Y(t,e){var r,n,o=(n=e,null==(r=t)?void 0:r[n]);return U(o)?o:void 0}function Z(t,e){return!!(e=null==e?u:e)&&("number"==typeof t||P.test(t))&&-1<t&&t%1==0&&t<e}K.prototype.clear=function(){this.__data__=z?z(null):{}},K.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},K.prototype.get=function(t){var e=this.__data__;if(z){var r=e[t];return r===n?void 0:r}return I.call(e,t)?e[t]:void 0},K.prototype.has=function(t){var e=this.__data__;return z?void 0!==e[t]:I.call(e,t)},K.prototype.set=function(t,e){return this.__data__[t]=z&&void 0===e?n:e,this},L.prototype.clear=function(){this.__data__=[]},L.prototype.delete=function(t){var e=this.__data__,r=Q(e,t);return!(r<0||(r==e.length-1?e.pop():q.call(e,r,1),0))},L.prototype.get=function(t){var e=this.__data__,r=Q(e,t);return r<0?void 0:e[r][1]},L.prototype.has=function(t){return-1<Q(this.__data__,t)},L.prototype.set=function(t,e){var r=this.__data__,n=Q(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},N.prototype.clear=function(){this.__data__={hash:new K,map:new(B||L),string:new K}},N.prototype.delete=function(t){return X(this,t).delete(t)},N.prototype.get=function(t){return X(this,t).get(t)},N.prototype.has=function(t){return X(this,t).has(t)},N.prototype.set=function(t,e){return X(this,t).set(t,e),this};var tt=rt(function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(ut(t))return J?J.call(t):"";var e=t+"";return"0"==e&&1/t==-r?"-0":e}(e);var o=[];return j.test(t)&&o.push(""),t.replace(O,function(t,e,r,n){o.push(r?n.replace(w,"$1"):e||t)}),o});function et(t){if("string"==typeof t||ut(t))return t;var e=t+"";return"0"==e&&1/t==-r?"-0":e}function rt(o,a){if("function"!=typeof o||a&&"function"!=typeof a)throw new TypeError(e);var u=function(){var t=arguments,e=a?a.apply(this,t):t[0],r=u.cache;if(r.has(e))return r.get(e);var n=o.apply(this,t);return u.cache=r.set(e,n),n};return u.cache=new(rt.Cache||N),u}function nt(t,e){return t===e||t!=t&&e!=e}rt.Cache=N;var ot=Array.isArray;function at(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function ut(t){return"symbol"==typeof t||!!(e=t)&&"object"==typeof e&&D.call(t)==b;var e}var it=function(t,e,r){return null==t?t:W(t,e,r)},ct="Expected a function",lt="__lodash_hash_undefined__",ft=1/0,st="[object Function]",pt="[object GeneratorFunction]",ht="[object Symbol]",yt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vt=/^\w*$/,_t=/^\./,dt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bt=/\\(\\)?/g,gt=/^\[object .+?Constructor\]$/,mt="object"==typeof t&&t&&t.Object===Object&&t,jt="object"==typeof self&&self&&self.Object===Object&&self,Ot=mt||jt||Function("return this")();var wt,St=Array.prototype,Pt=Function.prototype,Et=Object.prototype,$t=Ot["__core-js_shared__"],xt=(wt=/[^.]+$/.exec($t&&$t.keys&&$t.keys.IE_PROTO||""))?"Symbol(src)_1."+wt:"",At=Pt.toString,Ct=Et.hasOwnProperty,Ft=Et.toString,kt=RegExp("^"+At.call(Ct).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tt=Ot.Symbol,Vt=St.splice,Rt=Lt(Ot,"Map"),It=Lt(Object,"create"),Dt=Tt?Tt.prototype:void 0,Mt=Dt?Dt.toString:void 0;function Gt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function qt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Bt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function zt(t,e){for(var r,n,o=t.length;o--;)if((r=t[o][0])===(n=e)||r!=r&&n!=n)return o;return-1}function Ht(t,e){for(var r,n=0,o=(e=function(t,e){if(Wt(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||Yt(t))return!0;return vt.test(t)||!yt.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:Wt(r=e)?r:Nt(r)).length;null!=t&&n<o;)t=t[Qt(e[n++])];return n&&n==o?t:void 0}function Jt(t){return!(!Xt(t)||(e=t,xt&&xt in e))&&((n=Xt(r=t)?Ft.call(r):"")==st||n==pt||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?kt:gt).test(function(t){if(null!=t){try{return At.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e,r,n}function Kt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Lt(t,e){var r,n,o=(n=e,null==(r=t)?void 0:r[n]);return Jt(o)?o:void 0}Gt.prototype.clear=function(){this.__data__=It?It(null):{}},Gt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Gt.prototype.get=function(t){var e=this.__data__;if(It){var r=e[t];return r===lt?void 0:r}return Ct.call(e,t)?e[t]:void 0},Gt.prototype.has=function(t){var e=this.__data__;return It?void 0!==e[t]:Ct.call(e,t)},Gt.prototype.set=function(t,e){return this.__data__[t]=It&&void 0===e?lt:e,this},qt.prototype.clear=function(){this.__data__=[]},qt.prototype.delete=function(t){var e=this.__data__,r=zt(e,t);return!(r<0||(r==e.length-1?e.pop():Vt.call(e,r,1),0))},qt.prototype.get=function(t){var e=this.__data__,r=zt(e,t);return r<0?void 0:e[r][1]},qt.prototype.has=function(t){return-1<zt(this.__data__,t)},qt.prototype.set=function(t,e){var r=this.__data__,n=zt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Bt.prototype.clear=function(){this.__data__={hash:new Gt,map:new(Rt||qt),string:new Gt}},Bt.prototype.delete=function(t){return Kt(this,t).delete(t)},Bt.prototype.get=function(t){return Kt(this,t).get(t)},Bt.prototype.has=function(t){return Kt(this,t).has(t)},Bt.prototype.set=function(t,e){return Kt(this,t).set(t,e),this};var Nt=Ut(function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(Yt(t))return Mt?Mt.call(t):"";var e=t+"";return"0"==e&&1/t==-ft?"-0":e}(e);var o=[];return _t.test(t)&&o.push(""),t.replace(dt,function(t,e,r,n){o.push(r?n.replace(bt,"$1"):e||t)}),o});function Qt(t){if("string"==typeof t||Yt(t))return t;var e=t+"";return"0"==e&&1/t==-ft?"-0":e}function Ut(o,a){if("function"!=typeof o||a&&"function"!=typeof a)throw new TypeError(ct);var u=function(){var t=arguments,e=a?a.apply(this,t):t[0],r=u.cache;if(r.has(e))return r.get(e);var n=o.apply(this,t);return u.cache=r.set(e,n),n};return u.cache=new(Ut.Cache||Bt),u}Ut.Cache=Bt;var Wt=Array.isArray;function Xt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Yt(t){return"symbol"==typeof t||!!(e=t)&&"object"==typeof e&&Ft.call(t)==ht;var e}var Zt=function(t,e,r){var n=null==t?void 0:Ht(t,e);return void 0===n?r:n},te=i.createContext({}),ee=te.Provider,re=te.Consumer,ne=function(t){function u(){var t,e,a;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return y(a,(e=a=y(this,(t=s(u)).call.apply(t,[this].concat(n))),a.state={values:{},errors:{}},a.handleSubmit=function(t){var e=a.props.onSubmit,r=a.state,n=r.errors,o=r.values;t.preventDefault(),e({values:o,errors:n})},a.handleSetValues=function(){var o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},u=a.props.rules;a.setState(function(t){var e=t.values,r=t.errors,a=f({},e,o),n=Object.entries(u).reduce(function(t,e){var r=v(e,2),n=r[0],o=r[1];return f({},t,c({},n,(Array.isArray(o)?o:[o]).map(function(t){return t(Zt(a,n),a)}).filter(Boolean)))},r);return{values:a,errors:n}})},e))}var e,r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(u,o.Component),e=u,(r=[{key:"componentDidMount",value:function(){var t=this.props.values;this.handleSetValues(t)}},{key:"render",value:function(){var t=this.props,e=t.children,r=t.render,n=h(t,["children","render"]),o=this.state,a=o.values,u=o.errors;return i.createElement(ee,{value:{values:a,errors:u,setValues:this.handleSetValues}},i.createElement("form",l({},n,{onSubmit:this.handleSubmit}),r?r({values:a,errors:u,setValues:this.handleSetValues}):e))}}])&&a(e.prototype,r),n&&a(e,n),u}();ne.defaultProps={values:{},rules:[]};var oe;return{Form:ne,FormItem:(oe=function(t){var e=t.contextProps,r=e.values,n=e.errors,o=e.setValues,a=t.name,u=t.children;return i.cloneElement(u,f({value:Zt(r,a),error:(n[a]||[])[0],errors:n[a]||[],onChange:function(t){o(it(r,a,t.target?t.target.value:t)),t.persist()}},u.props))},function(e){return i.createElement(re,null,function(t){return i.createElement(oe,l({contextProps:t},e))})})}});
  