Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kofile/react-form

Package Overview
Dependencies
Maintainers
38
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kofile/react-form - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

es/Form.js

@@ -11,3 +11,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

import PropTypes from 'prop-types';
import R from 'ramda';
import * as R from 'ramda';
import mapField from './mapField.js';

@@ -14,0 +14,0 @@ import { runAllValidations } from './utils.js';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
import R from 'ramda';
import * as R from 'ramda';
import { getValueFromEvent, runAllValidations, resolveValidateEvent } from './utils.js';

@@ -5,0 +5,0 @@

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

import R from 'ramda';
import * as R from 'ramda';

@@ -3,0 +3,0 @@ var isEvent = R.has('nativeEvent');

@@ -17,3 +17,3 @@ 'use strict';

var _ramda2 = _interopRequireDefault(_ramda);
var R = _interopRequireWildcard(_ramda);

@@ -26,2 +26,4 @@ var _mapField = require('./mapField.js');

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -46,3 +48,3 @@

_this.updateFormState = function (stateChange) {
_this.props.onChange(_ramda2.default.merge(_this.state, stateChange));
_this.props.onChange(R.merge(_this.state, stateChange));

@@ -58,3 +60,3 @@ _this.setState(stateChange);

var newState = _ramda2.default.merge(formValues, (_R$merge = {}, _R$merge[key] = value, _R$merge));
var newState = R.merge(formValues, (_R$merge = {}, _R$merge[key] = value, _R$merge));

@@ -72,3 +74,3 @@ _this.updateFormState({ formValues: newState });

var newState = error ? _ramda2.default.merge(formErrors, (_R$merge2 = {}, _R$merge2[key] = error, _R$merge2)) : formErrors;
var newState = error ? R.merge(formErrors, (_R$merge2 = {}, _R$merge2[key] = error, _R$merge2)) : formErrors;

@@ -80,3 +82,3 @@ _this.updateFormState({ formErrors: newState });

_this.updateChildErrorsOnSubmit = function (fields) {
var errorArray = _ramda2.default.values(fields).map(function (field) {
var errorArray = R.values(fields).map(function (field) {
var _ref;

@@ -92,3 +94,3 @@

if (!_ramda2.default.contains('submit', validateOn)) {
if (!R.contains('submit', validateOn)) {
return;

@@ -102,3 +104,3 @@ }

return _this.setState({ formErrors: _ramda2.default.mergeAll(errorArray) });
return _this.setState({ formErrors: R.mergeAll(errorArray) });
};

@@ -115,3 +117,3 @@

var valid = _ramda2.default.values(fields).every(function (field) {
var valid = R.values(fields).every(function (field) {
var id = field.id,

@@ -145,3 +147,3 @@ _field$validateWith2 = field.validateWith,

var defaultValues = _ramda2.default.compose(_ramda2.default.pickBy(_ramda2.default.complement(_ramda2.default.isNil)), _ramda2.default.pickBy(_ramda2.default.complement(_ramda2.default.isEmpty)), _ramda2.default.mapObjIndexed(_ramda2.default.prop('value')))(config);
var defaultValues = R.compose(R.pickBy(R.complement(R.isNil)), R.pickBy(R.complement(R.isEmpty)), R.mapObjIndexed(R.prop('value')))(config);

@@ -148,0 +150,0 @@ _this.state = {

@@ -9,7 +9,7 @@ 'use strict';

var _ramda2 = _interopRequireDefault(_ramda);
var R = _interopRequireWildcard(_ramda);
var _utils = require('./utils.js');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

@@ -23,3 +23,3 @@ var mapField = function mapField(formConfig, formProps) {

var fields = _ramda2.default.mapObjIndexed(function (inputConfig, key) {
var fields = R.mapObjIndexed(function (inputConfig, key) {
var _inputConfig$validate = inputConfig.validateOn,

@@ -41,3 +41,3 @@ validateOn = _inputConfig$validate === undefined ? [] : _inputConfig$validate,

var onChange = function onChange(e) {
if (_ramda2.default.contains('change', validateOn)) {
if (R.contains('change', validateOn)) {
updateError(e);

@@ -44,0 +44,0 @@ }

{
"name": "@kofile/react-form",
"version": "0.1.2",
"version": "0.1.3",
"description": "A form abstraction for react",

@@ -70,4 +70,4 @@ "contributors": [

"classnames": "^2.2.5",
"prop-types": "^15.5.10",
"ramda": "^0.24.1"
"prop-types": "^15.6.0",
"ramda": "^0.25.0"
},

@@ -74,0 +74,0 @@ "lint-staged": {

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

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","react","prop-types"],n):n(t.ReactForm={},t.React,t.PropTypes)}(this,function(t,n,r){"use strict";var e="default"in n?n.default:n;r=r&&r.hasOwnProperty("default")?r.default:r;var u=function(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]},i=function(t){return function n(r){return 0===arguments.length||u(r)?n:t.apply(this,arguments)}},o=i(function(t){return function(){return t}}),c=o(!1),a=o(!0),f={"@@functional/placeholder":!0},s=function(t){return function n(r,e){switch(arguments.length){case 0:return n;case 1:return u(r)?n:i(function(n){return t(r,n)});default:return u(r)&&u(e)?n:u(r)?i(function(n){return t(n,e)}):u(e)?i(function(n){return t(r,n)}):t(r,e)}}},l=s(function(t,n){return+t+ +n}),p=function(t,n){t=t||[],n=n||[];var r,e=t.length,u=n.length,i=[];for(r=0;e>r;)i[i.length]=t[r],r+=1;for(r=0;u>r;)i[i.length]=n[r],r+=1;return i},h=function(t,n){switch(t){case 0:return function(){return n.apply(this,arguments)};case 1:return function(t){return n.apply(this,arguments)};case 2:return function(t,r){return n.apply(this,arguments)};case 3:return function(t,r,e){return n.apply(this,arguments)};case 4:return function(t,r,e,u){return n.apply(this,arguments)};case 5:return function(t,r,e,u,i){return n.apply(this,arguments)};case 6:return function(t,r,e,u,i,o){return n.apply(this,arguments)};case 7:return function(t,r,e,u,i,o,c){return n.apply(this,arguments)};case 8:return function(t,r,e,u,i,o,c,a){return n.apply(this,arguments)};case 9:return function(t,r,e,u,i,o,c,a,f){return n.apply(this,arguments)};case 10:return function(t,r,e,u,i,o,c,a,f,s){return n.apply(this,arguments)};default:throw Error("First argument to _arity must be a non-negative integer no greater than ten")}},y=function t(n,r,e){return function(){for(var i=[],o=0,c=n,a=0;r.length>a||arguments.length>o;){var f;a>=r.length||u(r[a])&&arguments.length>o?(f=arguments[o],o+=1):f=r[a],i[a]=f,u(f)||(c-=1),a+=1}return c>0?h(c,t(n,i,e)):e.apply(this,i)}},d=s(function(t,n){return 1===t?i(n):h(t,y(t,[],n))}),g=i(function(t){return d(t.length,function(){var n=0,r=arguments[0],e=arguments[arguments.length-1],u=Array.prototype.slice.call(arguments,0);return u[0]=function(){var t=r.apply(this,p(arguments,[n,e]));return n+=1,t},t.apply(this,u)})}),v=function(t){return function n(r,e,o){switch(arguments.length){case 0:return n;case 1:return u(r)?n:s(function(n,e){return t(r,n,e)});case 2:return u(r)&&u(e)?n:u(r)?s(function(n,r){return t(n,e,r)}):u(e)?s(function(n,e){return t(r,n,e)}):i(function(n){return t(r,e,n)});default:return u(r)&&u(e)&&u(o)?n:u(r)&&u(e)?s(function(n,r){return t(n,r,o)}):u(r)&&u(o)?s(function(n,r){return t(n,e,r)}):u(e)&&u(o)?s(function(n,e){return t(r,n,e)}):u(r)?i(function(n){return t(n,e,o)}):u(e)?i(function(n){return t(r,n,o)}):u(o)?i(function(n){return t(r,e,n)}):t(r,e,o)}}},m=v(function(t,n,r){if(n>=r.length||-r.length>n)return r;var e=(0>n?r.length:0)+n,u=p(r);return u[e]=t(r[e]),u}),b=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)},x=function(t){return"function"==typeof t["@@transducer/step"]},w=function(t,n,r){return function(){if(0===arguments.length)return r();var e=Array.prototype.slice.call(arguments,0),u=e.pop();if(!b(u)){for(var i=0;t.length>i;){if("function"==typeof u[t[i]])return u[t[i]].apply(u,e);i+=1}if(x(u))return n.apply(null,e)(u)}return r.apply(this,arguments)}},j=function(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}},O={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}},A=function(){function t(t,n){this.xf=n,this.f=t,this.all=!0}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=function(t){return this.all&&(t=this.xf["@@transducer/step"](t,!0)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)||(this.all=!1,t=j(this.xf["@@transducer/step"](t,!1))),t},s(function(n,r){return new t(n,r)})}(),E=s(w(["all"],A,function(t,n){for(var r=0;n.length>r;){if(!t(n[r]))return!1;r+=1}return!0})),S=s(function(t,n){return n>t?n:t}),_=function(t,n){for(var r=0,e=n.length,u=Array(e);e>r;)u[r]=t(n[r]),r+=1;return u},k=function(t){return"[object String]"===Object.prototype.toString.call(t)},q=i(function(t){return!!b(t)||!!t&&("object"==typeof t&&(!k(t)&&(1===t.nodeType?!!t.length:0===t.length||t.length>0&&(t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1)))))}),F=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,n){return this.f(t,n)},function(n){return new t(n)}}(),W=s(function(t,n){return h(t.length,function(){return t.apply(n,arguments)})}),C=function(){function t(t,n,r){for(var e=0,u=r.length;u>e;){if((n=t["@@transducer/step"](n,r[e]))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e+=1}return t["@@transducer/result"](n)}function n(t,n,r){for(var e=r.next();!e.done;){if((n=t["@@transducer/step"](n,e.value))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e=r.next()}return t["@@transducer/result"](n)}function r(t,n,r,e){return t["@@transducer/result"](r[e](W(t["@@transducer/step"],t),n))}var e="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";return function(u,i,o){if("function"==typeof u&&(u=F(u)),q(o))return t(u,i,o);if("function"==typeof o["fantasy-land/reduce"])return r(u,i,o,"fantasy-land/reduce");if(null!=o[e])return n(u,i,o[e]());if("function"==typeof o.next)return n(u,i,o);if("function"==typeof o.reduce)return r(u,i,o,"reduce");throw new TypeError("reduce: list must be array or iterable")}}(),P=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=O.result,t.prototype["@@transducer/step"]=function(t,n){return this.xf["@@transducer/step"](t,this.f(n))},s(function(n,r){return new t(n,r)})}(),I=function(t,n){return Object.prototype.hasOwnProperty.call(n,t)},N=function(){var t=Object.prototype.toString;return"[object Arguments]"===t.call(arguments)?function(n){return"[object Arguments]"===t.call(n)}:function(t){return I("callee",t)}}(),T=function(){var t=!{toString:null}.propertyIsEnumerable("toString"),n=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],r=function(){return arguments.propertyIsEnumerable("length")}(),e=function(t,n){for(var r=0;t.length>r;){if(t[r]===n)return!0;r+=1}return!1};return i("function"!=typeof Object.keys||r?function(u){if(Object(u)!==u)return[];var i,o,c=[],a=r&&N(u);for(i in u)!I(i,u)||a&&"length"===i||(c[c.length]=i);if(t)for(o=6;o>=0;)I(i=n[o],u)&&!e(c,i)&&(c[c.length]=i),o-=1;return c}:function(t){return Object(t)!==t?[]:Object.keys(t)})}(),V=s(w(["fantasy-land/map","map"],P,function(t,n){switch(Object.prototype.toString.call(n)){case"[object Function]":return d(n.length,function(){return t.call(this,n.apply(this,arguments))});case"[object Object]":return C(function(r,e){return r[e]=t(n[e]),r},{},T(n));default:return _(t,n)}})),U=s(function(t,n){return n[t]}),B=s(function(t,n){return V(U(t),n)}),R=v(C),D=i(function(t){return d(R(S,0,B("length",t)),function(){for(var n=0,r=t.length;r>n;){if(!t[n].apply(this,arguments))return!1;n+=1}return!0})}),M=s(function(t,n){return t&&n}),L=function(){function t(t,n){this.xf=n,this.f=t,this.any=!1}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=function(t){return this.any||(t=this.xf["@@transducer/step"](t,!1)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.any=!0,t=j(this.xf["@@transducer/step"](t,!0))),t},s(function(n,r){return new t(n,r)})}(),z=s(w(["any"],L,function(t,n){for(var r=0;n.length>r;){if(t(n[r]))return!0;r+=1}return!1})),K=i(function(t){return d(R(S,0,B("length",t)),function(){for(var n=0,r=t.length;r>n;){if(t[n].apply(this,arguments))return!0;n+=1}return!1})}),$=s(function(t,n){return"function"==typeof n["fantasy-land/ap"]?n["fantasy-land/ap"](t):"function"==typeof t.ap?t.ap(n):"function"==typeof t?function(r){return t(r)(n(r))}:C(function(t,r){return p(t,V(r,n))},[],t)}),H=function(){function t(t,n){this.xf=n,this.pos=0,this.full=!1,this.acc=Array(t)}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=function(t){return this.acc=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.store(n),this.full?this.xf["@@transducer/step"](t,this.getCopy()):t},t.prototype.store=function(t){this.acc[this.pos]=t,(this.pos+=1)===this.acc.length&&(this.pos=0,this.full=!0)},t.prototype.getCopy=function(){return p(Array.prototype.slice.call(this.acc,this.pos),Array.prototype.slice.call(this.acc,0,this.pos))},s(function(n,r){return new t(n,r)})}(),J=s(w([],H,function(t,n){for(var r=0,e=n.length-(t-1),u=Array(0>e?0:e);e>r;)u[r]=Array.prototype.slice.call(n,r,r+t),r+=1;return u})),X=s(function(t,n){return p(n,[t])}),Y=s(function(t,n){return t.apply(this,n)}),Z=i(function(t){for(var n=T(t),r=n.length,e=[],u=0;r>u;)e[u]=t[n[u]],u+=1;return e}),G=i(function t(n){return n=V(function(n){return"function"==typeof n?n:t(n)},n),d(R(S,0,B("length",Z(n))),function(){var t=arguments;return V(function(n){return Y(n,t)},n)})}),Q=v(function(t,n,r){var e=t(n),u=t(r);return u>e?-1:e>u?1:0}),tt=v(function(t,n,r){var e={};for(var u in r)e[u]=r[u];return e[t]=n,e}),nt=Number.isInteger||function(t){return t<<0===t},rt=i(function(t){return null==t}),et=v(function t(n,r,e){if(0===n.length)return r;var u=n[0];if(n.length>1){var i=!rt(e)&&I(u,e)?e[u]:nt(n[1])?[]:{};r=t(Array.prototype.slice.call(n,1),r,i)}if(nt(u)&&b(e)){var o=[].concat(e);return o[u]=r,o}return tt(u,r,e)}),ut=s(function(t,n){switch(t){case 0:return function(){return n.call(this)};case 1:return function(t){return n.call(this,t)};case 2:return function(t,r){return n.call(this,t,r)};case 3:return function(t,r,e){return n.call(this,t,r,e)};case 4:return function(t,r,e,u){return n.call(this,t,r,e,u)};case 5:return function(t,r,e,u,i){return n.call(this,t,r,e,u,i)};case 6:return function(t,r,e,u,i,o){return n.call(this,t,r,e,u,i,o)};case 7:return function(t,r,e,u,i,o,c){return n.call(this,t,r,e,u,i,o,c)};case 8:return function(t,r,e,u,i,o,c,a){return n.call(this,t,r,e,u,i,o,c,a)};case 9:return function(t,r,e,u,i,o,c,a,f){return n.call(this,t,r,e,u,i,o,c,a,f)};case 10:return function(t,r,e,u,i,o,c,a,f,s){return n.call(this,t,r,e,u,i,o,c,a,f,s)};default:throw Error("First argument to nAry must be a non-negative integer no greater than ten")}}),it=i(function(t){return ut(2,t)}),ot=function(t){return"[object Function]"===Object.prototype.toString.call(t)},ct=s(function(t,n){var r=d(t,n);return d(t,function(){return C($,V(r,arguments[0]),Array.prototype.slice.call(arguments,1))})}),at=i(function(t){return ct(t.length,t)}),ft=s(function(t,n){return ot(t)?function(){return t.apply(this,arguments)&&n.apply(this,arguments)}:at(M)(t,n)}),st=i(function(t){return d(t.length,t)}),lt=st(function(t){return t.apply(this,Array.prototype.slice.call(arguments,1))}),pt=function(t){return function n(r){for(var e,u,i,o=[],c=0,a=r.length;a>c;){if(q(r[c]))for(i=0,u=(e=t?n(r[c]):r[c]).length;u>i;)o[o.length]=e[i],i+=1;else o[o.length]=r[c];c+=1}return o}},ht=function(t){return{"@@transducer/value":t,"@@transducer/reduced":!0}},yt=function(){var t=function(t){return{"@@transducer/init":O.init,"@@transducer/result":function(n){return t["@@transducer/result"](n)},"@@transducer/step":function(n,r){var e=t["@@transducer/step"](n,r);return e["@@transducer/reduced"]?ht(e):e}}};return function(n){var r=t(n);return{"@@transducer/init":O.init,"@@transducer/result":function(t){return r["@@transducer/result"](t)},"@@transducer/step":function(t,n){return q(n)?C(r,t,n):C(r,t,[n])}}}}(),dt=s(function(t,n){return V(t,yt(n))}),gt=s(w(["fantasy-land/chain","chain"],dt,function(t,n){return"function"==typeof n?function(r){return t(n(r))(r)}:pt(!1)(V(t,n))})),vt=v(function(t,n,r){if(t>n)throw Error("min must not be greater than max in clamp(min, max, value)");return t>r?t:r>n?n:r}),mt=function(t){return RegExp(t.source,(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":""))},bt=i(function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),xt=function t(n,r,e,u){var i=function(i){for(var o=r.length,c=0;o>c;){if(n===r[c])return e[c];c+=1}r[c+1]=n,e[c+1]=i;for(var a in n)i[a]=u?t(n[a],r,e,!0):n[a];return i};switch(bt(n)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(n.valueOf());case"RegExp":return mt(n);default:return n}},wt=i(function(t){return null!=t&&"function"==typeof t.clone?t.clone():xt(t,[],[],!0)}),jt=i(function(t){return function(n,r){return t(n,r)?-1:t(r,n)?1:0}}),Ot=i(function(t){return!t}),At=at(Ot),Et=function(t,n){return function(){return n.call(this,t.apply(this,arguments))}},St=function(t,n){return function(){var r=arguments.length;if(0===r)return n();var e=arguments[r-1];return b(e)||"function"!=typeof e[t]?n.apply(this,arguments):e[t].apply(e,Array.prototype.slice.call(arguments,0,r-1))}},_t=v(St("slice",function(t,n,r){return Array.prototype.slice.call(r,t,n)})),kt=i(St("tail",_t(1,1/0))),qt=function(){if(0===arguments.length)throw Error("pipe requires at least one argument");return h(arguments[0].length,R(Et,arguments[0],kt(arguments)))},Ft=i(function(t){return k(t)?t.split("").reverse().join(""):Array.prototype.slice.call(t,0).reverse()}),Wt=function(){if(0===arguments.length)throw Error("compose requires at least one argument");return qt.apply(this,Ft(arguments))},Ct=function(){if(0===arguments.length)throw Error("composeK requires at least one argument");var t=Array.prototype.slice.call(arguments),n=t.pop();return Wt(Wt.apply(this,V(gt,t)),n)},Pt=function(t,n){return function(){var r=this;return t.apply(r,arguments).then(function(t){return n.call(r,t)})}},It=function(){if(0===arguments.length)throw Error("pipeP requires at least one argument");return h(arguments[0].length,R(Pt,arguments[0],kt(arguments)))},Nt=function(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r},Tt=function(t){var n=(t+"").match(/^function (\w*)/);return null==n?"":n[1]},Vt=s(function(t,n){return t===n?0!==t||1/t==1/n:t!==t&&n!==n}),Ut=function t(n,r,e,u){if(Vt(n,r))return!0;if(bt(n)!==bt(r))return!1;if(null==n||null==r)return!1;if("function"==typeof n["fantasy-land/equals"]||"function"==typeof r["fantasy-land/equals"])return"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](r)&&"function"==typeof r["fantasy-land/equals"]&&r["fantasy-land/equals"](n);if("function"==typeof n.equals||"function"==typeof r.equals)return"function"==typeof n.equals&&n.equals(r)&&"function"==typeof r.equals&&r.equals(n);switch(bt(n)){case"Arguments":case"Array":case"Object":if("function"==typeof n.constructor&&"Promise"===Tt(n.constructor))return n===r;break;case"Boolean":case"Number":case"String":if(typeof n!=typeof r||!Vt(n.valueOf(),r.valueOf()))return!1;break;case"Date":if(!Vt(n.valueOf(),r.valueOf()))return!1;break;case"Error":return n.name===r.name&&n.message===r.message;case"RegExp":if(n.source!==r.source||n.global!==r.global||n.ignoreCase!==r.ignoreCase||n.multiline!==r.multiline||n.sticky!==r.sticky||n.unicode!==r.unicode)return!1;break;case"Map":case"Set":if(!t(Nt(n.entries()),Nt(r.entries()),e,u))return!1;break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=T(n);if(i.length!==T(r).length)return!1;for(var o=e.length-1;o>=0;){if(e[o]===n)return u[o]===r;o-=1}for(e.push(n),u.push(r),o=i.length-1;o>=0;){var c=i[o];if(!I(c,r)||!t(r[c],n[c],e,u))return!1;o-=1}return e.pop(),u.pop(),!0},Bt=s(function(t,n){return Ut(t,n,[],[])}),Rt=function(t,n,r){var e,u;if("function"==typeof t.indexOf)switch(typeof n){case"number":if(0===n){for(e=1/n;t.length>r;){if(0===(u=t[r])&&1/u===e)return r;r+=1}return-1}if(n!==n){for(;t.length>r;){if("number"==typeof(u=t[r])&&u!==u)return r;r+=1}return-1}return t.indexOf(n,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(n,r);case"object":if(null===n)return t.indexOf(n,r)}for(;t.length>r;){if(Bt(t[r],n))return r;r+=1}return-1},Dt=function(t,n){return Rt(n,t,0)>=0},Mt=function(t){return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'},Lt=function(){var t=function(t){return(10>t?"0":"")+t};return"function"==typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(n){return n.getUTCFullYear()+"-"+t(n.getUTCMonth()+1)+"-"+t(n.getUTCDate())+"T"+t(n.getUTCHours())+":"+t(n.getUTCMinutes())+":"+t(n.getUTCSeconds())+"."+(n.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}}(),zt=function(t){return function(){return!t.apply(this,arguments)}},Kt=function(t,n){for(var r=0,e=n.length,u=[];e>r;)t(n[r])&&(u[u.length]=n[r]),r+=1;return u},$t=function(t){return"[object Object]"===Object.prototype.toString.call(t)},Ht=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=O.result,t.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):t},s(function(n,r){return new t(n,r)})}(),Jt=s(w(["filter"],Ht,function(t,n){return $t(n)?C(function(r,e){return t(n[e])&&(r[e]=n[e]),r},{},T(n)):Kt(t,n)})),Xt=s(function(t,n){return Jt(zt(t),n)}),Yt=function t(n,r){var e=function(e){var u=r.concat([n]);return Dt(e,u)?"<Circular>":t(e,u)},u=function(t,n){return _(function(n){return Mt(n)+": "+e(t[n])},n.slice().sort())};switch(Object.prototype.toString.call(n)){case"[object Arguments]":return"(function() { return arguments; }("+_(e,n).join(", ")+"))";case"[object Array]":return"["+_(e,n).concat(u(n,Xt(function(t){return/^\d+$/.test(t)},T(n)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof n?"new Boolean("+e(n.valueOf())+")":""+n;case"[object Date]":return"new Date("+(isNaN(n.valueOf())?e(NaN):Mt(Lt(n)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof n?"new Number("+e(n.valueOf())+")":1/n==-1/0?"-0":n.toString(10);case"[object String]":return"object"==typeof n?"new String("+e(n.valueOf())+")":Mt(n);case"[object Undefined]":return"undefined";default:if("function"==typeof n.toString){var i=""+n;if("[object Object]"!==i)return i}return"{"+u(n,T(n)).join(", ")+"}"}},Zt=i(function(t){return Yt(t,[])}),Gt=s(function(t,n){if(b(t)){if(b(n))return t.concat(n);throw new TypeError(Zt(n)+" is not an array")}if(k(t)){if(k(n))return t+n;throw new TypeError(Zt(n)+" is not a string")}if(null!=t&&ot(t["fantasy-land/concat"]))return t["fantasy-land/concat"](n);if(null!=t&&ot(t.concat))return t.concat(n);throw new TypeError(Zt(t)+' does not have a method named "concat" or "fantasy-land/concat"')}),Qt=i(function(t){var n=R(S,0,V(function(t){return t[0].length},t));return h(n,function(){for(var n=0;t.length>n;){if(t[n][0].apply(this,arguments))return t[n][1].apply(this,arguments);n+=1}})}),tn=s(function(t,n){if(t>10)throw Error("Constructor with greater than ten arguments");return 0===t?function(){return new n}:st(ut(t,function(t,r,e,u,i,o,c,a,f,s){switch(arguments.length){case 1:return new n(t);case 2:return new n(t,r);case 3:return new n(t,r,e);case 4:return new n(t,r,e,u);case 5:return new n(t,r,e,u,i);case 6:return new n(t,r,e,u,i,o);case 7:return new n(t,r,e,u,i,o,c);case 8:return new n(t,r,e,u,i,o,c,a);case 9:return new n(t,r,e,u,i,o,c,a,f);case 10:return new n(t,r,e,u,i,o,c,a,f,s)}}))}),nn=i(function(t){return tn(t.length,t)}),rn=s(Dt),en=s(function(t,n){return d(R(S,0,B("length",n)),function(){var r=arguments,e=this;return t.apply(e,_(function(t){return t.apply(e,r)},n))})}),un=function(){function t(t,n,r,e){this.valueFn=t,this.valueAcc=n,this.keyFn=r,this.xf=e,this.inputs={}}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=function(t){var n;for(n in this.inputs)if(I(n,this.inputs)&&(t=this.xf["@@transducer/step"](t,this.inputs[n]))["@@transducer/reduced"]){t=t["@@transducer/value"];break}return this.inputs=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){var r=this.keyFn(n);return this.inputs[r]=this.inputs[r]||[r,this.valueAcc],this.inputs[r][1]=this.valueFn(this.inputs[r][1],n),t},y(4,[],function(n,r,e,u){return new t(n,r,e,u)})}(),on=y(4,[],w([],un,function(t,n,r,e){return C(function(e,u){var i=r(u);return e[i]=t(I(i,e)?e[i]:n,u),e},{},e)})),cn=on(function(t,n){return t+1},0),an=l(-1),fn=s(function(t,n){return null==n||n!==n?t:n}),sn=v(function(t,n,r){var e=t(n),u=t(r);return e>u?-1:u>e?1:0}),ln=s(function(t,n){for(var r=[],e=0,u=t.length;u>e;)Dt(t[e],n)||Dt(t[e],r)||(r[r.length]=t[e]),e+=1;return r}),pn=function(t,n,r){for(var e=0,u=r.length;u>e;){if(t(n,r[e]))return!0;e+=1}return!1},hn=v(function(t,n,r){for(var e=[],u=0,i=n.length;i>u;)pn(t,n[u],r)||pn(t,n[u],e)||e.push(n[u]),u+=1;return e}),yn=s(function(t,n){var r={};for(var e in n)r[e]=n[e];return delete r[t],r}),dn=v(function(t,n,r){var e=Array.prototype.slice.call(r,0);return e.splice(t,n),e}),gn=v(function(t,n,r){return m(o(n),t,r)}),vn=s(function t(n,r){switch(n.length){case 0:return r;case 1:return nt(n[0])?dn(n[0],1,r):yn(n[0],r);default:var e=n[0],u=Array.prototype.slice.call(n,1);return null==r[e]?r:nt(n[0])?gn(e,t(u,r[e]),r):tt(e,t(u,r[e]),r)}}),mn=s(function(t,n){return t/n}),bn=function(){function t(t,n){this.xf=n,this.n=t}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=O.result,t.prototype["@@transducer/step"]=function(t,n){return this.n>0?(this.n-=1,t):this.xf["@@transducer/step"](t,n)},s(function(n,r){return new t(n,r)})}(),xn=s(w(["drop"],bn,function(t,n){return _t(Math.max(0,t),1/0,n)})),wn=function(){function t(t,n){this.xf=n,this.n=t,this.i=0}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=O.result,t.prototype["@@transducer/step"]=function(t,n){this.i+=1;var r=0===this.n?t:this.xf["@@transducer/step"](t,n);return 0>this.n||this.n>this.i?r:j(r)},s(function(n,r){return new t(n,r)})}(),jn=s(w(["take"],wn,function(t,n){return _t(0,0>t?1/0:t,n)})),On=function(){function t(t,n){this.xf=n,this.pos=0,this.full=!1,this.acc=Array(t)}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=function(t){return this.acc=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.full&&(t=this.xf["@@transducer/step"](t,this.acc[this.pos])),this.store(n),t},t.prototype.store=function(t){this.acc[this.pos]=t,(this.pos+=1)===this.acc.length&&(this.pos=0,this.full=!0)},s(function(n,r){return new t(n,r)})}(),An=s(w([],On,function(t,n){return jn(n.length>t?n.length-t:0,n)})),En=function(){function t(t,n){this.f=t,this.retained=[],this.xf=n}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=function(t){return this.retained=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.retain(t,n):this.flush(t,n)},t.prototype.flush=function(t,n){return t=C(this.xf["@@transducer/step"],t,this.retained),this.retained=[],this.xf["@@transducer/step"](t,n)},t.prototype.retain=function(t,n){return this.retained.push(n),t},s(function(n,r){return new t(n,r)})}(),Sn=s(w([],En,function(t,n){for(var r=n.length-1;r>=0&&t(n[r]);)r-=1;return Array.prototype.slice.call(n,0,r+1)})),_n=function(){function t(t,n){this.xf=n,this.pred=t,this.lastValue=void 0,this.seenFirstValue=!1}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=O.result,t.prototype["@@transducer/step"]=function(t,n){var r=!1;return this.seenFirstValue?this.pred(this.lastValue,n)&&(r=!0):this.seenFirstValue=!0,this.lastValue=n,r?t:this.xf["@@transducer/step"](t,n)},s(function(n,r){return new t(n,r)})}(),kn=s(function(t,n){var r=0>t?n.length+t:t;return k(n)?n.charAt(r):n[r]}),qn=kn(-1),Fn=s(w([],_n,function(t,n){var r=[],e=1,u=n.length;if(0!==u)for(r[0]=n[0];u>e;)t(qn(r),n[e])||(r[r.length]=n[e]),e+=1;return r})),Wn=i(w([],_n(Bt),Fn(Bt))),Cn=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=O.result,t.prototype["@@transducer/step"]=function(t,n){if(this.f){if(this.f(n))return t;this.f=null}return this.xf["@@transducer/step"](t,n)},s(function(n,r){return new t(n,r)})}(),Pn=s(w(["dropWhile"],Cn,function(t,n){for(var r=0,e=n.length;e>r&&t(n[r]);)r+=1;return Array.prototype.slice.call(n,r)})),In=s(function(t,n){return t||n}),Nn=s(function(t,n){return ot(t)?function(){return t.apply(this,arguments)||n.apply(this,arguments)}:at(In)(t,n)}),Tn=i(function(t){return null!=t&&"function"==typeof t["fantasy-land/empty"]?t["fantasy-land/empty"]():null!=t&&null!=t.constructor&&"function"==typeof t.constructor["fantasy-land/empty"]?t.constructor["fantasy-land/empty"]():null!=t&&"function"==typeof t.empty?t.empty():null!=t&&null!=t.constructor&&"function"==typeof t.constructor.empty?t.constructor.empty():b(t)?[]:k(t)?"":$t(t)?{}:N(t)?function(){return arguments}():void 0}),Vn=s(function(t,n){return xn(0>t?0:n.length-t,n)}),Un=s(function(t,n){return Bt(Vn(t.length,n),t)}),Bn=v(function(t,n,r){return Bt(t(n),t(r))}),Rn=v(function(t,n,r){return Bt(n[t],r[t])}),Dn=s(function t(n,r){var e,u,i,o={};for(u in r)i=typeof(e=n[u]),o[u]="function"===i?e(r[u]):e&&"object"===i?t(e,r[u]):r[u];return o}),Mn=function(){function t(t,n){this.xf=n,this.f=t,this.found=!1}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,void 0)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.found=!0,t=j(this.xf["@@transducer/step"](t,n))),t},s(function(n,r){return new t(n,r)})}(),Ln=s(w(["find"],Mn,function(t,n){for(var r=0,e=n.length;e>r;){if(t(n[r]))return n[r];r+=1}})),zn=function(){function t(t,n){this.xf=n,this.f=t,this.idx=-1,this.found=!1}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,-1)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,n){return this.idx+=1,this.f(n)&&(this.found=!0,t=j(this.xf["@@transducer/step"](t,this.idx))),t},s(function(n,r){return new t(n,r)})}(),Kn=s(w([],zn,function(t,n){for(var r=0,e=n.length;e>r;){if(t(n[r]))return r;r+=1}return-1})),$n=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=function(t){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](t,this.last))},t.prototype["@@transducer/step"]=function(t,n){return this.f(n)&&(this.last=n),t},s(function(n,r){return new t(n,r)})}(),Hn=s(w([],$n,function(t,n){for(var r=n.length-1;r>=0;){if(t(n[r]))return n[r];r-=1}})),Jn=function(){function t(t,n){this.xf=n,this.f=t,this.idx=-1,this.lastIdx=-1}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=function(t){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](t,this.lastIdx))},t.prototype["@@transducer/step"]=function(t,n){return this.idx+=1,this.f(n)&&(this.lastIdx=this.idx),t},s(function(n,r){return new t(n,r)})}(),Xn=s(w([],Jn,function(t,n){for(var r=n.length-1;r>=0;){if(t(n[r]))return r;r-=1}return-1})),Yn=i(pt(!0)),Zn=i(function(t){return st(function(n,r){var e=Array.prototype.slice.call(arguments,0);return e[0]=r,e[1]=n,t.apply(this,e)})}),Gn=s(St("forEach",function(t,n){for(var r=n.length,e=0;r>e;)t(n[e]),e+=1;return n})),Qn=s(function(t,n){for(var r=T(n),e=0;r.length>e;){var u=r[e];t(n[u],u,n),e+=1}return n}),tr=i(function(t){for(var n={},r=0;t.length>r;)n[t[r][0]]=t[r][1],r+=1;return n}),nr=s(St("groupBy",on(function(t,n){return null==t&&(t=[]),t.push(n),t},null))),rr=s(function(t,n){for(var r=[],e=0,u=n.length;u>e;){for(var i=e+1;u>i&&t(n[i-1],n[i]);)i+=1;r.push(n.slice(e,i)),e=i}return r}),er=s(function(t,n){return t>n}),ur=s(function(t,n){return t>=n}),ir=s(I),or=s(function(t,n){return t in n}),cr=kn(0),ar=function(t){return t},fr=i(ar),sr=v(function(t,n,r){return d(Math.max(t.length,n.length,r.length),function(){return t.apply(this,arguments)?n.apply(this,arguments):r.apply(this,arguments)})}),lr=l(1),pr=on(function(t,n){return n},null),hr=s(function(t,n){return"function"!=typeof n.indexOf||b(n)?Rt(n,t,0):n.indexOf(t)}),yr=_t(0,-1),dr=v(function(t,n,r){return Kt(function(n){return pn(t,n,r)},n)}),gr=v(function(t,n,r){t=r.length>t&&t>=0?t:r.length;var e=Array.prototype.slice.call(r,0);return e.splice(t,0,n),e}),vr=v(function(t,n,r){return t=r.length>t&&t>=0?t:r.length,[].concat(Array.prototype.slice.call(r,0,t),n,Array.prototype.slice.call(r,t))}),mr=function(){function t(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}function n(t,n,r){var e,u=typeof t;switch(u){case"string":case"number":return 0===t&&1/t==-1/0?!!r._items["-0"]||(n&&(r._items["-0"]=!0),!1):null!==r._nativeSet?n?(e=r._nativeSet.size,r._nativeSet.add(t),r._nativeSet.size===e):r._nativeSet.has(t):u in r._items?t in r._items[u]||(n&&(r._items[u][t]=!0),!1):(n&&(r._items[u]={},r._items[u][t]=!0),!1);case"boolean":if(u in r._items){var i=t?1:0;return!!r._items[u][i]||(n&&(r._items[u][i]=!0),!1)}return n&&(r._items[u]=t?[!1,!0]:[!0,!1]),!1;case"function":return null!==r._nativeSet?n?(e=r._nativeSet.size,r._nativeSet.add(t),r._nativeSet.size===e):r._nativeSet.has(t):u in r._items?!!Dt(t,r._items[u])||(n&&r._items[u].push(t),!1):(n&&(r._items[u]=[t]),!1);case"undefined":return!!r._items[u]||(n&&(r._items[u]=!0),!1);case"object":if(null===t)return!!r._items.null||(n&&(r._items.null=!0),!1);default:return(u=Object.prototype.toString.call(t))in r._items?!!Dt(t,r._items[u])||(n&&r._items[u].push(t),!1):(n&&(r._items[u]=[t]),!1)}}return t.prototype.add=function(t){return!n(t,!0,this)},t.prototype.has=function(t){return n(t,!1,this)},t}(),br=s(function(t,n){for(var r,e,u=new mr,i=[],o=0;n.length>o;)r=t(e=n[o]),u.add(r)&&i.push(e),o+=1;return i}),xr=br(fr),wr=s(function(t,n){var r,e;return t.length>n.length?(r=t,e=n):(r=n,e=t),xr(Kt(Zn(Dt)(r),e))}),jr=s(function(t,n){for(var r,e=0,u=n.length,i=[];u>e;)pn(t,r=n[e],i)||(i[i.length]=r),e+=1;return i}),Or=v(function(t,n,r){var e,u;n.length>r.length?(e=n,u=r):(e=r,u=n);for(var i=[],o=0;u.length>o;)pn(t,u[o],e)&&(i[i.length]=u[o]),o+=1;return jr(t,i)}),Ar=s(St("intersperse",function(t,n){for(var r=[],e=0,u=n.length;u>e;)e===u-1?r.push(n[e]):r.push(n[e],t),e+=1;return r})),Er="function"==typeof Object.assign?Object.assign:function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,e=arguments.length;e>r;){var u=arguments[r];if(null!=u)for(var i in u)I(i,u)&&(n[i]=u[i]);r+=1}return n},Sr=s(function(t,n){var r={};return r[t]=n,r}),_r=function(){var t={"@@transducer/init":Array,"@@transducer/step":function(t,n){return t.push(n),t},"@@transducer/result":ar},n={"@@transducer/init":String,"@@transducer/step":function(t,n){return t+n},"@@transducer/result":ar},r={"@@transducer/init":Object,"@@transducer/step":function(t,n){return Er(t,q(n)?Sr(n[0],n[1]):n)},"@@transducer/result":ar};return function(e){if(x(e))return e;if(q(e))return t;if("string"==typeof e)return n;if("object"==typeof e)return r;throw Error("Cannot create transformer for "+e)}}(),kr=v(function(t,n,r){return x(t)?C(n(t),t["@@transducer/init"](),r):C(n(_r(t)),xt(t,[],[],!1),r)}),qr=i(function(t){for(var n=T(t),r=n.length,e=0,u={};r>e;){var i=n[e],o=t[i],c=I(o,u)?u[o]:u[o]=[];c[c.length]=i,e+=1}return u}),Fr=i(function(t){for(var n=T(t),r=n.length,e=0,u={};r>e;){var i=n[e];u[t[i]]=i,e+=1}return u}),Wr=s(function(t,n){return d(t+1,function(){var r=arguments[t];if(null!=r&&ot(r[n]))return r[n].apply(r,Array.prototype.slice.call(arguments,0,t));throw new TypeError(Zt(r)+' does not have a method named "'+n+'"')})}),Cr=s(function(t,n){return null!=n&&n.constructor===t||n instanceof t}),Pr=i(function(t){return null!=t&&Bt(t,Tn(t))}),Ir=Wr(1,"join"),Nr=i(function(t){return en(function(){return Array.prototype.slice.call(arguments,0)},t)}),Tr=i(function(t){var n,r=[];for(n in t)r[r.length]=n;return r}),Vr=s(function(t,n){if("function"!=typeof n.lastIndexOf||b(n)){for(var r=n.length-1;r>=0;){if(Bt(n[r],t))return r;r-=1}return-1}return n.lastIndexOf(t)}),Ur=function(t){return"[object Number]"===Object.prototype.toString.call(t)},Br=i(function(t){return null!=t&&Ur(t.length)?t.length:NaN}),Rr=s(function(t,n){return function(r){return function(e){return V(function(t){return n(t,e)},r(t(e)))}}}),Dr=i(function(t){return Rr(kn(t),gn(t))}),Mr=s(function(t,n){for(var r=n,e=0;t.length>e;){if(null==r)return;r=r[t[e]],e+=1}return r}),Lr=i(function(t){return Rr(Mr(t),et(t))}),zr=i(function(t){return Rr(U(t),tt(t))}),Kr=s(function(t,n){return n>t}),$r=s(function(t,n){return n>=t}),Hr=v(function(t,n,r){for(var e=0,u=r.length,i=[],o=[n];u>e;)o=t(o[0],r[e]),i[e]=o[1],e+=1;return[o[0],i]}),Jr=v(function(t,n,r){for(var e=r.length-1,u=[],i=[n];e>=0;)i=t(r[e],i[0]),u[e]=i[1],e-=1;return[u,i[0]]}),Xr=s(function(t,n){return C(function(r,e){return r[e]=t(n[e],e,n),r},{},T(n))}),Yr=s(function(t,n){return n.match(t)||[]}),Zr=s(function(t,n){return nt(t)?!nt(n)||1>n?NaN:(t%n+n)%n:NaN}),Gr=v(function(t,n,r){return t(r)>t(n)?r:n}),Qr=R(l,0),te=i(function(t){return Qr(t)/t.length}),ne=i(function(t){var n=t.length;if(0===n)return NaN;var r=2-n%2,e=(n-r)/2;return te(Array.prototype.slice.call(t,0).sort(function(t,n){return n>t?-1:t>n?1:0}).slice(e,e+r))}),re=s(function(t,n){var r={};return h(n.length,function(){var e=t.apply(this,arguments);return I(e,r)||(r[e]=n.apply(this,arguments)),r[e]})}),ee=re(function(){return Zt(arguments)}),ue=s(function(t,n){return Er({},t,n)}),ie=i(function(t){return Er.apply(null,[{}].concat(t))}),oe=v(function(t,n,r){var e,u={};for(e in n)I(e,n)&&(u[e]=I(e,r)?t(e,n[e],r[e]):n[e]);for(e in r)I(e,r)&&!I(e,u)&&(u[e]=r[e]);return u}),ce=v(function t(n,r,e){return oe(function(r,e,u){return $t(e)&&$t(u)?t(n,e,u):n(r,e,u)},r,e)}),ae=s(function(t,n){return ce(function(t,n,r){return n},t,n)}),fe=s(function(t,n){return ce(function(t,n,r){return r},t,n)}),se=v(function(t,n,r){return ce(function(n,r,e){return t(r,e)},n,r)}),le=v(function(t,n,r){return oe(function(n,r,e){return t(r,e)},n,r)}),pe=s(function(t,n){return t>n?n:t}),he=v(function(t,n,r){return t(r)<t(n)?r:n}),ye=s(function(t,n){return t%n}),de=s(function(t,n){return t*n}),ge=i(function(t){return-t}),ve=s(zt(w(["any"],L,z))),me=i(function(t){return d(0>t?1:t+1,function(){return kn(t,arguments)})}),be=v(function(t,n,r){return t(n(r))}),xe=i(function(t){return[t]}),we=s(function(t,n){var r={};for(var e in n)Dt(e,t)||(r[e]=n[e]);return r}),je=i(function(t){var n,r=!1;return h(t.length,function(){return r?n:(r=!0,n=t.apply(this,arguments))})}),Oe=function(){var t=function(n){return{value:n,map:function(r){return t(r(n))}}};return v(function(n,r,e){return n(function(n){return t(r(n))})(e).value})}(),Ae=s(function(t,n){return[t,n]}),Ee=function(t){return s(function(n,r){return h(Math.max(0,n.length-r.length),function(){return n.apply(this,t(r,arguments))})})},Se=Ee(p),_e=Ee(Zn(p)),ke=Nr([Jt,Xt]),qe=v(function(t,n,r){return Bt(Mr(t,r),n)}),Fe=v(function(t,n,r){return fn(t,Mr(n,r))}),We=v(function(t,n,r){return n.length>0&&t(Mr(n,r))}),Ce=s(function(t,n){for(var r={},e=0;t.length>e;)t[e]in n&&(r[t[e]]=n[t[e]]),e+=1;return r}),Pe=s(function(t,n){for(var r={},e=0,u=t.length;u>e;){var i=t[e];r[i]=n[i],e+=1}return r}),Ie=s(function(t,n){var r={};for(var e in n)t(n[e],e,n)&&(r[e]=n[e]);return r}),Ne=s(function(t,n){return p([t],n)}),Te=R(de,1),Ve=s(function(t,n){return d(n.length,function(){for(var r=[],e=0;n.length>e;)r.push(n[e].call(this,arguments[e])),e+=1;return t.apply(this,r.concat(Array.prototype.slice.call(arguments,n.length)))})}),Ue=Ve(_,[Pe,fr]),Be=v(function(t,n,r){return Bt(n,r[t])}),Re=v(function(t,n,r){return Cr(t,r[n])}),De=v(function(t,n,r){return null!=r&&I(n,r)?r[n]:t}),Me=v(function(t,n,r){return t(r[n])}),Le=s(function(t,n){for(var r=t.length,e=[],u=0;r>u;)e[u]=n[t[u]],u+=1;return e}),ze=s(function(t,n){if(!Ur(t)||!Ur(n))throw new TypeError("Both arguments to range must be numbers");for(var r=[],e=t;n>e;)r.push(e),e+=1;return r}),Ke=v(function(t,n,r){for(var e=r.length-1;e>=0;)n=t(r[e],n),e-=1;return n}),$e=y(4,[],function(t,n,r,e){return C(function(r,e){return t(r,e)?n(r,e):j(r)},r,e)}),He=i(j),Je=s(function(t,n){var r,e=+n,u=0;if(0>e||isNaN(e))throw new RangeError("n must be a non-negative number");for(r=Array(e);e>u;)r[u]=t(u),u+=1;return r}),Xe=s(function(t,n){return Je(o(t),n)}),Ye=v(function(t,n,r){return r.replace(t,n)}),Ze=v(function(t,n,r){for(var e=0,u=r.length,i=[n];u>e;)n=t(n,r[e]),i[e+1]=n,e+=1;return i}),Ge=s(function(t,n){return"function"==typeof n.sequence?n.sequence(t):Ke(function(t,n){return $(V(Ne,t),n)},t([]),n)}),Qe=v(function(t,n,r){return Oe(t,o(n),r)}),tu=s(function(t,n){return Array.prototype.slice.call(n,0).sort(t)}),nu=s(function(t,n){return Array.prototype.slice.call(n,0).sort(function(n,r){var e=t(n),u=t(r);return u>e?-1:e>u?1:0})}),ru=s(function(t,n){return Array.prototype.slice.call(n,0).sort(function(n,r){for(var e=0,u=0;0===e&&t.length>u;)e=t[u](n,r),u+=1;return e})}),eu=Wr(1,"split"),uu=s(function(t,n){return[_t(0,t,n),_t(t,Br(n),n)]}),iu=s(function(t,n){if(0>=t)throw Error("First argument to splitEvery must be a positive integer");for(var r=[],e=0;n.length>e;)r.push(_t(e,e+=t,n));return r}),ou=s(function(t,n){for(var r=0,e=n.length,u=[];e>r&&!t(n[r]);)u.push(n[r]),r+=1;return[u,Array.prototype.slice.call(n,r)]}),cu=s(function(t,n){return Bt(jn(t.length,n),t)}),au=s(function(t,n){return+t-+n}),fu=s(function(t,n){return Gt(ln(t,n),ln(n,t))}),su=v(function(t,n,r){return Gt(hn(t,n,r),hn(t,r,n))}),lu=s(function(t,n){for(var r=n.length-1;r>=0&&t(n[r]);)r-=1;return Array.prototype.slice.call(n,r+1)}),pu=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=O.init,t.prototype["@@transducer/result"]=O.result,t.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):j(t)},s(function(n,r){return new t(n,r)})}(),hu=s(w(["takeWhile"],pu,function(t,n){for(var r=0,e=n.length;e>r&&t(n[r]);)r+=1;return Array.prototype.slice.call(n,0,r)})),yu=s(function(t,n){return t(n),n}),du=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},gu=s(function(t,n){if(!du(t))throw new TypeError("‘test’ requires a value of type RegExp as its first argument; received "+Zt(t));return mt(t).test(n)}),vu=Wr(0,"toLowerCase"),mu=i(function(t){var n=[];for(var r in t)I(r,t)&&(n[n.length]=[r,t[r]]);return n}),bu=i(function(t){var n=[];for(var r in t)n[n.length]=[r,t[r]];return n}),xu=Wr(0,"toUpperCase"),wu=d(4,function(t,n,r,e){return C(t("function"==typeof n?F(n):n),r,e)}),ju=i(function(t){for(var n=0,r=[];t.length>n;){for(var e=t[n],u=0;e.length>u;)void 0===r[u]&&(r[u]=[]),r[u].push(e[u]),u+=1;n+=1}return r}),Ou=v(function(t,n,r){return"function"==typeof r["fantasy-land/traverse"]?r["fantasy-land/traverse"](n,t):Ge(t,V(n,r))}),Au=function(){var t="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff";return i(!("function"==typeof String.prototype.trim)||t.trim()?function(n){var r=RegExp("^["+t+"]["+t+"]*"),e=RegExp("["+t+"]["+t+"]*$");return n.replace(r,"").replace(e,"")}:function(t){return t.trim()})}(),Eu=s(function(t,n){return h(t.length,function(){try{return t.apply(this,arguments)}catch(t){return n.apply(this,p([t],arguments))}})}),Su=i(function(t){return function(){return t(Array.prototype.slice.call(arguments,0))}}),_u=i(function(t){return ut(1,t)}),ku=s(function(t,n){return d(t,function(){for(var r,e=1,u=n,i=0;t>=e&&"function"==typeof u;)r=e===t?arguments.length:i+u.length,u=u.apply(this,Array.prototype.slice.call(arguments,i,r)),e+=1,i=r;return u})}),qu=s(function(t,n){for(var r=t(n),e=[];r&&r.length;)e[e.length]=r[0],r=t(r[1]);return e}),Fu=s(Wt(xr,p)),Wu=v(function(t,n,r){return jr(t,p(n,r))}),Cu=v(function(t,n,r){return t(r)?r:n(r)}),Pu=gt(ar),Iu=v(function(t,n,r){for(var e=r;!t(e);)e=n(e);return e}),Nu=i(function(t){var n,r=[];for(n in t)r[r.length]=t[n];return r}),Tu=function(){var t=function(t){return{value:t,"fantasy-land/map":function(){return this}}};return s(function(n,r){return n(t)(r).value})}(),Vu=v(function(t,n,r){return t(r)?n(r):r}),Uu=s(function(t,n){for(var r in t)if(I(r,t)&&!t[r](n[r]))return!1;return!0}),Bu=s(function(t,n){return Uu(V(Bt,t),n)}),Ru=s(function(t,n){return Xt(Zn(Dt)(t),n)}),Du=s(function(t,n){for(var r,e=0,u=t.length,i=n.length,o=[];u>e;){for(r=0;i>r;)o[o.length]=[t[e],n[r]],r+=1;e+=1}return o}),Mu=s(function(t,n){for(var r=[],e=0,u=Math.min(t.length,n.length);u>e;)r[e]=[t[e],n[e]],e+=1;return r}),Lu=s(function(t,n){for(var r=0,e=Math.min(t.length,n.length),u={};e>r;)u[t[r]]=n[r],r+=1;return u}),zu=v(function(t,n,r){for(var e=[],u=0,i=Math.min(n.length,r.length);i>u;)e[u]=t(n[u],r[u]),u+=1;return e}),Ku={F:c,T:a,__:f,add:l,addIndex:g,adjust:m,all:E,allPass:D,always:o,and:M,any:z,anyPass:K,ap:$,aperture:J,append:X,apply:Y,applySpec:G,ascend:Q,assoc:tt,assocPath:et,binary:it,bind:W,both:ft,call:lt,chain:gt,clamp:vt,clone:wt,comparator:jt,complement:At,compose:Wt,composeK:Ct,composeP:function(){if(0===arguments.length)throw Error("composeP requires at least one argument");return It.apply(this,Ft(arguments))},concat:Gt,cond:Qt,construct:nn,constructN:tn,contains:rn,converge:en,countBy:cn,curry:st,curryN:d,dec:an,defaultTo:fn,descend:sn,difference:ln,differenceWith:hn,dissoc:yn,dissocPath:vn,divide:mn,drop:xn,dropLast:An,dropLastWhile:Sn,dropRepeats:Wn,dropRepeatsWith:Fn,dropWhile:Pn,either:Nn,empty:Tn,endsWith:Un,eqBy:Bn,eqProps:Rn,equals:Bt,evolve:Dn,filter:Jt,find:Ln,findIndex:Kn,findLast:Hn,findLastIndex:Xn,flatten:Yn,flip:Zn,forEach:Gn,forEachObjIndexed:Qn,fromPairs:tr,groupBy:nr,groupWith:rr,gt:er,gte:ur,has:ir,hasIn:or,head:cr,identical:Vt,identity:fr,ifElse:sr,inc:lr,indexBy:pr,indexOf:hr,init:yr,innerJoin:dr,insert:gr,insertAll:vr,intersection:wr,intersectionWith:Or,intersperse:Ar,into:kr,invert:qr,invertObj:Fr,invoker:Wr,is:Cr,isEmpty:Pr,isNil:rt,join:Ir,juxt:Nr,keys:T,keysIn:Tr,last:qn,lastIndexOf:Vr,length:Br,lens:Rr,lensIndex:Dr,lensPath:Lr,lensProp:zr,lift:at,liftN:ct,lt:Kr,lte:$r,map:V,mapAccum:Hr,mapAccumRight:Jr,mapObjIndexed:Xr,match:Yr,mathMod:Zr,max:S,maxBy:Gr,mean:te,median:ne,memoize:ee,memoizeWith:re,merge:ue,mergeAll:ie,mergeDeepLeft:ae,mergeDeepRight:fe,mergeDeepWith:se,mergeDeepWithKey:ce,mergeWith:le,mergeWithKey:oe,min:pe,minBy:he,modulo:ye,multiply:de,nAry:ut,negate:ge,none:ve,not:Ot,nth:kn,nthArg:me,o:be,objOf:Sr,of:xe,omit:we,once:je,or:In,over:Oe,pair:Ae,partial:Se,partialRight:_e,partition:ke,path:Mr,pathEq:qe,pathOr:Fe,pathSatisfies:We,pick:Ce,pickAll:Pe,pickBy:Ie,pipe:qt,pipeK:function(){if(0===arguments.length)throw Error("pipeK requires at least one argument");return Ct.apply(this,Ft(arguments))},pipeP:It,pluck:B,prepend:Ne,product:Te,project:Ue,prop:U,propEq:Be,propIs:Re,propOr:De,propSatisfies:Me,props:Le,range:ze,reduce:R,reduceBy:on,reduceRight:Ke,reduceWhile:$e,reduced:He,reject:Xt,remove:dn,repeat:Xe,replace:Ye,reverse:Ft,scan:Ze,sequence:Ge,set:Qe,slice:_t,sort:tu,sortBy:nu,sortWith:ru,split:eu,splitAt:uu,splitEvery:iu,splitWhen:ou,startsWith:cu,subtract:au,sum:Qr,symmetricDifference:fu,symmetricDifferenceWith:su,tail:kt,take:jn,takeLast:Vn,takeLastWhile:lu,takeWhile:hu,tap:yu,test:gu,times:Je,toLower:vu,toPairs:mu,toPairsIn:bu,toString:Zt,toUpper:xu,transduce:wu,transpose:ju,traverse:Ou,trim:Au,tryCatch:Eu,type:bt,unapply:Su,unary:_u,uncurryN:ku,unfold:qu,union:Fu,unionWith:Wu,uniq:xr,uniqBy:br,uniqWith:jr,unless:Cu,unnest:Pu,until:Iu,update:gn,useWith:Ve,values:Z,valuesIn:Nu,view:Tu,when:Vu,where:Uu,whereEq:Bu,without:Ru,xprod:Du,zip:Mu,zipObj:Lu,zipWith:zu},$u=Ku.has("nativeEvent"),Hu=Ku.path(["target","value"]),Ju=Ku.ifElse($u,Hu,Ku.identity),Xu=["blur","focus","keyUp","keyPress","keyUp","click","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","mouseDown","mouseEnter","mouseLeave","mouseMove","mouseOut","mouseOver","mouseUp"],Yu=function(t){return Ku.contains(t,Xu)},Zu=function(t){return""+Ku.toUpper(Ku.head(t))+Ku.tail(t)},Gu=function(t){return"on"+Zu(t)},Qu=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Ku.reduceWhile(Ku.isEmpty,function(n,r){return r(t)},"",n)},ti=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=function(t){return Qu(Ju(t),n)};return Ku.reduce(function(t,n){var e;return Yu(n)?Ku.merge(t,(e={},e[Gu(n)]=r,e)):t},{},t)},ni=function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")},ri=Object.assign||function(t){for(var n=1;arguments.length>n;n++){var r=arguments[n];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},ei=function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)},ui=function(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n},ii=function(t,n){var r=n.updateFormValue,e=n.updateFormError,u=n.formValues,i=n.formErrors;return Ku.mapObjIndexed(function(t,n){var o=t.validateOn,c=void 0===o?[]:o,a=t.validateWith,f=void 0===a?[]:a,s=r(n),l=e(n),p=function(t){var n=Ju(t),r=Qu(n,f);l(r)};return Object.assign(n,{inputProps:ri({id:n,onChange:function(t){Ku.contains("change",c)&&p(t);var n=Ju(t);return s(n)},value:u[n]||""},ti(c,f)),error:i[n]})},t)},oi=function(){},ci=function(t){function n(r){ni(this,n);var e=ui(this,t.call(this,r));e.updateFormState=function(t){e.props.onChange(Ku.merge(e.state,t)),e.setState(t)},e.updateFormValue=function(t){return function(n){var r,u=e.state.formValues,i=Ku.merge(u,(r={},r[t]=n,r));e.updateFormState({formValues:i})}},e.updateFormError=function(t){return function(n){var r,u=e.state.formErrors,i=n?Ku.merge(u,(r={},r[t]=n,r)):u;e.updateFormState({formErrors:i})}},e.updateChildErrorsOnSubmit=function(t){var n=Ku.values(t).map(function(t){var n,r=t.id,e=t.validateWith,u=void 0===e?[]:e,i=t.validateOn,o=void 0===i?[]:i,c=t.value;if(Ku.contains("submit",o)){var a=Qu(c,u);return a?(n={},n[r]=a,n):{}}});return e.setState({formErrors:Ku.mergeAll(n)})},e.handleSubmit=function(t){return function(n){n.preventDefault();var r=e.state,u=r.formErrors,i=r.formValues;Ku.values(t).every(function(t){var n=t.id,r=t.validateWith,e=void 0===r?[]:r,o=i[n];return!u[n]&&!Qu(o,e)})?e.props.onSubmit({formValues:e.state.formValues,isValid:!0}):(e.props.onSubmit({formValues:e.state.formValues,isValid:!1}),e.updateChildErrorsOnSubmit(t))}};var u=r.config,i=Ku.compose(Ku.pickBy(Ku.complement(Ku.isNil)),Ku.pickBy(Ku.complement(Ku.isEmpty)),Ku.mapObjIndexed(Ku.prop("value")))(u);return e.state={formValues:i,formErrors:{}},e}return ei(n,t),n.prototype.render=function(){var t=this.props,n=t.render,r=t.config,u=ri({},this.state,{updateFormError:this.updateFormError,updateFormValue:this.updateFormValue}),i=ii(r,u);return e.createElement("form",{onSubmit:this.handleSubmit(i)},n(i))},n}(n.Component);ci.displayName="Form",ci.propTypes={config:r.object,render:r.func,onChange:r.func,onSubmit:r.func},ci.defaultProps={onChange:oi,onSubmit:oi,render:function(){return null},config:{}},t.Form=ci,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","react","prop-types"],n):n(t.ReactForm={},t.React,t.PropTypes)}(this,function(t,n,r){"use strict";function e(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function u(t){return function n(r){return 0===arguments.length||e(r)?n:t.apply(this,arguments)}}function o(t){return function n(r,o){switch(arguments.length){case 0:return n;case 1:return e(r)?n:u(function(n){return t(r,n)});default:return e(r)&&e(o)?n:e(r)?u(function(n){return t(n,o)}):e(o)?u(function(n){return t(r,n)}):t(r,o)}}}function a(t,n){t=t||[],n=n||[];var r,e=t.length,u=n.length,o=[];for(r=0;e>r;)o[o.length]=t[r],r+=1;for(r=0;u>r;)o[o.length]=n[r],r+=1;return o}function i(t,n){switch(t){case 0:return function(){return n.apply(this,arguments)};case 1:return function(t){return n.apply(this,arguments)};case 2:return function(t,r){return n.apply(this,arguments)};case 3:return function(t,r,e){return n.apply(this,arguments)};case 4:return function(t,r,e,u){return n.apply(this,arguments)};case 5:return function(t,r,e,u,o){return n.apply(this,arguments)};case 6:return function(t,r,e,u,o,a){return n.apply(this,arguments)};case 7:return function(t,r,e,u,o,a,i){return n.apply(this,arguments)};case 8:return function(t,r,e,u,o,a,i,c){return n.apply(this,arguments)};case 9:return function(t,r,e,u,o,a,i,c,f){return n.apply(this,arguments)};case 10:return function(t,r,e,u,o,a,i,c,f,l){return n.apply(this,arguments)};default:throw Error("First argument to _arity must be a non-negative integer no greater than ten")}}function c(t,n,r){return function(){for(var u=[],o=0,a=t,f=0;n.length>f||arguments.length>o;){var l;f>=n.length||e(n[f])&&arguments.length>o?(l=arguments[o],o+=1):l=n[f],u[f]=l,e(l)||(a-=1),f+=1}return a>0?i(a,c(t,u,r)):r.apply(this,u)}}function f(t){return function n(r,a,i){switch(arguments.length){case 0:return n;case 1:return e(r)?n:o(function(n,e){return t(r,n,e)});case 2:return e(r)&&e(a)?n:e(r)?o(function(n,r){return t(n,a,r)}):e(a)?o(function(n,e){return t(r,n,e)}):u(function(n){return t(r,a,n)});default:return e(r)&&e(a)&&e(i)?n:e(r)&&e(a)?o(function(n,r){return t(n,r,i)}):e(r)&&e(i)?o(function(n,r){return t(n,a,r)}):e(a)&&e(i)?o(function(n,e){return t(r,n,e)}):e(r)?u(function(n){return t(n,a,i)}):e(a)?u(function(n){return t(r,n,i)}):e(i)?u(function(n){return t(r,a,n)}):t(r,a,i)}}}function l(t){return"function"==typeof t["@@transducer/step"]}function s(t,n,r){return function(){if(0===arguments.length)return r();var e=Array.prototype.slice.call(arguments,0),u=e.pop();if(!R(u)){for(var o=0;t.length>o;){if("function"==typeof u[t[o]])return u[t[o]].apply(u,e);o+=1}if(l(u))return n.apply(null,e)(u)}return r.apply(this,arguments)}}function p(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}function y(t,n){for(var r=0,e=n.length,u=Array(e);e>r;)u[r]=t(n[r]),r+=1;return u}function d(t){return"[object String]"===Object.prototype.toString.call(t)}function h(t){return new L(t)}function g(t,n,r){for(var e=0,u=r.length;u>e;){if((n=t["@@transducer/step"](n,r[e]))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e+=1}return t["@@transducer/result"](n)}function v(t,n,r){for(var e=r.next();!e.done;){if((n=t["@@transducer/step"](n,e.value))&&n["@@transducer/reduced"]){n=n["@@transducer/value"];break}e=r.next()}return t["@@transducer/result"](n)}function m(t,n,r,e){return t["@@transducer/result"](r[e](H(t["@@transducer/step"],t),n))}function b(t,n,r){if("function"==typeof t&&(t=h(t)),W(r))return g(t,n,r);if("function"==typeof r["fantasy-land/reduce"])return m(t,n,r,"fantasy-land/reduce");if(null!=r[X])return v(t,n,r[X]());if("function"==typeof r.next)return v(t,n,r);if("function"==typeof r.reduce)return m(t,n,r,"reduce");throw new TypeError("reduce: list must be array or iterable")}function j(t,n){return Object.prototype.hasOwnProperty.call(n,t)}function O(t){return"[object Function]"===Object.prototype.toString.call(t)}function S(t,n){return function(){return n.call(this,t.apply(this,arguments))}}function w(t,n){return function(){var r=arguments.length;if(0===r)return n();var e=arguments[r-1];return R(e)||"function"!=typeof e[t]?n.apply(this,arguments):e[t].apply(e,Array.prototype.slice.call(arguments,0,r-1))}}function E(){if(0===arguments.length)throw Error("pipe requires at least one argument");return i(arguments[0].length,ot(S,arguments[0],dt(arguments)))}function A(){if(0===arguments.length)throw Error("compose requires at least one argument");return E.apply(this,ht(arguments))}function x(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}function C(t,n,r){for(var e=0,u=r.length;u>e;){if(t(n,r[e]))return!0;e+=1}return!1}function F(t){var n=(t+"").match(/^function (\w*)/);return null==n?"":n[1]}function U(t,n,r,e){function u(t,n){return q(t,n,r.slice(),e.slice())}var o=x(t);return!C(function(t,n){return!C(u,n,t)},x(n),o)}function q(t,n,r,e){if(gt(t,n))return!0;var u=st(t);if(u!==st(n))return!1;if(null==t||null==n)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===F(t.constructor))return t===n;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof n||!gt(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!gt(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var o=r.length-1;o>=0;){if(r[o]===t)return e[o]===n;o-=1}switch(u){case"Map":return t.size===n.size&&U(t.entries(),n.entries(),r.concat([t]),e.concat([n]));case"Set":return t.size===n.size&&U(t.values(),n.values(),r.concat([t]),e.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=nt(t);if(a.length!==nt(n).length)return!1;var i=r.concat([t]),c=e.concat([n]);for(o=a.length-1;o>=0;){var f=a[o];if(!j(f,n)||!q(n[f],t[f],i,c))return!1;o-=1}return!0}function T(t,n,r){var e,u;if("function"==typeof t.indexOf)switch(typeof n){case"number":if(0===n){for(e=1/n;t.length>r;){if(0===(u=t[r])&&1/u===e)return r;r+=1}return-1}if(n!==n){for(;t.length>r;){if("number"==typeof(u=t[r])&&u!==u)return r;r+=1}return-1}return t.indexOf(n,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(n,r);case"object":if(null===n)return t.indexOf(n,r)}for(;t.length>r;){if(vt(t[r],n))return r;r+=1}return-1}function k(t,n){return T(n,t,0)>=0}function P(t){return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}function V(t){return function(){return!t.apply(this,arguments)}}function N(t,n){for(var r=0,e=n.length,u=[];e>r;)t(n[r])&&(u[u.length]=n[r]),r+=1;return u}function D(t){return"[object Object]"===Object.prototype.toString.call(t)}function I(t,n){var r=function(r){var e=n.concat([t]);return k(r,e)?"<Circular>":I(r,e)},e=function(t,n){return y(function(n){return P(n)+": "+r(t[n])},n.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+y(r,t).join(", ")+"))";case"[object Array]":return"["+y(r,t).concat(e(t,St(function(t){return/^\d+$/.test(t)},nt(t)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof t?"new Boolean("+r(t.valueOf())+")":""+t;case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):P(bt(t)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof t?"new Number("+r(t.valueOf())+")":1/t==-1/0?"-0":t.toString(10);case"[object String]":return"object"==typeof t?"new String("+r(t.valueOf())+")":P(t);case"[object Undefined]":return"undefined";default:if("function"==typeof t.toString){var u=""+t;if("[object Object]"!==u)return u}return"{"+e(t,nt(t)).join(", ")+"}"}}function M(t){return t}var _="default"in n?n.default:n;r=r&&r.hasOwnProperty("default")?r.default:r;var B=o(function(t,n){return 1===t?u(n):i(t,c(t,[],n))}),R=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)},z={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}},W=u(function(t){return!!R(t)||!!t&&("object"==typeof t&&(!d(t)&&(1===t.nodeType?!!t.length:0===t.length||t.length>0&&(t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1)))))}),L=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,n){return this.f(t,n)},t}(),H=o(function(t,n){return i(t.length,function(){return t.apply(n,arguments)})}),X="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",Y=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=z.init,t.prototype["@@transducer/result"]=z.result,t.prototype["@@transducer/step"]=function(t,n){return this.xf["@@transducer/step"](t,this.f(n))},t}(),Z=o(function(t,n){return new Y(t,n)}),$=Object.prototype.toString,G=function(){return"[object Arguments]"===$.call(arguments)?function(t){return"[object Arguments]"===$.call(t)}:function(t){return j("callee",t)}},J=!{toString:null}.propertyIsEnumerable("toString"),K=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Q=function(){return arguments.propertyIsEnumerable("length")}(),tt=function(t,n){for(var r=0;t.length>r;){if(t[r]===n)return!0;r+=1}return!1},nt=u("function"!=typeof Object.keys||Q?function(t){if(Object(t)!==t)return[];var n,r,e=[],u=Q&&G(t);for(n in t)!j(n,t)||u&&"length"===n||(e[e.length]=n);if(J)for(r=6;r>=0;)j(n=K[r],t)&&!tt(e,n)&&(e[e.length]=n),r-=1;return e}:function(t){return Object(t)!==t?[]:Object.keys(t)}),rt=o(s(["fantasy-land/map","map"],Z,function(t,n){switch(Object.prototype.toString.call(n)){case"[object Function]":return B(n.length,function(){return t.call(this,n.apply(this,arguments))});case"[object Object]":return b(function(r,e){return r[e]=t(n[e]),r},{},nt(n));default:return y(t,n)}})),et=o(function(t,n){for(var r=n,e=0;t.length>e;){if(null==r)return;r=r[t[e]],e+=1}return r}),ut=o(function(t,n){return et([t],n)}),ot=f(b),at=o(function(t,n){return"function"==typeof n["fantasy-land/ap"]?n["fantasy-land/ap"](t):"function"==typeof t.ap?t.ap(n):"function"==typeof t?function(r){return t(r)(n(r))}:b(function(t,r){return a(t,rt(r,n))},[],t)}),it=u(function(t){for(var n=nt(t),r=n.length,e=[],u=0;r>u;)e[u]=t[n[u]],u+=1;return e}),ct=u(function(t){return null==t}),ft=o(function(t,n){var r=B(t,n);return B(t,function(){return b(at,rt(r,arguments[0]),Array.prototype.slice.call(arguments,1))})}),lt=u(function(t){return ft(t.length,t)}),st=u(function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),pt=lt(u(function(t){return!t})),yt=f(w("slice",function(t,n,r){return Array.prototype.slice.call(r,t,n)})),dt=u(w("tail",yt(1,1/0))),ht=u(function(t){return d(t)?t.split("").reverse().join(""):Array.prototype.slice.call(t,0).reverse()}),gt=o(function(t,n){return t===n?0!==t||1/t==1/n:t!==t&&n!==n}),vt=o(function(t,n){return q(t,n,[],[])}),mt=function(t){return(10>t?"0":"")+t},bt="function"==typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+mt(t.getUTCMonth()+1)+"-"+mt(t.getUTCDate())+"T"+mt(t.getUTCHours())+":"+mt(t.getUTCMinutes())+":"+mt(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},jt=function(){function t(t,n){this.xf=n,this.f=t}return t.prototype["@@transducer/init"]=z.init,t.prototype["@@transducer/result"]=z.result,t.prototype["@@transducer/step"]=function(t,n){return this.f(n)?this.xf["@@transducer/step"](t,n):t},t}(),Ot=o(s(["filter"],o(function(t,n){return new jt(t,n)}),function(t,n){return D(n)?b(function(r,e){return t(n[e])&&(r[e]=n[e]),r},{},nt(n)):N(t,n)})),St=o(function(t,n){return Ot(V(t),n)}),wt=u(function(t){return I(t,[])}),Et=o(k),At=o(function(t,n){var r=0>t?n.length+t:t;return d(n)?n.charAt(r):n[r]}),xt=u(function(t){return null!=t&&"function"==typeof t["fantasy-land/empty"]?t["fantasy-land/empty"]():null!=t&&null!=t.constructor&&"function"==typeof t.constructor["fantasy-land/empty"]?t.constructor["fantasy-land/empty"]():null!=t&&"function"==typeof t.empty?t.empty():null!=t&&null!=t.constructor&&"function"==typeof t.constructor.empty?t.constructor.empty():R(t)?[]:d(t)?"":D(t)?{}:G(t)?function(){return arguments}():void 0}),Ct=o(j),Ft=At(0),Ut=u(M),qt=f(function(t,n,r){return B(Math.max(t.length,n.length,r.length),function(){return t.apply(this,arguments)?n.apply(this,arguments):r.apply(this,arguments)})}),Tt="function"==typeof Object.assign?Object.assign:function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,e=arguments.length;e>r;){var u=arguments[r];if(null!=u)for(var o in u)j(o,u)&&(n[o]=u[o]);r+=1}return n},kt=o(function(t,n){return B(t+1,function(){var r=arguments[t];if(null!=r&&O(r[n]))return r[n].apply(r,Array.prototype.slice.call(arguments,0,t));throw new TypeError(wt(r)+' does not have a method named "'+n+'"')})}),Pt=u(function(t){return null!=t&&vt(t,xt(t))}),Vt=o(function(t,n){return b(function(r,e){return r[e]=t(n[e],e,n),r},{},nt(n))}),Nt=o(function(t,n){return Tt({},t,n)}),Dt=u(function(t){return Tt.apply(null,[{}].concat(t))}),It=o(function(t,n){var r={};for(var e in n)t(n[e],e,n)&&(r[e]=n[e]);return r}),Mt=c(4,[],function(t,n,r,e){return b(function(r,e){return t(r,e)?n(r,e):p(r)},r,e)}),_t=kt(0,"toUpperCase"),Bt=qt(Ct("nativeEvent"),et(["target","value"]),Ut),Rt=["blur","focus","keyUp","keyPress","keyUp","click","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","mouseDown","mouseEnter","mouseLeave","mouseMove","mouseOut","mouseOver","mouseUp"],zt=function(t){return Et(t,Rt)},Wt=function(t){return""+_t(Ft(t))+dt(t)},Lt=function(t){return"on"+Wt(t)},Ht=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Mt(Pt,function(n,r){return r(t)},"",arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])},Xt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=function(t){return Ht(Bt(t),n)};return ot(function(t,n){var e;return zt(n)?Nt(t,(e={},e[Lt(n)]=r,e)):t},{},t)},Yt=function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")},Zt=Object.assign||function(t){for(var n=1;arguments.length>n;n++){var r=arguments[n];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},$t=function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)},Gt=function(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n},Jt=function(t,n){var r=n.updateFormValue,e=n.updateFormError,u=n.formValues,o=n.formErrors;return Vt(function(t,n){var a=t.validateOn,i=void 0===a?[]:a,c=t.validateWith,f=void 0===c?[]:c,l=r(n),s=e(n),p=function(t){var n=Bt(t),r=Ht(n,f);s(r)};return Object.assign(n,{inputProps:Zt({id:n,onChange:function(t){Et("change",i)&&p(t);var n=Bt(t);return l(n)},value:u[n]||""},Xt(i,f)),error:o[n]})},t)},Kt=function(){},Qt=function(t){function n(r){Yt(this,n);var e=Gt(this,t.call(this,r));e.updateFormState=function(t){e.props.onChange(Nt(e.state,t)),e.setState(t)},e.updateFormValue=function(t){return function(n){var r,u=Nt(e.state.formValues,(r={},r[t]=n,r));e.updateFormState({formValues:u})}},e.updateFormError=function(t){return function(n){var r,u=e.state.formErrors,o=n?Nt(u,(r={},r[t]=n,r)):u;e.updateFormState({formErrors:o})}},e.updateChildErrorsOnSubmit=function(t){var n=it(t).map(function(t){var n,r=t.id,e=t.validateWith,u=void 0===e?[]:e,o=t.validateOn,a=void 0===o?[]:o,i=t.value;if(Et("submit",a)){var c=Ht(i,u);return c?(n={},n[r]=c,n):{}}});return e.setState({formErrors:Dt(n)})},e.handleSubmit=function(t){return function(n){n.preventDefault();var r=e.state,u=r.formErrors,o=r.formValues;it(t).every(function(t){var n=t.id,r=t.validateWith,e=void 0===r?[]:r,a=o[n];return!u[n]&&!Ht(a,e)})?e.props.onSubmit({formValues:e.state.formValues,isValid:!0}):(e.props.onSubmit({formValues:e.state.formValues,isValid:!1}),e.updateChildErrorsOnSubmit(t))}};var u=r.config,o=A(It(pt(ct)),It(pt(Pt)),Vt(ut("value")))(u);return e.state={formValues:o,formErrors:{}},e}return $t(n,t),n.prototype.render=function(){var t=this.props,n=t.render,r=t.config,e=Zt({},this.state,{updateFormError:this.updateFormError,updateFormValue:this.updateFormValue}),u=Jt(r,e);return _.createElement("form",{onSubmit:this.handleSubmit(u)},n(u))},n}(n.Component);Qt.displayName="Form",Qt.propTypes={config:r.object,render:r.func,onChange:r.func,onSubmit:r.func},Qt.defaultProps={onChange:Kt,onSubmit:Kt,render:function(){return null},config:{}},t.Form=Qt,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -8,10 +8,10 @@ 'use strict';

var _ramda2 = _interopRequireDefault(_ramda);
var R = _interopRequireWildcard(_ramda);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var isEvent = _ramda2.default.has('nativeEvent');
var getEventValue = _ramda2.default.path(['target', 'value']);
var isEvent = R.has('nativeEvent');
var getEventValue = R.path(['target', 'value']);
var getValueFromEvent = exports.getValueFromEvent = _ramda2.default.ifElse(isEvent, getEventValue, _ramda2.default.identity);
var getValueFromEvent = exports.getValueFromEvent = R.ifElse(isEvent, getEventValue, R.identity);

@@ -23,7 +23,7 @@ var noop = exports.noop = function noop() {};

var isAcceptedEvent = exports.isAcceptedEvent = function isAcceptedEvent(event) {
return _ramda2.default.contains(event, acceptedEvents);
return R.contains(event, acceptedEvents);
};
var capitalize = function capitalize(s) {
return '' + _ramda2.default.toUpper(_ramda2.default.head(s)) + _ramda2.default.tail(s);
return '' + R.toUpper(R.head(s)) + R.tail(s);
};

@@ -38,3 +38,3 @@

var validateWith = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
return _ramda2.default.reduceWhile(_ramda2.default.isEmpty, function (acc, validate) {
return R.reduceWhile(R.isEmpty, function (acc, validate) {
return validate(input);

@@ -52,6 +52,6 @@ }, '', validateWith);

var inputProps = _ramda2.default.reduce(function (acc, val) {
var inputProps = R.reduce(function (acc, val) {
var _R$merge;
return isAcceptedEvent(val) ? _ramda2.default.merge(acc, (_R$merge = {}, _R$merge[makeEventName(val)] = validateInput, _R$merge)) : acc;
return isAcceptedEvent(val) ? R.merge(acc, (_R$merge = {}, _R$merge[makeEventName(val)] = validateInput, _R$merge)) : acc;
}, {}, validateOn);

@@ -58,0 +58,0 @@

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

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