{"version":3,"sources":["webpack:///./node_modules/async-validator/es/util.js","webpack:///./node_modules/async-validator/es/rule/required.js","webpack:///./node_modules/async-validator/es/rule/whitespace.js","webpack:///./node_modules/async-validator/es/rule/type.js","webpack:///./node_modules/async-validator/es/rule/range.js","webpack:///./node_modules/async-validator/es/rule/enum.js","webpack:///./node_modules/async-validator/es/rule/pattern.js","webpack:///./node_modules/async-validator/es/rule/index.js","webpack:///./node_modules/async-validator/es/validator/string.js","webpack:///./node_modules/async-validator/es/validator/method.js","webpack:///./node_modules/async-validator/es/validator/number.js","webpack:///./node_modules/async-validator/es/validator/boolean.js","webpack:///./node_modules/async-validator/es/validator/regexp.js","webpack:///./node_modules/async-validator/es/validator/integer.js","webpack:///./node_modules/async-validator/es/validator/float.js","webpack:///./node_modules/async-validator/es/validator/array.js","webpack:///./node_modules/async-validator/es/validator/object.js","webpack:///./node_modules/async-validator/es/validator/enum.js","webpack:///./node_modules/async-validator/es/validator/pattern.js","webpack:///./node_modules/async-validator/es/validator/date.js","webpack:///./node_modules/async-validator/es/validator/required.js","webpack:///./node_modules/async-validator/es/validator/type.js","webpack:///./node_modules/async-validator/es/validator/index.js","webpack:///./node_modules/async-validator/es/messages.js","webpack:///./node_modules/async-validator/es/index.js"],"names":["formatRegExp","warning","format","_len","arguments","length","args","Array","_key","i","f","len","apply","slice","str","String","replace","x","Number","JSON","stringify","_","arg","isNativeStringType","type","isEmptyValue","value","undefined","isArray","asyncParallelArray","arr","func","callback","results","total","arrLength","count","errors","push","forEach","a","asyncSerialArray","index","next","original","flattenObjArr","objArr","ret","Object","keys","k","asyncMap","option","first","flattenArr","firstFields","objArrKeys","objArrLength","key","indexOf","complementError","rule","oe","message","field","fullField","deepMerge","target","source","s","hasOwnProperty","required","options","messages","whitespace","test","pattern","email","url","RegExp","hex","types","integer","number","parseInt","float","array","regexp","e","date","getTime","getMonth","getYear","isNaN","object","method","match","custom","ruleType","range","min","max","spRegexp","val","num","ENUM","enumerable","join","lastIndex","mismatch","_pattern","string","validate","floatFn","dateObject","Date","boolean","newMessages","parse","invalid","clone","cloned","this","Schema","descriptor","rules","_messages","define","prototype","Error","z","item","source_","_this","o","oc","series","r","transform","validator","getValidationMethod","getType","errorFields","data","doIt","deep","fields","defaultField","addFullfield","schema","cb","concat","map","error","fieldsSchema","fieldSchema","bind","errs","res","then","complete","add","messageIndex","splice","register"],"mappings":"0KAEIA,EAAe,WAERC,EAAU,aAed,SAASC,IACd,IAAK,IAAIC,EAAOC,UAAUC,OAAQC,EAAOC,MAAMJ,GAAOK,EAAO,EAAGA,EAAOL,EAAMK,IAC3EF,EAAKE,GAAQJ,UAAUI,GAGzB,IAAIC,EAAI,EACJC,EAAIJ,EAAK,GACTK,EAAML,EAAKD,OACf,GAAiB,oBAANK,EACT,OAAOA,EAAEE,MAAM,KAAMN,EAAKO,MAAM,IAElC,GAAiB,kBAANH,EAAgB,CAwBzB,IAvBA,IAAII,EAAMC,OAAOL,GAAGM,QAAQhB,GAAc,SAAUiB,GAClD,GAAU,OAANA,EACF,MAAO,IAET,GAAIR,GAAKE,EACP,OAAOM,EAET,OAAQA,GACN,IAAK,KACH,OAAOF,OAAOT,EAAKG,MACrB,IAAK,KACH,OAAOS,OAAOZ,EAAKG,MACrB,IAAK,KACH,IACE,OAAOU,KAAKC,UAAUd,EAAKG,MAC3B,MAAOY,GACP,MAAO,aAET,MACF,QACE,OAAOJ,MAGJK,EAAMhB,EAAKG,GAAIA,EAAIE,EAAKW,EAAMhB,IAAOG,GAC5CK,GAAO,IAAMQ,EAEf,OAAOR,EAET,OAAOJ,EAGT,SAASa,EAAmBC,GAC1B,MAAgB,WAATA,GAA8B,QAATA,GAA2B,QAATA,GAA2B,UAATA,GAA6B,YAATA,EAG/E,SAASC,EAAaC,EAAOF,GAClC,YAAcG,IAAVD,GAAiC,OAAVA,MAGd,UAATF,IAAoBjB,MAAMqB,QAAQF,IAAWA,EAAMrB,YAGnDkB,EAAmBC,IAA0B,kBAAVE,GAAuBA,IAUhE,S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OhC,OAAQI,IAC7BuD,EAAQ3B,EAAO5B,GAAGuD,MAClBkF,EAAOlF,GAASkF,EAAOlF,IAAU,GACjCkF,EAAOlF,GAAO1B,KAAKD,EAAO5B,SAN5B4B,EAAS,KACT6G,EAAS,KAQXlH,EAASK,EAAQ6G,KA2IrBL,QAAS,SAAiBhF,GAIxB,QAHkBlC,IAAdkC,EAAKrC,MAAsBqC,EAAKe,mBAAmBG,SACrDlB,EAAKrC,KAAO,WAEgB,oBAAnBqC,EAAK8E,WAA4B9E,EAAKrC,OAAS,GAAW8C,eAAeT,EAAKrC,MACvF,MAAM,IAAIyG,MAAM/H,EAAO,uBAAwB2D,EAAKrC,OAEtD,OAAOqC,EAAKrC,MAAQ,UAEtBoH,oBAAqB,SAA6B/E,GAChD,GAA8B,oBAAnBA,EAAK8E,UACd,OAAO9E,EAAK8E,UAEd,IAAI1F,EAAOD,OAAOC,KAAKY,GACnBqG,EAAejH,EAAKU,QAAQ,WAIhC,OAHsB,IAAlBuG,GACFjH,EAAKkH,OAAOD,EAAc,GAER,IAAhBjH,EAAK5C,QAA4B,aAAZ4C,EAAK,GACrB,GAAWsB,SAEb,GAAWmD,KAAKmB,QAAQhF,MAAU,IAI7C8D,GAAOyC,SAAW,SAAkB5I,EAAMmH,GACxC,GAAyB,oBAAdA,EACT,MAAM,IAAIV,MAAM,oEAElB,GAAWzG,GAAQmH,GAGrBhB,GAAOlD,SAAW,GAEH","file":"static/js/npm.async-validator.3c1ded75.js","sourcesContent":["import _extends from 'babel-runtime/helpers/extends';\nimport _typeof from 'babel-runtime/helpers/typeof';\nvar formatRegExp = /%[sdj%]/g;\n\nexport var warning = function warning() {};\n\n// don't print warning message when in production env or node runtime\nif (process.env.NODE_ENV !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {\n warning = function warning(type, errors) {\n if (typeof console !== 'undefined' && console.warn) {\n if (errors.every(function (e) {\n return typeof e === 'string';\n })) {\n console.warn(type, errors);\n }\n }\n };\n}\n\nexport function format() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var i = 1;\n var f = args[0];\n var len = args.length;\n if (typeof f === 'function') {\n return f.apply(null, args.slice(1));\n }\n if (typeof f === 'string') {\n var str = String(f).replace(formatRegExp, function (x) {\n if (x === '%%') {\n return '%';\n }\n if (i >= len) {\n return x;\n }\n switch (x) {\n case '%s':\n return String(args[i++]);\n case '%d':\n return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n break;\n default:\n return x;\n }\n });\n for (var arg = args[i]; i < len; arg = args[++i]) {\n str += ' ' + arg;\n }\n return str;\n }\n return f;\n}\n\nfunction isNativeStringType(type) {\n return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';\n}\n\nexport function isEmptyValue(value, type) {\n if (value === undefined || value === null) {\n return true;\n }\n if (type === 'array' && Array.isArray(value) && !value.length) {\n return true;\n }\n if (isNativeStringType(type) && typeof value === 'string' && !value) {\n return true;\n }\n return false;\n}\n\nexport function isEmptyObject(obj) {\n return Object.keys(obj).length === 0;\n}\n\nfunction asyncParallelArray(arr, func, callback) {\n var results = [];\n var total = 0;\n var arrLength = arr.length;\n\n function count(errors) {\n results.push.apply(results, errors);\n total++;\n if (total === arrLength) {\n callback(results);\n }\n }\n\n arr.forEach(function (a) {\n func(a, count);\n });\n}\n\nfunction asyncSerialArray(arr, func, callback) {\n var index = 0;\n var arrLength = arr.length;\n\n function next(errors) {\n if (errors && errors.length) {\n callback(errors);\n return;\n }\n var original = index;\n index = index + 1;\n if (original < arrLength) {\n func(arr[original], next);\n } else {\n callback([]);\n }\n }\n\n next([]);\n}\n\nfunction flattenObjArr(objArr) {\n var ret = [];\n Object.keys(objArr).forEach(function (k) {\n ret.push.apply(ret, objArr[k]);\n });\n return ret;\n}\n\nexport function asyncMap(objArr, option, func, callback) {\n if (option.first) {\n var flattenArr = flattenObjArr(objArr);\n return asyncSerialArray(flattenArr, func, callback);\n }\n var firstFields = option.firstFields || [];\n if (firstFields === true) {\n firstFields = Object.keys(objArr);\n }\n var objArrKeys = Object.keys(objArr);\n var objArrLength = objArrKeys.length;\n var total = 0;\n var results = [];\n var next = function next(errors) {\n results.push.apply(results, errors);\n total++;\n if (total === objArrLength) {\n callback(results);\n }\n };\n objArrKeys.forEach(function (key) {\n var arr = objArr[key];\n if (firstFields.indexOf(key) !== -1) {\n asyncSerialArray(arr, func, next);\n } else {\n asyncParallelArray(arr, func, next);\n }\n });\n}\n\nexport function complementError(rule) {\n return function (oe) {\n if (oe && oe.message) {\n oe.field = oe.field || rule.fullField;\n return oe;\n }\n return {\n message: oe,\n field: oe.field || rule.fullField\n };\n };\n}\n\nexport function deepMerge(target, source) {\n if (source) {\n for (var s in source) {\n if (source.hasOwnProperty(s)) {\n var value = source[s];\n if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && _typeof(target[s]) === 'object') {\n target[s] = _extends({}, target[s], value);\n } else {\n target[s] = value;\n }\n }\n }\n }\n return target;\n}","import * as util from '../util';\n\n/**\n * Rule for validating required fields.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param source The source object being validated.\n * @param errors An array of errors that this rule may add\n * validation errors to.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type || rule.type))) {\n errors.push(util.format(options.messages.required, rule.fullField));\n }\n}\n\nexport default required;","import * as util from '../util';\n\n/**\n * Rule for validating whitespace.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param source The source object being validated.\n * @param errors An array of errors that this rule may add\n * validation errors to.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction whitespace(rule, value, source, errors, options) {\n if (/^\\s+$/.test(value) || value === '') {\n errors.push(util.format(options.messages.whitespace, rule.fullField));\n }\n}\n\nexport default whitespace;","import _typeof from 'babel-runtime/helpers/typeof';\nimport * as util from '../util';\nimport required from './required';\n\n/* eslint max-len:0 */\n\nvar pattern = {\n // http://emailregex.com/\n email: /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,\n url: new RegExp('^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\\\S+(?::\\\\S*)?@)?(?:(?:(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}(?:\\\\.(?:[0-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))|(?:(?:[a-z\\\\u00a1-\\\\uffff0-9]+-?)*[a-z\\\\u00a1-\\\\uffff0-9]+)(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff0-9]+-?)*[a-z\\\\u00a1-\\\\uffff0-9]+)*(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff]{2,})))|localhost)(?::\\\\d{2,5})?(?:(/|\\\\?|#)[^\\\\s]*)?$', 'i'),\n hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i\n};\n\nvar types = {\n integer: function integer(value) {\n return types.number(value) && parseInt(value, 10) === value;\n },\n float: function float(value) {\n return types.number(value) && !types.integer(value);\n },\n array: function array(value) {\n return Array.isArray(value);\n },\n regexp: function regexp(value) {\n if (value instanceof RegExp) {\n return true;\n }\n try {\n return !!new RegExp(value);\n } catch (e) {\n return false;\n }\n },\n date: function date(value) {\n return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';\n },\n number: function number(value) {\n if (isNaN(value)) {\n return false;\n }\n return typeof value === 'number';\n },\n object: function object(value) {\n return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !types.array(value);\n },\n method: function method(value) {\n return typeof value === 'function';\n },\n email: function email(value) {\n return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;\n },\n url: function url(value) {\n return typeof value === 'string' && !!value.match(pattern.url);\n },\n hex: function hex(value) {\n return typeof value === 'string' && !!value.match(pattern.hex);\n }\n};\n\n/**\n * Rule for validating the type of a value.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param source The source object being validated.\n * @param errors An array of errors that this rule may add\n * validation errors to.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}\n\nexport default type;","import * as util from '../util';\n\n/**\n * Rule for validating minimum and maximum allowed values.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param source The source object being validated.\n * @param errors An array of errors that this rule may add\n * validation errors to.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction range(rule, value, source, errors, options) {\n var len = typeof rule.len === 'number';\n var min = typeof rule.min === 'number';\n var max = typeof rule.max === 'number';\n // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)\n var spRegexp = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n var val = value;\n var key = null;\n var num = typeof value === 'number';\n var str = typeof value === 'string';\n var arr = Array.isArray(value);\n if (num) {\n key = 'number';\n } else if (str) {\n key = 'string';\n } else if (arr) {\n key = 'array';\n }\n // if the value is not of a supported type for range validation\n // the validation rule rule should use the\n // type property to also test for a particular type\n if (!key) {\n return false;\n }\n if (arr) {\n val = value.length;\n }\n if (str) {\n // 处理码点大于U+010000的文字length属性不准确的bug,如\"𠮷𠮷𠮷\".lenght !== 3\n val = value.replace(spRegexp, '_').length;\n }\n if (len) {\n if (val !== rule.len) {\n errors.push(util.format(options.messages[key].len, rule.fullField, rule.len));\n }\n } else if (min && !max && val < rule.min) {\n errors.push(util.format(options.messages[key].min, rule.fullField, rule.min));\n } else if (max && !min && val > rule.max) {\n errors.push(util.format(options.messages[key].max, rule.fullField, rule.max));\n } else if (min && max && (val < rule.min || val > rule.max)) {\n errors.push(util.format(options.messages[key].range, rule.fullField, rule.min, rule.max));\n }\n}\n\nexport default range;","import * as util from '../util';\nvar ENUM = 'enum';\n\n/**\n * Rule for validating a value exists in an enumerable list.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param source The source object being validated.\n * @param errors An array of errors that this rule may add\n * validation errors to.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}\n\nexport default enumerable;","import * as util from '../util';\n\n/**\n * Rule for validating a regular expression pattern.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param source The source object being validated.\n * @param errors An array of errors that this rule may add\n * validation errors to.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction pattern(rule, value, source, errors, options) {\n if (rule.pattern) {\n if (rule.pattern instanceof RegExp) {\n // if a RegExp instance is passed, reset `lastIndex` in case its `global`\n // flag is accidentally set to `true`, which in a validation scenario\n // is not necessary and the result might be misleading\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n } else if (typeof rule.pattern === 'string') {\n var _pattern = new RegExp(rule.pattern);\n if (!_pattern.test(value)) {\n errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));\n }\n }\n }\n}\n\nexport default pattern;","import required from './required';\nimport whitespace from './whitespace';\nimport type from './type';\nimport range from './range';\nimport enumRule from './enum';\nimport pattern from './pattern';\n\nexport default {\n required: required,\n whitespace: whitespace,\n type: type,\n range: range,\n 'enum': enumRule,\n pattern: pattern\n};","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\n\n/**\n * Performs validation for string types.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param callback The callback function.\n * @param source The source object being validated.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction string(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options, 'string');\n if (!isEmptyValue(value, 'string')) {\n rules.type(rule, value, source, errors, options);\n rules.range(rule, value, source, errors, options);\n rules.pattern(rule, value, source, errors, options);\n if (rule.whitespace === true) {\n rules.whitespace(rule, value, source, errors, options);\n }\n }\n }\n callback(errors);\n}\n\nexport default string;","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\n\n/**\n * Validates a function.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param callback The callback function.\n * @param source The source object being validated.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction method(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (value !== undefined) {\n rules.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}\n\nexport default method;","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\n\n/**\n * Validates a number.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param callback The callback function.\n * @param source The source object being validated.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction number(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (value !== undefined) {\n rules.type(rule, value, source, errors, options);\n rules.range(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}\n\nexport default number;","import { isEmptyValue } from '../util';\nimport rules from '../rule/';\n\n/**\n * Validates a boolean.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param callback The callback function.\n * @param source The source object being validated.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction boolean(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (value !== undefined) {\n rules.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}\n\nexport default boolean;","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\n\n/**\n * Validates the regular expression type.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param callback The callback function.\n * @param source The source object being validated.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (!isEmptyValue(value)) {\n rules.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}\n\nexport default regexp;","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\n\n/**\n * Validates a number is an integer.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param callback The callback function.\n * @param source The source object being validated.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction integer(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (value !== undefined) {\n rules.type(rule, value, source, errors, options);\n rules.range(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}\n\nexport default integer;","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\n\n/**\n * Validates a number is a floating point number.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param callback The callback function.\n * @param source The source object being validated.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction floatFn(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (value !== undefined) {\n rules.type(rule, value, source, errors, options);\n rules.range(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}\n\nexport default floatFn;","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\n/**\n * Validates an array.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param callback The callback function.\n * @param source The source object being validated.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction array(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'array') && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options, 'array');\n if (!isEmptyValue(value, 'array')) {\n rules.type(rule, value, source, errors, options);\n rules.range(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}\n\nexport default array;","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\n\n/**\n * Validates an object.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param callback The callback function.\n * @param source The source object being validated.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction object(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (value !== undefined) {\n rules.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}\n\nexport default object;","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\nvar ENUM = 'enum';\n\n/**\n * Validates an enumerable list.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param callback The callback function.\n * @param source The source object being validated.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction enumerable(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (value) {\n rules[ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}\n\nexport default enumerable;","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\n\n/**\n * Validates a regular expression pattern.\n *\n * Performs validation when a rule only contains\n * a pattern property but is not declared as a string type.\n *\n * @param rule The validation rule.\n * @param value The value of the field on the source object.\n * @param callback The callback function.\n * @param source The source object being validated.\n * @param options The validation options.\n * @param options.messages The validation messages.\n */\nfunction pattern(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, 'string') && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (!isEmptyValue(value, 'string')) {\n rules.pattern(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}\n\nexport default pattern;","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\n\nfunction date(rule, value, callback, source, options) {\n // console.log('integer rule called %j', rule);\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n // console.log('validate on %s value', value);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (!isEmptyValue(value)) {\n var dateObject = void 0;\n\n if (typeof value === 'number') {\n dateObject = new Date(value);\n } else {\n dateObject = value;\n }\n\n rules.type(rule, dateObject, source, errors, options);\n if (dateObject) {\n rules.range(rule, dateObject.getTime(), source, errors, options);\n }\n }\n }\n callback(errors);\n}\n\nexport default date;","import _typeof from 'babel-runtime/helpers/typeof';\nimport rules from '../rule/';\n\nfunction required(rule, value, callback, source, options) {\n var errors = [];\n var type = Array.isArray(value) ? 'array' : typeof value === 'undefined' ? 'undefined' : _typeof(value);\n rules.required(rule, value, source, errors, options, type);\n callback(errors);\n}\n\nexport default required;","import rules from '../rule/';\nimport { isEmptyValue } from '../util';\n\nfunction type(rule, value, callback, source, options) {\n var ruleType = rule.type;\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value, ruleType) && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options, ruleType);\n if (!isEmptyValue(value, ruleType)) {\n rules.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}\n\nexport default type;","import string from './string';\nimport method from './method';\nimport number from './number';\nimport boolean from './boolean';\nimport regexp from './regexp';\nimport integer from './integer';\nimport float from './float';\nimport array from './array';\nimport object from './object';\nimport enumValidator from './enum';\nimport pattern from './pattern';\nimport date from './date';\nimport required from './required';\nimport type from './type';\n\nexport default {\n string: string,\n method: method,\n number: number,\n boolean: boolean,\n regexp: regexp,\n integer: integer,\n float: float,\n array: array,\n object: object,\n 'enum': enumValidator,\n pattern: pattern,\n date: date,\n url: type,\n hex: type,\n email: type,\n required: required\n};","export function newMessages() {\n return {\n 'default': 'Validation error on field %s',\n required: '%s is required',\n 'enum': '%s must be one of %s',\n whitespace: '%s cannot be empty',\n date: {\n format: '%s date %s is invalid for format %s',\n parse: '%s date could not be parsed, %s is invalid ',\n invalid: '%s date %s is invalid'\n },\n types: {\n string: '%s is not a %s',\n method: '%s is not a %s (function)',\n array: '%s is not an %s',\n object: '%s is not an %s',\n number: '%s is not a %s',\n date: '%s is not a %s',\n boolean: '%s is not a %s',\n integer: '%s is not an %s',\n float: '%s is not a %s',\n regexp: '%s is not a valid %s',\n email: '%s is not a valid %s',\n url: '%s is not a valid %s',\n hex: '%s is not a valid %s'\n },\n string: {\n len: '%s must be exactly %s characters',\n min: '%s must be at least %s characters',\n max: '%s cannot be longer than %s characters',\n range: '%s must be between %s and %s characters'\n },\n number: {\n len: '%s must equal %s',\n min: '%s cannot be less than %s',\n max: '%s cannot be greater than %s',\n range: '%s must be between %s and %s'\n },\n array: {\n len: '%s must be exactly %s in length',\n min: '%s cannot be less than %s in length',\n max: '%s cannot be greater than %s in length',\n range: '%s must be between %s and %s in length'\n },\n pattern: {\n mismatch: '%s value %s does not match pattern %s'\n },\n clone: function clone() {\n var cloned = JSON.parse(JSON.stringify(this));\n cloned.clone = this.clone;\n return cloned;\n }\n };\n}\n\nexport var messages = newMessages();","import _extends from 'babel-runtime/helpers/extends';\nimport _typeof from 'babel-runtime/helpers/typeof';\nimport { format, complementError, asyncMap, warning, deepMerge } from './util';\nimport validators from './validator/';\nimport { messages as defaultMessages, newMessages } from './messages';\n\n/**\n * Encapsulates a validation schema.\n *\n * @param descriptor An object declaring validation rules\n * for this schema.\n */\nfunction Schema(descriptor) {\n this.rules = null;\n this._messages = defaultMessages;\n this.define(descriptor);\n}\n\nSchema.prototype = {\n messages: function messages(_messages) {\n if (_messages) {\n this._messages = deepMerge(newMessages(), _messages);\n }\n return this._messages;\n },\n define: function define(rules) {\n if (!rules) {\n throw new Error('Cannot configure a schema with no rules');\n }\n if ((typeof rules === 'undefined' ? 'undefined' : _typeof(rules)) !== 'object' || Array.isArray(rules)) {\n throw new Error('Rules must be an object');\n }\n this.rules = {};\n var z = void 0;\n var item = void 0;\n for (z in rules) {\n if (rules.hasOwnProperty(z)) {\n item = rules[z];\n this.rules[z] = Array.isArray(item) ? item : [item];\n }\n }\n },\n validate: function validate(source_) {\n var _this = this;\n\n var o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var oc = arguments[2];\n\n var source = source_;\n var options = o;\n var callback = oc;\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n if (!this.rules || Object.keys(this.rules).length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n function complete(results) {\n var i = void 0;\n var field = void 0;\n var errors = [];\n var fields = {};\n\n function add(e) {\n if (Array.isArray(e)) {\n errors = errors.concat.apply(errors, e);\n } else {\n errors.push(e);\n }\n }\n\n for (i = 0; i < results.length; i++) {\n add(results[i]);\n }\n if (!errors.length) {\n errors = null;\n fields = null;\n } else {\n for (i = 0; i < errors.length; i++) {\n field = errors[i].field;\n fields[field] = fields[field] || [];\n fields[field].push(errors[i]);\n }\n }\n callback(errors, fields);\n }\n\n if (options.messages) {\n var messages = this.messages();\n if (messages === defaultMessages) {\n messages = newMessages();\n }\n deepMerge(messages, options.messages);\n options.messages = messages;\n } else {\n options.messages = this.messages();\n }\n var arr = void 0;\n var value = void 0;\n var series = {};\n var keys = options.keys || Object.keys(this.rules);\n keys.forEach(function (z) {\n arr = _this.rules[z];\n value = source[z];\n arr.forEach(function (r) {\n var rule = r;\n if (typeof rule.transform === 'function') {\n if (source === source_) {\n source = _extends({}, source);\n }\n value = source[z] = rule.transform(value);\n }\n if (typeof rule === 'function') {\n rule = {\n validator: rule\n };\n } else {\n rule = _extends({}, rule);\n }\n rule.validator = _this.getValidationMethod(rule);\n rule.field = z;\n rule.fullField = rule.fullField || z;\n rule.type = _this.getType(rule);\n if (!rule.validator) {\n return;\n }\n series[z] = series[z] || [];\n series[z].push({\n rule: rule,\n value: value,\n source: source,\n field: z\n });\n });\n });\n var errorFields = {};\n asyncMap(series, options, function (data, doIt) {\n var rule = data.rule;\n var deep = (rule.type === 'object' || rule.type === 'array') && (_typeof(rule.fields) === 'object' || _typeof(rule.defaultField) === 'object');\n deep = deep && (rule.required || !rule.required && data.value);\n rule.field = data.field;\n function addFullfield(key, schema) {\n return _extends({}, schema, {\n fullField: rule.fullField + '.' + key\n });\n }\n\n function cb() {\n var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n var errors = e;\n if (!Array.isArray(errors)) {\n errors = [errors];\n }\n if (errors.length) {\n warning('async-validator:', errors);\n }\n if (errors.length && rule.message) {\n errors = [].concat(rule.message);\n }\n\n errors = errors.map(complementError(rule));\n\n if (options.first && errors.length) {\n errorFields[rule.field] = 1;\n return doIt(errors);\n }\n if (!deep) {\n doIt(errors);\n } else {\n // if rule is required but the target object\n // does not exist fail at the rule level and don't\n // go deeper\n if (rule.required && !data.value) {\n if (rule.message) {\n errors = [].concat(rule.message).map(complementError(rule));\n } else if (options.error) {\n errors = [options.error(rule, format(options.messages.required, rule.field))];\n } else {\n errors = [];\n }\n return doIt(errors);\n }\n\n var fieldsSchema = {};\n if (rule.defaultField) {\n for (var k in data.value) {\n if (data.value.hasOwnProperty(k)) {\n fieldsSchema[k] = rule.defaultField;\n }\n }\n }\n fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);\n for (var f in fieldsSchema) {\n if (fieldsSchema.hasOwnProperty(f)) {\n var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];\n fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));\n }\n }\n var schema = new Schema(fieldsSchema);\n schema.messages(options.messages);\n if (data.rule.options) {\n data.rule.options.messages = options.messages;\n data.rule.options.error = options.error;\n }\n schema.validate(data.value, data.rule.options || options, function (errs) {\n doIt(errs && errs.length ? errors.concat(errs) : errs);\n });\n }\n }\n\n var res = rule.validator(rule, data.value, cb, data.source, options);\n if (res && res.then) {\n res.then(function () {\n return cb();\n }, function (e) {\n return cb(e);\n });\n }\n }, function (results) {\n complete(results);\n });\n },\n getType: function getType(rule) {\n if (rule.type === undefined && rule.pattern instanceof RegExp) {\n rule.type = 'pattern';\n }\n if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {\n throw new Error(format('Unknown rule type %s', rule.type));\n }\n return rule.type || 'string';\n },\n getValidationMethod: function getValidationMethod(rule) {\n if (typeof rule.validator === 'function') {\n return rule.validator;\n }\n var keys = Object.keys(rule);\n var messageIndex = keys.indexOf('message');\n if (messageIndex !== -1) {\n keys.splice(messageIndex, 1);\n }\n if (keys.length === 1 && keys[0] === 'required') {\n return validators.required;\n }\n return validators[this.getType(rule)] || false;\n }\n};\n\nSchema.register = function register(type, validator) {\n if (typeof validator !== 'function') {\n throw new Error('Cannot register a validator by type, validator is not a function');\n }\n validators[type] = validator;\n};\n\nSchema.messages = defaultMessages;\n\nexport default Schema;"],"sourceRoot":""}