diff --git a/README.md b/README.md index dd84e27ae..3693ea1a7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ JavaScript form validation, without actually writing a single line of JavaScript ## Version -2.9.1 +2.9.2 ## Doc diff --git a/dist/i18n/en.extra.js b/dist/i18n/en.extra.js index e1e835ef3..9ee07dba7 100644 --- a/dist/i18n/en.extra.js +++ b/dist/i18n/en.extra.js @@ -3,6 +3,9 @@ Parsley.addMessages('en', { dateiso: "This value should be a valid date (YYYY-MM-DD).", + date: "It must be a valid date with format %s", + datebeforenow: "Date must be valid with format %s and be before now", + dateafternow: "Date must be valid with format %s and be after now", minwords: "This value is too short. It should have %s words or more.", maxwords: "This value is too long. It should have %s words or fewer.", words: "This value length is invalid. It should be between %s and %s words long.", diff --git a/dist/i18n/it.extra.js b/dist/i18n/it.extra.js index 10e40bfd5..133c63946 100644 --- a/dist/i18n/it.extra.js +++ b/dist/i18n/it.extra.js @@ -2,7 +2,10 @@ // Load this after Parsley Parsley.addMessages('it', { - dateiso: "Inserire una data valida (AAAA-MM-GG).", + dateiso: "Inserire una data valida (AAAA-MM-GG).", + date: "Deve essere una data valida nel formato %s", + datebeforenow: "La data deve essere valida nel formato %s e precedere la data attuale", + dateafternow: "La data deve essere valida nel formato %s e posteriore alla data attuale", minwords: "Questo valore deve avere almeno %s parole.", maxwords: "Questo valore deve avere meno di %s parole.", words: "Questo valore deve avere tra %s e %s parole.", @@ -10,5 +13,5 @@ Parsley.addMessages('it', { gte: "Questo valore deve essere maggiore o uguale a %s.", lt: "Questo valore deve essere minore di %s.", lte: "Questo valore deve essere minore o uguale a %s.", - notequalto: "Questo valore deve essere differente da %s.", + notequalto: "Questo valore deve essere differente da %s." }); diff --git a/dist/i18n/th.extra.js b/dist/i18n/th.extra.js new file mode 100644 index 000000000..70a87af3f --- /dev/null +++ b/dist/i18n/th.extra.js @@ -0,0 +1,17 @@ +// Validation errors messages for Parsley +// Load this after Parsley + +Parsley.addMessages('th', { + dateiso: "วันที่ต้องมีรูปแบบเป็น YYYY-MM-DD", + date: "วันที่ไม่ถูกต้องตามรูปแบบ %s", + datebeforenow: "วันที่ต้องมีรูปแบบเป็น %s และเป็นวันที่ก่อนวันปัจจุบัน", + dateafternow: "วันที่ต้องมีรูปแบบเป็น %s และเป็นวันที่หลังวันปัจจุบัน", + minwords: "กรุณากรอกอย่างน้อย %s คำ", + maxwords: "กรอกได้ไม่เกิน %s คำ", + words: "จำนวนคำต้องอยู่ระหว่าง %s ถึง %s คำ", + gt: "กรุณากรอกค่าที่มากกว่า %s", + gte: "กรุณากรอกค่าที่มากกว่าหรือเท่ากับ %s", + lt: "กรุณากรอกค่าที่น้อยกว่า %s", + lte: "กรุณากรอกค่าที่น้อยกว่าหรือเท่ากับ %s", + notequalto: "ค่าที่กรอกต้องเหมือนกับ %s" +}); diff --git a/dist/i18n/th.js b/dist/i18n/th.js index e97f910c1..c9d38ae15 100644 --- a/dist/i18n/th.js +++ b/dist/i18n/th.js @@ -4,26 +4,27 @@ Parsley.addMessages('th', { defaultMessage: "ค่านี้ดูเหมือนว่าจะไม่ถูกต้อง", type: { - email: "ค่านี้ควรจะเป็นอีเมลที่ถูกต้อง", - url: "ค่านี้ควรจะเป็น url ที่ถูกต้อง", - number: "ค่านี้ควรจะเป็นตัวเลขที่ถูกต้อง", - integer: "ค่านี้ควรจะเป็นจำนวนเต็มที่ถูกต้อง", - digits: "ค่านี้ควรเป็นทศนิยมที่ถูกต้อง", - alphanum: "ค่านี้ควรเป็นอักขระตัวอักษรหรือตัวเลขที่ถูกต้อง" + email: "กรุณากรอกอีเมลให้ถูกต้อง", + url: "กรุณากรอก url ให้ถูกต้อง", + number: "กรุณากรอกตัวเลข", + integer: "กรุณากรอกจำนวนเต็ม", + digits: "กรุณากรอกเลขทศนิยม", + alphanum: "กรุณากรอกตัวอักษรและตัวเลข" }, - notblank: "ค่านี้ไม่ควรจะว่าง", - required: "ค่านี้จำเป็น", - pattern: "ค่านี้ดูเหมือนว่าจะไม่ถูกต้อง", - min: "ค่านี้ควรมากกว่าหรือเท่ากับ %s.", - max: "ค่านี้ควรจะน้อยกว่าหรือเท่ากับ %s.", - range: "ค่านี้ควรจะอยู่ระหว่าง %s และ %s.", - minlength: "ค่านี้สั้นเกินไป ควรจะมี %s อักขระหรือมากกว่า", - maxlength: "ค่านี้ยาวเกินไป ควรจะมี %s อักขระหรือน้อยกว่า", - length: "ความยาวของค่านี้ไม่ถูกต้อง ควรมีความยาวอยู่ระหว่าง %s และ %s อักขระ", - mincheck: "คุณควรเลือกอย่างน้อย %s ตัวเลือก", - maxcheck: "คุณควรเลือก %s ตัวเลือกหรือน้อยกว่า", - check: "คุณควรเลือกระหว่าง %s และ %s ตัวเลือก", - equalto: "ค่านี้ควรจะเหมือนกัน" + notblank: "ห้ามเป็นค่าว่าง", + required: "จำเป็นต้องกรอก", + pattern: "รูปแบบไม่ถูกต้อง", + min: "ต้องมากกว่าหรือเท่ากับ %s", + max: "ต้องน้อยกว่าหรือเท่ากับ %s", + range: "ต้องอยู่ระหว่าง %s และ %s", + minlength: "กรุณากรอกอย่างน้อย %s ตัวอักษร", + maxlength: "กรอกได้ไม่เกิน %s ตัวอักษร", + length: "ความยาวตัวอักษรต้องอยู่ระหว่าง %s ถึง %s ตัวอักษร", + mincheck: "กรุณาเลือกอย่างน้อย %s ตัวเลือก", + maxcheck: "เลือกได้ไม่เกิน %s ตัวเลือก", + check: "กรุณาเลือกระหว่าง %s และ %s ตัวเลือก", + equalto: "ค่าที่กรอกไม่เหมืิอนกัน", + euvatin: "หมายเลขประจำตัวผู้เสียภาษีไม่ถูกต้อง", }); Parsley.setLocale('th'); diff --git a/dist/parsley.js b/dist/parsley.js index 992f3dc88..0f5718d83 100644 --- a/dist/parsley.js +++ b/dist/parsley.js @@ -1,6 +1,6 @@ /*! * Parsley.js -* Version 2.9.1 - built Tue, Apr 30th 2019, 1:56 am +* Version 2.9.2 - built Tue, Dec 10th 2019, 6:18 pm * http://parsleyjs.org * Guillaume Potier - * Marc-Andre Lafortune - @@ -14,7 +14,7 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : - (global.parsley = factory(global.jQuery)); + (global = global || self, global.parsley = factory(global.jQuery)); }(this, (function ($) { 'use strict'; function _typeof(obj) { @@ -74,6 +74,10 @@ } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; @@ -541,7 +545,7 @@ }; var typeTesters = { - email: /^((([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/, + email: /^((([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))$/, // Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers number: /^-?(\d*\.)?\d+(e[-+]?\d+)?$/i, integer: /^-?\d+$/, @@ -1042,10 +1046,15 @@ this._insertErrorWrapper(); if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length) this._ui.$errorsWrapper.append($(this.options.errorTemplate).addClass('parsley-custom-error-message')); - return this._ui.$errorsWrapper.addClass('filled').find('.parsley-custom-error-message').html(this.options.errorMessage); + + this._ui.$errorClassHandler.attr('aria-describedby', this._ui.errorsWrapperId); + + return this._ui.$errorsWrapper.addClass('filled').attr('aria-hidden', 'false').find('.parsley-custom-error-message').html(this.options.errorMessage); } - return this._ui.$errorsWrapper.removeClass('filled').find('.parsley-custom-error-message').remove(); + this._ui.$errorClassHandler.removeAttr('aria-describedby'); + + return this._ui.$errorsWrapper.removeClass('filled').attr('aria-hidden', 'true').find('.parsley-custom-error-message').remove(); } // Show, hide, update failing constraints messages @@ -1075,7 +1084,7 @@ this._ui.$errorClassHandler.attr('aria-describedby', this._ui.errorsWrapperId); - this._ui.$errorsWrapper.addClass('filled').append($(this.options.errorTemplate).addClass('parsley-' + name).html(message || this._getErrorMessage(assert))); + this._ui.$errorsWrapper.addClass('filled').attr('aria-hidden', 'false').append($(this.options.errorTemplate).addClass('parsley-' + name).html(message || this._getErrorMessage(assert))); }, _updateError: function _updateError(name, _ref5) { var message = _ref5.message, @@ -1086,7 +1095,7 @@ _removeError: function _removeError(name) { this._ui.$errorClassHandler.removeAttr('aria-describedby'); - this._ui.$errorsWrapper.removeClass('filled').find('.parsley-' + name).remove(); + this._ui.$errorsWrapper.removeClass('filled').attr('aria-hidden', 'true').find('.parsley-' + name).remove(); }, _getErrorMessage: function _getErrorMessage(constraint) { var customConstraintErrorMessage = constraint.name + 'Message'; @@ -1977,7 +1986,7 @@ Factory.prototype = { init: function init(options) { this.__class__ = 'Parsley'; - this.__version__ = '2.9.1'; + this.__version__ = '2.9.2'; this.__id__ = Utils.generateID(); // Pre-compute options this._resetOptions(options); // A Form instance is obviously a `
` element but also every node that is not an input and has the `data-parsley-validate` attribute @@ -2095,7 +2104,7 @@ actualizeOptions: null, _resetOptions: null, Factory: Factory, - version: '2.9.1' + version: '2.9.2' }); // Supplement Field and Form with Base // This way, the constructors will have access to those methods @@ -2437,9 +2446,8 @@ } globals.inputEventPatched = '0.0.3'; - var _arr = ['select', 'input[type="checkbox"]', 'input[type="radio"]', 'input[type="file"]']; - for (var _i = 0; _i < _arr.length; _i++) { + for (var _i = 0, _arr = ['select', 'input[type="checkbox"]', 'input[type="radio"]', 'input[type="file"]']; _i < _arr.length; _i++) { var selector = _arr[_i]; $(document).on('input.inputevent', selector, { selector: selector diff --git a/dist/parsley.js.map b/dist/parsley.js.map index 989f81c41..e6b1578d1 100644 --- a/dist/parsley.js.map +++ b/dist/parsley.js.map @@ -1 +1 @@ -{"version":3,"file":"parsley.js","sources":["../src/parsley/utils.js","../src/parsley/defaults.js","../src/parsley/base.js","../src/parsley/validator.js","../src/parsley/validator_registry.js","../src/parsley/ui.js","../src/parsley/form.js","../src/parsley/constraint.js","../src/parsley/field.js","../src/parsley/multiple.js","../src/parsley/factory.js","../src/parsley/main.js","../src/parsley/pubsub.js","../src/parsley/remote.js","../src/i18n/en.js","../src/vendor/inputevent.js","../src/parsley.js"],"sourcesContent":["import $ from 'jquery';\n\nvar globalID = 1;\nvar pastWarnings = {};\n\nvar Utils = {\n // Parsley DOM-API\n // returns object from dom attributes and values\n attr: function (element, namespace, obj) {\n var i;\n var attribute;\n var attributes;\n var regex = new RegExp('^' + namespace, 'i');\n\n if ('undefined' === typeof obj)\n obj = {};\n else {\n // Clear all own properties. This won't affect prototype's values\n for (i in obj) {\n if (obj.hasOwnProperty(i))\n delete obj[i];\n }\n }\n\n if (!element)\n return obj;\n\n attributes = element.attributes;\n for (i = attributes.length; i--; ) {\n attribute = attributes[i];\n\n if (attribute && attribute.specified && regex.test(attribute.name)) {\n obj[this.camelize(attribute.name.slice(namespace.length))] = this.deserializeValue(attribute.value);\n }\n }\n\n return obj;\n },\n\n checkAttr: function (element, namespace, checkAttr) {\n return element.hasAttribute(namespace + checkAttr);\n },\n\n setAttr: function (element, namespace, attr, value) {\n element.setAttribute(this.dasherize(namespace + attr), String(value));\n },\n\n getType: function(element) {\n return element.getAttribute('type') || 'text';\n },\n\n generateID: function () {\n return '' + globalID++;\n },\n\n /** Third party functions **/\n deserializeValue: function (value) {\n var num;\n\n try {\n return value ?\n value == \"true\" ||\n (value == \"false\" ? false :\n value == \"null\" ? null :\n !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? JSON.parse(value) :\n value)\n : value;\n } catch (e) { return value; }\n },\n\n // Zepto camelize function\n camelize: function (str) {\n return str.replace(/-+(.)?/g, function (match, chr) {\n return chr ? chr.toUpperCase() : '';\n });\n },\n\n // Zepto dasherize function\n dasherize: function (str) {\n return str.replace(/::/g, '/')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .replace(/_/g, '-')\n .toLowerCase();\n },\n\n warn: function () {\n if (window.console && 'function' === typeof window.console.warn)\n window.console.warn(...arguments);\n },\n\n warnOnce: function(msg) {\n if (!pastWarnings[msg]) {\n pastWarnings[msg] = true;\n this.warn(...arguments);\n }\n },\n\n _resetWarnings: function () {\n pastWarnings = {};\n },\n\n trimString: function(string) {\n return string.replace(/^\\s+|\\s+$/g, '');\n },\n\n parse: {\n date: function(string) {\n let parsed = string.match(/^(\\d{4,})-(\\d\\d)-(\\d\\d)$/);\n if (!parsed)\n return null;\n let [_, year, month, day] = parsed.map(x => parseInt(x, 10));\n let date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day)\n return null;\n return date;\n },\n string: function(string) {\n return string;\n },\n integer: function(string) {\n if (isNaN(string))\n return null;\n return parseInt(string, 10);\n },\n number: function(string) {\n if (isNaN(string))\n throw null;\n return parseFloat(string);\n },\n 'boolean': function _boolean(string) {\n return !(/^\\s*false\\s*$/i.test(string));\n },\n object: function(string) {\n return Utils.deserializeValue(string);\n },\n regexp: function(regexp) {\n var flags = '';\n\n // Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern\n if (/^\\/.*\\/(?:[gimy]*)$/.test(regexp)) {\n // Replace the regexp literal string with the first match group: ([gimy]*)\n // If no flag is present, this will be a blank string\n flags = regexp.replace(/.*\\/([gimy]*)$/, '$1');\n // Again, replace the regexp literal string with the first match group:\n // everything excluding the opening and closing slashes and the flags\n regexp = regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');\n } else {\n // Anchor regexp:\n regexp = '^' + regexp + '$';\n }\n return new RegExp(regexp, flags);\n }\n },\n\n parseRequirement: function(requirementType, string) {\n var converter = this.parse[requirementType || 'string'];\n if (!converter)\n throw 'Unknown requirement specification: \"' + requirementType + '\"';\n let converted = converter(string);\n if (converted === null)\n throw `Requirement is not a ${requirementType}: \"${string}\"`;\n return converted;\n },\n\n namespaceEvents: function(events, namespace) {\n events = this.trimString(events || '').split(/\\s+/);\n if (!events[0])\n return '';\n return $.map(events, evt => `${evt}.${namespace}`).join(' ');\n },\n\n difference: function(array, remove) {\n // This is O(N^2), should be optimized\n let result = [];\n $.each(array, (_, elem) => {\n if (remove.indexOf(elem) == -1)\n result.push(elem);\n });\n return result;\n },\n\n // Alter-ego to native Promise.all, but for jQuery\n all: function(promises) {\n // jQuery treats $.when() and $.when(singlePromise) differently; let's avoid that and add spurious elements\n return $.when(...promises, 42, 42);\n },\n\n // Object.create polyfill, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill\n objectCreate: Object.create || (function () {\n var Object = function () {};\n return function (prototype) {\n if (arguments.length > 1) {\n throw Error('Second argument not supported');\n }\n if (typeof prototype != 'object') {\n throw TypeError('Argument must be an object');\n }\n Object.prototype = prototype;\n var result = new Object();\n Object.prototype = null;\n return result;\n };\n })(),\n\n _SubmitSelector: 'input[type=\"submit\"], button:submit'\n};\n\nexport default Utils;\n","// All these options could be overriden and specified directly in DOM using\n// `data-parsley-` default DOM-API\n// eg: `inputs` can be set in DOM using `data-parsley-inputs=\"input, textarea\"`\n// eg: `data-parsley-stop-on-first-failing-constraint=\"false\"`\n\nvar Defaults = {\n // ### General\n\n // Default data-namespace for DOM API\n namespace: 'data-parsley-',\n\n // Supported inputs by default\n inputs: 'input, textarea, select',\n\n // Excluded inputs by default\n excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden]',\n\n // Stop validating field on highest priority failing constraint\n priorityEnabled: true,\n\n // ### Field only\n\n // identifier used to group together inputs (e.g. radio buttons...)\n multiple: null,\n\n // identifier (or array of identifiers) used to validate only a select group of inputs\n group: null,\n\n // ### UI\n // Enable\\Disable error messages\n uiEnabled: true,\n\n // Key events threshold before validation\n validationThreshold: 3,\n\n // Focused field on form validation error. 'first'|'last'|'none'\n focus: 'first',\n\n // event(s) that will trigger validation before first failure. eg: `input`...\n trigger: false,\n\n // event(s) that will trigger validation after first failure.\n triggerAfterFailure: 'input',\n\n // Class that would be added on every failing validation Parsley field\n errorClass: 'parsley-error',\n\n // Same for success validation\n successClass: 'parsley-success',\n\n // Return the `$element` that will receive these above success or error classes\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n classHandler: function (Field) {},\n\n // Return the `$element` where errors will be appended\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n errorsContainer: function (Field) {},\n\n // ul elem that would receive errors' list\n errorsWrapper: '
    ',\n\n // li elem that would receive error message\n errorTemplate: '
  • '\n};\n\nexport default Defaults;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Base = function () {\n this.__id__ = Utils.generateID();\n};\n\nBase.prototype = {\n asyncSupport: true, // Deprecated\n\n _pipeAccordingToValidationResult: function () {\n var pipe = () => {\n var r = $.Deferred();\n if (true !== this.validationResult)\n r.reject();\n return r.resolve().promise();\n };\n return [pipe, pipe];\n },\n\n actualizeOptions: function () {\n Utils.attr(this.element, this.options.namespace, this.domOptions);\n if (this.parent && this.parent.actualizeOptions)\n this.parent.actualizeOptions();\n return this;\n },\n\n _resetOptions: function (initOptions) {\n this.domOptions = Utils.objectCreate(this.parent.options);\n this.options = Utils.objectCreate(this.domOptions);\n // Shallow copy of ownProperties of initOptions:\n for (var i in initOptions) {\n if (initOptions.hasOwnProperty(i))\n this.options[i] = initOptions[i];\n }\n this.actualizeOptions();\n },\n\n _listeners: null,\n\n // Register a callback for the given event name\n // Callback is called with context as the first argument and the `this`\n // The context is the current parsley instance, or window.Parsley if global\n // A return value of `false` will interrupt the calls\n on: function (name, fn) {\n this._listeners = this._listeners || {};\n var queue = this._listeners[name] = this._listeners[name] || [];\n queue.push(fn);\n\n return this;\n },\n\n // Deprecated. Use `on` instead\n subscribe: function(name, fn) {\n $.listenTo(this, name.toLowerCase(), fn);\n },\n\n // Unregister a callback (or all if none is given) for the given event name\n off: function (name, fn) {\n var queue = this._listeners && this._listeners[name];\n if (queue) {\n if (!fn) {\n delete this._listeners[name];\n } else {\n for (var i = queue.length; i--; )\n if (queue[i] === fn)\n queue.splice(i, 1);\n }\n }\n return this;\n },\n\n // Deprecated. Use `off`\n unsubscribe: function(name, fn) {\n $.unsubscribeTo(this, name.toLowerCase());\n },\n\n // Trigger an event of the given name\n // A return value of `false` interrupts the callback chain\n // Returns false if execution was interrupted\n trigger: function (name, target, extraArg) {\n target = target || this;\n var queue = this._listeners && this._listeners[name];\n var result;\n var parentResult;\n if (queue) {\n for (var i = queue.length; i--; ) {\n result = queue[i].call(target, target, extraArg);\n if (result === false) return result;\n }\n }\n if (this.parent) {\n return this.parent.trigger(name, target, extraArg);\n }\n return true;\n },\n\n asyncIsValid: function (group, force) {\n Utils.warnOnce(\"asyncIsValid is deprecated; please use whenValid instead\");\n return this.whenValid({group, force});\n },\n\n _findRelated: function () {\n return this.options.multiple ?\n $(this.parent.element.querySelectorAll(`[${this.options.namespace}multiple=\"${this.options.multiple}\"]`))\n : this.$element;\n }\n};\n\nexport default Base;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar convertArrayRequirement = function(string, length) {\n var m = string.match(/^\\s*\\[(.*)\\]\\s*$/);\n if (!m)\n throw 'Requirement is not an array: \"' + string + '\"';\n var values = m[1].split(',').map(Utils.trimString);\n if (values.length !== length)\n throw 'Requirement has ' + values.length + ' values when ' + length + ' are needed';\n return values;\n};\n\nvar convertExtraOptionRequirement = function(requirementSpec, string, extraOptionReader) {\n var main = null;\n var extra = {};\n for (var key in requirementSpec) {\n if (key) {\n var value = extraOptionReader(key);\n if ('string' === typeof value)\n value = Utils.parseRequirement(requirementSpec[key], value);\n extra[key] = value;\n } else {\n main = Utils.parseRequirement(requirementSpec[key], string);\n }\n }\n return [main, extra];\n};\n\n// A Validator needs to implement the methods `validate` and `parseRequirements`\n\nvar Validator = function(spec) {\n $.extend(true, this, spec);\n};\n\nValidator.prototype = {\n // Returns `true` iff the given `value` is valid according the given requirements.\n validate: function(value, requirementFirstArg) {\n if (this.fn) { // Legacy style validator\n\n if (arguments.length > 3) // If more args then value, requirement, instance...\n requirementFirstArg = [].slice.call(arguments, 1, -1); // Skip first arg (value) and last (instance), combining the rest\n return this.fn(value, requirementFirstArg);\n }\n\n if (Array.isArray(value)) {\n if (!this.validateMultiple)\n throw 'Validator `' + this.name + '` does not handle multiple values';\n return this.validateMultiple(...arguments);\n } else {\n let instance = arguments[arguments.length - 1];\n if (this.validateDate && instance._isDateInput()) {\n arguments[0] = Utils.parse.date(arguments[0]);\n if (arguments[0] === null)\n return false;\n return this.validateDate(...arguments);\n }\n if (this.validateNumber) {\n if (!value) // Builtin validators all accept empty strings, except `required` of course\n return true;\n if (isNaN(value))\n return false;\n arguments[0] = parseFloat(arguments[0]);\n return this.validateNumber(...arguments);\n }\n if (this.validateString) {\n return this.validateString(...arguments);\n }\n throw 'Validator `' + this.name + '` only handles multiple values';\n }\n },\n\n // Parses `requirements` into an array of arguments,\n // according to `this.requirementType`\n parseRequirements: function(requirements, extraOptionReader) {\n if ('string' !== typeof requirements) {\n // Assume requirement already parsed\n // but make sure we return an array\n return Array.isArray(requirements) ? requirements : [requirements];\n }\n var type = this.requirementType;\n if (Array.isArray(type)) {\n var values = convertArrayRequirement(requirements, type.length);\n for (var i = 0; i < values.length; i++)\n values[i] = Utils.parseRequirement(type[i], values[i]);\n return values;\n } else if ($.isPlainObject(type)) {\n return convertExtraOptionRequirement(type, requirements, extraOptionReader);\n } else {\n return [Utils.parseRequirement(type, requirements)];\n }\n },\n // Defaults:\n requirementType: 'string',\n\n priority: 2\n\n};\n\nexport default Validator;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Validator from './validator';\n\nvar ValidatorRegistry = function (validators, catalog) {\n this.__class__ = 'ValidatorRegistry';\n\n // Default Parsley locale is en\n this.locale = 'en';\n\n this.init(validators || {}, catalog || {});\n};\n\nvar typeTesters = {\n email: /^((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/,\n\n // Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers\n number: /^-?(\\d*\\.)?\\d+(e[-+]?\\d+)?$/i,\n\n integer: /^-?\\d+$/,\n\n digits: /^\\d+$/,\n\n alphanum: /^\\w+$/i,\n\n date: {\n test: value => Utils.parse.date(value) !== null\n },\n\n url: new RegExp(\n \"^\" +\n // protocol identifier\n \"(?:(?:https?|ftp)://)?\" + // ** mod: make scheme optional\n // user:pass authentication\n \"(?:\\\\S+(?::\\\\S*)?@)?\" +\n \"(?:\" +\n // IP address exclusion\n // private & local networks\n // \"(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})\" + // ** mod: allow local networks\n // \"(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // \"(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // IP address dotted notation octets\n // excludes loopback network 0.0.0.0\n // excludes reserved space >= 224.0.0.0\n // excludes network & broacast addresses\n // (first & last IP address of each class)\n \"(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])\" +\n \"(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}\" +\n \"(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))\" +\n \"|\" +\n // host name\n \"(?:(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)\" +\n // domain name\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)*\" +\n // TLD identifier\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff]{2,}))\" +\n \")\" +\n // port number\n \"(?::\\\\d{2,5})?\" +\n // resource path\n \"(?:/\\\\S*)?\" +\n \"$\"\n )\n};\ntypeTesters.range = typeTesters.number;\n\n// See http://stackoverflow.com/a/10454560/8279\nvar decimalPlaces = num => {\n var match = ('' + num).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n if (!match) { return 0; }\n return Math.max(\n 0,\n // Number of digits right of decimal point.\n (match[1] ? match[1].length : 0) -\n // Adjust for scientific notation.\n (match[2] ? +match[2] : 0));\n};\n\n// parseArguments('number', ['1', '2']) => [1, 2]\nlet parseArguments = (type, args) => args.map(Utils.parse[type]);\n// operatorToValidator returns a validating function for an operator function, applied to the given type\nlet operatorToValidator = (type, operator) => {\n return (value, ...requirementsAndInput) => {\n requirementsAndInput.pop(); // Get rid of `input` argument\n return operator(value, ...parseArguments(type, requirementsAndInput));\n };\n};\n\nlet comparisonOperator = operator => ({\n validateDate: operatorToValidator('date', operator),\n validateNumber: operatorToValidator('number', operator),\n requirementType: operator.length <= 2 ? 'string' : ['string', 'string'], // Support operators with a 1 or 2 requirement(s)\n priority: 30\n});\n\nValidatorRegistry.prototype = {\n init: function (validators, catalog) {\n this.catalog = catalog;\n // Copy prototype's validators:\n this.validators = Object.assign({}, this.validators);\n\n for (var name in validators)\n this.addValidator(name, validators[name].fn, validators[name].priority);\n\n window.Parsley.trigger('parsley:validator:init');\n },\n\n // Set new messages locale if we have dictionary loaded in ParsleyConfig.i18n\n setLocale: function (locale) {\n if ('undefined' === typeof this.catalog[locale])\n throw new Error(locale + ' is not available in the catalog');\n\n this.locale = locale;\n\n return this;\n },\n\n // Add a new messages catalog for a given locale. Set locale for this catalog if set === `true`\n addCatalog: function (locale, messages, set) {\n if ('object' === typeof messages)\n this.catalog[locale] = messages;\n\n if (true === set)\n return this.setLocale(locale);\n\n return this;\n },\n\n // Add a specific message for a given constraint in a given locale\n addMessage: function (locale, name, message) {\n if ('undefined' === typeof this.catalog[locale])\n this.catalog[locale] = {};\n\n this.catalog[locale][name] = message;\n\n return this;\n },\n\n // Add messages for a given locale\n addMessages: function (locale, nameMessageObject) {\n for (var name in nameMessageObject)\n this.addMessage(locale, name, nameMessageObject[name]);\n\n return this;\n },\n\n // Add a new validator\n //\n // addValidator('custom', {\n // requirementType: ['integer', 'integer'],\n // validateString: function(value, from, to) {},\n // priority: 22,\n // messages: {\n // en: \"Hey, that's no good\",\n // fr: \"Aye aye, pas bon du tout\",\n // }\n // })\n //\n // Old API was addValidator(name, function, priority)\n //\n addValidator: function (name, arg1, arg2) {\n if (this.validators[name])\n Utils.warn('Validator \"' + name + '\" is already defined.');\n else if (Defaults.hasOwnProperty(name)) {\n Utils.warn('\"' + name + '\" is a restricted keyword and is not a valid validator name.');\n return;\n }\n return this._setValidator(...arguments);\n },\n\n hasValidator: function (name) {\n return !!this.validators[name];\n },\n\n updateValidator: function (name, arg1, arg2) {\n if (!this.validators[name]) {\n Utils.warn('Validator \"' + name + '\" is not already defined.');\n return this.addValidator(...arguments);\n }\n return this._setValidator(...arguments);\n },\n\n removeValidator: function (name) {\n if (!this.validators[name])\n Utils.warn('Validator \"' + name + '\" is not defined.');\n\n delete this.validators[name];\n\n return this;\n },\n\n _setValidator: function (name, validator, priority) {\n if ('object' !== typeof validator) {\n // Old style validator, with `fn` and `priority`\n validator = {\n fn: validator,\n priority: priority\n };\n }\n if (!validator.validate) {\n validator = new Validator(validator);\n }\n this.validators[name] = validator;\n\n for (var locale in validator.messages || {})\n this.addMessage(locale, name, validator.messages[locale]);\n\n return this;\n },\n\n getErrorMessage: function (constraint) {\n var message;\n\n // Type constraints are a bit different, we have to match their requirements too to find right error message\n if ('type' === constraint.name) {\n var typeMessages = this.catalog[this.locale][constraint.name] || {};\n message = typeMessages[constraint.requirements];\n } else\n message = this.formatMessage(this.catalog[this.locale][constraint.name], constraint.requirements);\n\n return message || this.catalog[this.locale].defaultMessage || this.catalog.en.defaultMessage;\n },\n\n // Kind of light `sprintf()` implementation\n formatMessage: function (string, parameters) {\n if ('object' === typeof parameters) {\n for (var i in parameters)\n string = this.formatMessage(string, parameters[i]);\n\n return string;\n }\n\n return 'string' === typeof string ? string.replace(/%s/i, parameters) : '';\n },\n\n // Here is the Parsley default validators list.\n // A validator is an object with the following key values:\n // - priority: an integer\n // - requirement: 'string' (default), 'integer', 'number', 'regexp' or an Array of these\n // - validateString, validateMultiple, validateNumber: functions returning `true`, `false` or a promise\n // Alternatively, a validator can be a function that returns such an object\n //\n validators: {\n notblank: {\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 2\n },\n required: {\n validateMultiple: function(values) {\n return values.length > 0;\n },\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 512\n },\n type: {\n validateString: function(value, type, {step = 'any', base = 0} = {}) {\n var tester = typeTesters[type];\n if (!tester) {\n throw new Error('validator type `' + type + '` is not supported');\n }\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n if (!tester.test(value))\n return false;\n if ('number' === type) {\n if (!/^any$/i.test(step || '')) {\n var nb = Number(value);\n var decimals = Math.max(decimalPlaces(step), decimalPlaces(base));\n if (decimalPlaces(nb) > decimals) // Value can't have too many decimals\n return false;\n // Be careful of rounding errors by using integers.\n var toInt = f => Math.round(f * Math.pow(10, decimals));\n if ((toInt(nb) - toInt(base)) % toInt(step) != 0)\n return false;\n }\n }\n return true;\n },\n requirementType: {\n '': 'string',\n step: 'string',\n base: 'number'\n },\n priority: 256\n },\n pattern: {\n validateString: function(value, regexp) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return regexp.test(value);\n },\n requirementType: 'regexp',\n priority: 64\n },\n minlength: {\n validateString: function (value, requirement) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxlength: {\n validateString: function (value, requirement) {\n return value.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n length: {\n validateString: function (value, min, max) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= min && value.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n mincheck: {\n validateMultiple: function (values, requirement) {\n return values.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxcheck: {\n validateMultiple: function (values, requirement) {\n return values.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n check: {\n validateMultiple: function (values, min, max) {\n return values.length >= min && values.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n min: comparisonOperator((value, requirement) => value >= requirement),\n max: comparisonOperator((value, requirement) => value <= requirement),\n range: comparisonOperator((value, min, max) => value >= min && value <= max),\n equalto: {\n validateString: function (value, refOrValue) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n var $reference = $(refOrValue);\n if ($reference.length)\n return value === $reference.val();\n else\n return value === refOrValue;\n },\n priority: 256\n },\n euvatin: {\n validateString: function (value, refOrValue) {\n if (!value) {\n return true; // Builtin validators all accept empty strings, except `required` of course\n }\n\n var re = /^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/;\n return re.test(value);\n },\n priority: 30,\n },\n }\n};\n\nexport default ValidatorRegistry;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar UI = {};\n\nvar diffResults = function (newResult, oldResult, deep) {\n var added = [];\n var kept = [];\n\n for (var i = 0; i < newResult.length; i++) {\n var found = false;\n\n for (var j = 0; j < oldResult.length; j++)\n if (newResult[i].assert.name === oldResult[j].assert.name) {\n found = true;\n break;\n }\n\n if (found)\n kept.push(newResult[i]);\n else\n added.push(newResult[i]);\n }\n\n return {\n kept: kept,\n added: added,\n removed: !deep ? diffResults(oldResult, newResult, true).added : []\n };\n};\n\nUI.Form = {\n\n _actualizeTriggers: function () {\n this.$element.on('submit.Parsley', evt => { this.onSubmitValidate(evt); });\n this.$element.on('click.Parsley', Utils._SubmitSelector, evt => { this.onSubmitButton(evt); });\n\n // UI could be disabled\n if (false === this.options.uiEnabled)\n return;\n\n this.element.setAttribute('novalidate', '');\n },\n\n focus: function () {\n this._focusedField = null;\n\n if (true === this.validationResult || 'none' === this.options.focus)\n return null;\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i];\n if (true !== field.validationResult && field.validationResult.length > 0 && 'undefined' === typeof field.options.noFocus) {\n this._focusedField = field.$element;\n if ('first' === this.options.focus)\n break;\n }\n }\n\n if (null === this._focusedField)\n return null;\n\n return this._focusedField.focus();\n },\n\n _destroyUI: function () {\n // Reset all event listeners\n this.$element.off('.Parsley');\n }\n\n};\n\nUI.Field = {\n\n _reflowUI: function () {\n this._buildUI();\n\n // If this field doesn't have an active UI don't bother doing something\n if (!this._ui)\n return;\n\n // Diff between two validation results\n var diff = diffResults(this.validationResult, this._ui.lastValidationResult);\n\n // Then store current validation result for next reflow\n this._ui.lastValidationResult = this.validationResult;\n\n // Handle valid / invalid / none field class\n this._manageStatusClass();\n\n // Add, remove, updated errors messages\n this._manageErrorsMessages(diff);\n\n // Triggers impl\n this._actualizeTriggers();\n\n // If field is not valid for the first time, bind keyup trigger to ease UX and quickly inform user\n if ((diff.kept.length || diff.added.length) && !this._failedOnce) {\n this._failedOnce = true;\n this._actualizeTriggers();\n }\n },\n\n // Returns an array of field's error message(s)\n getErrorsMessages: function () {\n // No error message, field is valid\n if (true === this.validationResult)\n return [];\n\n var messages = [];\n\n for (var i = 0; i < this.validationResult.length; i++)\n messages.push(this.validationResult[i].errorMessage ||\n this._getErrorMessage(this.validationResult[i].assert));\n\n return messages;\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n addError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._addError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n updateError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._updateError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n removeError: function (name, {updateClass = true} = {}) {\n this._buildUI();\n this._removeError(name);\n\n // edge case possible here: remove a standard Parsley error that is still failing in this.validationResult\n // but highly improbable cuz' manually removing a well Parsley handled error makes no sense.\n if (updateClass)\n this._manageStatusClass();\n },\n\n _manageStatusClass: function () {\n if (this.hasConstraints() && this.needsValidation() && true === this.validationResult)\n this._successClass();\n else if (this.validationResult.length > 0)\n this._errorClass();\n else\n this._resetClass();\n },\n\n _manageErrorsMessages: function (diff) {\n if ('undefined' !== typeof this.options.errorsMessagesDisabled)\n return;\n\n // Case where we have errorMessage option that configure an unique field error message, regardless failing validators\n if ('undefined' !== typeof this.options.errorMessage) {\n if ((diff.added.length || diff.kept.length)) {\n this._insertErrorWrapper();\n\n if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length)\n this._ui.$errorsWrapper\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-custom-error-message')\n );\n\n return this._ui.$errorsWrapper\n .addClass('filled')\n .find('.parsley-custom-error-message')\n .html(this.options.errorMessage);\n }\n\n return this._ui.$errorsWrapper\n .removeClass('filled')\n .find('.parsley-custom-error-message')\n .remove();\n }\n\n // Show, hide, update failing constraints messages\n for (var i = 0; i < diff.removed.length; i++)\n this._removeError(diff.removed[i].assert.name);\n\n for (i = 0; i < diff.added.length; i++)\n this._addError(diff.added[i].assert.name, {message: diff.added[i].errorMessage, assert: diff.added[i].assert});\n\n for (i = 0; i < diff.kept.length; i++)\n this._updateError(diff.kept[i].assert.name, {message: diff.kept[i].errorMessage, assert: diff.kept[i].assert});\n },\n\n\n _addError: function (name, {message, assert}) {\n this._insertErrorWrapper();\n this._ui.$errorClassHandler\n .attr('aria-describedby', this._ui.errorsWrapperId);\n this._ui.$errorsWrapper\n .addClass('filled')\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-' + name)\n .html(message || this._getErrorMessage(assert))\n );\n },\n\n _updateError: function (name, {message, assert}) {\n this._ui.$errorsWrapper\n .addClass('filled')\n .find('.parsley-' + name)\n .html(message || this._getErrorMessage(assert));\n },\n\n _removeError: function (name) {\n this._ui.$errorClassHandler\n .removeAttr('aria-describedby');\n this._ui.$errorsWrapper\n .removeClass('filled')\n .find('.parsley-' + name)\n .remove();\n },\n\n _getErrorMessage: function (constraint) {\n var customConstraintErrorMessage = constraint.name + 'Message';\n\n if ('undefined' !== typeof this.options[customConstraintErrorMessage])\n return window.Parsley.formatMessage(this.options[customConstraintErrorMessage], constraint.requirements);\n\n return window.Parsley.getErrorMessage(constraint);\n },\n\n _buildUI: function () {\n // UI could be already built or disabled\n if (this._ui || false === this.options.uiEnabled)\n return;\n\n var _ui = {};\n\n // Give field its Parsley id in DOM\n this.element.setAttribute(this.options.namespace + 'id', this.__id__);\n\n /** Generate important UI elements and store them in this **/\n // $errorClassHandler is the $element that woul have parsley-error and parsley-success classes\n _ui.$errorClassHandler = this._manageClassHandler();\n\n // $errorsWrapper is a div that would contain the various field errors, it will be appended into $errorsContainer\n _ui.errorsWrapperId = 'parsley-id-' + (this.options.multiple ? 'multiple-' + this.options.multiple : this.__id__);\n _ui.$errorsWrapper = $(this.options.errorsWrapper).attr('id', _ui.errorsWrapperId);\n\n // ValidationResult UI storage to detect what have changed bwt two validations, and update DOM accordingly\n _ui.lastValidationResult = [];\n _ui.validationInformationVisible = false;\n\n // Store it in this for later\n this._ui = _ui;\n },\n\n // Determine which element will have `parsley-error` and `parsley-success` classes\n _manageClassHandler: function () {\n // Class handled could also be determined by function given in Parsley options\n if ('string' === typeof this.options.classHandler && $(this.options.classHandler).length)\n return $(this.options.classHandler);\n\n // Class handled could also be determined by function given in Parsley options\n var $handlerFunction = this.options.classHandler;\n\n // It might also be the function name of a global function\n if ('string' === typeof this.options.classHandler && 'function' === typeof window[this.options.classHandler])\n $handlerFunction = window[this.options.classHandler];\n\n if ('function' === typeof $handlerFunction) {\n var $handler = $handlerFunction.call(this, this);\n\n // If this function returned a valid existing DOM element, go for it\n if ('undefined' !== typeof $handler && $handler.length)\n return $handler;\n } else if ('object' === typeof $handlerFunction && $handlerFunction instanceof jQuery && $handlerFunction.length) {\n return $handlerFunction;\n } else if ($handlerFunction) {\n Utils.warn('The class handler `' + $handlerFunction + '` does not exist in DOM nor as a global JS function');\n }\n\n return this._inputHolder();\n },\n\n _inputHolder: function() {\n // if simple element (input, texatrea, select...) it will perfectly host the classes and precede the error container\n if (!this.options.multiple || this.element.nodeName === 'SELECT')\n return this.$element;\n\n // But if multiple element (radio, checkbox), that would be their parent\n return this.$element.parent();\n },\n\n _insertErrorWrapper: function () {\n var $errorsContainer = this.options.errorsContainer;\n\n // Nothing to do if already inserted\n if (0 !== this._ui.$errorsWrapper.parent().length)\n return this._ui.$errorsWrapper.parent();\n\n if ('string' === typeof $errorsContainer) {\n if ($($errorsContainer).length)\n return $($errorsContainer).append(this._ui.$errorsWrapper);\n else if ('function' === typeof window[$errorsContainer])\n $errorsContainer = window[$errorsContainer];\n else\n Utils.warn('The errors container `' + $errorsContainer + '` does not exist in DOM nor as a global JS function');\n }\n\n if ('function' === typeof $errorsContainer)\n $errorsContainer = $errorsContainer.call(this, this);\n\n if ('object' === typeof $errorsContainer && $errorsContainer.length)\n return $errorsContainer.append(this._ui.$errorsWrapper);\n\n return this._inputHolder().after(this._ui.$errorsWrapper);\n },\n\n _actualizeTriggers: function () {\n var $toBind = this._findRelated();\n var trigger;\n\n // Remove Parsley events already bound on this field\n $toBind.off('.Parsley');\n if (this._failedOnce)\n $toBind.on(Utils.namespaceEvents(this.options.triggerAfterFailure, 'Parsley'), () => {\n this._validateIfNeeded();\n });\n else if (trigger = Utils.namespaceEvents(this.options.trigger, 'Parsley')) {\n $toBind.on(trigger, event => {\n this._validateIfNeeded(event);\n });\n }\n },\n\n _validateIfNeeded: function (event) {\n // For keyup, keypress, keydown, input... events that could be a little bit obstrusive\n // do not validate if val length < min threshold on first validation. Once field have been validated once and info\n // about success or failure have been displayed, always validate with this trigger to reflect every yalidation change.\n if (event && /key|input/.test(event.type))\n if (!(this._ui && this._ui.validationInformationVisible) && this.getValue().length <= this.options.validationThreshold)\n return;\n\n if (this.options.debounce) {\n window.clearTimeout(this._debounced);\n this._debounced = window.setTimeout(() => this.validate(), this.options.debounce);\n } else\n this.validate();\n },\n\n _resetUI: function () {\n // Reset all event listeners\n this._failedOnce = false;\n this._actualizeTriggers();\n\n // Nothing to do if UI never initialized for this field\n if ('undefined' === typeof this._ui)\n return;\n\n // Reset all errors' li\n this._ui.$errorsWrapper\n .removeClass('filled')\n .children()\n .remove();\n\n // Reset validation class\n this._resetClass();\n\n // Reset validation flags and last validation result\n this._ui.lastValidationResult = [];\n this._ui.validationInformationVisible = false;\n },\n\n _destroyUI: function () {\n this._resetUI();\n\n if ('undefined' !== typeof this._ui)\n this._ui.$errorsWrapper.remove();\n\n delete this._ui;\n },\n\n _successClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass);\n },\n _errorClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass);\n },\n _resetClass: function () {\n this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass);\n }\n};\n\nexport default UI;\n","import $ from 'jquery';\nimport Base from './base';\nimport Utils from './utils';\n\nvar Form = function (element, domOptions, options) {\n this.__class__ = 'Form';\n\n this.element = element;\n this.$element = $(element);\n this.domOptions = domOptions;\n this.options = options;\n this.parent = window.Parsley;\n\n this.fields = [];\n this.validationResult = null;\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nForm.prototype = {\n onSubmitValidate: function (event) {\n // This is a Parsley generated submit event, do not validate, do not prevent, simply exit and keep normal behavior\n if (true === event.parsley)\n return;\n\n // If we didn't come here through a submit button, use the first one in the form\n var submitSource = this._submitSource || this.$element.find(Utils._SubmitSelector)[0];\n this._submitSource = null;\n this.$element.find('.parsley-synthetic-submit-button').prop('disabled', true);\n if (submitSource && null !== submitSource.getAttribute('formnovalidate'))\n return;\n\n window.Parsley._remoteCache = {};\n\n var promise = this.whenValidate({event});\n\n if ('resolved' === promise.state() && false !== this._trigger('submit')) {\n // All good, let event go through. We make this distinction because browsers\n // differ in their handling of `submit` being called from inside a submit event [#1047]\n } else {\n // Rejected or pending: cancel this submit\n event.stopImmediatePropagation();\n event.preventDefault();\n if ('pending' === promise.state())\n promise.done(() => { this._submit(submitSource); });\n }\n },\n\n onSubmitButton: function(event) {\n this._submitSource = event.currentTarget;\n },\n // internal\n // _submit submits the form, this time without going through the validations.\n // Care must be taken to \"fake\" the actual submit button being clicked.\n _submit: function (submitSource) {\n if (false === this._trigger('submit'))\n return;\n // Add submit button's data\n if (submitSource) {\n var $synthetic = this.$element.find('.parsley-synthetic-submit-button').prop('disabled', false);\n if (0 === $synthetic.length)\n $synthetic = $('').appendTo(this.$element);\n $synthetic.attr({\n name: submitSource.getAttribute('name'),\n value: submitSource.getAttribute('value')\n });\n }\n\n this.$element.trigger(Object.assign($.Event('submit'), {parsley: true}));\n },\n\n // Performs validation on fields while triggering events.\n // @returns `true` if all validations succeeds, `false`\n // if a failure is immediately detected, or `null`\n // if dependant on a promise.\n // Consider using `whenValidate` instead.\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley form without passing arguments as an object is deprecated.');\n var [group, force, event] = arguments;\n options = {group, force, event};\n }\n return statusMapping[ this.whenValidate(options).state() ];\n },\n\n whenValidate: function ({group, force, event} = {}) {\n this.submitEvent = event;\n if (event) {\n this.submitEvent = Object.assign({}, event, {preventDefault: () => {\n Utils.warnOnce(\"Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`\");\n this.validationResult = false;\n }});\n }\n this.validationResult = true;\n\n // fire validate event to eventually modify things before every validation\n this._trigger('validate');\n\n // Refresh form DOM options and form's fields that could have changed\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValidate({force, group}));\n });\n\n return Utils.all(promises)\n .done( () => { this._trigger('success'); })\n .fail( () => {\n this.validationResult = false;\n this.focus();\n this._trigger('error');\n })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n // Iterate over refreshed fields, and stop on first failure.\n // Returns `true` if all fields are valid, `false` if a failure is detected\n // or `null` if the result depends on an unresolved promise.\n // Prefer using `whenValid` instead.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley form without passing arguments as an object is deprecated.');\n var [group, force] = arguments;\n options = {group, force};\n }\n return statusMapping[ this.whenValid(options).state() ];\n },\n\n // Iterate over refreshed fields and validate them.\n // Returns a promise.\n // A validation that immediately fails will interrupt the validations.\n whenValid: function ({group, force} = {}) {\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValid({group, force}));\n });\n return Utils.all(promises);\n },\n\n refresh: function() {\n this._refreshFields();\n return this;\n },\n\n // Reset UI\n reset: function () {\n // Form case: emit a reset event for each field\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].reset();\n\n this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n\n // Form case: destroy all its fields and then destroy stored instance\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].destroy();\n\n this.$element.removeData('Parsley');\n this._trigger('destroy');\n },\n\n _refreshFields: function () {\n return this.actualizeOptions()._bindFields();\n },\n\n _bindFields: function () {\n var oldFields = this.fields;\n\n this.fields = [];\n this.fieldsMappedById = {};\n\n this._withoutReactualizingFormOptions(() => {\n this.$element\n .find(this.options.inputs)\n .not(this.options.excluded)\n .not(`[${this.options.namespace}excluded=true]`)\n .each((_, element) => {\n var fieldInstance = new window.Parsley.Factory(element, {}, this);\n\n // Only add valid and not excluded `Field` and `FieldMultiple` children\n if ('Field' === fieldInstance.__class__ || 'FieldMultiple' === fieldInstance.__class__) {\n let uniqueId = fieldInstance.__class__ + '-' + fieldInstance.__id__;\n if ('undefined' === typeof this.fieldsMappedById[uniqueId]) {\n this.fieldsMappedById[uniqueId] = fieldInstance;\n this.fields.push(fieldInstance);\n }\n }\n });\n\n $.each(Utils.difference(oldFields, this.fields), (_, field) => {\n field.reset();\n });\n });\n return this;\n },\n\n // Internal only.\n // Looping on a form's fields to do validation or similar\n // will trigger reactualizing options on all of them, which\n // in turn will reactualize the form's options.\n // To avoid calling actualizeOptions so many times on the form\n // for nothing, _withoutReactualizingFormOptions temporarily disables\n // the method actualizeOptions on this form while `fn` is called.\n _withoutReactualizingFormOptions: function (fn) {\n var oldActualizeOptions = this.actualizeOptions;\n this.actualizeOptions = function () { return this; };\n var result = fn();\n this.actualizeOptions = oldActualizeOptions;\n return result;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n // Returns true iff event is not interrupted and default not prevented.\n _trigger: function (eventName) {\n return this.trigger('form:' + eventName);\n }\n\n};\n\nexport default Form;\n","import Utils from './utils';\nimport Validator from './validator';\n\nconst Constraint = function(parsleyField, name, requirements, priority, isDomConstraint) {\n const validatorSpec = window.Parsley._validatorRegistry.validators[name];\n const validator = new Validator(validatorSpec);\n priority = priority || parsleyField.options[name + 'Priority'] || validator.priority;\n isDomConstraint = (true === isDomConstraint);\n\n Object.assign(this, {\n validator,\n name,\n requirements,\n priority,\n isDomConstraint\n });\n this._parseRequirements(parsleyField.options);\n};\n\nconst capitalize = function(str) {\n const cap = str[0].toUpperCase();\n return cap + str.slice(1);\n};\n\nConstraint.prototype = {\n validate: function(value, instance) {\n return this.validator.validate(value, ...this.requirementList, instance);\n },\n\n _parseRequirements: function(options) {\n this.requirementList = this.validator.parseRequirements(this.requirements,\n key => options[this.name + capitalize(key)]\n );\n }\n};\n\nexport default Constraint;\n","import $ from 'jquery';\nimport Constraint from './constraint';\nimport UI from './ui';\nimport Utils from './utils';\n\nvar Field = function (field, domOptions, options, parsleyFormInstance) {\n this.__class__ = 'Field';\n\n this.element = field;\n this.$element = $(field);\n\n // Set parent if we have one\n if ('undefined' !== typeof parsleyFormInstance) {\n this.parent = parsleyFormInstance;\n }\n\n this.options = options;\n this.domOptions = domOptions;\n\n // Initialize some properties\n this.constraints = [];\n this.constraintsByName = {};\n this.validationResult = true;\n\n // Bind constraints\n this._bindConstraints();\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nField.prototype = {\n // # Public API\n // Validate field and trigger some events for mainly `UI`\n // @returns `true`, an array of the validators that failed, or\n // `null` if validation is not finished. Prefer using whenValidate\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley field without passing arguments as an object is deprecated.');\n options = {options};\n }\n var promise = this.whenValidate(options);\n if (!promise) // If excluded with `group` option\n return true;\n switch (promise.state()) {\n case 'pending': return null;\n case 'resolved': return true;\n case 'rejected': return this.validationResult;\n }\n },\n\n // Validate field and trigger some events for mainly `UI`\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if field is not in the given `group`.\n whenValidate: function ({force, group} = {}) {\n // do not validate a field if not the same as given validation group\n this.refresh();\n if (group && !this._isInGroup(group))\n return;\n\n this.value = this.getValue();\n\n // Field Validate event. `this.value` could be altered for custom needs\n this._trigger('validate');\n\n return this.whenValid({force, value: this.value, _refreshed: true})\n .always(() => { this._reflowUI(); })\n .done(() => { this._trigger('success'); })\n .fail(() => { this._trigger('error'); })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n hasConstraints: function () {\n return 0 !== this.constraints.length;\n },\n\n // An empty optional field does not need validation\n needsValidation: function (value) {\n if ('undefined' === typeof value)\n value = this.getValue();\n\n // If a field is empty and not required, it is valid\n // Except if `data-parsley-validate-if-empty` explicitely added, useful for some custom validators\n if (!value.length && !this._isRequired() && 'undefined' === typeof this.options.validateIfEmpty)\n return false;\n\n return true;\n },\n\n _isInGroup: function (group) {\n if (Array.isArray(this.options.group))\n return -1 !== $.inArray(group, this.options.group);\n return this.options.group === group;\n },\n\n // Just validate field. Do not trigger any event.\n // Returns `true` iff all constraints pass, `false` if there are failures,\n // or `null` if the result can not be determined yet (depends on a promise)\n // See also `whenValid`.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley field without passing arguments as an object is deprecated.');\n var [force, value] = arguments;\n options = {force, value};\n }\n var promise = this.whenValid(options);\n if (!promise) // Excluded via `group`\n return true;\n return statusMapping[promise.state()];\n },\n\n // Just validate field. Do not trigger any event.\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if the field is not in the given `group`.\n // The argument `force` will force validation of empty fields.\n // If a `value` is given, it will be validated instead of the value of the input.\n whenValid: function ({force = false, value, group, _refreshed} = {}) {\n // Recompute options and rebind constraints to have latest changes\n if (!_refreshed)\n this.refresh();\n // do not validate a field if not the same as given validation group\n if (group && !this._isInGroup(group))\n return;\n\n this.validationResult = true;\n\n // A field without constraint is valid\n if (!this.hasConstraints())\n return $.when();\n\n // Value could be passed as argument, needed to add more power to 'field:validate'\n if ('undefined' === typeof value || null === value)\n value = this.getValue();\n\n if (!this.needsValidation(value) && true !== force)\n return $.when();\n\n var groupedConstraints = this._getGroupedConstraints();\n var promises = [];\n $.each(groupedConstraints, (_, constraints) => {\n // Process one group of constraints at a time, we validate the constraints\n // and combine the promises together.\n var promise = Utils.all(\n $.map(constraints, constraint => this._validateConstraint(value, constraint))\n );\n promises.push(promise);\n if (promise.state() === 'rejected')\n return false; // Interrupt processing if a group has already failed\n });\n return Utils.all(promises);\n },\n\n // @returns a promise\n _validateConstraint: function(value, constraint) {\n var result = constraint.validate(value, this);\n // Map false to a failed promise\n if (false === result)\n result = $.Deferred().reject();\n // Make sure we return a promise and that we record failures\n return Utils.all([result]).fail(errorMessage => {\n if (!(this.validationResult instanceof Array))\n this.validationResult = [];\n this.validationResult.push({\n assert: constraint,\n errorMessage: 'string' === typeof errorMessage && errorMessage\n });\n });\n },\n\n // @returns Parsley field computed value that could be overrided or configured in DOM\n getValue: function () {\n var value;\n\n // Value could be overriden in DOM or with explicit options\n if ('function' === typeof this.options.value)\n value = this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n value = this.options.value;\n else\n value = this.$element.val();\n\n // Handle wrong DOM or configurations\n if ('undefined' === typeof value || null === value)\n return '';\n\n return this._handleWhitespace(value);\n },\n\n // Reset UI\n reset: function () {\n this._resetUI();\n return this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n this.$element.removeData('Parsley');\n this.$element.removeData('FieldMultiple');\n this._trigger('destroy');\n },\n\n // Actualize options and rebind constraints\n refresh: function () {\n this._refreshConstraints();\n return this;\n },\n\n _refreshConstraints: function () {\n return this.actualizeOptions()._bindConstraints();\n },\n\n refreshConstraints: function() {\n Utils.warnOnce(\"Parsley's refreshConstraints is deprecated. Please use refresh\");\n return this.refresh();\n },\n\n /**\n * Add a new constraint to a field\n *\n * @param {String} name\n * @param {Mixed} requirements optional\n * @param {Number} priority optional\n * @param {Boolean} isDomConstraint optional\n */\n addConstraint: function (name, requirements, priority, isDomConstraint) {\n\n if (window.Parsley._validatorRegistry.validators[name]) {\n var constraint = new Constraint(this, name, requirements, priority, isDomConstraint);\n\n // if constraint already exist, delete it and push new version\n if ('undefined' !== this.constraintsByName[constraint.name])\n this.removeConstraint(constraint.name);\n\n this.constraints.push(constraint);\n this.constraintsByName[constraint.name] = constraint;\n }\n\n return this;\n },\n\n // Remove a constraint\n removeConstraint: function (name) {\n for (var i = 0; i < this.constraints.length; i++)\n if (name === this.constraints[i].name) {\n this.constraints.splice(i, 1);\n break;\n }\n delete this.constraintsByName[name];\n return this;\n },\n\n // Update a constraint (Remove + re-add)\n updateConstraint: function (name, parameters, priority) {\n return this.removeConstraint(name)\n .addConstraint(name, parameters, priority);\n },\n\n // # Internals\n\n // Internal only.\n // Bind constraints from config + options + DOM\n _bindConstraints: function () {\n var constraints = [];\n var constraintsByName = {};\n\n // clean all existing DOM constraints to only keep javascript user constraints\n for (var i = 0; i < this.constraints.length; i++)\n if (false === this.constraints[i].isDomConstraint) {\n constraints.push(this.constraints[i]);\n constraintsByName[this.constraints[i].name] = this.constraints[i];\n }\n\n this.constraints = constraints;\n this.constraintsByName = constraintsByName;\n\n // then re-add Parsley DOM-API constraints\n for (var name in this.options)\n this.addConstraint(name, this.options[name], undefined, true);\n\n // finally, bind special HTML5 constraints\n return this._bindHtml5Constraints();\n },\n\n // Internal only.\n // Bind specific HTML5 constraints to be HTML5 compliant\n _bindHtml5Constraints: function () {\n // html5 required\n if (null !== this.element.getAttribute('required'))\n this.addConstraint('required', true, undefined, true);\n\n // html5 pattern\n if (null !== this.element.getAttribute('pattern'))\n this.addConstraint('pattern', this.element.getAttribute('pattern'), undefined, true);\n\n // range\n let min = this.element.getAttribute('min');\n let max = this.element.getAttribute('max');\n if (null !== min && null !== max)\n this.addConstraint('range', [min, max], undefined, true);\n\n // HTML5 min\n else if (null !== min)\n this.addConstraint('min', min, undefined, true);\n\n // HTML5 max\n else if (null !== max)\n this.addConstraint('max', max, undefined, true);\n\n\n // length\n if (null !== this.element.getAttribute('minlength') && null !== this.element.getAttribute('maxlength'))\n this.addConstraint('length', [this.element.getAttribute('minlength'), this.element.getAttribute('maxlength')], undefined, true);\n\n // HTML5 minlength\n else if (null !== this.element.getAttribute('minlength'))\n this.addConstraint('minlength', this.element.getAttribute('minlength'), undefined, true);\n\n // HTML5 maxlength\n else if (null !== this.element.getAttribute('maxlength'))\n this.addConstraint('maxlength', this.element.getAttribute('maxlength'), undefined, true);\n\n\n // html5 types\n var type = Utils.getType(this.element);\n\n // Small special case here for HTML5 number: integer validator if step attribute is undefined or an integer value, number otherwise\n if ('number' === type) {\n return this.addConstraint('type', ['number', {\n step: this.element.getAttribute('step') || '1',\n base: min || this.element.getAttribute('value')\n }], undefined, true);\n // Regular other HTML5 supported types\n } else if (/^(email|url|range|date)$/i.test(type)) {\n return this.addConstraint('type', type, undefined, true);\n }\n return this;\n },\n\n // Internal only.\n // Field is required if have required constraint without `false` value\n _isRequired: function () {\n if ('undefined' === typeof this.constraintsByName.required)\n return false;\n\n return false !== this.constraintsByName.required.requirements;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n _trigger: function (eventName) {\n return this.trigger('field:' + eventName);\n },\n\n // Internal only\n // Handles whitespace in a value\n // Use `data-parsley-whitespace=\"squish\"` to auto squish input value\n // Use `data-parsley-whitespace=\"trim\"` to auto trim input value\n _handleWhitespace: function (value) {\n if (true === this.options.trimValue)\n Utils.warnOnce('data-parsley-trim-value=\"true\" is deprecated, please use data-parsley-whitespace=\"trim\"');\n\n if ('squish' === this.options.whitespace)\n value = value.replace(/\\s{2,}/g, ' ');\n\n if (('trim' === this.options.whitespace) || ('squish' === this.options.whitespace) || (true === this.options.trimValue))\n value = Utils.trimString(value);\n\n return value;\n },\n\n _isDateInput: function() {\n var c = this.constraintsByName.type;\n return c && c.requirements === 'date';\n },\n\n // Internal only.\n // Returns the constraints, grouped by descending priority.\n // The result is thus an array of arrays of constraints.\n _getGroupedConstraints: function () {\n if (false === this.options.priorityEnabled)\n return [this.constraints];\n\n var groupedConstraints = [];\n var index = {};\n\n // Create array unique of priorities\n for (var i = 0; i < this.constraints.length; i++) {\n var p = this.constraints[i].priority;\n if (!index[p])\n groupedConstraints.push(index[p] = []);\n index[p].push(this.constraints[i]);\n }\n // Sort them by priority DESC\n groupedConstraints.sort(function (a, b) { return b[0].priority - a[0].priority; });\n\n return groupedConstraints;\n }\n\n};\n\nexport default Field;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Multiple = function () {\n this.__class__ = 'FieldMultiple';\n};\n\nMultiple.prototype = {\n // Add new `$element` sibling for multiple field\n addElement: function ($element) {\n this.$elements.push($element);\n\n return this;\n },\n\n // See `Field._refreshConstraints()`\n _refreshConstraints: function () {\n var fieldConstraints;\n\n this.constraints = [];\n\n // Select multiple special treatment\n if (this.element.nodeName === 'SELECT') {\n this.actualizeOptions()._bindConstraints();\n\n return this;\n }\n\n // Gather all constraints for each input in the multiple group\n for (var i = 0; i < this.$elements.length; i++) {\n\n // Check if element have not been dynamically removed since last binding\n if (!$('html').has(this.$elements[i]).length) {\n this.$elements.splice(i, 1);\n continue;\n }\n\n fieldConstraints = this.$elements[i].data('FieldMultiple')._refreshConstraints().constraints;\n\n for (var j = 0; j < fieldConstraints.length; j++)\n this.addConstraint(fieldConstraints[j].name, fieldConstraints[j].requirements, fieldConstraints[j].priority, fieldConstraints[j].isDomConstraint);\n }\n\n return this;\n },\n\n // See `Field.getValue()`\n getValue: function () {\n // Value could be overriden in DOM\n if ('function' === typeof this.options.value)\n return this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n return this.options.value;\n\n // Radio input case\n if (this.element.nodeName === 'INPUT') {\n var type = Utils.getType(this.element);\n if (type === 'radio')\n return this._findRelated().filter(':checked').val() || '';\n\n // checkbox input case\n if (type === 'checkbox') {\n var values = [];\n\n this._findRelated().filter(':checked').each(function () {\n values.push($(this).val());\n });\n\n return values;\n }\n }\n\n // Select multiple case\n if (this.element.nodeName === 'SELECT' && null === this.$element.val())\n return [];\n\n // Default case that should never happen\n return this.$element.val();\n },\n\n _init: function () {\n this.$elements = [this.$element];\n\n return this;\n }\n};\n\nexport default Multiple;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\n\nvar Factory = function (element, options, parsleyFormInstance) {\n this.element = element;\n this.$element = $(element);\n\n // If the element has already been bound, returns its saved Parsley instance\n var savedparsleyFormInstance = this.$element.data('Parsley');\n if (savedparsleyFormInstance) {\n\n // If the saved instance has been bound without a Form parent and there is one given in this call, add it\n if ('undefined' !== typeof parsleyFormInstance && savedparsleyFormInstance.parent === window.Parsley) {\n savedparsleyFormInstance.parent = parsleyFormInstance;\n savedparsleyFormInstance._resetOptions(savedparsleyFormInstance.options);\n }\n\n if ('object' === typeof options) {\n Object.assign(savedparsleyFormInstance.options, options);\n }\n\n return savedparsleyFormInstance;\n }\n\n // Parsley must be instantiated with a DOM element or jQuery $element\n if (!this.$element.length)\n throw new Error('You must bind Parsley on an existing element.');\n\n if ('undefined' !== typeof parsleyFormInstance && 'Form' !== parsleyFormInstance.__class__)\n throw new Error('Parent instance must be a Form instance');\n\n this.parent = parsleyFormInstance || window.Parsley;\n return this.init(options);\n};\n\nFactory.prototype = {\n init: function (options) {\n this.__class__ = 'Parsley';\n this.__version__ = 'VERSION';\n this.__id__ = Utils.generateID();\n\n // Pre-compute options\n this._resetOptions(options);\n\n // A Form instance is obviously a `` element but also every node that is not an input and has the `data-parsley-validate` attribute\n if (this.element.nodeName === 'FORM' || (Utils.checkAttr(this.element, this.options.namespace, 'validate') && !this.$element.is(this.options.inputs)))\n return this.bind('parsleyForm');\n\n // Every other element is bound as a `Field` or `FieldMultiple`\n return this.isMultiple() ? this.handleMultiple() : this.bind('parsleyField');\n },\n\n isMultiple: function () {\n var type = Utils.getType(this.element);\n return ((type === 'radio' || type === 'checkbox') ||\n (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')));\n },\n\n // Multiples fields are a real nightmare :(\n // Maybe some refactoring would be appreciated here...\n handleMultiple: function () {\n var name;\n var multiple;\n var parsleyMultipleInstance;\n\n // Handle multiple name\n this.options.multiple = this.options.multiple ||\n (name = this.element.getAttribute('name')) ||\n this.element.getAttribute('id');\n\n // Special select multiple input\n if (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')) {\n this.options.multiple = this.options.multiple || this.__id__;\n return this.bind('parsleyFieldMultiple');\n\n // Else for radio / checkboxes, we need a `name` or `data-parsley-multiple` to properly bind it\n } else if (!this.options.multiple) {\n Utils.warn('To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.', this.$element);\n return this;\n }\n\n // Remove special chars\n this.options.multiple = this.options.multiple.replace(/(:|\\.|\\[|\\]|\\{|\\}|\\$)/g, '');\n\n // Add proper `data-parsley-multiple` to siblings if we have a valid multiple name\n if (name) {\n $('input[name=\"' + name + '\"]').each((i, input) => {\n var type = Utils.getType(input);\n if ((type === 'radio' || type === 'checkbox'))\n input.setAttribute(this.options.namespace + 'multiple', this.options.multiple);\n });\n }\n\n // Check here if we don't already have a related multiple instance saved\n var $previouslyRelated = this._findRelated();\n for (var i = 0; i < $previouslyRelated.length; i++) {\n parsleyMultipleInstance = $($previouslyRelated.get(i)).data('Parsley');\n if ('undefined' !== typeof parsleyMultipleInstance) {\n\n if (!this.$element.data('FieldMultiple')) {\n parsleyMultipleInstance.addElement(this.$element);\n }\n\n break;\n }\n }\n\n // Create a secret Field instance for every multiple field. It will be stored in `data('FieldMultiple')`\n // And will be useful later to access classic `Field` stuff while being in a `FieldMultiple` instance\n this.bind('parsleyField', true);\n\n return parsleyMultipleInstance || this.bind('parsleyFieldMultiple');\n },\n\n // Return proper `Form`, `Field` or `FieldMultiple`\n bind: function (type, doNotStore) {\n var parsleyInstance;\n\n switch (type) {\n case 'parsleyForm':\n parsleyInstance = $.extend(\n new Form(this.element, this.domOptions, this.options),\n new Base(),\n window.ParsleyExtend\n )._bindFields();\n break;\n case 'parsleyField':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Base(),\n window.ParsleyExtend\n );\n break;\n case 'parsleyFieldMultiple':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Multiple(),\n new Base(),\n window.ParsleyExtend\n )._init();\n break;\n default:\n throw new Error(type + 'is not a supported Parsley type');\n }\n\n if (this.options.multiple)\n Utils.setAttr(this.element, this.options.namespace, 'multiple', this.options.multiple);\n\n if ('undefined' !== typeof doNotStore) {\n this.$element.data('FieldMultiple', parsleyInstance);\n\n return parsleyInstance;\n }\n\n // Store the freshly bound instance in a DOM element for later access using jQuery `data()`\n this.$element.data('Parsley', parsleyInstance);\n\n // Tell the world we have a new Form or Field instance!\n parsleyInstance._actualizeTriggers();\n parsleyInstance._trigger('init');\n\n return parsleyInstance;\n }\n};\n\nexport default Factory;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Base from './base';\nimport ValidatorRegistry from './validator_registry';\nimport UI from './ui';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\nimport Factory from './factory';\n\nvar vernums = $.fn.jquery.split('.');\nif (parseInt(vernums[0]) <= 1 && parseInt(vernums[1]) < 8) {\n throw \"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.\";\n}\nif (!vernums.forEach) {\n Utils.warn('Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim');\n}\n// Inherit `on`, `off` & `trigger` to Parsley:\nvar Parsley = Object.assign(new Base(), {\n element: document,\n $element: $(document),\n actualizeOptions: null,\n _resetOptions: null,\n Factory: Factory,\n version: 'VERSION'\n });\n\n// Supplement Field and Form with Base\n// This way, the constructors will have access to those methods\nObject.assign(Field.prototype, UI.Field, Base.prototype);\nObject.assign(Form.prototype, UI.Form, Base.prototype);\n// Inherit actualizeOptions and _resetOptions:\nObject.assign(Factory.prototype, Base.prototype);\n\n// ### jQuery API\n// `$('.elem').parsley(options)` or `$('.elem').psly(options)`\n$.fn.parsley = $.fn.psly = function (options) {\n if (this.length > 1) {\n var instances = [];\n\n this.each(function () {\n instances.push($(this).parsley(options));\n });\n\n return instances;\n }\n\n // Return undefined if applied to non existing DOM element\n if (this.length == 0) {\n return;\n }\n\n return new Factory(this[0], options);\n};\n\n// ### Field and Form extension\n// Ensure the extension is now defined if it wasn't previously\nif ('undefined' === typeof window.ParsleyExtend)\n window.ParsleyExtend = {};\n\n// ### Parsley config\n// Inherit from ParsleyDefault, and copy over any existing values\nParsley.options = Object.assign(Utils.objectCreate(Defaults), window.ParsleyConfig);\nwindow.ParsleyConfig = Parsley.options; // Old way of accessing global options\n\n// ### Globals\nwindow.Parsley = window.psly = Parsley;\nParsley.Utils = Utils;\nwindow.ParsleyUtils = {};\n$.each(Utils, (key, value) => {\n if ('function' === typeof value) {\n window.ParsleyUtils[key] = (...args) => {\n Utils.warnOnce('Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead.');\n return Utils[key](...args);\n };\n }\n});\n\n// ### Define methods that forward to the registry, and deprecate all access except through window.Parsley\nvar registry = window.Parsley._validatorRegistry = new ValidatorRegistry(window.ParsleyConfig.validators, window.ParsleyConfig.i18n);\nwindow.ParsleyValidator = {};\n$.each('setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator hasValidator'.split(' '), function (i, method) {\n window.Parsley[method] = (...args) => registry[method](...args);\n window.ParsleyValidator[method] = function () {\n Utils.warnOnce(`Accessing the method '${method}' through Validator is deprecated. Simply call 'window.Parsley.${method}(...)'`);\n return window.Parsley[method](...arguments);\n };\n});\n\n// ### UI\n// Deprecated global object\nwindow.Parsley.UI = UI;\nwindow.ParsleyUI = {\n removeError: function (instance, name, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance.removeError(name, {updateClass});\n },\n getErrorsMessages: function (instance) {\n Utils.warnOnce(`Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly.`);\n return instance.getErrorsMessages();\n }\n};\n$.each('addError updateError'.split(' '), function (i, method) {\n window.ParsleyUI[method] = function (instance, name, message, assert, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call '${method}' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance[method](name, {message, assert, updateClass});\n };\n});\n\n// ### PARSLEY auto-binding\n// Prevent it by setting `ParsleyConfig.autoBind` to `false`\nif (false !== window.ParsleyConfig.autoBind) {\n $(function () {\n // Works only on `data-parsley-validate`.\n if ($('[data-parsley-validate]').length)\n $('[data-parsley-validate]').parsley();\n });\n}\n\nexport default Parsley;\n","import $ from 'jquery';\nimport Field from './field';\nimport Form from './form';\nimport Utils from './utils';\n\nvar o = $({});\nvar deprecated = function () {\n Utils.warnOnce(\"Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley\");\n};\n\n// Returns an event handler that calls `fn` with the arguments it expects\nfunction adapt(fn, context) {\n // Store to allow unbinding\n if (!fn.parsleyAdaptedCallback) {\n fn.parsleyAdaptedCallback = function () {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift(this);\n fn.apply(context || o, args);\n };\n }\n return fn.parsleyAdaptedCallback;\n}\n\nvar eventPrefix = 'parsley:';\n// Converts 'parsley:form:validate' into 'form:validate'\nfunction eventName(name) {\n if (name.lastIndexOf(eventPrefix, 0) === 0)\n return name.substr(eventPrefix.length);\n return name;\n}\n\n// $.listen is deprecated. Use Parsley.on instead.\n$.listen = function (name, callback) {\n var context;\n deprecated();\n if ('object' === typeof arguments[1] && 'function' === typeof arguments[2]) {\n context = arguments[1];\n callback = arguments[2];\n }\n\n if ('function' !== typeof callback)\n throw new Error('Wrong parameters');\n\n window.Parsley.on(eventName(name), adapt(callback, context));\n};\n\n$.listenTo = function (instance, name, fn) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong parameters');\n\n instance.on(eventName(name), adapt(fn));\n};\n\n$.unsubscribe = function (name, fn) {\n deprecated();\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong arguments');\n window.Parsley.off(eventName(name), fn.parsleyAdaptedCallback);\n};\n\n$.unsubscribeTo = function (instance, name) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n instance.off(eventName(name));\n};\n\n$.unsubscribeAll = function (name) {\n deprecated();\n window.Parsley.off(eventName(name));\n $('form,input,textarea,select').each(function () {\n var instance = $(this).data('Parsley');\n if (instance) {\n instance.off(eventName(name));\n }\n });\n};\n\n// $.emit is deprecated. Use jQuery events instead.\n$.emit = function (name, instance) {\n deprecated();\n var instanceGiven = (instance instanceof Field) || (instance instanceof Form);\n var args = Array.prototype.slice.call(arguments, instanceGiven ? 2 : 1);\n args.unshift(eventName(name));\n if (!instanceGiven) {\n instance = window.Parsley;\n }\n instance.trigger(...args);\n};\n\nexport default {};\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\n\nimport Parsley from './main';\n\n$.extend(true, Parsley, {\n asyncValidators: {\n 'default': {\n fn: function (xhr) {\n // By default, only status 2xx are deemed successful.\n // Note: we use status instead of state() because responses with status 200\n // but invalid messages (e.g. an empty body for content type set to JSON) will\n // result in state() === 'rejected'.\n return xhr.status >= 200 && xhr.status < 300;\n },\n url: false\n },\n reverse: {\n fn: function (xhr) {\n // If reverse option is set, a failing ajax request is considered successful\n return xhr.status < 200 || xhr.status >= 300;\n },\n url: false\n }\n },\n\n addAsyncValidator: function (name, fn, url, options) {\n Parsley.asyncValidators[name] = {\n fn: fn,\n url: url || false,\n options: options || {}\n };\n\n return this;\n }\n\n});\n\nParsley.addValidator('remote', {\n requirementType: {\n '': 'string',\n 'validator': 'string',\n 'reverse': 'boolean',\n 'options': 'object'\n },\n\n validateString: function (value, url, options, instance) {\n var data = {};\n var ajaxOptions;\n var csr;\n var validator = options.validator || (true === options.reverse ? 'reverse' : 'default');\n\n if ('undefined' === typeof Parsley.asyncValidators[validator])\n throw new Error('Calling an undefined async validator: `' + validator + '`');\n\n url = Parsley.asyncValidators[validator].url || url;\n\n // Fill current value\n if (url.indexOf('{value}') > -1) {\n url = url.replace('{value}', encodeURIComponent(value));\n } else {\n data[instance.element.getAttribute('name') || instance.element.getAttribute('id')] = value;\n }\n\n // Merge options passed in from the function with the ones in the attribute\n var remoteOptions = $.extend(true, options.options || {} , Parsley.asyncValidators[validator].options);\n\n // All `$.ajax(options)` could be overridden or extended directly from DOM in `data-parsley-remote-options`\n ajaxOptions = $.extend(true, {}, {\n url: url,\n data: data,\n type: 'GET'\n }, remoteOptions);\n\n // Generate store key based on ajax options\n instance.trigger('field:ajaxoptions', instance, ajaxOptions);\n\n csr = $.param(ajaxOptions);\n\n // Initialise querry cache\n if ('undefined' === typeof Parsley._remoteCache)\n Parsley._remoteCache = {};\n\n // Try to retrieve stored xhr\n var xhr = Parsley._remoteCache[csr] = Parsley._remoteCache[csr] || $.ajax(ajaxOptions);\n\n var handleXhr = function () {\n var result = Parsley.asyncValidators[validator].fn.call(instance, xhr, url, options);\n if (!result) // Map falsy results to rejected promise\n result = $.Deferred().reject();\n return $.when(result);\n };\n\n return xhr.then(handleXhr, handleXhr);\n },\n\n priority: -1\n});\n\nParsley.on('form:submit', function () {\n Parsley._remoteCache = {};\n});\n\nBase.prototype.addAsyncValidator = function () {\n Utils.warnOnce('Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`');\n return Parsley.addAsyncValidator(...arguments);\n};\n","// This is included with the Parsley library itself,\n// thus there is no use in adding it to your project.\nimport Parsley from '../parsley/main';\n\nParsley.addMessages('en', {\n defaultMessage: \"This value seems to be invalid.\",\n type: {\n email: \"This value should be a valid email.\",\n url: \"This value should be a valid url.\",\n number: \"This value should be a valid number.\",\n integer: \"This value should be a valid integer.\",\n digits: \"This value should be digits.\",\n alphanum: \"This value should be alphanumeric.\"\n },\n notblank: \"This value should not be blank.\",\n required: \"This value is required.\",\n pattern: \"This value seems to be invalid.\",\n min: \"This value should be greater than or equal to %s.\",\n max: \"This value should be lower than or equal to %s.\",\n range: \"This value should be between %s and %s.\",\n minlength: \"This value is too short. It should have %s characters or more.\",\n maxlength: \"This value is too long. It should have %s characters or fewer.\",\n length: \"This value length is invalid. It should be between %s and %s characters long.\",\n mincheck: \"You must select at least %s choices.\",\n maxcheck: \"You must select %s choices or fewer.\",\n check: \"You must select between %s and %s choices.\",\n equalto: \"This value should be the same.\",\n euvatin: \"It's not a valid VAT Identification Number.\",\n});\n\nParsley.setLocale('en');\n","/**\n * inputevent - Alleviate browser bugs for input events\n * https://github.com/marcandre/inputevent\n * @version v0.0.3 - (built Thu, Apr 14th 2016, 5:58 pm)\n * @author Marc-Andre Lafortune \n * @license MIT\n */\n\nimport $ from 'jquery';\n\nfunction InputEvent() {\n let globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n Object.assign(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: evt => {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: evt => {\n if (this.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: evt => {\n if (this.isNativeEvent(evt)) {\n this.behavesOk(evt);\n $(document)\n .on('change.inputevent', evt.data.selector, this.fakeInputEvent);\n this.fakeInputEvent(evt);\n }\n },\n\n behavesOk: evt => {\n if (this.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, this.behavesOk)\n .off('change.inputevent', evt.data.selector, this.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: () => {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n for (let selector of ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]']) {\n $(document)\n .on('input.inputevent', selector, {selector}, this.behavesOk)\n .on('change.inputevent', selector, {selector}, this.misbehaves);\n }\n },\n\n uninstall: () => {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n};\n\nexport default new InputEvent();\n","import $ from 'jquery';\nimport Parsley from './parsley/main';\nimport './parsley/pubsub';\nimport './parsley/remote';\nimport './i18n/en';\nimport inputevent from './vendor/inputevent';\n\ninputevent.install();\n\nexport default Parsley;\n"],"names":["globalID","pastWarnings","Utils","attr","element","namespace","obj","i","attribute","attributes","regex","RegExp","hasOwnProperty","length","specified","test","name","camelize","slice","deserializeValue","value","checkAttr","hasAttribute","setAttr","setAttribute","dasherize","String","getType","getAttribute","generateID","num","isNaN","Number","JSON","parse","e","str","replace","match","chr","toUpperCase","toLowerCase","warn","window","console","arguments","warnOnce","msg","_resetWarnings","trimString","string","date","parsed","map","x","parseInt","_","year","month","day","Date","getFullYear","getMonth","getDate","integer","number","parseFloat","_boolean","object","regexp","flags","parseRequirement","requirementType","converter","converted","namespaceEvents","events","split","$","evt","join","difference","array","remove","result","each","elem","indexOf","push","all","promises","when","objectCreate","Object","create","prototype","Error","TypeError","_SubmitSelector","Defaults","inputs","excluded","priorityEnabled","multiple","group","uiEnabled","validationThreshold","focus","trigger","triggerAfterFailure","errorClass","successClass","classHandler","Field","errorsContainer","errorsWrapper","errorTemplate","Base","__id__","asyncSupport","_pipeAccordingToValidationResult","pipe","r","Deferred","validationResult","reject","resolve","promise","actualizeOptions","options","domOptions","parent","_resetOptions","initOptions","_listeners","on","fn","queue","subscribe","listenTo","off","splice","unsubscribe","unsubscribeTo","target","extraArg","call","asyncIsValid","force","whenValid","_findRelated","querySelectorAll","$element","convertArrayRequirement","m","values","convertExtraOptionRequirement","requirementSpec","extraOptionReader","main","extra","key","Validator","spec","extend","validate","requirementFirstArg","Array","isArray","validateMultiple","instance","validateDate","_isDateInput","validateNumber","validateString","parseRequirements","requirements","type","isPlainObject","priority","ValidatorRegistry","validators","catalog","__class__","locale","init","typeTesters","email","digits","alphanum","url","range","decimalPlaces","Math","max","parseArguments","args","operatorToValidator","operator","requirementsAndInput","pop","comparisonOperator","addValidator","Parsley","setLocale","addCatalog","messages","set","addMessage","message","addMessages","nameMessageObject","arg1","arg2","_setValidator","hasValidator","updateValidator","removeValidator","validator","getErrorMessage","constraint","typeMessages","formatMessage","defaultMessage","en","parameters","notblank","required","step","base","tester","nb","decimals","toInt","f","round","pow","pattern","minlength","requirement","maxlength","min","mincheck","maxcheck","check","equalto","refOrValue","$reference","val","euvatin","re","UI","diffResults","newResult","oldResult","deep","added","kept","found","j","assert","removed","Form","_actualizeTriggers","onSubmitValidate","onSubmitButton","_focusedField","fields","field","noFocus","_destroyUI","_reflowUI","_buildUI","_ui","diff","lastValidationResult","_manageStatusClass","_manageErrorsMessages","_failedOnce","getErrorsMessages","errorMessage","_getErrorMessage","addError","updateClass","_addError","_errorClass","updateError","_updateError","removeError","_removeError","hasConstraints","needsValidation","_successClass","_resetClass","errorsMessagesDisabled","_insertErrorWrapper","$errorsWrapper","find","append","addClass","html","removeClass","$errorClassHandler","errorsWrapperId","removeAttr","customConstraintErrorMessage","_manageClassHandler","validationInformationVisible","$handlerFunction","$handler","jQuery","_inputHolder","nodeName","$errorsContainer","after","$toBind","_validateIfNeeded","event","getValue","debounce","clearTimeout","_debounced","setTimeout","_resetUI","children","statusMapping","pending","resolved","rejected","parsley","submitSource","_submitSource","prop","_remoteCache","whenValidate","state","_trigger","stopImmediatePropagation","preventDefault","done","_submit","currentTarget","$synthetic","appendTo","Event","submitEvent","_refreshFields","_withoutReactualizingFormOptions","fail","always","isValid","refresh","reset","destroy","removeData","_bindFields","oldFields","fieldsMappedById","not","fieldInstance","Factory","uniqueId","oldActualizeOptions","eventName","Constraint","parsleyField","isDomConstraint","validatorSpec","_validatorRegistry","_parseRequirements","capitalize","cap","requirementList","parsleyFormInstance","constraints","constraintsByName","_bindConstraints","_isInGroup","_refreshed","_isRequired","validateIfEmpty","inArray","groupedConstraints","_getGroupedConstraints","_validateConstraint","_handleWhitespace","_refreshConstraints","refreshConstraints","addConstraint","removeConstraint","updateConstraint","undefined","_bindHtml5Constraints","trimValue","whitespace","c","index","p","sort","a","b","Multiple","addElement","$elements","fieldConstraints","has","data","filter","_init","savedparsleyFormInstance","__version__","is","bind","isMultiple","handleMultiple","parsleyMultipleInstance","input","$previouslyRelated","get","doNotStore","parsleyInstance","ParsleyExtend","vernums","jquery","forEach","document","version","psly","instances","ParsleyConfig","ParsleyUtils","registry","i18n","ParsleyValidator","method","ParsleyUI","doNotUpdateClass","autoBind","o","deprecated","adapt","context","parsleyAdaptedCallback","unshift","apply","eventPrefix","lastIndexOf","substr","listen","callback","unsubscribeAll","emit","instanceGiven","asyncValidators","xhr","status","reverse","addAsyncValidator","ajaxOptions","csr","encodeURIComponent","remoteOptions","param","ajax","handleXhr","then","InputEvent","globals","global","isNativeEvent","originalEvent","isTrusted","fakeInputEvent","misbehaves","behavesOk","selector","install","inputEventPatched","uninstall","inputevent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA,IAAIA,QAAQ,GAAG,CAAf;EACA,IAAIC,YAAY,GAAG,EAAnB;EAEA,IAAIC,KAAK,GAAG;EACV;EACA;EACAC,EAAAA,IAAI,EAAE,cAAUC,OAAV,EAAmBC,SAAnB,EAA8BC,GAA9B,EAAmC;EACvC,QAAIC,CAAJ;EACA,QAAIC,SAAJ;EACA,QAAIC,UAAJ;EACA,QAAIC,KAAK,GAAG,IAAIC,MAAJ,CAAW,MAAMN,SAAjB,EAA4B,GAA5B,CAAZ;EAEA,QAAI,gBAAgB,OAAOC,GAA3B,EACEA,GAAG,GAAG,EAAN,CADF,KAEK;EACH;EACA,WAAKC,CAAL,IAAUD,GAAV,EAAe;EACb,YAAIA,GAAG,CAACM,cAAJ,CAAmBL,CAAnB,CAAJ,EACE,OAAOD,GAAG,CAACC,CAAD,CAAV;EACH;EACF;EAED,QAAI,CAACH,OAAL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,UAFpD;EAGD;EACF,KA5BiB;EA8BlB;EACAG,IAAAA,OAAO,EAAE,mBAAM;EACb,UAAIT,OAAO,CAACU,iBAAZ,EAA+B;EAC7B;EACD;;EACDV,MAAAA,OAAO,CAACU,iBAAR,GAA4B,OAA5B;EAJa,iBAKQ,CAAC,QAAD,EAAW,wBAAX,EAAqC,qBAArC,EAA4D,oBAA5D,CALR;;EAKb,+CAAwG;EAAnG,YAAIF,QAAQ,WAAZ;EACH7Y,QAAAA,CAAC,CAAC2V,QAAD,CAAD,CACGlS,EADH,CACM,kBADN,EAC0BoV,QAD1B,EACoC;EAACA,UAAAA,QAAQ,EAARA;EAAD,SADpC,EACgD,KAAI,CAACD,SADrD,EAEGnV,EAFH,CAEM,mBAFN,EAE2BoV,QAF3B,EAEqC;EAACA,UAAAA,QAAQ,EAARA;EAAD,SAFrC,EAEiD,KAAI,CAACF,UAFtD;EAGD;EACF,KAzCiB;EA2ClBK,IAAAA,SAAS,EAAE,qBAAM;EACf,aAAOX,OAAO,CAACU,iBAAf;EACA/Y,MAAAA,CAAC,CAAC2V,QAAD,CAAD,CAAY7R,GAAZ,CAAgB,aAAhB;EACD;EA9CiB,GAApB;EAiDD;AAED,mBAAe,IAAIsU,UAAJ,EAAf;;EC3DAa,UAAU,CAACH,OAAX;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"parsley.js","sources":["../src/parsley/utils.js","../src/parsley/defaults.js","../src/parsley/base.js","../src/parsley/validator.js","../src/parsley/validator_registry.js","../src/parsley/ui.js","../src/parsley/form.js","../src/parsley/constraint.js","../src/parsley/field.js","../src/parsley/multiple.js","../src/parsley/factory.js","../src/parsley/main.js","../src/parsley/pubsub.js","../src/parsley/remote.js","../src/i18n/en.js","../src/vendor/inputevent.js","../src/parsley.js"],"sourcesContent":["import $ from 'jquery';\n\nvar globalID = 1;\nvar pastWarnings = {};\n\nvar Utils = {\n // Parsley DOM-API\n // returns object from dom attributes and values\n attr: function (element, namespace, obj) {\n var i;\n var attribute;\n var attributes;\n var regex = new RegExp('^' + namespace, 'i');\n\n if ('undefined' === typeof obj)\n obj = {};\n else {\n // Clear all own properties. This won't affect prototype's values\n for (i in obj) {\n if (obj.hasOwnProperty(i))\n delete obj[i];\n }\n }\n\n if (!element)\n return obj;\n\n attributes = element.attributes;\n for (i = attributes.length; i--; ) {\n attribute = attributes[i];\n\n if (attribute && attribute.specified && regex.test(attribute.name)) {\n obj[this.camelize(attribute.name.slice(namespace.length))] = this.deserializeValue(attribute.value);\n }\n }\n\n return obj;\n },\n\n checkAttr: function (element, namespace, checkAttr) {\n return element.hasAttribute(namespace + checkAttr);\n },\n\n setAttr: function (element, namespace, attr, value) {\n element.setAttribute(this.dasherize(namespace + attr), String(value));\n },\n\n getType: function(element) {\n return element.getAttribute('type') || 'text';\n },\n\n generateID: function () {\n return '' + globalID++;\n },\n\n /** Third party functions **/\n deserializeValue: function (value) {\n var num;\n\n try {\n return value ?\n value == \"true\" ||\n (value == \"false\" ? false :\n value == \"null\" ? null :\n !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? JSON.parse(value) :\n value)\n : value;\n } catch (e) { return value; }\n },\n\n // Zepto camelize function\n camelize: function (str) {\n return str.replace(/-+(.)?/g, function (match, chr) {\n return chr ? chr.toUpperCase() : '';\n });\n },\n\n // Zepto dasherize function\n dasherize: function (str) {\n return str.replace(/::/g, '/')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .replace(/_/g, '-')\n .toLowerCase();\n },\n\n warn: function () {\n if (window.console && 'function' === typeof window.console.warn)\n window.console.warn(...arguments);\n },\n\n warnOnce: function(msg) {\n if (!pastWarnings[msg]) {\n pastWarnings[msg] = true;\n this.warn(...arguments);\n }\n },\n\n _resetWarnings: function () {\n pastWarnings = {};\n },\n\n trimString: function(string) {\n return string.replace(/^\\s+|\\s+$/g, '');\n },\n\n parse: {\n date: function(string) {\n let parsed = string.match(/^(\\d{4,})-(\\d\\d)-(\\d\\d)$/);\n if (!parsed)\n return null;\n let [_, year, month, day] = parsed.map(x => parseInt(x, 10));\n let date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day)\n return null;\n return date;\n },\n string: function(string) {\n return string;\n },\n integer: function(string) {\n if (isNaN(string))\n return null;\n return parseInt(string, 10);\n },\n number: function(string) {\n if (isNaN(string))\n throw null;\n return parseFloat(string);\n },\n 'boolean': function _boolean(string) {\n return !(/^\\s*false\\s*$/i.test(string));\n },\n object: function(string) {\n return Utils.deserializeValue(string);\n },\n regexp: function(regexp) {\n var flags = '';\n\n // Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern\n if (/^\\/.*\\/(?:[gimy]*)$/.test(regexp)) {\n // Replace the regexp literal string with the first match group: ([gimy]*)\n // If no flag is present, this will be a blank string\n flags = regexp.replace(/.*\\/([gimy]*)$/, '$1');\n // Again, replace the regexp literal string with the first match group:\n // everything excluding the opening and closing slashes and the flags\n regexp = regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');\n } else {\n // Anchor regexp:\n regexp = '^' + regexp + '$';\n }\n return new RegExp(regexp, flags);\n }\n },\n\n parseRequirement: function(requirementType, string) {\n var converter = this.parse[requirementType || 'string'];\n if (!converter)\n throw 'Unknown requirement specification: \"' + requirementType + '\"';\n let converted = converter(string);\n if (converted === null)\n throw `Requirement is not a ${requirementType}: \"${string}\"`;\n return converted;\n },\n\n namespaceEvents: function(events, namespace) {\n events = this.trimString(events || '').split(/\\s+/);\n if (!events[0])\n return '';\n return $.map(events, evt => `${evt}.${namespace}`).join(' ');\n },\n\n difference: function(array, remove) {\n // This is O(N^2), should be optimized\n let result = [];\n $.each(array, (_, elem) => {\n if (remove.indexOf(elem) == -1)\n result.push(elem);\n });\n return result;\n },\n\n // Alter-ego to native Promise.all, but for jQuery\n all: function(promises) {\n // jQuery treats $.when() and $.when(singlePromise) differently; let's avoid that and add spurious elements\n return $.when(...promises, 42, 42);\n },\n\n // Object.create polyfill, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill\n objectCreate: Object.create || (function () {\n var Object = function () {};\n return function (prototype) {\n if (arguments.length > 1) {\n throw Error('Second argument not supported');\n }\n if (typeof prototype != 'object') {\n throw TypeError('Argument must be an object');\n }\n Object.prototype = prototype;\n var result = new Object();\n Object.prototype = null;\n return result;\n };\n })(),\n\n _SubmitSelector: 'input[type=\"submit\"], button:submit'\n};\n\nexport default Utils;\n","// All these options could be overriden and specified directly in DOM using\n// `data-parsley-` default DOM-API\n// eg: `inputs` can be set in DOM using `data-parsley-inputs=\"input, textarea\"`\n// eg: `data-parsley-stop-on-first-failing-constraint=\"false\"`\n\nvar Defaults = {\n // ### General\n\n // Default data-namespace for DOM API\n namespace: 'data-parsley-',\n\n // Supported inputs by default\n inputs: 'input, textarea, select',\n\n // Excluded inputs by default\n excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden]',\n\n // Stop validating field on highest priority failing constraint\n priorityEnabled: true,\n\n // ### Field only\n\n // identifier used to group together inputs (e.g. radio buttons...)\n multiple: null,\n\n // identifier (or array of identifiers) used to validate only a select group of inputs\n group: null,\n\n // ### UI\n // Enable\\Disable error messages\n uiEnabled: true,\n\n // Key events threshold before validation\n validationThreshold: 3,\n\n // Focused field on form validation error. 'first'|'last'|'none'\n focus: 'first',\n\n // event(s) that will trigger validation before first failure. eg: `input`...\n trigger: false,\n\n // event(s) that will trigger validation after first failure.\n triggerAfterFailure: 'input',\n\n // Class that would be added on every failing validation Parsley field\n errorClass: 'parsley-error',\n\n // Same for success validation\n successClass: 'parsley-success',\n\n // Return the `$element` that will receive these above success or error classes\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n classHandler: function (Field) {},\n\n // Return the `$element` where errors will be appended\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n errorsContainer: function (Field) {},\n\n // ul elem that would receive errors' list\n errorsWrapper: '
      ',\n\n // li elem that would receive error message\n errorTemplate: '
    • '\n};\n\nexport default Defaults;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Base = function () {\n this.__id__ = Utils.generateID();\n};\n\nBase.prototype = {\n asyncSupport: true, // Deprecated\n\n _pipeAccordingToValidationResult: function () {\n var pipe = () => {\n var r = $.Deferred();\n if (true !== this.validationResult)\n r.reject();\n return r.resolve().promise();\n };\n return [pipe, pipe];\n },\n\n actualizeOptions: function () {\n Utils.attr(this.element, this.options.namespace, this.domOptions);\n if (this.parent && this.parent.actualizeOptions)\n this.parent.actualizeOptions();\n return this;\n },\n\n _resetOptions: function (initOptions) {\n this.domOptions = Utils.objectCreate(this.parent.options);\n this.options = Utils.objectCreate(this.domOptions);\n // Shallow copy of ownProperties of initOptions:\n for (var i in initOptions) {\n if (initOptions.hasOwnProperty(i))\n this.options[i] = initOptions[i];\n }\n this.actualizeOptions();\n },\n\n _listeners: null,\n\n // Register a callback for the given event name\n // Callback is called with context as the first argument and the `this`\n // The context is the current parsley instance, or window.Parsley if global\n // A return value of `false` will interrupt the calls\n on: function (name, fn) {\n this._listeners = this._listeners || {};\n var queue = this._listeners[name] = this._listeners[name] || [];\n queue.push(fn);\n\n return this;\n },\n\n // Deprecated. Use `on` instead\n subscribe: function(name, fn) {\n $.listenTo(this, name.toLowerCase(), fn);\n },\n\n // Unregister a callback (or all if none is given) for the given event name\n off: function (name, fn) {\n var queue = this._listeners && this._listeners[name];\n if (queue) {\n if (!fn) {\n delete this._listeners[name];\n } else {\n for (var i = queue.length; i--; )\n if (queue[i] === fn)\n queue.splice(i, 1);\n }\n }\n return this;\n },\n\n // Deprecated. Use `off`\n unsubscribe: function(name, fn) {\n $.unsubscribeTo(this, name.toLowerCase());\n },\n\n // Trigger an event of the given name\n // A return value of `false` interrupts the callback chain\n // Returns false if execution was interrupted\n trigger: function (name, target, extraArg) {\n target = target || this;\n var queue = this._listeners && this._listeners[name];\n var result;\n var parentResult;\n if (queue) {\n for (var i = queue.length; i--; ) {\n result = queue[i].call(target, target, extraArg);\n if (result === false) return result;\n }\n }\n if (this.parent) {\n return this.parent.trigger(name, target, extraArg);\n }\n return true;\n },\n\n asyncIsValid: function (group, force) {\n Utils.warnOnce(\"asyncIsValid is deprecated; please use whenValid instead\");\n return this.whenValid({group, force});\n },\n\n _findRelated: function () {\n return this.options.multiple ?\n $(this.parent.element.querySelectorAll(`[${this.options.namespace}multiple=\"${this.options.multiple}\"]`))\n : this.$element;\n }\n};\n\nexport default Base;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar convertArrayRequirement = function(string, length) {\n var m = string.match(/^\\s*\\[(.*)\\]\\s*$/);\n if (!m)\n throw 'Requirement is not an array: \"' + string + '\"';\n var values = m[1].split(',').map(Utils.trimString);\n if (values.length !== length)\n throw 'Requirement has ' + values.length + ' values when ' + length + ' are needed';\n return values;\n};\n\nvar convertExtraOptionRequirement = function(requirementSpec, string, extraOptionReader) {\n var main = null;\n var extra = {};\n for (var key in requirementSpec) {\n if (key) {\n var value = extraOptionReader(key);\n if ('string' === typeof value)\n value = Utils.parseRequirement(requirementSpec[key], value);\n extra[key] = value;\n } else {\n main = Utils.parseRequirement(requirementSpec[key], string);\n }\n }\n return [main, extra];\n};\n\n// A Validator needs to implement the methods `validate` and `parseRequirements`\n\nvar Validator = function(spec) {\n $.extend(true, this, spec);\n};\n\nValidator.prototype = {\n // Returns `true` iff the given `value` is valid according the given requirements.\n validate: function(value, requirementFirstArg) {\n if (this.fn) { // Legacy style validator\n\n if (arguments.length > 3) // If more args then value, requirement, instance...\n requirementFirstArg = [].slice.call(arguments, 1, -1); // Skip first arg (value) and last (instance), combining the rest\n return this.fn(value, requirementFirstArg);\n }\n\n if (Array.isArray(value)) {\n if (!this.validateMultiple)\n throw 'Validator `' + this.name + '` does not handle multiple values';\n return this.validateMultiple(...arguments);\n } else {\n let instance = arguments[arguments.length - 1];\n if (this.validateDate && instance._isDateInput()) {\n arguments[0] = Utils.parse.date(arguments[0]);\n if (arguments[0] === null)\n return false;\n return this.validateDate(...arguments);\n }\n if (this.validateNumber) {\n if (!value) // Builtin validators all accept empty strings, except `required` of course\n return true;\n if (isNaN(value))\n return false;\n arguments[0] = parseFloat(arguments[0]);\n return this.validateNumber(...arguments);\n }\n if (this.validateString) {\n return this.validateString(...arguments);\n }\n throw 'Validator `' + this.name + '` only handles multiple values';\n }\n },\n\n // Parses `requirements` into an array of arguments,\n // according to `this.requirementType`\n parseRequirements: function(requirements, extraOptionReader) {\n if ('string' !== typeof requirements) {\n // Assume requirement already parsed\n // but make sure we return an array\n return Array.isArray(requirements) ? requirements : [requirements];\n }\n var type = this.requirementType;\n if (Array.isArray(type)) {\n var values = convertArrayRequirement(requirements, type.length);\n for (var i = 0; i < values.length; i++)\n values[i] = Utils.parseRequirement(type[i], values[i]);\n return values;\n } else if ($.isPlainObject(type)) {\n return convertExtraOptionRequirement(type, requirements, extraOptionReader);\n } else {\n return [Utils.parseRequirement(type, requirements)];\n }\n },\n // Defaults:\n requirementType: 'string',\n\n priority: 2\n\n};\n\nexport default Validator;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Validator from './validator';\n\nvar ValidatorRegistry = function (validators, catalog) {\n this.__class__ = 'ValidatorRegistry';\n\n // Default Parsley locale is en\n this.locale = 'en';\n\n this.init(validators || {}, catalog || {});\n};\n\nvar typeTesters = {\n email: /^((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))$/,\n\n // Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers\n number: /^-?(\\d*\\.)?\\d+(e[-+]?\\d+)?$/i,\n\n integer: /^-?\\d+$/,\n\n digits: /^\\d+$/,\n\n alphanum: /^\\w+$/i,\n\n date: {\n test: value => Utils.parse.date(value) !== null\n },\n\n url: new RegExp(\n \"^\" +\n // protocol identifier\n \"(?:(?:https?|ftp)://)?\" + // ** mod: make scheme optional\n // user:pass authentication\n \"(?:\\\\S+(?::\\\\S*)?@)?\" +\n \"(?:\" +\n // IP address exclusion\n // private & local networks\n // \"(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})\" + // ** mod: allow local networks\n // \"(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // \"(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // IP address dotted notation octets\n // excludes loopback network 0.0.0.0\n // excludes reserved space >= 224.0.0.0\n // excludes network & broacast addresses\n // (first & last IP address of each class)\n \"(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])\" +\n \"(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}\" +\n \"(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))\" +\n \"|\" +\n // host name\n \"(?:(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)\" +\n // domain name\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)*\" +\n // TLD identifier\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff]{2,}))\" +\n \")\" +\n // port number\n \"(?::\\\\d{2,5})?\" +\n // resource path\n \"(?:/\\\\S*)?\" +\n \"$\"\n )\n};\ntypeTesters.range = typeTesters.number;\n\n// See http://stackoverflow.com/a/10454560/8279\nvar decimalPlaces = num => {\n var match = ('' + num).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n if (!match) { return 0; }\n return Math.max(\n 0,\n // Number of digits right of decimal point.\n (match[1] ? match[1].length : 0) -\n // Adjust for scientific notation.\n (match[2] ? +match[2] : 0));\n};\n\n// parseArguments('number', ['1', '2']) => [1, 2]\nlet parseArguments = (type, args) => args.map(Utils.parse[type]);\n// operatorToValidator returns a validating function for an operator function, applied to the given type\nlet operatorToValidator = (type, operator) => {\n return (value, ...requirementsAndInput) => {\n requirementsAndInput.pop(); // Get rid of `input` argument\n return operator(value, ...parseArguments(type, requirementsAndInput));\n };\n};\n\nlet comparisonOperator = operator => ({\n validateDate: operatorToValidator('date', operator),\n validateNumber: operatorToValidator('number', operator),\n requirementType: operator.length <= 2 ? 'string' : ['string', 'string'], // Support operators with a 1 or 2 requirement(s)\n priority: 30\n});\n\nValidatorRegistry.prototype = {\n init: function (validators, catalog) {\n this.catalog = catalog;\n // Copy prototype's validators:\n this.validators = Object.assign({}, this.validators);\n\n for (var name in validators)\n this.addValidator(name, validators[name].fn, validators[name].priority);\n\n window.Parsley.trigger('parsley:validator:init');\n },\n\n // Set new messages locale if we have dictionary loaded in ParsleyConfig.i18n\n setLocale: function (locale) {\n if ('undefined' === typeof this.catalog[locale])\n throw new Error(locale + ' is not available in the catalog');\n\n this.locale = locale;\n\n return this;\n },\n\n // Add a new messages catalog for a given locale. Set locale for this catalog if set === `true`\n addCatalog: function (locale, messages, set) {\n if ('object' === typeof messages)\n this.catalog[locale] = messages;\n\n if (true === set)\n return this.setLocale(locale);\n\n return this;\n },\n\n // Add a specific message for a given constraint in a given locale\n addMessage: function (locale, name, message) {\n if ('undefined' === typeof this.catalog[locale])\n this.catalog[locale] = {};\n\n this.catalog[locale][name] = message;\n\n return this;\n },\n\n // Add messages for a given locale\n addMessages: function (locale, nameMessageObject) {\n for (var name in nameMessageObject)\n this.addMessage(locale, name, nameMessageObject[name]);\n\n return this;\n },\n\n // Add a new validator\n //\n // addValidator('custom', {\n // requirementType: ['integer', 'integer'],\n // validateString: function(value, from, to) {},\n // priority: 22,\n // messages: {\n // en: \"Hey, that's no good\",\n // fr: \"Aye aye, pas bon du tout\",\n // }\n // })\n //\n // Old API was addValidator(name, function, priority)\n //\n addValidator: function (name, arg1, arg2) {\n if (this.validators[name])\n Utils.warn('Validator \"' + name + '\" is already defined.');\n else if (Defaults.hasOwnProperty(name)) {\n Utils.warn('\"' + name + '\" is a restricted keyword and is not a valid validator name.');\n return;\n }\n return this._setValidator(...arguments);\n },\n\n hasValidator: function (name) {\n return !!this.validators[name];\n },\n\n updateValidator: function (name, arg1, arg2) {\n if (!this.validators[name]) {\n Utils.warn('Validator \"' + name + '\" is not already defined.');\n return this.addValidator(...arguments);\n }\n return this._setValidator(...arguments);\n },\n\n removeValidator: function (name) {\n if (!this.validators[name])\n Utils.warn('Validator \"' + name + '\" is not defined.');\n\n delete this.validators[name];\n\n return this;\n },\n\n _setValidator: function (name, validator, priority) {\n if ('object' !== typeof validator) {\n // Old style validator, with `fn` and `priority`\n validator = {\n fn: validator,\n priority: priority\n };\n }\n if (!validator.validate) {\n validator = new Validator(validator);\n }\n this.validators[name] = validator;\n\n for (var locale in validator.messages || {})\n this.addMessage(locale, name, validator.messages[locale]);\n\n return this;\n },\n\n getErrorMessage: function (constraint) {\n var message;\n\n // Type constraints are a bit different, we have to match their requirements too to find right error message\n if ('type' === constraint.name) {\n var typeMessages = this.catalog[this.locale][constraint.name] || {};\n message = typeMessages[constraint.requirements];\n } else\n message = this.formatMessage(this.catalog[this.locale][constraint.name], constraint.requirements);\n\n return message || this.catalog[this.locale].defaultMessage || this.catalog.en.defaultMessage;\n },\n\n // Kind of light `sprintf()` implementation\n formatMessage: function (string, parameters) {\n if ('object' === typeof parameters) {\n for (var i in parameters)\n string = this.formatMessage(string, parameters[i]);\n\n return string;\n }\n\n return 'string' === typeof string ? string.replace(/%s/i, parameters) : '';\n },\n\n // Here is the Parsley default validators list.\n // A validator is an object with the following key values:\n // - priority: an integer\n // - requirement: 'string' (default), 'integer', 'number', 'regexp' or an Array of these\n // - validateString, validateMultiple, validateNumber: functions returning `true`, `false` or a promise\n // Alternatively, a validator can be a function that returns such an object\n //\n validators: {\n notblank: {\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 2\n },\n required: {\n validateMultiple: function(values) {\n return values.length > 0;\n },\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 512\n },\n type: {\n validateString: function(value, type, {step = 'any', base = 0} = {}) {\n var tester = typeTesters[type];\n if (!tester) {\n throw new Error('validator type `' + type + '` is not supported');\n }\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n if (!tester.test(value))\n return false;\n if ('number' === type) {\n if (!/^any$/i.test(step || '')) {\n var nb = Number(value);\n var decimals = Math.max(decimalPlaces(step), decimalPlaces(base));\n if (decimalPlaces(nb) > decimals) // Value can't have too many decimals\n return false;\n // Be careful of rounding errors by using integers.\n var toInt = f => Math.round(f * Math.pow(10, decimals));\n if ((toInt(nb) - toInt(base)) % toInt(step) != 0)\n return false;\n }\n }\n return true;\n },\n requirementType: {\n '': 'string',\n step: 'string',\n base: 'number'\n },\n priority: 256\n },\n pattern: {\n validateString: function(value, regexp) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return regexp.test(value);\n },\n requirementType: 'regexp',\n priority: 64\n },\n minlength: {\n validateString: function (value, requirement) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxlength: {\n validateString: function (value, requirement) {\n return value.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n length: {\n validateString: function (value, min, max) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= min && value.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n mincheck: {\n validateMultiple: function (values, requirement) {\n return values.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxcheck: {\n validateMultiple: function (values, requirement) {\n return values.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n check: {\n validateMultiple: function (values, min, max) {\n return values.length >= min && values.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n min: comparisonOperator((value, requirement) => value >= requirement),\n max: comparisonOperator((value, requirement) => value <= requirement),\n range: comparisonOperator((value, min, max) => value >= min && value <= max),\n equalto: {\n validateString: function (value, refOrValue) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n var $reference = $(refOrValue);\n if ($reference.length)\n return value === $reference.val();\n else\n return value === refOrValue;\n },\n priority: 256\n },\n euvatin: {\n validateString: function (value, refOrValue) {\n if (!value) {\n return true; // Builtin validators all accept empty strings, except `required` of course\n }\n\n var re = /^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/;\n return re.test(value);\n },\n priority: 30,\n },\n }\n};\n\nexport default ValidatorRegistry;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar UI = {};\n\nvar diffResults = function (newResult, oldResult, deep) {\n var added = [];\n var kept = [];\n\n for (var i = 0; i < newResult.length; i++) {\n var found = false;\n\n for (var j = 0; j < oldResult.length; j++)\n if (newResult[i].assert.name === oldResult[j].assert.name) {\n found = true;\n break;\n }\n\n if (found)\n kept.push(newResult[i]);\n else\n added.push(newResult[i]);\n }\n\n return {\n kept: kept,\n added: added,\n removed: !deep ? diffResults(oldResult, newResult, true).added : []\n };\n};\n\nUI.Form = {\n\n _actualizeTriggers: function () {\n this.$element.on('submit.Parsley', evt => { this.onSubmitValidate(evt); });\n this.$element.on('click.Parsley', Utils._SubmitSelector, evt => { this.onSubmitButton(evt); });\n\n // UI could be disabled\n if (false === this.options.uiEnabled)\n return;\n\n this.element.setAttribute('novalidate', '');\n },\n\n focus: function () {\n this._focusedField = null;\n\n if (true === this.validationResult || 'none' === this.options.focus)\n return null;\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i];\n if (true !== field.validationResult && field.validationResult.length > 0 && 'undefined' === typeof field.options.noFocus) {\n this._focusedField = field.$element;\n if ('first' === this.options.focus)\n break;\n }\n }\n\n if (null === this._focusedField)\n return null;\n\n return this._focusedField.focus();\n },\n\n _destroyUI: function () {\n // Reset all event listeners\n this.$element.off('.Parsley');\n }\n\n};\n\nUI.Field = {\n\n _reflowUI: function () {\n this._buildUI();\n\n // If this field doesn't have an active UI don't bother doing something\n if (!this._ui)\n return;\n\n // Diff between two validation results\n var diff = diffResults(this.validationResult, this._ui.lastValidationResult);\n\n // Then store current validation result for next reflow\n this._ui.lastValidationResult = this.validationResult;\n\n // Handle valid / invalid / none field class\n this._manageStatusClass();\n\n // Add, remove, updated errors messages\n this._manageErrorsMessages(diff);\n\n // Triggers impl\n this._actualizeTriggers();\n\n // If field is not valid for the first time, bind keyup trigger to ease UX and quickly inform user\n if ((diff.kept.length || diff.added.length) && !this._failedOnce) {\n this._failedOnce = true;\n this._actualizeTriggers();\n }\n },\n\n // Returns an array of field's error message(s)\n getErrorsMessages: function () {\n // No error message, field is valid\n if (true === this.validationResult)\n return [];\n\n var messages = [];\n\n for (var i = 0; i < this.validationResult.length; i++)\n messages.push(this.validationResult[i].errorMessage ||\n this._getErrorMessage(this.validationResult[i].assert));\n\n return messages;\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n addError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._addError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n updateError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._updateError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n removeError: function (name, {updateClass = true} = {}) {\n this._buildUI();\n this._removeError(name);\n\n // edge case possible here: remove a standard Parsley error that is still failing in this.validationResult\n // but highly improbable cuz' manually removing a well Parsley handled error makes no sense.\n if (updateClass)\n this._manageStatusClass();\n },\n\n _manageStatusClass: function () {\n if (this.hasConstraints() && this.needsValidation() && true === this.validationResult)\n this._successClass();\n else if (this.validationResult.length > 0)\n this._errorClass();\n else\n this._resetClass();\n },\n\n _manageErrorsMessages: function (diff) {\n if ('undefined' !== typeof this.options.errorsMessagesDisabled)\n return;\n\n // Case where we have errorMessage option that configure an unique field error message, regardless failing validators\n if ('undefined' !== typeof this.options.errorMessage) {\n if ((diff.added.length || diff.kept.length)) {\n this._insertErrorWrapper();\n\n if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length)\n this._ui.$errorsWrapper\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-custom-error-message')\n );\n\n this._ui.$errorClassHandler.attr('aria-describedby', this._ui.errorsWrapperId);\n\n return this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .find('.parsley-custom-error-message')\n .html(this.options.errorMessage);\n }\n\n this._ui.$errorClassHandler.removeAttr('aria-describedby');\n\n return this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-custom-error-message')\n .remove();\n }\n\n // Show, hide, update failing constraints messages\n for (var i = 0; i < diff.removed.length; i++)\n this._removeError(diff.removed[i].assert.name);\n\n for (i = 0; i < diff.added.length; i++)\n this._addError(diff.added[i].assert.name, {message: diff.added[i].errorMessage, assert: diff.added[i].assert});\n\n for (i = 0; i < diff.kept.length; i++)\n this._updateError(diff.kept[i].assert.name, {message: diff.kept[i].errorMessage, assert: diff.kept[i].assert});\n },\n\n\n _addError: function (name, {message, assert}) {\n this._insertErrorWrapper();\n this._ui.$errorClassHandler\n .attr('aria-describedby', this._ui.errorsWrapperId);\n this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-' + name)\n .html(message || this._getErrorMessage(assert))\n );\n },\n\n _updateError: function (name, {message, assert}) {\n this._ui.$errorsWrapper\n .addClass('filled')\n .find('.parsley-' + name)\n .html(message || this._getErrorMessage(assert));\n },\n\n _removeError: function (name) {\n this._ui.$errorClassHandler\n .removeAttr('aria-describedby');\n this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-' + name)\n .remove();\n },\n\n _getErrorMessage: function (constraint) {\n var customConstraintErrorMessage = constraint.name + 'Message';\n\n if ('undefined' !== typeof this.options[customConstraintErrorMessage])\n return window.Parsley.formatMessage(this.options[customConstraintErrorMessage], constraint.requirements);\n\n return window.Parsley.getErrorMessage(constraint);\n },\n\n _buildUI: function () {\n // UI could be already built or disabled\n if (this._ui || false === this.options.uiEnabled)\n return;\n\n var _ui = {};\n\n // Give field its Parsley id in DOM\n this.element.setAttribute(this.options.namespace + 'id', this.__id__);\n\n /** Generate important UI elements and store them in this **/\n // $errorClassHandler is the $element that woul have parsley-error and parsley-success classes\n _ui.$errorClassHandler = this._manageClassHandler();\n\n // $errorsWrapper is a div that would contain the various field errors, it will be appended into $errorsContainer\n _ui.errorsWrapperId = 'parsley-id-' + (this.options.multiple ? 'multiple-' + this.options.multiple : this.__id__);\n _ui.$errorsWrapper = $(this.options.errorsWrapper).attr('id', _ui.errorsWrapperId);\n\n // ValidationResult UI storage to detect what have changed bwt two validations, and update DOM accordingly\n _ui.lastValidationResult = [];\n _ui.validationInformationVisible = false;\n\n // Store it in this for later\n this._ui = _ui;\n },\n\n // Determine which element will have `parsley-error` and `parsley-success` classes\n _manageClassHandler: function () {\n // Class handled could also be determined by function given in Parsley options\n if ('string' === typeof this.options.classHandler && $(this.options.classHandler).length)\n return $(this.options.classHandler);\n\n // Class handled could also be determined by function given in Parsley options\n var $handlerFunction = this.options.classHandler;\n\n // It might also be the function name of a global function\n if ('string' === typeof this.options.classHandler && 'function' === typeof window[this.options.classHandler])\n $handlerFunction = window[this.options.classHandler];\n\n if ('function' === typeof $handlerFunction) {\n var $handler = $handlerFunction.call(this, this);\n\n // If this function returned a valid existing DOM element, go for it\n if ('undefined' !== typeof $handler && $handler.length)\n return $handler;\n } else if ('object' === typeof $handlerFunction && $handlerFunction instanceof jQuery && $handlerFunction.length) {\n return $handlerFunction;\n } else if ($handlerFunction) {\n Utils.warn('The class handler `' + $handlerFunction + '` does not exist in DOM nor as a global JS function');\n }\n\n return this._inputHolder();\n },\n\n _inputHolder: function() {\n // if simple element (input, texatrea, select...) it will perfectly host the classes and precede the error container\n if (!this.options.multiple || this.element.nodeName === 'SELECT')\n return this.$element;\n\n // But if multiple element (radio, checkbox), that would be their parent\n return this.$element.parent();\n },\n\n _insertErrorWrapper: function () {\n var $errorsContainer = this.options.errorsContainer;\n\n // Nothing to do if already inserted\n if (0 !== this._ui.$errorsWrapper.parent().length)\n return this._ui.$errorsWrapper.parent();\n\n if ('string' === typeof $errorsContainer) {\n if ($($errorsContainer).length)\n return $($errorsContainer).append(this._ui.$errorsWrapper);\n else if ('function' === typeof window[$errorsContainer])\n $errorsContainer = window[$errorsContainer];\n else\n Utils.warn('The errors container `' + $errorsContainer + '` does not exist in DOM nor as a global JS function');\n }\n\n if ('function' === typeof $errorsContainer)\n $errorsContainer = $errorsContainer.call(this, this);\n\n if ('object' === typeof $errorsContainer && $errorsContainer.length)\n return $errorsContainer.append(this._ui.$errorsWrapper);\n\n return this._inputHolder().after(this._ui.$errorsWrapper);\n },\n\n _actualizeTriggers: function () {\n var $toBind = this._findRelated();\n var trigger;\n\n // Remove Parsley events already bound on this field\n $toBind.off('.Parsley');\n if (this._failedOnce)\n $toBind.on(Utils.namespaceEvents(this.options.triggerAfterFailure, 'Parsley'), () => {\n this._validateIfNeeded();\n });\n else if (trigger = Utils.namespaceEvents(this.options.trigger, 'Parsley')) {\n $toBind.on(trigger, event => {\n this._validateIfNeeded(event);\n });\n }\n },\n\n _validateIfNeeded: function (event) {\n // For keyup, keypress, keydown, input... events that could be a little bit obstrusive\n // do not validate if val length < min threshold on first validation. Once field have been validated once and info\n // about success or failure have been displayed, always validate with this trigger to reflect every yalidation change.\n if (event && /key|input/.test(event.type))\n if (!(this._ui && this._ui.validationInformationVisible) && this.getValue().length <= this.options.validationThreshold)\n return;\n\n if (this.options.debounce) {\n window.clearTimeout(this._debounced);\n this._debounced = window.setTimeout(() => this.validate(), this.options.debounce);\n } else\n this.validate();\n },\n\n _resetUI: function () {\n // Reset all event listeners\n this._failedOnce = false;\n this._actualizeTriggers();\n\n // Nothing to do if UI never initialized for this field\n if ('undefined' === typeof this._ui)\n return;\n\n // Reset all errors' li\n this._ui.$errorsWrapper\n .removeClass('filled')\n .children()\n .remove();\n\n // Reset validation class\n this._resetClass();\n\n // Reset validation flags and last validation result\n this._ui.lastValidationResult = [];\n this._ui.validationInformationVisible = false;\n },\n\n _destroyUI: function () {\n this._resetUI();\n\n if ('undefined' !== typeof this._ui)\n this._ui.$errorsWrapper.remove();\n\n delete this._ui;\n },\n\n _successClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass);\n },\n _errorClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass);\n },\n _resetClass: function () {\n this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass);\n }\n};\n\nexport default UI;\n","import $ from 'jquery';\nimport Base from './base';\nimport Utils from './utils';\n\nvar Form = function (element, domOptions, options) {\n this.__class__ = 'Form';\n\n this.element = element;\n this.$element = $(element);\n this.domOptions = domOptions;\n this.options = options;\n this.parent = window.Parsley;\n\n this.fields = [];\n this.validationResult = null;\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nForm.prototype = {\n onSubmitValidate: function (event) {\n // This is a Parsley generated submit event, do not validate, do not prevent, simply exit and keep normal behavior\n if (true === event.parsley)\n return;\n\n // If we didn't come here through a submit button, use the first one in the form\n var submitSource = this._submitSource || this.$element.find(Utils._SubmitSelector)[0];\n this._submitSource = null;\n this.$element.find('.parsley-synthetic-submit-button').prop('disabled', true);\n if (submitSource && null !== submitSource.getAttribute('formnovalidate'))\n return;\n\n window.Parsley._remoteCache = {};\n\n var promise = this.whenValidate({event});\n\n if ('resolved' === promise.state() && false !== this._trigger('submit')) {\n // All good, let event go through. We make this distinction because browsers\n // differ in their handling of `submit` being called from inside a submit event [#1047]\n } else {\n // Rejected or pending: cancel this submit\n event.stopImmediatePropagation();\n event.preventDefault();\n if ('pending' === promise.state())\n promise.done(() => { this._submit(submitSource); });\n }\n },\n\n onSubmitButton: function(event) {\n this._submitSource = event.currentTarget;\n },\n // internal\n // _submit submits the form, this time without going through the validations.\n // Care must be taken to \"fake\" the actual submit button being clicked.\n _submit: function (submitSource) {\n if (false === this._trigger('submit'))\n return;\n // Add submit button's data\n if (submitSource) {\n var $synthetic = this.$element.find('.parsley-synthetic-submit-button').prop('disabled', false);\n if (0 === $synthetic.length)\n $synthetic = $('').appendTo(this.$element);\n $synthetic.attr({\n name: submitSource.getAttribute('name'),\n value: submitSource.getAttribute('value')\n });\n }\n\n this.$element.trigger(Object.assign($.Event('submit'), {parsley: true}));\n },\n\n // Performs validation on fields while triggering events.\n // @returns `true` if all validations succeeds, `false`\n // if a failure is immediately detected, or `null`\n // if dependant on a promise.\n // Consider using `whenValidate` instead.\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley form without passing arguments as an object is deprecated.');\n var [group, force, event] = arguments;\n options = {group, force, event};\n }\n return statusMapping[ this.whenValidate(options).state() ];\n },\n\n whenValidate: function ({group, force, event} = {}) {\n this.submitEvent = event;\n if (event) {\n this.submitEvent = Object.assign({}, event, {preventDefault: () => {\n Utils.warnOnce(\"Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`\");\n this.validationResult = false;\n }});\n }\n this.validationResult = true;\n\n // fire validate event to eventually modify things before every validation\n this._trigger('validate');\n\n // Refresh form DOM options and form's fields that could have changed\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValidate({force, group}));\n });\n\n return Utils.all(promises)\n .done( () => { this._trigger('success'); })\n .fail( () => {\n this.validationResult = false;\n this.focus();\n this._trigger('error');\n })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n // Iterate over refreshed fields, and stop on first failure.\n // Returns `true` if all fields are valid, `false` if a failure is detected\n // or `null` if the result depends on an unresolved promise.\n // Prefer using `whenValid` instead.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley form without passing arguments as an object is deprecated.');\n var [group, force] = arguments;\n options = {group, force};\n }\n return statusMapping[ this.whenValid(options).state() ];\n },\n\n // Iterate over refreshed fields and validate them.\n // Returns a promise.\n // A validation that immediately fails will interrupt the validations.\n whenValid: function ({group, force} = {}) {\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValid({group, force}));\n });\n return Utils.all(promises);\n },\n\n refresh: function() {\n this._refreshFields();\n return this;\n },\n\n // Reset UI\n reset: function () {\n // Form case: emit a reset event for each field\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].reset();\n\n this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n\n // Form case: destroy all its fields and then destroy stored instance\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].destroy();\n\n this.$element.removeData('Parsley');\n this._trigger('destroy');\n },\n\n _refreshFields: function () {\n return this.actualizeOptions()._bindFields();\n },\n\n _bindFields: function () {\n var oldFields = this.fields;\n\n this.fields = [];\n this.fieldsMappedById = {};\n\n this._withoutReactualizingFormOptions(() => {\n this.$element\n .find(this.options.inputs)\n .not(this.options.excluded)\n .not(`[${this.options.namespace}excluded=true]`)\n .each((_, element) => {\n var fieldInstance = new window.Parsley.Factory(element, {}, this);\n\n // Only add valid and not excluded `Field` and `FieldMultiple` children\n if ('Field' === fieldInstance.__class__ || 'FieldMultiple' === fieldInstance.__class__) {\n let uniqueId = fieldInstance.__class__ + '-' + fieldInstance.__id__;\n if ('undefined' === typeof this.fieldsMappedById[uniqueId]) {\n this.fieldsMappedById[uniqueId] = fieldInstance;\n this.fields.push(fieldInstance);\n }\n }\n });\n\n $.each(Utils.difference(oldFields, this.fields), (_, field) => {\n field.reset();\n });\n });\n return this;\n },\n\n // Internal only.\n // Looping on a form's fields to do validation or similar\n // will trigger reactualizing options on all of them, which\n // in turn will reactualize the form's options.\n // To avoid calling actualizeOptions so many times on the form\n // for nothing, _withoutReactualizingFormOptions temporarily disables\n // the method actualizeOptions on this form while `fn` is called.\n _withoutReactualizingFormOptions: function (fn) {\n var oldActualizeOptions = this.actualizeOptions;\n this.actualizeOptions = function () { return this; };\n var result = fn();\n this.actualizeOptions = oldActualizeOptions;\n return result;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n // Returns true iff event is not interrupted and default not prevented.\n _trigger: function (eventName) {\n return this.trigger('form:' + eventName);\n }\n\n};\n\nexport default Form;\n","import Utils from './utils';\nimport Validator from './validator';\n\nconst Constraint = function(parsleyField, name, requirements, priority, isDomConstraint) {\n const validatorSpec = window.Parsley._validatorRegistry.validators[name];\n const validator = new Validator(validatorSpec);\n priority = priority || parsleyField.options[name + 'Priority'] || validator.priority;\n isDomConstraint = (true === isDomConstraint);\n\n Object.assign(this, {\n validator,\n name,\n requirements,\n priority,\n isDomConstraint\n });\n this._parseRequirements(parsleyField.options);\n};\n\nconst capitalize = function(str) {\n const cap = str[0].toUpperCase();\n return cap + str.slice(1);\n};\n\nConstraint.prototype = {\n validate: function(value, instance) {\n return this.validator.validate(value, ...this.requirementList, instance);\n },\n\n _parseRequirements: function(options) {\n this.requirementList = this.validator.parseRequirements(this.requirements,\n key => options[this.name + capitalize(key)]\n );\n }\n};\n\nexport default Constraint;\n","import $ from 'jquery';\nimport Constraint from './constraint';\nimport UI from './ui';\nimport Utils from './utils';\n\nvar Field = function (field, domOptions, options, parsleyFormInstance) {\n this.__class__ = 'Field';\n\n this.element = field;\n this.$element = $(field);\n\n // Set parent if we have one\n if ('undefined' !== typeof parsleyFormInstance) {\n this.parent = parsleyFormInstance;\n }\n\n this.options = options;\n this.domOptions = domOptions;\n\n // Initialize some properties\n this.constraints = [];\n this.constraintsByName = {};\n this.validationResult = true;\n\n // Bind constraints\n this._bindConstraints();\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nField.prototype = {\n // # Public API\n // Validate field and trigger some events for mainly `UI`\n // @returns `true`, an array of the validators that failed, or\n // `null` if validation is not finished. Prefer using whenValidate\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley field without passing arguments as an object is deprecated.');\n options = {options};\n }\n var promise = this.whenValidate(options);\n if (!promise) // If excluded with `group` option\n return true;\n switch (promise.state()) {\n case 'pending': return null;\n case 'resolved': return true;\n case 'rejected': return this.validationResult;\n }\n },\n\n // Validate field and trigger some events for mainly `UI`\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if field is not in the given `group`.\n whenValidate: function ({force, group} = {}) {\n // do not validate a field if not the same as given validation group\n this.refresh();\n if (group && !this._isInGroup(group))\n return;\n\n this.value = this.getValue();\n\n // Field Validate event. `this.value` could be altered for custom needs\n this._trigger('validate');\n\n return this.whenValid({force, value: this.value, _refreshed: true})\n .always(() => { this._reflowUI(); })\n .done(() => { this._trigger('success'); })\n .fail(() => { this._trigger('error'); })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n hasConstraints: function () {\n return 0 !== this.constraints.length;\n },\n\n // An empty optional field does not need validation\n needsValidation: function (value) {\n if ('undefined' === typeof value)\n value = this.getValue();\n\n // If a field is empty and not required, it is valid\n // Except if `data-parsley-validate-if-empty` explicitely added, useful for some custom validators\n if (!value.length && !this._isRequired() && 'undefined' === typeof this.options.validateIfEmpty)\n return false;\n\n return true;\n },\n\n _isInGroup: function (group) {\n if (Array.isArray(this.options.group))\n return -1 !== $.inArray(group, this.options.group);\n return this.options.group === group;\n },\n\n // Just validate field. Do not trigger any event.\n // Returns `true` iff all constraints pass, `false` if there are failures,\n // or `null` if the result can not be determined yet (depends on a promise)\n // See also `whenValid`.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley field without passing arguments as an object is deprecated.');\n var [force, value] = arguments;\n options = {force, value};\n }\n var promise = this.whenValid(options);\n if (!promise) // Excluded via `group`\n return true;\n return statusMapping[promise.state()];\n },\n\n // Just validate field. Do not trigger any event.\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if the field is not in the given `group`.\n // The argument `force` will force validation of empty fields.\n // If a `value` is given, it will be validated instead of the value of the input.\n whenValid: function ({force = false, value, group, _refreshed} = {}) {\n // Recompute options and rebind constraints to have latest changes\n if (!_refreshed)\n this.refresh();\n // do not validate a field if not the same as given validation group\n if (group && !this._isInGroup(group))\n return;\n\n this.validationResult = true;\n\n // A field without constraint is valid\n if (!this.hasConstraints())\n return $.when();\n\n // Value could be passed as argument, needed to add more power to 'field:validate'\n if ('undefined' === typeof value || null === value)\n value = this.getValue();\n\n if (!this.needsValidation(value) && true !== force)\n return $.when();\n\n var groupedConstraints = this._getGroupedConstraints();\n var promises = [];\n $.each(groupedConstraints, (_, constraints) => {\n // Process one group of constraints at a time, we validate the constraints\n // and combine the promises together.\n var promise = Utils.all(\n $.map(constraints, constraint => this._validateConstraint(value, constraint))\n );\n promises.push(promise);\n if (promise.state() === 'rejected')\n return false; // Interrupt processing if a group has already failed\n });\n return Utils.all(promises);\n },\n\n // @returns a promise\n _validateConstraint: function(value, constraint) {\n var result = constraint.validate(value, this);\n // Map false to a failed promise\n if (false === result)\n result = $.Deferred().reject();\n // Make sure we return a promise and that we record failures\n return Utils.all([result]).fail(errorMessage => {\n if (!(this.validationResult instanceof Array))\n this.validationResult = [];\n this.validationResult.push({\n assert: constraint,\n errorMessage: 'string' === typeof errorMessage && errorMessage\n });\n });\n },\n\n // @returns Parsley field computed value that could be overrided or configured in DOM\n getValue: function () {\n var value;\n\n // Value could be overriden in DOM or with explicit options\n if ('function' === typeof this.options.value)\n value = this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n value = this.options.value;\n else\n value = this.$element.val();\n\n // Handle wrong DOM or configurations\n if ('undefined' === typeof value || null === value)\n return '';\n\n return this._handleWhitespace(value);\n },\n\n // Reset UI\n reset: function () {\n this._resetUI();\n return this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n this.$element.removeData('Parsley');\n this.$element.removeData('FieldMultiple');\n this._trigger('destroy');\n },\n\n // Actualize options and rebind constraints\n refresh: function () {\n this._refreshConstraints();\n return this;\n },\n\n _refreshConstraints: function () {\n return this.actualizeOptions()._bindConstraints();\n },\n\n refreshConstraints: function() {\n Utils.warnOnce(\"Parsley's refreshConstraints is deprecated. Please use refresh\");\n return this.refresh();\n },\n\n /**\n * Add a new constraint to a field\n *\n * @param {String} name\n * @param {Mixed} requirements optional\n * @param {Number} priority optional\n * @param {Boolean} isDomConstraint optional\n */\n addConstraint: function (name, requirements, priority, isDomConstraint) {\n\n if (window.Parsley._validatorRegistry.validators[name]) {\n var constraint = new Constraint(this, name, requirements, priority, isDomConstraint);\n\n // if constraint already exist, delete it and push new version\n if ('undefined' !== this.constraintsByName[constraint.name])\n this.removeConstraint(constraint.name);\n\n this.constraints.push(constraint);\n this.constraintsByName[constraint.name] = constraint;\n }\n\n return this;\n },\n\n // Remove a constraint\n removeConstraint: function (name) {\n for (var i = 0; i < this.constraints.length; i++)\n if (name === this.constraints[i].name) {\n this.constraints.splice(i, 1);\n break;\n }\n delete this.constraintsByName[name];\n return this;\n },\n\n // Update a constraint (Remove + re-add)\n updateConstraint: function (name, parameters, priority) {\n return this.removeConstraint(name)\n .addConstraint(name, parameters, priority);\n },\n\n // # Internals\n\n // Internal only.\n // Bind constraints from config + options + DOM\n _bindConstraints: function () {\n var constraints = [];\n var constraintsByName = {};\n\n // clean all existing DOM constraints to only keep javascript user constraints\n for (var i = 0; i < this.constraints.length; i++)\n if (false === this.constraints[i].isDomConstraint) {\n constraints.push(this.constraints[i]);\n constraintsByName[this.constraints[i].name] = this.constraints[i];\n }\n\n this.constraints = constraints;\n this.constraintsByName = constraintsByName;\n\n // then re-add Parsley DOM-API constraints\n for (var name in this.options)\n this.addConstraint(name, this.options[name], undefined, true);\n\n // finally, bind special HTML5 constraints\n return this._bindHtml5Constraints();\n },\n\n // Internal only.\n // Bind specific HTML5 constraints to be HTML5 compliant\n _bindHtml5Constraints: function () {\n // html5 required\n if (null !== this.element.getAttribute('required'))\n this.addConstraint('required', true, undefined, true);\n\n // html5 pattern\n if (null !== this.element.getAttribute('pattern'))\n this.addConstraint('pattern', this.element.getAttribute('pattern'), undefined, true);\n\n // range\n let min = this.element.getAttribute('min');\n let max = this.element.getAttribute('max');\n if (null !== min && null !== max)\n this.addConstraint('range', [min, max], undefined, true);\n\n // HTML5 min\n else if (null !== min)\n this.addConstraint('min', min, undefined, true);\n\n // HTML5 max\n else if (null !== max)\n this.addConstraint('max', max, undefined, true);\n\n\n // length\n if (null !== this.element.getAttribute('minlength') && null !== this.element.getAttribute('maxlength'))\n this.addConstraint('length', [this.element.getAttribute('minlength'), this.element.getAttribute('maxlength')], undefined, true);\n\n // HTML5 minlength\n else if (null !== this.element.getAttribute('minlength'))\n this.addConstraint('minlength', this.element.getAttribute('minlength'), undefined, true);\n\n // HTML5 maxlength\n else if (null !== this.element.getAttribute('maxlength'))\n this.addConstraint('maxlength', this.element.getAttribute('maxlength'), undefined, true);\n\n\n // html5 types\n var type = Utils.getType(this.element);\n\n // Small special case here for HTML5 number: integer validator if step attribute is undefined or an integer value, number otherwise\n if ('number' === type) {\n return this.addConstraint('type', ['number', {\n step: this.element.getAttribute('step') || '1',\n base: min || this.element.getAttribute('value')\n }], undefined, true);\n // Regular other HTML5 supported types\n } else if (/^(email|url|range|date)$/i.test(type)) {\n return this.addConstraint('type', type, undefined, true);\n }\n return this;\n },\n\n // Internal only.\n // Field is required if have required constraint without `false` value\n _isRequired: function () {\n if ('undefined' === typeof this.constraintsByName.required)\n return false;\n\n return false !== this.constraintsByName.required.requirements;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n _trigger: function (eventName) {\n return this.trigger('field:' + eventName);\n },\n\n // Internal only\n // Handles whitespace in a value\n // Use `data-parsley-whitespace=\"squish\"` to auto squish input value\n // Use `data-parsley-whitespace=\"trim\"` to auto trim input value\n _handleWhitespace: function (value) {\n if (true === this.options.trimValue)\n Utils.warnOnce('data-parsley-trim-value=\"true\" is deprecated, please use data-parsley-whitespace=\"trim\"');\n\n if ('squish' === this.options.whitespace)\n value = value.replace(/\\s{2,}/g, ' ');\n\n if (('trim' === this.options.whitespace) || ('squish' === this.options.whitespace) || (true === this.options.trimValue))\n value = Utils.trimString(value);\n\n return value;\n },\n\n _isDateInput: function() {\n var c = this.constraintsByName.type;\n return c && c.requirements === 'date';\n },\n\n // Internal only.\n // Returns the constraints, grouped by descending priority.\n // The result is thus an array of arrays of constraints.\n _getGroupedConstraints: function () {\n if (false === this.options.priorityEnabled)\n return [this.constraints];\n\n var groupedConstraints = [];\n var index = {};\n\n // Create array unique of priorities\n for (var i = 0; i < this.constraints.length; i++) {\n var p = this.constraints[i].priority;\n if (!index[p])\n groupedConstraints.push(index[p] = []);\n index[p].push(this.constraints[i]);\n }\n // Sort them by priority DESC\n groupedConstraints.sort(function (a, b) { return b[0].priority - a[0].priority; });\n\n return groupedConstraints;\n }\n\n};\n\nexport default Field;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Multiple = function () {\n this.__class__ = 'FieldMultiple';\n};\n\nMultiple.prototype = {\n // Add new `$element` sibling for multiple field\n addElement: function ($element) {\n this.$elements.push($element);\n\n return this;\n },\n\n // See `Field._refreshConstraints()`\n _refreshConstraints: function () {\n var fieldConstraints;\n\n this.constraints = [];\n\n // Select multiple special treatment\n if (this.element.nodeName === 'SELECT') {\n this.actualizeOptions()._bindConstraints();\n\n return this;\n }\n\n // Gather all constraints for each input in the multiple group\n for (var i = 0; i < this.$elements.length; i++) {\n\n // Check if element have not been dynamically removed since last binding\n if (!$('html').has(this.$elements[i]).length) {\n this.$elements.splice(i, 1);\n continue;\n }\n\n fieldConstraints = this.$elements[i].data('FieldMultiple')._refreshConstraints().constraints;\n\n for (var j = 0; j < fieldConstraints.length; j++)\n this.addConstraint(fieldConstraints[j].name, fieldConstraints[j].requirements, fieldConstraints[j].priority, fieldConstraints[j].isDomConstraint);\n }\n\n return this;\n },\n\n // See `Field.getValue()`\n getValue: function () {\n // Value could be overriden in DOM\n if ('function' === typeof this.options.value)\n return this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n return this.options.value;\n\n // Radio input case\n if (this.element.nodeName === 'INPUT') {\n var type = Utils.getType(this.element);\n if (type === 'radio')\n return this._findRelated().filter(':checked').val() || '';\n\n // checkbox input case\n if (type === 'checkbox') {\n var values = [];\n\n this._findRelated().filter(':checked').each(function () {\n values.push($(this).val());\n });\n\n return values;\n }\n }\n\n // Select multiple case\n if (this.element.nodeName === 'SELECT' && null === this.$element.val())\n return [];\n\n // Default case that should never happen\n return this.$element.val();\n },\n\n _init: function () {\n this.$elements = [this.$element];\n\n return this;\n }\n};\n\nexport default Multiple;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\n\nvar Factory = function (element, options, parsleyFormInstance) {\n this.element = element;\n this.$element = $(element);\n\n // If the element has already been bound, returns its saved Parsley instance\n var savedparsleyFormInstance = this.$element.data('Parsley');\n if (savedparsleyFormInstance) {\n\n // If the saved instance has been bound without a Form parent and there is one given in this call, add it\n if ('undefined' !== typeof parsleyFormInstance && savedparsleyFormInstance.parent === window.Parsley) {\n savedparsleyFormInstance.parent = parsleyFormInstance;\n savedparsleyFormInstance._resetOptions(savedparsleyFormInstance.options);\n }\n\n if ('object' === typeof options) {\n Object.assign(savedparsleyFormInstance.options, options);\n }\n\n return savedparsleyFormInstance;\n }\n\n // Parsley must be instantiated with a DOM element or jQuery $element\n if (!this.$element.length)\n throw new Error('You must bind Parsley on an existing element.');\n\n if ('undefined' !== typeof parsleyFormInstance && 'Form' !== parsleyFormInstance.__class__)\n throw new Error('Parent instance must be a Form instance');\n\n this.parent = parsleyFormInstance || window.Parsley;\n return this.init(options);\n};\n\nFactory.prototype = {\n init: function (options) {\n this.__class__ = 'Parsley';\n this.__version__ = 'VERSION';\n this.__id__ = Utils.generateID();\n\n // Pre-compute options\n this._resetOptions(options);\n\n // A Form instance is obviously a `` element but also every node that is not an input and has the `data-parsley-validate` attribute\n if (this.element.nodeName === 'FORM' || (Utils.checkAttr(this.element, this.options.namespace, 'validate') && !this.$element.is(this.options.inputs)))\n return this.bind('parsleyForm');\n\n // Every other element is bound as a `Field` or `FieldMultiple`\n return this.isMultiple() ? this.handleMultiple() : this.bind('parsleyField');\n },\n\n isMultiple: function () {\n var type = Utils.getType(this.element);\n return ((type === 'radio' || type === 'checkbox') ||\n (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')));\n },\n\n // Multiples fields are a real nightmare :(\n // Maybe some refactoring would be appreciated here...\n handleMultiple: function () {\n var name;\n var multiple;\n var parsleyMultipleInstance;\n\n // Handle multiple name\n this.options.multiple = this.options.multiple ||\n (name = this.element.getAttribute('name')) ||\n this.element.getAttribute('id');\n\n // Special select multiple input\n if (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')) {\n this.options.multiple = this.options.multiple || this.__id__;\n return this.bind('parsleyFieldMultiple');\n\n // Else for radio / checkboxes, we need a `name` or `data-parsley-multiple` to properly bind it\n } else if (!this.options.multiple) {\n Utils.warn('To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.', this.$element);\n return this;\n }\n\n // Remove special chars\n this.options.multiple = this.options.multiple.replace(/(:|\\.|\\[|\\]|\\{|\\}|\\$)/g, '');\n\n // Add proper `data-parsley-multiple` to siblings if we have a valid multiple name\n if (name) {\n $('input[name=\"' + name + '\"]').each((i, input) => {\n var type = Utils.getType(input);\n if ((type === 'radio' || type === 'checkbox'))\n input.setAttribute(this.options.namespace + 'multiple', this.options.multiple);\n });\n }\n\n // Check here if we don't already have a related multiple instance saved\n var $previouslyRelated = this._findRelated();\n for (var i = 0; i < $previouslyRelated.length; i++) {\n parsleyMultipleInstance = $($previouslyRelated.get(i)).data('Parsley');\n if ('undefined' !== typeof parsleyMultipleInstance) {\n\n if (!this.$element.data('FieldMultiple')) {\n parsleyMultipleInstance.addElement(this.$element);\n }\n\n break;\n }\n }\n\n // Create a secret Field instance for every multiple field. It will be stored in `data('FieldMultiple')`\n // And will be useful later to access classic `Field` stuff while being in a `FieldMultiple` instance\n this.bind('parsleyField', true);\n\n return parsleyMultipleInstance || this.bind('parsleyFieldMultiple');\n },\n\n // Return proper `Form`, `Field` or `FieldMultiple`\n bind: function (type, doNotStore) {\n var parsleyInstance;\n\n switch (type) {\n case 'parsleyForm':\n parsleyInstance = $.extend(\n new Form(this.element, this.domOptions, this.options),\n new Base(),\n window.ParsleyExtend\n )._bindFields();\n break;\n case 'parsleyField':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Base(),\n window.ParsleyExtend\n );\n break;\n case 'parsleyFieldMultiple':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Multiple(),\n new Base(),\n window.ParsleyExtend\n )._init();\n break;\n default:\n throw new Error(type + 'is not a supported Parsley type');\n }\n\n if (this.options.multiple)\n Utils.setAttr(this.element, this.options.namespace, 'multiple', this.options.multiple);\n\n if ('undefined' !== typeof doNotStore) {\n this.$element.data('FieldMultiple', parsleyInstance);\n\n return parsleyInstance;\n }\n\n // Store the freshly bound instance in a DOM element for later access using jQuery `data()`\n this.$element.data('Parsley', parsleyInstance);\n\n // Tell the world we have a new Form or Field instance!\n parsleyInstance._actualizeTriggers();\n parsleyInstance._trigger('init');\n\n return parsleyInstance;\n }\n};\n\nexport default Factory;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Base from './base';\nimport ValidatorRegistry from './validator_registry';\nimport UI from './ui';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\nimport Factory from './factory';\n\nvar vernums = $.fn.jquery.split('.');\nif (parseInt(vernums[0]) <= 1 && parseInt(vernums[1]) < 8) {\n throw \"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.\";\n}\nif (!vernums.forEach) {\n Utils.warn('Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim');\n}\n// Inherit `on`, `off` & `trigger` to Parsley:\nvar Parsley = Object.assign(new Base(), {\n element: document,\n $element: $(document),\n actualizeOptions: null,\n _resetOptions: null,\n Factory: Factory,\n version: 'VERSION'\n });\n\n// Supplement Field and Form with Base\n// This way, the constructors will have access to those methods\nObject.assign(Field.prototype, UI.Field, Base.prototype);\nObject.assign(Form.prototype, UI.Form, Base.prototype);\n// Inherit actualizeOptions and _resetOptions:\nObject.assign(Factory.prototype, Base.prototype);\n\n// ### jQuery API\n// `$('.elem').parsley(options)` or `$('.elem').psly(options)`\n$.fn.parsley = $.fn.psly = function (options) {\n if (this.length > 1) {\n var instances = [];\n\n this.each(function () {\n instances.push($(this).parsley(options));\n });\n\n return instances;\n }\n\n // Return undefined if applied to non existing DOM element\n if (this.length == 0) {\n return;\n }\n\n return new Factory(this[0], options);\n};\n\n// ### Field and Form extension\n// Ensure the extension is now defined if it wasn't previously\nif ('undefined' === typeof window.ParsleyExtend)\n window.ParsleyExtend = {};\n\n// ### Parsley config\n// Inherit from ParsleyDefault, and copy over any existing values\nParsley.options = Object.assign(Utils.objectCreate(Defaults), window.ParsleyConfig);\nwindow.ParsleyConfig = Parsley.options; // Old way of accessing global options\n\n// ### Globals\nwindow.Parsley = window.psly = Parsley;\nParsley.Utils = Utils;\nwindow.ParsleyUtils = {};\n$.each(Utils, (key, value) => {\n if ('function' === typeof value) {\n window.ParsleyUtils[key] = (...args) => {\n Utils.warnOnce('Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead.');\n return Utils[key](...args);\n };\n }\n});\n\n// ### Define methods that forward to the registry, and deprecate all access except through window.Parsley\nvar registry = window.Parsley._validatorRegistry = new ValidatorRegistry(window.ParsleyConfig.validators, window.ParsleyConfig.i18n);\nwindow.ParsleyValidator = {};\n$.each('setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator hasValidator'.split(' '), function (i, method) {\n window.Parsley[method] = (...args) => registry[method](...args);\n window.ParsleyValidator[method] = function () {\n Utils.warnOnce(`Accessing the method '${method}' through Validator is deprecated. Simply call 'window.Parsley.${method}(...)'`);\n return window.Parsley[method](...arguments);\n };\n});\n\n// ### UI\n// Deprecated global object\nwindow.Parsley.UI = UI;\nwindow.ParsleyUI = {\n removeError: function (instance, name, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance.removeError(name, {updateClass});\n },\n getErrorsMessages: function (instance) {\n Utils.warnOnce(`Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly.`);\n return instance.getErrorsMessages();\n }\n};\n$.each('addError updateError'.split(' '), function (i, method) {\n window.ParsleyUI[method] = function (instance, name, message, assert, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call '${method}' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance[method](name, {message, assert, updateClass});\n };\n});\n\n// ### PARSLEY auto-binding\n// Prevent it by setting `ParsleyConfig.autoBind` to `false`\nif (false !== window.ParsleyConfig.autoBind) {\n $(function () {\n // Works only on `data-parsley-validate`.\n if ($('[data-parsley-validate]').length)\n $('[data-parsley-validate]').parsley();\n });\n}\n\nexport default Parsley;\n","import $ from 'jquery';\nimport Field from './field';\nimport Form from './form';\nimport Utils from './utils';\n\nvar o = $({});\nvar deprecated = function () {\n Utils.warnOnce(\"Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley\");\n};\n\n// Returns an event handler that calls `fn` with the arguments it expects\nfunction adapt(fn, context) {\n // Store to allow unbinding\n if (!fn.parsleyAdaptedCallback) {\n fn.parsleyAdaptedCallback = function () {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift(this);\n fn.apply(context || o, args);\n };\n }\n return fn.parsleyAdaptedCallback;\n}\n\nvar eventPrefix = 'parsley:';\n// Converts 'parsley:form:validate' into 'form:validate'\nfunction eventName(name) {\n if (name.lastIndexOf(eventPrefix, 0) === 0)\n return name.substr(eventPrefix.length);\n return name;\n}\n\n// $.listen is deprecated. Use Parsley.on instead.\n$.listen = function (name, callback) {\n var context;\n deprecated();\n if ('object' === typeof arguments[1] && 'function' === typeof arguments[2]) {\n context = arguments[1];\n callback = arguments[2];\n }\n\n if ('function' !== typeof callback)\n throw new Error('Wrong parameters');\n\n window.Parsley.on(eventName(name), adapt(callback, context));\n};\n\n$.listenTo = function (instance, name, fn) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong parameters');\n\n instance.on(eventName(name), adapt(fn));\n};\n\n$.unsubscribe = function (name, fn) {\n deprecated();\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong arguments');\n window.Parsley.off(eventName(name), fn.parsleyAdaptedCallback);\n};\n\n$.unsubscribeTo = function (instance, name) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n instance.off(eventName(name));\n};\n\n$.unsubscribeAll = function (name) {\n deprecated();\n window.Parsley.off(eventName(name));\n $('form,input,textarea,select').each(function () {\n var instance = $(this).data('Parsley');\n if (instance) {\n instance.off(eventName(name));\n }\n });\n};\n\n// $.emit is deprecated. Use jQuery events instead.\n$.emit = function (name, instance) {\n deprecated();\n var instanceGiven = (instance instanceof Field) || (instance instanceof Form);\n var args = Array.prototype.slice.call(arguments, instanceGiven ? 2 : 1);\n args.unshift(eventName(name));\n if (!instanceGiven) {\n instance = window.Parsley;\n }\n instance.trigger(...args);\n};\n\nexport default {};\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\n\nimport Parsley from './main';\n\n$.extend(true, Parsley, {\n asyncValidators: {\n 'default': {\n fn: function (xhr) {\n // By default, only status 2xx are deemed successful.\n // Note: we use status instead of state() because responses with status 200\n // but invalid messages (e.g. an empty body for content type set to JSON) will\n // result in state() === 'rejected'.\n return xhr.status >= 200 && xhr.status < 300;\n },\n url: false\n },\n reverse: {\n fn: function (xhr) {\n // If reverse option is set, a failing ajax request is considered successful\n return xhr.status < 200 || xhr.status >= 300;\n },\n url: false\n }\n },\n\n addAsyncValidator: function (name, fn, url, options) {\n Parsley.asyncValidators[name] = {\n fn: fn,\n url: url || false,\n options: options || {}\n };\n\n return this;\n }\n\n});\n\nParsley.addValidator('remote', {\n requirementType: {\n '': 'string',\n 'validator': 'string',\n 'reverse': 'boolean',\n 'options': 'object'\n },\n\n validateString: function (value, url, options, instance) {\n var data = {};\n var ajaxOptions;\n var csr;\n var validator = options.validator || (true === options.reverse ? 'reverse' : 'default');\n\n if ('undefined' === typeof Parsley.asyncValidators[validator])\n throw new Error('Calling an undefined async validator: `' + validator + '`');\n\n url = Parsley.asyncValidators[validator].url || url;\n\n // Fill current value\n if (url.indexOf('{value}') > -1) {\n url = url.replace('{value}', encodeURIComponent(value));\n } else {\n data[instance.element.getAttribute('name') || instance.element.getAttribute('id')] = value;\n }\n\n // Merge options passed in from the function with the ones in the attribute\n var remoteOptions = $.extend(true, options.options || {} , Parsley.asyncValidators[validator].options);\n\n // All `$.ajax(options)` could be overridden or extended directly from DOM in `data-parsley-remote-options`\n ajaxOptions = $.extend(true, {}, {\n url: url,\n data: data,\n type: 'GET'\n }, remoteOptions);\n\n // Generate store key based on ajax options\n instance.trigger('field:ajaxoptions', instance, ajaxOptions);\n\n csr = $.param(ajaxOptions);\n\n // Initialise querry cache\n if ('undefined' === typeof Parsley._remoteCache)\n Parsley._remoteCache = {};\n\n // Try to retrieve stored xhr\n var xhr = Parsley._remoteCache[csr] = Parsley._remoteCache[csr] || $.ajax(ajaxOptions);\n\n var handleXhr = function () {\n var result = Parsley.asyncValidators[validator].fn.call(instance, xhr, url, options);\n if (!result) // Map falsy results to rejected promise\n result = $.Deferred().reject();\n return $.when(result);\n };\n\n return xhr.then(handleXhr, handleXhr);\n },\n\n priority: -1\n});\n\nParsley.on('form:submit', function () {\n Parsley._remoteCache = {};\n});\n\nBase.prototype.addAsyncValidator = function () {\n Utils.warnOnce('Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`');\n return Parsley.addAsyncValidator(...arguments);\n};\n","// This is included with the Parsley library itself,\n// thus there is no use in adding it to your project.\nimport Parsley from '../parsley/main';\n\nParsley.addMessages('en', {\n defaultMessage: \"This value seems to be invalid.\",\n type: {\n email: \"This value should be a valid email.\",\n url: \"This value should be a valid url.\",\n number: \"This value should be a valid number.\",\n integer: \"This value should be a valid integer.\",\n digits: \"This value should be digits.\",\n alphanum: \"This value should be alphanumeric.\"\n },\n notblank: \"This value should not be blank.\",\n required: \"This value is required.\",\n pattern: \"This value seems to be invalid.\",\n min: \"This value should be greater than or equal to %s.\",\n max: \"This value should be lower than or equal to %s.\",\n range: \"This value should be between %s and %s.\",\n minlength: \"This value is too short. It should have %s characters or more.\",\n maxlength: \"This value is too long. It should have %s characters or fewer.\",\n length: \"This value length is invalid. It should be between %s and %s characters long.\",\n mincheck: \"You must select at least %s choices.\",\n maxcheck: \"You must select %s choices or fewer.\",\n check: \"You must select between %s and %s choices.\",\n equalto: \"This value should be the same.\",\n euvatin: \"It's not a valid VAT Identification Number.\",\n});\n\nParsley.setLocale('en');\n","/**\n * inputevent - Alleviate browser bugs for input events\n * https://github.com/marcandre/inputevent\n * @version v0.0.3 - (built Thu, Apr 14th 2016, 5:58 pm)\n * @author Marc-Andre Lafortune \n * @license MIT\n */\n\nimport $ from 'jquery';\n\nfunction InputEvent() {\n let globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n Object.assign(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: evt => {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: evt => {\n if (this.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: evt => {\n if (this.isNativeEvent(evt)) {\n this.behavesOk(evt);\n $(document)\n .on('change.inputevent', evt.data.selector, this.fakeInputEvent);\n this.fakeInputEvent(evt);\n }\n },\n\n behavesOk: evt => {\n if (this.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, this.behavesOk)\n .off('change.inputevent', evt.data.selector, this.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: () => {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n for (let selector of ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]']) {\n $(document)\n .on('input.inputevent', selector, {selector}, this.behavesOk)\n .on('change.inputevent', selector, {selector}, this.misbehaves);\n }\n },\n\n uninstall: () => {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n};\n\nexport default new InputEvent();\n","import $ from 'jquery';\nimport Parsley from './parsley/main';\nimport './parsley/pubsub';\nimport './parsley/remote';\nimport './i18n/en';\nimport inputevent from './vendor/inputevent';\n\ninputevent.install();\n\nexport default Parsley;\n"],"names":["globalID","pastWarnings","Utils","attr","element","namespace","obj","i","attribute","attributes","regex","RegExp","hasOwnProperty","length","specified","test","name","camelize","slice","deserializeValue","value","checkAttr","hasAttribute","setAttr","setAttribute","dasherize","String","getType","getAttribute","generateID","num","isNaN","Number","JSON","parse","e","str","replace","match","chr","toUpperCase","toLowerCase","warn","window","console","arguments","warnOnce","msg","_resetWarnings","trimString","string","date","parsed","map","x","parseInt","_","year","month","day","Date","getFullYear","getMonth","getDate","integer","number","parseFloat","_boolean","object","regexp","flags","parseRequirement","requirementType","converter","converted","namespaceEvents","events","split","$","evt","join","difference","array","remove","result","each","elem","indexOf","push","all","promises","when","objectCreate","Object","create","prototype","Error","TypeError","_SubmitSelector","Defaults","inputs","excluded","priorityEnabled","multiple","group","uiEnabled","validationThreshold","focus","trigger","triggerAfterFailure","errorClass","successClass","classHandler","Field","errorsContainer","errorsWrapper","errorTemplate","Base","__id__","asyncSupport","_pipeAccordingToValidationResult","pipe","r","Deferred","validationResult","reject","resolve","promise","actualizeOptions","options","domOptions","parent","_resetOptions","initOptions","_listeners","on","fn","queue","subscribe","listenTo","off","splice","unsubscribe","unsubscribeTo","target","extraArg","call","asyncIsValid","force","whenValid","_findRelated","querySelectorAll","$element","convertArrayRequirement","m","values","convertExtraOptionRequirement","requirementSpec","extraOptionReader","main","extra","key","Validator","spec","extend","validate","requirementFirstArg","Array","isArray","validateMultiple","instance","validateDate","_isDateInput","validateNumber","validateString","parseRequirements","requirements","type","isPlainObject","priority","ValidatorRegistry","validators","catalog","__class__","locale","init","typeTesters","email","digits","alphanum","url","range","decimalPlaces","Math","max","parseArguments","args","operatorToValidator","operator","requirementsAndInput","pop","comparisonOperator","addValidator","Parsley","setLocale","addCatalog","messages","set","addMessage","message","addMessages","nameMessageObject","arg1","arg2","_setValidator","hasValidator","updateValidator","removeValidator","validator","getErrorMessage","constraint","typeMessages","formatMessage","defaultMessage","en","parameters","notblank","required","step","base","tester","nb","decimals","toInt","f","round","pow","pattern","minlength","requirement","maxlength","min","mincheck","maxcheck","check","equalto","refOrValue","$reference","val","euvatin","re","UI","diffResults","newResult","oldResult","deep","added","kept","found","j","assert","removed","Form","_actualizeTriggers","onSubmitValidate","onSubmitButton","_focusedField","fields","field","noFocus","_destroyUI","_reflowUI","_buildUI","_ui","diff","lastValidationResult","_manageStatusClass","_manageErrorsMessages","_failedOnce","getErrorsMessages","errorMessage","_getErrorMessage","addError","updateClass","_addError","_errorClass","updateError","_updateError","removeError","_removeError","hasConstraints","needsValidation","_successClass","_resetClass","errorsMessagesDisabled","_insertErrorWrapper","$errorsWrapper","find","append","addClass","$errorClassHandler","errorsWrapperId","html","removeAttr","removeClass","customConstraintErrorMessage","_manageClassHandler","validationInformationVisible","$handlerFunction","$handler","jQuery","_inputHolder","nodeName","$errorsContainer","after","$toBind","_validateIfNeeded","event","getValue","debounce","clearTimeout","_debounced","setTimeout","_resetUI","children","statusMapping","pending","resolved","rejected","parsley","submitSource","_submitSource","prop","_remoteCache","whenValidate","state","_trigger","stopImmediatePropagation","preventDefault","done","_submit","currentTarget","$synthetic","appendTo","Event","submitEvent","_refreshFields","_withoutReactualizingFormOptions","fail","always","isValid","refresh","reset","destroy","removeData","_bindFields","oldFields","fieldsMappedById","not","fieldInstance","Factory","uniqueId","oldActualizeOptions","eventName","Constraint","parsleyField","isDomConstraint","validatorSpec","_validatorRegistry","_parseRequirements","capitalize","cap","requirementList","parsleyFormInstance","constraints","constraintsByName","_bindConstraints","_isInGroup","_refreshed","_isRequired","validateIfEmpty","inArray","groupedConstraints","_getGroupedConstraints","_validateConstraint","_handleWhitespace","_refreshConstraints","refreshConstraints","addConstraint","removeConstraint","updateConstraint","undefined","_bindHtml5Constraints","trimValue","whitespace","c","index","p","sort","a","b","Multiple","addElement","$elements","fieldConstraints","has","data","filter","_init","savedparsleyFormInstance","__version__","is","bind","isMultiple","handleMultiple","parsleyMultipleInstance","input","$previouslyRelated","get","doNotStore","parsleyInstance","ParsleyExtend","vernums","jquery","forEach","document","version","psly","instances","ParsleyConfig","ParsleyUtils","registry","i18n","ParsleyValidator","method","ParsleyUI","doNotUpdateClass","autoBind","o","deprecated","adapt","context","parsleyAdaptedCallback","unshift","apply","eventPrefix","lastIndexOf","substr","listen","callback","unsubscribeAll","emit","instanceGiven","asyncValidators","xhr","status","reverse","addAsyncValidator","ajaxOptions","csr","encodeURIComponent","remoteOptions","param","ajax","handleXhr","then","InputEvent","globals","global","isNativeEvent","originalEvent","isTrusted","fakeInputEvent","misbehaves","behavesOk","selector","install","inputEventPatched","uninstall","inputevent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA,IAAIA,QAAQ,GAAG,CAAf;EACA,IAAIC,YAAY,GAAG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,EAARA;EAAD,SADpC,EACgD,KAAI,CAACD,SADrD,EAEGnV,EAFH,CAEM,mBAFN,EAE2BoV,QAF3B,EAEqC;EAACA,UAAAA,QAAQ,EAARA;EAAD,SAFrC,EAEiD,KAAI,CAACF,UAFtD;EAGD;EACF,KAzCiB;EA2ClBK,IAAAA,SAAS,EAAE,qBAAM;EACf,aAAOX,OAAO,CAACU,iBAAf;EACA/Y,MAAAA,CAAC,CAAC2V,QAAD,CAAD,CAAY7R,GAAZ,CAAgB,aAAhB;EACD;EA9CiB,GAApB;EAiDD;AAED,mBAAe,IAAIsU,UAAJ,EAAf;;EC3DAa,UAAU,CAACH,OAAX;;;;;;;;"} \ No newline at end of file diff --git a/dist/parsley.min.js b/dist/parsley.min.js index 96a781bfc..09a24b301 100644 --- a/dist/parsley.min.js +++ b/dist/parsley.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):t.parsley=e(t.jQuery)}(this,function(h){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){return(o=Object.assign||function(t){for(var e=1;e',errorTemplate:"
    • "},s=function(){this.__id__=d.generateID()};s.prototype={asyncSupport:!0,_pipeAccordingToValidationResult:function(){var e=this,t=function(){var t=h.Deferred();return!0!==e.validationResult&&t.reject(),t.resolve().promise()};return[t,t]},actualizeOptions:function(){return d.attr(this.element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(t){for(var e in this.domOptions=d.objectCreate(this.parent.options),this.options=d.objectCreate(this.domOptions),t)t.hasOwnProperty(e)&&(this.options[e]=t[e]);this.actualizeOptions()},_listeners:null,on:function(t,e){return this._listeners=this._listeners||{},(this._listeners[t]=this._listeners[t]||[]).push(e),this},subscribe:function(t,e){h.listenTo(this,t.toLowerCase(),e)},off:function(t,e){var i=this._listeners&&this._listeners[t];if(i)if(e)for(var n=i.length;n--;)i[n]===e&&i.splice(n,1);else delete this._listeners[t];return this},unsubscribe:function(t,e){h.unsubscribeTo(this,t.toLowerCase())},trigger:function(t,e,i){e=e||this;var n,r=this._listeners&&this._listeners[t];if(r)for(var s=r.length;s--;)if(!1===(n=r[s].call(e,e,i)))return n;return!this.parent||this.parent.trigger(t,e,i)},asyncIsValid:function(t,e){return d.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:t,force:e})},_findRelated:function(){return this.options.multiple?h(this.parent.element.querySelectorAll("[".concat(this.options.namespace,'multiple="').concat(this.options.multiple,'"]'))):this.$element}};var c=function(t){h.extend(!0,this,t)};c.prototype={validate:function(t,e){if(this.fn)return 3u)return!1;var d=function(t){return Math.round(t*Math.pow(10,u))};if((d(l)-d(a))%d(r)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(t,e){return!t||e.test(t)},requirementType:"regexp",priority:64},minlength:{validateString:function(t,e){return!t||t.length>=e},requirementType:"integer",priority:30},maxlength:{validateString:function(t,e){return t.length<=e},requirementType:"integer",priority:30},length:{validateString:function(t,e,i){return!t||t.length>=e&&t.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(t,e){return t.length>=e},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(t,e){return t.length<=e},requirementType:"integer",priority:30},check:{validateMultiple:function(t,e,i){return t.length>=e&&t.length<=i},requirementType:["integer","integer"],priority:30},min:g(function(t,e){return e<=t}),max:g(function(t,e){return t<=e}),range:g(function(t,e,i){return e<=t&&t<=i}),equalto:{validateString:function(t,e){if(!t)return!0;var i=h(e);return i.length?t===i.val():t===e},priority:256},euvatin:{validateString:function(t,e){if(!t)return!0;return/^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/.test(t)},priority:30}}};var v={};v.Form={_actualizeTriggers:function(){var e=this;this.$element.on("submit.Parsley",function(t){e.onSubmitValidate(t)}),this.$element.on("click.Parsley",d._SubmitSelector,function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.element.setAttribute("novalidate","")},focus:function(){if(!(this._focusedField=null)===this.validationResult||"none"===this.options.focus)return null;for(var t=0;t').appendTo(this.$element)),e.attr({name:t.getAttribute("name"),value:t.getAttribute("value")})}this.$element.trigger(o(h.Event("submit"),{parsley:!0}))}},validate:function(t){if(1<=arguments.length&&!h.isPlainObject(t)){d.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var e=Array.prototype.slice.call(arguments);t={group:e[0],force:e[1],event:e[2]}}return _[this.whenValidate(t).state()]},whenValidate:function(){var t,e=this,i=0',errorTemplate:"
    • "};r.prototype={asyncSupport:!0,_pipeAccordingToValidationResult:function(){function t(){var t=h.Deferred();return!0!==e.validationResult&&t.reject(),t.resolve().promise()}var e=this;return[t,t]},actualizeOptions:function(){return d.attr(this.element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(t){for(var e in this.domOptions=d.objectCreate(this.parent.options),this.options=d.objectCreate(this.domOptions),t)t.hasOwnProperty(e)&&(this.options[e]=t[e]);this.actualizeOptions()},_listeners:null,on:function(t,e){return this._listeners=this._listeners||{},(this._listeners[t]=this._listeners[t]||[]).push(e),this},subscribe:function(t,e){h.listenTo(this,t.toLowerCase(),e)},off:function(t,e){var i=this._listeners&&this._listeners[t];if(i)if(e)for(var r=i.length;r--;)i[r]===e&&i.splice(r,1);else delete this._listeners[t];return this},unsubscribe:function(t){h.unsubscribeTo(this,t.toLowerCase())},trigger:function(t,e,i){e=e||this;var r,n=this._listeners&&this._listeners[t];if(n)for(var s=n.length;s--;)if(!1===(r=n[s].call(e,e,i)))return r;return!this.parent||this.parent.trigger(t,e,i)},asyncIsValid:function(t,e){return d.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:t,force:e})},_findRelated:function(){return this.options.multiple?h(this.parent.element.querySelectorAll("[".concat(this.options.namespace,'multiple="').concat(this.options.multiple,'"]'))):this.$element}};function c(t){h.extend(!0,this,t)}c.prototype={validate:function(t,e){if(this.fn)return 3d)return!1;var h=function(t){return Math.round(t*Math.pow(10,d))};if((h(u)-h(o))%h(s)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(t,e){return!t||e.test(t)},requirementType:"regexp",priority:64},minlength:{validateString:function(t,e){return!t||t.length>=e},requirementType:"integer",priority:30},maxlength:{validateString:function(t,e){return t.length<=e},requirementType:"integer",priority:30},length:{validateString:function(t,e,i){return!t||t.length>=e&&t.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(t,e){return t.length>=e},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(t,e){return t.length<=e},requirementType:"integer",priority:30},check:{validateMultiple:function(t,e,i){return t.length>=e&&t.length<=i},requirementType:["integer","integer"],priority:30},min:g(function(t,e){return e<=t}),max:g(function(t,e){return t<=e}),range:g(function(t,e,i){return e<=t&&t<=i}),equalto:{validateString:function(t,e){if(!t)return!0;var i=h(e);return i.length?t===i.val():t===e},priority:256},euvatin:{validateString:function(t){if(!t)return!0;return/^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/.test(t)},priority:30}}};var v={};v.Form={_actualizeTriggers:function(){var e=this;this.$element.on("submit.Parsley",function(t){e.onSubmitValidate(t)}),this.$element.on("click.Parsley",d._SubmitSelector,function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.element.setAttribute("novalidate","")},focus:function(){if(!(this._focusedField=null)===this.validationResult||"none"===this.options.focus)return null;for(var t=0;t').appendTo(this.$element)),e.attr({name:t.getAttribute("name"),value:t.getAttribute("value")})}this.$element.trigger(l(h.Event("submit"),{parsley:!0}))}},validate:function(t){if(1<=arguments.length&&!h.isPlainObject(t)){d.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var e=Array.prototype.slice.call(arguments);t={group:e[0],force:e[1],event:e[2]}}return _[this.whenValidate(t).state()]},whenValidate:function(t){var e,i=this,r=0 parseInt(x, 10));\n let date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day)\n return null;\n return date;\n },\n string: function(string) {\n return string;\n },\n integer: function(string) {\n if (isNaN(string))\n return null;\n return parseInt(string, 10);\n },\n number: function(string) {\n if (isNaN(string))\n throw null;\n return parseFloat(string);\n },\n 'boolean': function _boolean(string) {\n return !(/^\\s*false\\s*$/i.test(string));\n },\n object: function(string) {\n return Utils.deserializeValue(string);\n },\n regexp: function(regexp) {\n var flags = '';\n\n // Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern\n if (/^\\/.*\\/(?:[gimy]*)$/.test(regexp)) {\n // Replace the regexp literal string with the first match group: ([gimy]*)\n // If no flag is present, this will be a blank string\n flags = regexp.replace(/.*\\/([gimy]*)$/, '$1');\n // Again, replace the regexp literal string with the first match group:\n // everything excluding the opening and closing slashes and the flags\n regexp = regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');\n } else {\n // Anchor regexp:\n regexp = '^' + regexp + '$';\n }\n return new RegExp(regexp, flags);\n }\n },\n\n parseRequirement: function(requirementType, string) {\n var converter = this.parse[requirementType || 'string'];\n if (!converter)\n throw 'Unknown requirement specification: \"' + requirementType + '\"';\n let converted = converter(string);\n if (converted === null)\n throw `Requirement is not a ${requirementType}: \"${string}\"`;\n return converted;\n },\n\n namespaceEvents: function(events, namespace) {\n events = this.trimString(events || '').split(/\\s+/);\n if (!events[0])\n return '';\n return $.map(events, evt => `${evt}.${namespace}`).join(' ');\n },\n\n difference: function(array, remove) {\n // This is O(N^2), should be optimized\n let result = [];\n $.each(array, (_, elem) => {\n if (remove.indexOf(elem) == -1)\n result.push(elem);\n });\n return result;\n },\n\n // Alter-ego to native Promise.all, but for jQuery\n all: function(promises) {\n // jQuery treats $.when() and $.when(singlePromise) differently; let's avoid that and add spurious elements\n return $.when(...promises, 42, 42);\n },\n\n // Object.create polyfill, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill\n objectCreate: Object.create || (function () {\n var Object = function () {};\n return function (prototype) {\n if (arguments.length > 1) {\n throw Error('Second argument not supported');\n }\n if (typeof prototype != 'object') {\n throw TypeError('Argument must be an object');\n }\n Object.prototype = prototype;\n var result = new Object();\n Object.prototype = null;\n return result;\n };\n })(),\n\n _SubmitSelector: 'input[type=\"submit\"], button:submit'\n};\n\nexport default Utils;\n","// All these options could be overriden and specified directly in DOM using\n// `data-parsley-` default DOM-API\n// eg: `inputs` can be set in DOM using `data-parsley-inputs=\"input, textarea\"`\n// eg: `data-parsley-stop-on-first-failing-constraint=\"false\"`\n\nvar Defaults = {\n // ### General\n\n // Default data-namespace for DOM API\n namespace: 'data-parsley-',\n\n // Supported inputs by default\n inputs: 'input, textarea, select',\n\n // Excluded inputs by default\n excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden]',\n\n // Stop validating field on highest priority failing constraint\n priorityEnabled: true,\n\n // ### Field only\n\n // identifier used to group together inputs (e.g. radio buttons...)\n multiple: null,\n\n // identifier (or array of identifiers) used to validate only a select group of inputs\n group: null,\n\n // ### UI\n // Enable\\Disable error messages\n uiEnabled: true,\n\n // Key events threshold before validation\n validationThreshold: 3,\n\n // Focused field on form validation error. 'first'|'last'|'none'\n focus: 'first',\n\n // event(s) that will trigger validation before first failure. eg: `input`...\n trigger: false,\n\n // event(s) that will trigger validation after first failure.\n triggerAfterFailure: 'input',\n\n // Class that would be added on every failing validation Parsley field\n errorClass: 'parsley-error',\n\n // Same for success validation\n successClass: 'parsley-success',\n\n // Return the `$element` that will receive these above success or error classes\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n classHandler: function (Field) {},\n\n // Return the `$element` where errors will be appended\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n errorsContainer: function (Field) {},\n\n // ul elem that would receive errors' list\n errorsWrapper: '
        ',\n\n // li elem that would receive error message\n errorTemplate: '
      • '\n};\n\nexport default Defaults;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Base = function () {\n this.__id__ = Utils.generateID();\n};\n\nBase.prototype = {\n asyncSupport: true, // Deprecated\n\n _pipeAccordingToValidationResult: function () {\n var pipe = () => {\n var r = $.Deferred();\n if (true !== this.validationResult)\n r.reject();\n return r.resolve().promise();\n };\n return [pipe, pipe];\n },\n\n actualizeOptions: function () {\n Utils.attr(this.element, this.options.namespace, this.domOptions);\n if (this.parent && this.parent.actualizeOptions)\n this.parent.actualizeOptions();\n return this;\n },\n\n _resetOptions: function (initOptions) {\n this.domOptions = Utils.objectCreate(this.parent.options);\n this.options = Utils.objectCreate(this.domOptions);\n // Shallow copy of ownProperties of initOptions:\n for (var i in initOptions) {\n if (initOptions.hasOwnProperty(i))\n this.options[i] = initOptions[i];\n }\n this.actualizeOptions();\n },\n\n _listeners: null,\n\n // Register a callback for the given event name\n // Callback is called with context as the first argument and the `this`\n // The context is the current parsley instance, or window.Parsley if global\n // A return value of `false` will interrupt the calls\n on: function (name, fn) {\n this._listeners = this._listeners || {};\n var queue = this._listeners[name] = this._listeners[name] || [];\n queue.push(fn);\n\n return this;\n },\n\n // Deprecated. Use `on` instead\n subscribe: function(name, fn) {\n $.listenTo(this, name.toLowerCase(), fn);\n },\n\n // Unregister a callback (or all if none is given) for the given event name\n off: function (name, fn) {\n var queue = this._listeners && this._listeners[name];\n if (queue) {\n if (!fn) {\n delete this._listeners[name];\n } else {\n for (var i = queue.length; i--; )\n if (queue[i] === fn)\n queue.splice(i, 1);\n }\n }\n return this;\n },\n\n // Deprecated. Use `off`\n unsubscribe: function(name, fn) {\n $.unsubscribeTo(this, name.toLowerCase());\n },\n\n // Trigger an event of the given name\n // A return value of `false` interrupts the callback chain\n // Returns false if execution was interrupted\n trigger: function (name, target, extraArg) {\n target = target || this;\n var queue = this._listeners && this._listeners[name];\n var result;\n var parentResult;\n if (queue) {\n for (var i = queue.length; i--; ) {\n result = queue[i].call(target, target, extraArg);\n if (result === false) return result;\n }\n }\n if (this.parent) {\n return this.parent.trigger(name, target, extraArg);\n }\n return true;\n },\n\n asyncIsValid: function (group, force) {\n Utils.warnOnce(\"asyncIsValid is deprecated; please use whenValid instead\");\n return this.whenValid({group, force});\n },\n\n _findRelated: function () {\n return this.options.multiple ?\n $(this.parent.element.querySelectorAll(`[${this.options.namespace}multiple=\"${this.options.multiple}\"]`))\n : this.$element;\n }\n};\n\nexport default Base;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar convertArrayRequirement = function(string, length) {\n var m = string.match(/^\\s*\\[(.*)\\]\\s*$/);\n if (!m)\n throw 'Requirement is not an array: \"' + string + '\"';\n var values = m[1].split(',').map(Utils.trimString);\n if (values.length !== length)\n throw 'Requirement has ' + values.length + ' values when ' + length + ' are needed';\n return values;\n};\n\nvar convertExtraOptionRequirement = function(requirementSpec, string, extraOptionReader) {\n var main = null;\n var extra = {};\n for (var key in requirementSpec) {\n if (key) {\n var value = extraOptionReader(key);\n if ('string' === typeof value)\n value = Utils.parseRequirement(requirementSpec[key], value);\n extra[key] = value;\n } else {\n main = Utils.parseRequirement(requirementSpec[key], string);\n }\n }\n return [main, extra];\n};\n\n// A Validator needs to implement the methods `validate` and `parseRequirements`\n\nvar Validator = function(spec) {\n $.extend(true, this, spec);\n};\n\nValidator.prototype = {\n // Returns `true` iff the given `value` is valid according the given requirements.\n validate: function(value, requirementFirstArg) {\n if (this.fn) { // Legacy style validator\n\n if (arguments.length > 3) // If more args then value, requirement, instance...\n requirementFirstArg = [].slice.call(arguments, 1, -1); // Skip first arg (value) and last (instance), combining the rest\n return this.fn(value, requirementFirstArg);\n }\n\n if (Array.isArray(value)) {\n if (!this.validateMultiple)\n throw 'Validator `' + this.name + '` does not handle multiple values';\n return this.validateMultiple(...arguments);\n } else {\n let instance = arguments[arguments.length - 1];\n if (this.validateDate && instance._isDateInput()) {\n arguments[0] = Utils.parse.date(arguments[0]);\n if (arguments[0] === null)\n return false;\n return this.validateDate(...arguments);\n }\n if (this.validateNumber) {\n if (!value) // Builtin validators all accept empty strings, except `required` of course\n return true;\n if (isNaN(value))\n return false;\n arguments[0] = parseFloat(arguments[0]);\n return this.validateNumber(...arguments);\n }\n if (this.validateString) {\n return this.validateString(...arguments);\n }\n throw 'Validator `' + this.name + '` only handles multiple values';\n }\n },\n\n // Parses `requirements` into an array of arguments,\n // according to `this.requirementType`\n parseRequirements: function(requirements, extraOptionReader) {\n if ('string' !== typeof requirements) {\n // Assume requirement already parsed\n // but make sure we return an array\n return Array.isArray(requirements) ? requirements : [requirements];\n }\n var type = this.requirementType;\n if (Array.isArray(type)) {\n var values = convertArrayRequirement(requirements, type.length);\n for (var i = 0; i < values.length; i++)\n values[i] = Utils.parseRequirement(type[i], values[i]);\n return values;\n } else if ($.isPlainObject(type)) {\n return convertExtraOptionRequirement(type, requirements, extraOptionReader);\n } else {\n return [Utils.parseRequirement(type, requirements)];\n }\n },\n // Defaults:\n requirementType: 'string',\n\n priority: 2\n\n};\n\nexport default Validator;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Validator from './validator';\n\nvar ValidatorRegistry = function (validators, catalog) {\n this.__class__ = 'ValidatorRegistry';\n\n // Default Parsley locale is en\n this.locale = 'en';\n\n this.init(validators || {}, catalog || {});\n};\n\nvar typeTesters = {\n email: /^((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/,\n\n // Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers\n number: /^-?(\\d*\\.)?\\d+(e[-+]?\\d+)?$/i,\n\n integer: /^-?\\d+$/,\n\n digits: /^\\d+$/,\n\n alphanum: /^\\w+$/i,\n\n date: {\n test: value => Utils.parse.date(value) !== null\n },\n\n url: new RegExp(\n \"^\" +\n // protocol identifier\n \"(?:(?:https?|ftp)://)?\" + // ** mod: make scheme optional\n // user:pass authentication\n \"(?:\\\\S+(?::\\\\S*)?@)?\" +\n \"(?:\" +\n // IP address exclusion\n // private & local networks\n // \"(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})\" + // ** mod: allow local networks\n // \"(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // \"(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // IP address dotted notation octets\n // excludes loopback network 0.0.0.0\n // excludes reserved space >= 224.0.0.0\n // excludes network & broacast addresses\n // (first & last IP address of each class)\n \"(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])\" +\n \"(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}\" +\n \"(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))\" +\n \"|\" +\n // host name\n \"(?:(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)\" +\n // domain name\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)*\" +\n // TLD identifier\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff]{2,}))\" +\n \")\" +\n // port number\n \"(?::\\\\d{2,5})?\" +\n // resource path\n \"(?:/\\\\S*)?\" +\n \"$\"\n )\n};\ntypeTesters.range = typeTesters.number;\n\n// See http://stackoverflow.com/a/10454560/8279\nvar decimalPlaces = num => {\n var match = ('' + num).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n if (!match) { return 0; }\n return Math.max(\n 0,\n // Number of digits right of decimal point.\n (match[1] ? match[1].length : 0) -\n // Adjust for scientific notation.\n (match[2] ? +match[2] : 0));\n};\n\n// parseArguments('number', ['1', '2']) => [1, 2]\nlet parseArguments = (type, args) => args.map(Utils.parse[type]);\n// operatorToValidator returns a validating function for an operator function, applied to the given type\nlet operatorToValidator = (type, operator) => {\n return (value, ...requirementsAndInput) => {\n requirementsAndInput.pop(); // Get rid of `input` argument\n return operator(value, ...parseArguments(type, requirementsAndInput));\n };\n};\n\nlet comparisonOperator = operator => ({\n validateDate: operatorToValidator('date', operator),\n validateNumber: operatorToValidator('number', operator),\n requirementType: operator.length <= 2 ? 'string' : ['string', 'string'], // Support operators with a 1 or 2 requirement(s)\n priority: 30\n});\n\nValidatorRegistry.prototype = {\n init: function (validators, catalog) {\n this.catalog = catalog;\n // Copy prototype's validators:\n this.validators = Object.assign({}, this.validators);\n\n for (var name in validators)\n this.addValidator(name, validators[name].fn, validators[name].priority);\n\n window.Parsley.trigger('parsley:validator:init');\n },\n\n // Set new messages locale if we have dictionary loaded in ParsleyConfig.i18n\n setLocale: function (locale) {\n if ('undefined' === typeof this.catalog[locale])\n throw new Error(locale + ' is not available in the catalog');\n\n this.locale = locale;\n\n return this;\n },\n\n // Add a new messages catalog for a given locale. Set locale for this catalog if set === `true`\n addCatalog: function (locale, messages, set) {\n if ('object' === typeof messages)\n this.catalog[locale] = messages;\n\n if (true === set)\n return this.setLocale(locale);\n\n return this;\n },\n\n // Add a specific message for a given constraint in a given locale\n addMessage: function (locale, name, message) {\n if ('undefined' === typeof this.catalog[locale])\n this.catalog[locale] = {};\n\n this.catalog[locale][name] = message;\n\n return this;\n },\n\n // Add messages for a given locale\n addMessages: function (locale, nameMessageObject) {\n for (var name in nameMessageObject)\n this.addMessage(locale, name, nameMessageObject[name]);\n\n return this;\n },\n\n // Add a new validator\n //\n // addValidator('custom', {\n // requirementType: ['integer', 'integer'],\n // validateString: function(value, from, to) {},\n // priority: 22,\n // messages: {\n // en: \"Hey, that's no good\",\n // fr: \"Aye aye, pas bon du tout\",\n // }\n // })\n //\n // Old API was addValidator(name, function, priority)\n //\n addValidator: function (name, arg1, arg2) {\n if (this.validators[name])\n Utils.warn('Validator \"' + name + '\" is already defined.');\n else if (Defaults.hasOwnProperty(name)) {\n Utils.warn('\"' + name + '\" is a restricted keyword and is not a valid validator name.');\n return;\n }\n return this._setValidator(...arguments);\n },\n\n hasValidator: function (name) {\n return !!this.validators[name];\n },\n\n updateValidator: function (name, arg1, arg2) {\n if (!this.validators[name]) {\n Utils.warn('Validator \"' + name + '\" is not already defined.');\n return this.addValidator(...arguments);\n }\n return this._setValidator(...arguments);\n },\n\n removeValidator: function (name) {\n if (!this.validators[name])\n Utils.warn('Validator \"' + name + '\" is not defined.');\n\n delete this.validators[name];\n\n return this;\n },\n\n _setValidator: function (name, validator, priority) {\n if ('object' !== typeof validator) {\n // Old style validator, with `fn` and `priority`\n validator = {\n fn: validator,\n priority: priority\n };\n }\n if (!validator.validate) {\n validator = new Validator(validator);\n }\n this.validators[name] = validator;\n\n for (var locale in validator.messages || {})\n this.addMessage(locale, name, validator.messages[locale]);\n\n return this;\n },\n\n getErrorMessage: function (constraint) {\n var message;\n\n // Type constraints are a bit different, we have to match their requirements too to find right error message\n if ('type' === constraint.name) {\n var typeMessages = this.catalog[this.locale][constraint.name] || {};\n message = typeMessages[constraint.requirements];\n } else\n message = this.formatMessage(this.catalog[this.locale][constraint.name], constraint.requirements);\n\n return message || this.catalog[this.locale].defaultMessage || this.catalog.en.defaultMessage;\n },\n\n // Kind of light `sprintf()` implementation\n formatMessage: function (string, parameters) {\n if ('object' === typeof parameters) {\n for (var i in parameters)\n string = this.formatMessage(string, parameters[i]);\n\n return string;\n }\n\n return 'string' === typeof string ? string.replace(/%s/i, parameters) : '';\n },\n\n // Here is the Parsley default validators list.\n // A validator is an object with the following key values:\n // - priority: an integer\n // - requirement: 'string' (default), 'integer', 'number', 'regexp' or an Array of these\n // - validateString, validateMultiple, validateNumber: functions returning `true`, `false` or a promise\n // Alternatively, a validator can be a function that returns such an object\n //\n validators: {\n notblank: {\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 2\n },\n required: {\n validateMultiple: function(values) {\n return values.length > 0;\n },\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 512\n },\n type: {\n validateString: function(value, type, {step = 'any', base = 0} = {}) {\n var tester = typeTesters[type];\n if (!tester) {\n throw new Error('validator type `' + type + '` is not supported');\n }\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n if (!tester.test(value))\n return false;\n if ('number' === type) {\n if (!/^any$/i.test(step || '')) {\n var nb = Number(value);\n var decimals = Math.max(decimalPlaces(step), decimalPlaces(base));\n if (decimalPlaces(nb) > decimals) // Value can't have too many decimals\n return false;\n // Be careful of rounding errors by using integers.\n var toInt = f => Math.round(f * Math.pow(10, decimals));\n if ((toInt(nb) - toInt(base)) % toInt(step) != 0)\n return false;\n }\n }\n return true;\n },\n requirementType: {\n '': 'string',\n step: 'string',\n base: 'number'\n },\n priority: 256\n },\n pattern: {\n validateString: function(value, regexp) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return regexp.test(value);\n },\n requirementType: 'regexp',\n priority: 64\n },\n minlength: {\n validateString: function (value, requirement) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxlength: {\n validateString: function (value, requirement) {\n return value.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n length: {\n validateString: function (value, min, max) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= min && value.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n mincheck: {\n validateMultiple: function (values, requirement) {\n return values.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxcheck: {\n validateMultiple: function (values, requirement) {\n return values.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n check: {\n validateMultiple: function (values, min, max) {\n return values.length >= min && values.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n min: comparisonOperator((value, requirement) => value >= requirement),\n max: comparisonOperator((value, requirement) => value <= requirement),\n range: comparisonOperator((value, min, max) => value >= min && value <= max),\n equalto: {\n validateString: function (value, refOrValue) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n var $reference = $(refOrValue);\n if ($reference.length)\n return value === $reference.val();\n else\n return value === refOrValue;\n },\n priority: 256\n },\n euvatin: {\n validateString: function (value, refOrValue) {\n if (!value) {\n return true; // Builtin validators all accept empty strings, except `required` of course\n }\n\n var re = /^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/;\n return re.test(value);\n },\n priority: 30,\n },\n }\n};\n\nexport default ValidatorRegistry;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar UI = {};\n\nvar diffResults = function (newResult, oldResult, deep) {\n var added = [];\n var kept = [];\n\n for (var i = 0; i < newResult.length; i++) {\n var found = false;\n\n for (var j = 0; j < oldResult.length; j++)\n if (newResult[i].assert.name === oldResult[j].assert.name) {\n found = true;\n break;\n }\n\n if (found)\n kept.push(newResult[i]);\n else\n added.push(newResult[i]);\n }\n\n return {\n kept: kept,\n added: added,\n removed: !deep ? diffResults(oldResult, newResult, true).added : []\n };\n};\n\nUI.Form = {\n\n _actualizeTriggers: function () {\n this.$element.on('submit.Parsley', evt => { this.onSubmitValidate(evt); });\n this.$element.on('click.Parsley', Utils._SubmitSelector, evt => { this.onSubmitButton(evt); });\n\n // UI could be disabled\n if (false === this.options.uiEnabled)\n return;\n\n this.element.setAttribute('novalidate', '');\n },\n\n focus: function () {\n this._focusedField = null;\n\n if (true === this.validationResult || 'none' === this.options.focus)\n return null;\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i];\n if (true !== field.validationResult && field.validationResult.length > 0 && 'undefined' === typeof field.options.noFocus) {\n this._focusedField = field.$element;\n if ('first' === this.options.focus)\n break;\n }\n }\n\n if (null === this._focusedField)\n return null;\n\n return this._focusedField.focus();\n },\n\n _destroyUI: function () {\n // Reset all event listeners\n this.$element.off('.Parsley');\n }\n\n};\n\nUI.Field = {\n\n _reflowUI: function () {\n this._buildUI();\n\n // If this field doesn't have an active UI don't bother doing something\n if (!this._ui)\n return;\n\n // Diff between two validation results\n var diff = diffResults(this.validationResult, this._ui.lastValidationResult);\n\n // Then store current validation result for next reflow\n this._ui.lastValidationResult = this.validationResult;\n\n // Handle valid / invalid / none field class\n this._manageStatusClass();\n\n // Add, remove, updated errors messages\n this._manageErrorsMessages(diff);\n\n // Triggers impl\n this._actualizeTriggers();\n\n // If field is not valid for the first time, bind keyup trigger to ease UX and quickly inform user\n if ((diff.kept.length || diff.added.length) && !this._failedOnce) {\n this._failedOnce = true;\n this._actualizeTriggers();\n }\n },\n\n // Returns an array of field's error message(s)\n getErrorsMessages: function () {\n // No error message, field is valid\n if (true === this.validationResult)\n return [];\n\n var messages = [];\n\n for (var i = 0; i < this.validationResult.length; i++)\n messages.push(this.validationResult[i].errorMessage ||\n this._getErrorMessage(this.validationResult[i].assert));\n\n return messages;\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n addError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._addError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n updateError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._updateError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n removeError: function (name, {updateClass = true} = {}) {\n this._buildUI();\n this._removeError(name);\n\n // edge case possible here: remove a standard Parsley error that is still failing in this.validationResult\n // but highly improbable cuz' manually removing a well Parsley handled error makes no sense.\n if (updateClass)\n this._manageStatusClass();\n },\n\n _manageStatusClass: function () {\n if (this.hasConstraints() && this.needsValidation() && true === this.validationResult)\n this._successClass();\n else if (this.validationResult.length > 0)\n this._errorClass();\n else\n this._resetClass();\n },\n\n _manageErrorsMessages: function (diff) {\n if ('undefined' !== typeof this.options.errorsMessagesDisabled)\n return;\n\n // Case where we have errorMessage option that configure an unique field error message, regardless failing validators\n if ('undefined' !== typeof this.options.errorMessage) {\n if ((diff.added.length || diff.kept.length)) {\n this._insertErrorWrapper();\n\n if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length)\n this._ui.$errorsWrapper\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-custom-error-message')\n );\n\n return this._ui.$errorsWrapper\n .addClass('filled')\n .find('.parsley-custom-error-message')\n .html(this.options.errorMessage);\n }\n\n return this._ui.$errorsWrapper\n .removeClass('filled')\n .find('.parsley-custom-error-message')\n .remove();\n }\n\n // Show, hide, update failing constraints messages\n for (var i = 0; i < diff.removed.length; i++)\n this._removeError(diff.removed[i].assert.name);\n\n for (i = 0; i < diff.added.length; i++)\n this._addError(diff.added[i].assert.name, {message: diff.added[i].errorMessage, assert: diff.added[i].assert});\n\n for (i = 0; i < diff.kept.length; i++)\n this._updateError(diff.kept[i].assert.name, {message: diff.kept[i].errorMessage, assert: diff.kept[i].assert});\n },\n\n\n _addError: function (name, {message, assert}) {\n this._insertErrorWrapper();\n this._ui.$errorClassHandler\n .attr('aria-describedby', this._ui.errorsWrapperId);\n this._ui.$errorsWrapper\n .addClass('filled')\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-' + name)\n .html(message || this._getErrorMessage(assert))\n );\n },\n\n _updateError: function (name, {message, assert}) {\n this._ui.$errorsWrapper\n .addClass('filled')\n .find('.parsley-' + name)\n .html(message || this._getErrorMessage(assert));\n },\n\n _removeError: function (name) {\n this._ui.$errorClassHandler\n .removeAttr('aria-describedby');\n this._ui.$errorsWrapper\n .removeClass('filled')\n .find('.parsley-' + name)\n .remove();\n },\n\n _getErrorMessage: function (constraint) {\n var customConstraintErrorMessage = constraint.name + 'Message';\n\n if ('undefined' !== typeof this.options[customConstraintErrorMessage])\n return window.Parsley.formatMessage(this.options[customConstraintErrorMessage], constraint.requirements);\n\n return window.Parsley.getErrorMessage(constraint);\n },\n\n _buildUI: function () {\n // UI could be already built or disabled\n if (this._ui || false === this.options.uiEnabled)\n return;\n\n var _ui = {};\n\n // Give field its Parsley id in DOM\n this.element.setAttribute(this.options.namespace + 'id', this.__id__);\n\n /** Generate important UI elements and store them in this **/\n // $errorClassHandler is the $element that woul have parsley-error and parsley-success classes\n _ui.$errorClassHandler = this._manageClassHandler();\n\n // $errorsWrapper is a div that would contain the various field errors, it will be appended into $errorsContainer\n _ui.errorsWrapperId = 'parsley-id-' + (this.options.multiple ? 'multiple-' + this.options.multiple : this.__id__);\n _ui.$errorsWrapper = $(this.options.errorsWrapper).attr('id', _ui.errorsWrapperId);\n\n // ValidationResult UI storage to detect what have changed bwt two validations, and update DOM accordingly\n _ui.lastValidationResult = [];\n _ui.validationInformationVisible = false;\n\n // Store it in this for later\n this._ui = _ui;\n },\n\n // Determine which element will have `parsley-error` and `parsley-success` classes\n _manageClassHandler: function () {\n // Class handled could also be determined by function given in Parsley options\n if ('string' === typeof this.options.classHandler && $(this.options.classHandler).length)\n return $(this.options.classHandler);\n\n // Class handled could also be determined by function given in Parsley options\n var $handlerFunction = this.options.classHandler;\n\n // It might also be the function name of a global function\n if ('string' === typeof this.options.classHandler && 'function' === typeof window[this.options.classHandler])\n $handlerFunction = window[this.options.classHandler];\n\n if ('function' === typeof $handlerFunction) {\n var $handler = $handlerFunction.call(this, this);\n\n // If this function returned a valid existing DOM element, go for it\n if ('undefined' !== typeof $handler && $handler.length)\n return $handler;\n } else if ('object' === typeof $handlerFunction && $handlerFunction instanceof jQuery && $handlerFunction.length) {\n return $handlerFunction;\n } else if ($handlerFunction) {\n Utils.warn('The class handler `' + $handlerFunction + '` does not exist in DOM nor as a global JS function');\n }\n\n return this._inputHolder();\n },\n\n _inputHolder: function() {\n // if simple element (input, texatrea, select...) it will perfectly host the classes and precede the error container\n if (!this.options.multiple || this.element.nodeName === 'SELECT')\n return this.$element;\n\n // But if multiple element (radio, checkbox), that would be their parent\n return this.$element.parent();\n },\n\n _insertErrorWrapper: function () {\n var $errorsContainer = this.options.errorsContainer;\n\n // Nothing to do if already inserted\n if (0 !== this._ui.$errorsWrapper.parent().length)\n return this._ui.$errorsWrapper.parent();\n\n if ('string' === typeof $errorsContainer) {\n if ($($errorsContainer).length)\n return $($errorsContainer).append(this._ui.$errorsWrapper);\n else if ('function' === typeof window[$errorsContainer])\n $errorsContainer = window[$errorsContainer];\n else\n Utils.warn('The errors container `' + $errorsContainer + '` does not exist in DOM nor as a global JS function');\n }\n\n if ('function' === typeof $errorsContainer)\n $errorsContainer = $errorsContainer.call(this, this);\n\n if ('object' === typeof $errorsContainer && $errorsContainer.length)\n return $errorsContainer.append(this._ui.$errorsWrapper);\n\n return this._inputHolder().after(this._ui.$errorsWrapper);\n },\n\n _actualizeTriggers: function () {\n var $toBind = this._findRelated();\n var trigger;\n\n // Remove Parsley events already bound on this field\n $toBind.off('.Parsley');\n if (this._failedOnce)\n $toBind.on(Utils.namespaceEvents(this.options.triggerAfterFailure, 'Parsley'), () => {\n this._validateIfNeeded();\n });\n else if (trigger = Utils.namespaceEvents(this.options.trigger, 'Parsley')) {\n $toBind.on(trigger, event => {\n this._validateIfNeeded(event);\n });\n }\n },\n\n _validateIfNeeded: function (event) {\n // For keyup, keypress, keydown, input... events that could be a little bit obstrusive\n // do not validate if val length < min threshold on first validation. Once field have been validated once and info\n // about success or failure have been displayed, always validate with this trigger to reflect every yalidation change.\n if (event && /key|input/.test(event.type))\n if (!(this._ui && this._ui.validationInformationVisible) && this.getValue().length <= this.options.validationThreshold)\n return;\n\n if (this.options.debounce) {\n window.clearTimeout(this._debounced);\n this._debounced = window.setTimeout(() => this.validate(), this.options.debounce);\n } else\n this.validate();\n },\n\n _resetUI: function () {\n // Reset all event listeners\n this._failedOnce = false;\n this._actualizeTriggers();\n\n // Nothing to do if UI never initialized for this field\n if ('undefined' === typeof this._ui)\n return;\n\n // Reset all errors' li\n this._ui.$errorsWrapper\n .removeClass('filled')\n .children()\n .remove();\n\n // Reset validation class\n this._resetClass();\n\n // Reset validation flags and last validation result\n this._ui.lastValidationResult = [];\n this._ui.validationInformationVisible = false;\n },\n\n _destroyUI: function () {\n this._resetUI();\n\n if ('undefined' !== typeof this._ui)\n this._ui.$errorsWrapper.remove();\n\n delete this._ui;\n },\n\n _successClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass);\n },\n _errorClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass);\n },\n _resetClass: function () {\n this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass);\n }\n};\n\nexport default UI;\n","import $ from 'jquery';\nimport Base from './base';\nimport Utils from './utils';\n\nvar Form = function (element, domOptions, options) {\n this.__class__ = 'Form';\n\n this.element = element;\n this.$element = $(element);\n this.domOptions = domOptions;\n this.options = options;\n this.parent = window.Parsley;\n\n this.fields = [];\n this.validationResult = null;\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nForm.prototype = {\n onSubmitValidate: function (event) {\n // This is a Parsley generated submit event, do not validate, do not prevent, simply exit and keep normal behavior\n if (true === event.parsley)\n return;\n\n // If we didn't come here through a submit button, use the first one in the form\n var submitSource = this._submitSource || this.$element.find(Utils._SubmitSelector)[0];\n this._submitSource = null;\n this.$element.find('.parsley-synthetic-submit-button').prop('disabled', true);\n if (submitSource && null !== submitSource.getAttribute('formnovalidate'))\n return;\n\n window.Parsley._remoteCache = {};\n\n var promise = this.whenValidate({event});\n\n if ('resolved' === promise.state() && false !== this._trigger('submit')) {\n // All good, let event go through. We make this distinction because browsers\n // differ in their handling of `submit` being called from inside a submit event [#1047]\n } else {\n // Rejected or pending: cancel this submit\n event.stopImmediatePropagation();\n event.preventDefault();\n if ('pending' === promise.state())\n promise.done(() => { this._submit(submitSource); });\n }\n },\n\n onSubmitButton: function(event) {\n this._submitSource = event.currentTarget;\n },\n // internal\n // _submit submits the form, this time without going through the validations.\n // Care must be taken to \"fake\" the actual submit button being clicked.\n _submit: function (submitSource) {\n if (false === this._trigger('submit'))\n return;\n // Add submit button's data\n if (submitSource) {\n var $synthetic = this.$element.find('.parsley-synthetic-submit-button').prop('disabled', false);\n if (0 === $synthetic.length)\n $synthetic = $('').appendTo(this.$element);\n $synthetic.attr({\n name: submitSource.getAttribute('name'),\n value: submitSource.getAttribute('value')\n });\n }\n\n this.$element.trigger(Object.assign($.Event('submit'), {parsley: true}));\n },\n\n // Performs validation on fields while triggering events.\n // @returns `true` if all validations succeeds, `false`\n // if a failure is immediately detected, or `null`\n // if dependant on a promise.\n // Consider using `whenValidate` instead.\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley form without passing arguments as an object is deprecated.');\n var [group, force, event] = arguments;\n options = {group, force, event};\n }\n return statusMapping[ this.whenValidate(options).state() ];\n },\n\n whenValidate: function ({group, force, event} = {}) {\n this.submitEvent = event;\n if (event) {\n this.submitEvent = Object.assign({}, event, {preventDefault: () => {\n Utils.warnOnce(\"Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`\");\n this.validationResult = false;\n }});\n }\n this.validationResult = true;\n\n // fire validate event to eventually modify things before every validation\n this._trigger('validate');\n\n // Refresh form DOM options and form's fields that could have changed\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValidate({force, group}));\n });\n\n return Utils.all(promises)\n .done( () => { this._trigger('success'); })\n .fail( () => {\n this.validationResult = false;\n this.focus();\n this._trigger('error');\n })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n // Iterate over refreshed fields, and stop on first failure.\n // Returns `true` if all fields are valid, `false` if a failure is detected\n // or `null` if the result depends on an unresolved promise.\n // Prefer using `whenValid` instead.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley form without passing arguments as an object is deprecated.');\n var [group, force] = arguments;\n options = {group, force};\n }\n return statusMapping[ this.whenValid(options).state() ];\n },\n\n // Iterate over refreshed fields and validate them.\n // Returns a promise.\n // A validation that immediately fails will interrupt the validations.\n whenValid: function ({group, force} = {}) {\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValid({group, force}));\n });\n return Utils.all(promises);\n },\n\n refresh: function() {\n this._refreshFields();\n return this;\n },\n\n // Reset UI\n reset: function () {\n // Form case: emit a reset event for each field\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].reset();\n\n this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n\n // Form case: destroy all its fields and then destroy stored instance\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].destroy();\n\n this.$element.removeData('Parsley');\n this._trigger('destroy');\n },\n\n _refreshFields: function () {\n return this.actualizeOptions()._bindFields();\n },\n\n _bindFields: function () {\n var oldFields = this.fields;\n\n this.fields = [];\n this.fieldsMappedById = {};\n\n this._withoutReactualizingFormOptions(() => {\n this.$element\n .find(this.options.inputs)\n .not(this.options.excluded)\n .not(`[${this.options.namespace}excluded=true]`)\n .each((_, element) => {\n var fieldInstance = new window.Parsley.Factory(element, {}, this);\n\n // Only add valid and not excluded `Field` and `FieldMultiple` children\n if ('Field' === fieldInstance.__class__ || 'FieldMultiple' === fieldInstance.__class__) {\n let uniqueId = fieldInstance.__class__ + '-' + fieldInstance.__id__;\n if ('undefined' === typeof this.fieldsMappedById[uniqueId]) {\n this.fieldsMappedById[uniqueId] = fieldInstance;\n this.fields.push(fieldInstance);\n }\n }\n });\n\n $.each(Utils.difference(oldFields, this.fields), (_, field) => {\n field.reset();\n });\n });\n return this;\n },\n\n // Internal only.\n // Looping on a form's fields to do validation or similar\n // will trigger reactualizing options on all of them, which\n // in turn will reactualize the form's options.\n // To avoid calling actualizeOptions so many times on the form\n // for nothing, _withoutReactualizingFormOptions temporarily disables\n // the method actualizeOptions on this form while `fn` is called.\n _withoutReactualizingFormOptions: function (fn) {\n var oldActualizeOptions = this.actualizeOptions;\n this.actualizeOptions = function () { return this; };\n var result = fn();\n this.actualizeOptions = oldActualizeOptions;\n return result;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n // Returns true iff event is not interrupted and default not prevented.\n _trigger: function (eventName) {\n return this.trigger('form:' + eventName);\n }\n\n};\n\nexport default Form;\n","import Utils from './utils';\nimport Validator from './validator';\n\nconst Constraint = function(parsleyField, name, requirements, priority, isDomConstraint) {\n const validatorSpec = window.Parsley._validatorRegistry.validators[name];\n const validator = new Validator(validatorSpec);\n priority = priority || parsleyField.options[name + 'Priority'] || validator.priority;\n isDomConstraint = (true === isDomConstraint);\n\n Object.assign(this, {\n validator,\n name,\n requirements,\n priority,\n isDomConstraint\n });\n this._parseRequirements(parsleyField.options);\n};\n\nconst capitalize = function(str) {\n const cap = str[0].toUpperCase();\n return cap + str.slice(1);\n};\n\nConstraint.prototype = {\n validate: function(value, instance) {\n return this.validator.validate(value, ...this.requirementList, instance);\n },\n\n _parseRequirements: function(options) {\n this.requirementList = this.validator.parseRequirements(this.requirements,\n key => options[this.name + capitalize(key)]\n );\n }\n};\n\nexport default Constraint;\n","import $ from 'jquery';\nimport Constraint from './constraint';\nimport UI from './ui';\nimport Utils from './utils';\n\nvar Field = function (field, domOptions, options, parsleyFormInstance) {\n this.__class__ = 'Field';\n\n this.element = field;\n this.$element = $(field);\n\n // Set parent if we have one\n if ('undefined' !== typeof parsleyFormInstance) {\n this.parent = parsleyFormInstance;\n }\n\n this.options = options;\n this.domOptions = domOptions;\n\n // Initialize some properties\n this.constraints = [];\n this.constraintsByName = {};\n this.validationResult = true;\n\n // Bind constraints\n this._bindConstraints();\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nField.prototype = {\n // # Public API\n // Validate field and trigger some events for mainly `UI`\n // @returns `true`, an array of the validators that failed, or\n // `null` if validation is not finished. Prefer using whenValidate\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley field without passing arguments as an object is deprecated.');\n options = {options};\n }\n var promise = this.whenValidate(options);\n if (!promise) // If excluded with `group` option\n return true;\n switch (promise.state()) {\n case 'pending': return null;\n case 'resolved': return true;\n case 'rejected': return this.validationResult;\n }\n },\n\n // Validate field and trigger some events for mainly `UI`\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if field is not in the given `group`.\n whenValidate: function ({force, group} = {}) {\n // do not validate a field if not the same as given validation group\n this.refresh();\n if (group && !this._isInGroup(group))\n return;\n\n this.value = this.getValue();\n\n // Field Validate event. `this.value` could be altered for custom needs\n this._trigger('validate');\n\n return this.whenValid({force, value: this.value, _refreshed: true})\n .always(() => { this._reflowUI(); })\n .done(() => { this._trigger('success'); })\n .fail(() => { this._trigger('error'); })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n hasConstraints: function () {\n return 0 !== this.constraints.length;\n },\n\n // An empty optional field does not need validation\n needsValidation: function (value) {\n if ('undefined' === typeof value)\n value = this.getValue();\n\n // If a field is empty and not required, it is valid\n // Except if `data-parsley-validate-if-empty` explicitely added, useful for some custom validators\n if (!value.length && !this._isRequired() && 'undefined' === typeof this.options.validateIfEmpty)\n return false;\n\n return true;\n },\n\n _isInGroup: function (group) {\n if (Array.isArray(this.options.group))\n return -1 !== $.inArray(group, this.options.group);\n return this.options.group === group;\n },\n\n // Just validate field. Do not trigger any event.\n // Returns `true` iff all constraints pass, `false` if there are failures,\n // or `null` if the result can not be determined yet (depends on a promise)\n // See also `whenValid`.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley field without passing arguments as an object is deprecated.');\n var [force, value] = arguments;\n options = {force, value};\n }\n var promise = this.whenValid(options);\n if (!promise) // Excluded via `group`\n return true;\n return statusMapping[promise.state()];\n },\n\n // Just validate field. Do not trigger any event.\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if the field is not in the given `group`.\n // The argument `force` will force validation of empty fields.\n // If a `value` is given, it will be validated instead of the value of the input.\n whenValid: function ({force = false, value, group, _refreshed} = {}) {\n // Recompute options and rebind constraints to have latest changes\n if (!_refreshed)\n this.refresh();\n // do not validate a field if not the same as given validation group\n if (group && !this._isInGroup(group))\n return;\n\n this.validationResult = true;\n\n // A field without constraint is valid\n if (!this.hasConstraints())\n return $.when();\n\n // Value could be passed as argument, needed to add more power to 'field:validate'\n if ('undefined' === typeof value || null === value)\n value = this.getValue();\n\n if (!this.needsValidation(value) && true !== force)\n return $.when();\n\n var groupedConstraints = this._getGroupedConstraints();\n var promises = [];\n $.each(groupedConstraints, (_, constraints) => {\n // Process one group of constraints at a time, we validate the constraints\n // and combine the promises together.\n var promise = Utils.all(\n $.map(constraints, constraint => this._validateConstraint(value, constraint))\n );\n promises.push(promise);\n if (promise.state() === 'rejected')\n return false; // Interrupt processing if a group has already failed\n });\n return Utils.all(promises);\n },\n\n // @returns a promise\n _validateConstraint: function(value, constraint) {\n var result = constraint.validate(value, this);\n // Map false to a failed promise\n if (false === result)\n result = $.Deferred().reject();\n // Make sure we return a promise and that we record failures\n return Utils.all([result]).fail(errorMessage => {\n if (!(this.validationResult instanceof Array))\n this.validationResult = [];\n this.validationResult.push({\n assert: constraint,\n errorMessage: 'string' === typeof errorMessage && errorMessage\n });\n });\n },\n\n // @returns Parsley field computed value that could be overrided or configured in DOM\n getValue: function () {\n var value;\n\n // Value could be overriden in DOM or with explicit options\n if ('function' === typeof this.options.value)\n value = this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n value = this.options.value;\n else\n value = this.$element.val();\n\n // Handle wrong DOM or configurations\n if ('undefined' === typeof value || null === value)\n return '';\n\n return this._handleWhitespace(value);\n },\n\n // Reset UI\n reset: function () {\n this._resetUI();\n return this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n this.$element.removeData('Parsley');\n this.$element.removeData('FieldMultiple');\n this._trigger('destroy');\n },\n\n // Actualize options and rebind constraints\n refresh: function () {\n this._refreshConstraints();\n return this;\n },\n\n _refreshConstraints: function () {\n return this.actualizeOptions()._bindConstraints();\n },\n\n refreshConstraints: function() {\n Utils.warnOnce(\"Parsley's refreshConstraints is deprecated. Please use refresh\");\n return this.refresh();\n },\n\n /**\n * Add a new constraint to a field\n *\n * @param {String} name\n * @param {Mixed} requirements optional\n * @param {Number} priority optional\n * @param {Boolean} isDomConstraint optional\n */\n addConstraint: function (name, requirements, priority, isDomConstraint) {\n\n if (window.Parsley._validatorRegistry.validators[name]) {\n var constraint = new Constraint(this, name, requirements, priority, isDomConstraint);\n\n // if constraint already exist, delete it and push new version\n if ('undefined' !== this.constraintsByName[constraint.name])\n this.removeConstraint(constraint.name);\n\n this.constraints.push(constraint);\n this.constraintsByName[constraint.name] = constraint;\n }\n\n return this;\n },\n\n // Remove a constraint\n removeConstraint: function (name) {\n for (var i = 0; i < this.constraints.length; i++)\n if (name === this.constraints[i].name) {\n this.constraints.splice(i, 1);\n break;\n }\n delete this.constraintsByName[name];\n return this;\n },\n\n // Update a constraint (Remove + re-add)\n updateConstraint: function (name, parameters, priority) {\n return this.removeConstraint(name)\n .addConstraint(name, parameters, priority);\n },\n\n // # Internals\n\n // Internal only.\n // Bind constraints from config + options + DOM\n _bindConstraints: function () {\n var constraints = [];\n var constraintsByName = {};\n\n // clean all existing DOM constraints to only keep javascript user constraints\n for (var i = 0; i < this.constraints.length; i++)\n if (false === this.constraints[i].isDomConstraint) {\n constraints.push(this.constraints[i]);\n constraintsByName[this.constraints[i].name] = this.constraints[i];\n }\n\n this.constraints = constraints;\n this.constraintsByName = constraintsByName;\n\n // then re-add Parsley DOM-API constraints\n for (var name in this.options)\n this.addConstraint(name, this.options[name], undefined, true);\n\n // finally, bind special HTML5 constraints\n return this._bindHtml5Constraints();\n },\n\n // Internal only.\n // Bind specific HTML5 constraints to be HTML5 compliant\n _bindHtml5Constraints: function () {\n // html5 required\n if (null !== this.element.getAttribute('required'))\n this.addConstraint('required', true, undefined, true);\n\n // html5 pattern\n if (null !== this.element.getAttribute('pattern'))\n this.addConstraint('pattern', this.element.getAttribute('pattern'), undefined, true);\n\n // range\n let min = this.element.getAttribute('min');\n let max = this.element.getAttribute('max');\n if (null !== min && null !== max)\n this.addConstraint('range', [min, max], undefined, true);\n\n // HTML5 min\n else if (null !== min)\n this.addConstraint('min', min, undefined, true);\n\n // HTML5 max\n else if (null !== max)\n this.addConstraint('max', max, undefined, true);\n\n\n // length\n if (null !== this.element.getAttribute('minlength') && null !== this.element.getAttribute('maxlength'))\n this.addConstraint('length', [this.element.getAttribute('minlength'), this.element.getAttribute('maxlength')], undefined, true);\n\n // HTML5 minlength\n else if (null !== this.element.getAttribute('minlength'))\n this.addConstraint('minlength', this.element.getAttribute('minlength'), undefined, true);\n\n // HTML5 maxlength\n else if (null !== this.element.getAttribute('maxlength'))\n this.addConstraint('maxlength', this.element.getAttribute('maxlength'), undefined, true);\n\n\n // html5 types\n var type = Utils.getType(this.element);\n\n // Small special case here for HTML5 number: integer validator if step attribute is undefined or an integer value, number otherwise\n if ('number' === type) {\n return this.addConstraint('type', ['number', {\n step: this.element.getAttribute('step') || '1',\n base: min || this.element.getAttribute('value')\n }], undefined, true);\n // Regular other HTML5 supported types\n } else if (/^(email|url|range|date)$/i.test(type)) {\n return this.addConstraint('type', type, undefined, true);\n }\n return this;\n },\n\n // Internal only.\n // Field is required if have required constraint without `false` value\n _isRequired: function () {\n if ('undefined' === typeof this.constraintsByName.required)\n return false;\n\n return false !== this.constraintsByName.required.requirements;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n _trigger: function (eventName) {\n return this.trigger('field:' + eventName);\n },\n\n // Internal only\n // Handles whitespace in a value\n // Use `data-parsley-whitespace=\"squish\"` to auto squish input value\n // Use `data-parsley-whitespace=\"trim\"` to auto trim input value\n _handleWhitespace: function (value) {\n if (true === this.options.trimValue)\n Utils.warnOnce('data-parsley-trim-value=\"true\" is deprecated, please use data-parsley-whitespace=\"trim\"');\n\n if ('squish' === this.options.whitespace)\n value = value.replace(/\\s{2,}/g, ' ');\n\n if (('trim' === this.options.whitespace) || ('squish' === this.options.whitespace) || (true === this.options.trimValue))\n value = Utils.trimString(value);\n\n return value;\n },\n\n _isDateInput: function() {\n var c = this.constraintsByName.type;\n return c && c.requirements === 'date';\n },\n\n // Internal only.\n // Returns the constraints, grouped by descending priority.\n // The result is thus an array of arrays of constraints.\n _getGroupedConstraints: function () {\n if (false === this.options.priorityEnabled)\n return [this.constraints];\n\n var groupedConstraints = [];\n var index = {};\n\n // Create array unique of priorities\n for (var i = 0; i < this.constraints.length; i++) {\n var p = this.constraints[i].priority;\n if (!index[p])\n groupedConstraints.push(index[p] = []);\n index[p].push(this.constraints[i]);\n }\n // Sort them by priority DESC\n groupedConstraints.sort(function (a, b) { return b[0].priority - a[0].priority; });\n\n return groupedConstraints;\n }\n\n};\n\nexport default Field;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Multiple = function () {\n this.__class__ = 'FieldMultiple';\n};\n\nMultiple.prototype = {\n // Add new `$element` sibling for multiple field\n addElement: function ($element) {\n this.$elements.push($element);\n\n return this;\n },\n\n // See `Field._refreshConstraints()`\n _refreshConstraints: function () {\n var fieldConstraints;\n\n this.constraints = [];\n\n // Select multiple special treatment\n if (this.element.nodeName === 'SELECT') {\n this.actualizeOptions()._bindConstraints();\n\n return this;\n }\n\n // Gather all constraints for each input in the multiple group\n for (var i = 0; i < this.$elements.length; i++) {\n\n // Check if element have not been dynamically removed since last binding\n if (!$('html').has(this.$elements[i]).length) {\n this.$elements.splice(i, 1);\n continue;\n }\n\n fieldConstraints = this.$elements[i].data('FieldMultiple')._refreshConstraints().constraints;\n\n for (var j = 0; j < fieldConstraints.length; j++)\n this.addConstraint(fieldConstraints[j].name, fieldConstraints[j].requirements, fieldConstraints[j].priority, fieldConstraints[j].isDomConstraint);\n }\n\n return this;\n },\n\n // See `Field.getValue()`\n getValue: function () {\n // Value could be overriden in DOM\n if ('function' === typeof this.options.value)\n return this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n return this.options.value;\n\n // Radio input case\n if (this.element.nodeName === 'INPUT') {\n var type = Utils.getType(this.element);\n if (type === 'radio')\n return this._findRelated().filter(':checked').val() || '';\n\n // checkbox input case\n if (type === 'checkbox') {\n var values = [];\n\n this._findRelated().filter(':checked').each(function () {\n values.push($(this).val());\n });\n\n return values;\n }\n }\n\n // Select multiple case\n if (this.element.nodeName === 'SELECT' && null === this.$element.val())\n return [];\n\n // Default case that should never happen\n return this.$element.val();\n },\n\n _init: function () {\n this.$elements = [this.$element];\n\n return this;\n }\n};\n\nexport default Multiple;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\n\nvar Factory = function (element, options, parsleyFormInstance) {\n this.element = element;\n this.$element = $(element);\n\n // If the element has already been bound, returns its saved Parsley instance\n var savedparsleyFormInstance = this.$element.data('Parsley');\n if (savedparsleyFormInstance) {\n\n // If the saved instance has been bound without a Form parent and there is one given in this call, add it\n if ('undefined' !== typeof parsleyFormInstance && savedparsleyFormInstance.parent === window.Parsley) {\n savedparsleyFormInstance.parent = parsleyFormInstance;\n savedparsleyFormInstance._resetOptions(savedparsleyFormInstance.options);\n }\n\n if ('object' === typeof options) {\n Object.assign(savedparsleyFormInstance.options, options);\n }\n\n return savedparsleyFormInstance;\n }\n\n // Parsley must be instantiated with a DOM element or jQuery $element\n if (!this.$element.length)\n throw new Error('You must bind Parsley on an existing element.');\n\n if ('undefined' !== typeof parsleyFormInstance && 'Form' !== parsleyFormInstance.__class__)\n throw new Error('Parent instance must be a Form instance');\n\n this.parent = parsleyFormInstance || window.Parsley;\n return this.init(options);\n};\n\nFactory.prototype = {\n init: function (options) {\n this.__class__ = 'Parsley';\n this.__version__ = 'VERSION';\n this.__id__ = Utils.generateID();\n\n // Pre-compute options\n this._resetOptions(options);\n\n // A Form instance is obviously a `` element but also every node that is not an input and has the `data-parsley-validate` attribute\n if (this.element.nodeName === 'FORM' || (Utils.checkAttr(this.element, this.options.namespace, 'validate') && !this.$element.is(this.options.inputs)))\n return this.bind('parsleyForm');\n\n // Every other element is bound as a `Field` or `FieldMultiple`\n return this.isMultiple() ? this.handleMultiple() : this.bind('parsleyField');\n },\n\n isMultiple: function () {\n var type = Utils.getType(this.element);\n return ((type === 'radio' || type === 'checkbox') ||\n (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')));\n },\n\n // Multiples fields are a real nightmare :(\n // Maybe some refactoring would be appreciated here...\n handleMultiple: function () {\n var name;\n var multiple;\n var parsleyMultipleInstance;\n\n // Handle multiple name\n this.options.multiple = this.options.multiple ||\n (name = this.element.getAttribute('name')) ||\n this.element.getAttribute('id');\n\n // Special select multiple input\n if (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')) {\n this.options.multiple = this.options.multiple || this.__id__;\n return this.bind('parsleyFieldMultiple');\n\n // Else for radio / checkboxes, we need a `name` or `data-parsley-multiple` to properly bind it\n } else if (!this.options.multiple) {\n Utils.warn('To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.', this.$element);\n return this;\n }\n\n // Remove special chars\n this.options.multiple = this.options.multiple.replace(/(:|\\.|\\[|\\]|\\{|\\}|\\$)/g, '');\n\n // Add proper `data-parsley-multiple` to siblings if we have a valid multiple name\n if (name) {\n $('input[name=\"' + name + '\"]').each((i, input) => {\n var type = Utils.getType(input);\n if ((type === 'radio' || type === 'checkbox'))\n input.setAttribute(this.options.namespace + 'multiple', this.options.multiple);\n });\n }\n\n // Check here if we don't already have a related multiple instance saved\n var $previouslyRelated = this._findRelated();\n for (var i = 0; i < $previouslyRelated.length; i++) {\n parsleyMultipleInstance = $($previouslyRelated.get(i)).data('Parsley');\n if ('undefined' !== typeof parsleyMultipleInstance) {\n\n if (!this.$element.data('FieldMultiple')) {\n parsleyMultipleInstance.addElement(this.$element);\n }\n\n break;\n }\n }\n\n // Create a secret Field instance for every multiple field. It will be stored in `data('FieldMultiple')`\n // And will be useful later to access classic `Field` stuff while being in a `FieldMultiple` instance\n this.bind('parsleyField', true);\n\n return parsleyMultipleInstance || this.bind('parsleyFieldMultiple');\n },\n\n // Return proper `Form`, `Field` or `FieldMultiple`\n bind: function (type, doNotStore) {\n var parsleyInstance;\n\n switch (type) {\n case 'parsleyForm':\n parsleyInstance = $.extend(\n new Form(this.element, this.domOptions, this.options),\n new Base(),\n window.ParsleyExtend\n )._bindFields();\n break;\n case 'parsleyField':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Base(),\n window.ParsleyExtend\n );\n break;\n case 'parsleyFieldMultiple':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Multiple(),\n new Base(),\n window.ParsleyExtend\n )._init();\n break;\n default:\n throw new Error(type + 'is not a supported Parsley type');\n }\n\n if (this.options.multiple)\n Utils.setAttr(this.element, this.options.namespace, 'multiple', this.options.multiple);\n\n if ('undefined' !== typeof doNotStore) {\n this.$element.data('FieldMultiple', parsleyInstance);\n\n return parsleyInstance;\n }\n\n // Store the freshly bound instance in a DOM element for later access using jQuery `data()`\n this.$element.data('Parsley', parsleyInstance);\n\n // Tell the world we have a new Form or Field instance!\n parsleyInstance._actualizeTriggers();\n parsleyInstance._trigger('init');\n\n return parsleyInstance;\n }\n};\n\nexport default Factory;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Base from './base';\nimport ValidatorRegistry from './validator_registry';\nimport UI from './ui';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\nimport Factory from './factory';\n\nvar vernums = $.fn.jquery.split('.');\nif (parseInt(vernums[0]) <= 1 && parseInt(vernums[1]) < 8) {\n throw \"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.\";\n}\nif (!vernums.forEach) {\n Utils.warn('Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim');\n}\n// Inherit `on`, `off` & `trigger` to Parsley:\nvar Parsley = Object.assign(new Base(), {\n element: document,\n $element: $(document),\n actualizeOptions: null,\n _resetOptions: null,\n Factory: Factory,\n version: 'VERSION'\n });\n\n// Supplement Field and Form with Base\n// This way, the constructors will have access to those methods\nObject.assign(Field.prototype, UI.Field, Base.prototype);\nObject.assign(Form.prototype, UI.Form, Base.prototype);\n// Inherit actualizeOptions and _resetOptions:\nObject.assign(Factory.prototype, Base.prototype);\n\n// ### jQuery API\n// `$('.elem').parsley(options)` or `$('.elem').psly(options)`\n$.fn.parsley = $.fn.psly = function (options) {\n if (this.length > 1) {\n var instances = [];\n\n this.each(function () {\n instances.push($(this).parsley(options));\n });\n\n return instances;\n }\n\n // Return undefined if applied to non existing DOM element\n if (this.length == 0) {\n return;\n }\n\n return new Factory(this[0], options);\n};\n\n// ### Field and Form extension\n// Ensure the extension is now defined if it wasn't previously\nif ('undefined' === typeof window.ParsleyExtend)\n window.ParsleyExtend = {};\n\n// ### Parsley config\n// Inherit from ParsleyDefault, and copy over any existing values\nParsley.options = Object.assign(Utils.objectCreate(Defaults), window.ParsleyConfig);\nwindow.ParsleyConfig = Parsley.options; // Old way of accessing global options\n\n// ### Globals\nwindow.Parsley = window.psly = Parsley;\nParsley.Utils = Utils;\nwindow.ParsleyUtils = {};\n$.each(Utils, (key, value) => {\n if ('function' === typeof value) {\n window.ParsleyUtils[key] = (...args) => {\n Utils.warnOnce('Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead.');\n return Utils[key](...args);\n };\n }\n});\n\n// ### Define methods that forward to the registry, and deprecate all access except through window.Parsley\nvar registry = window.Parsley._validatorRegistry = new ValidatorRegistry(window.ParsleyConfig.validators, window.ParsleyConfig.i18n);\nwindow.ParsleyValidator = {};\n$.each('setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator hasValidator'.split(' '), function (i, method) {\n window.Parsley[method] = (...args) => registry[method](...args);\n window.ParsleyValidator[method] = function () {\n Utils.warnOnce(`Accessing the method '${method}' through Validator is deprecated. Simply call 'window.Parsley.${method}(...)'`);\n return window.Parsley[method](...arguments);\n };\n});\n\n// ### UI\n// Deprecated global object\nwindow.Parsley.UI = UI;\nwindow.ParsleyUI = {\n removeError: function (instance, name, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance.removeError(name, {updateClass});\n },\n getErrorsMessages: function (instance) {\n Utils.warnOnce(`Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly.`);\n return instance.getErrorsMessages();\n }\n};\n$.each('addError updateError'.split(' '), function (i, method) {\n window.ParsleyUI[method] = function (instance, name, message, assert, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call '${method}' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance[method](name, {message, assert, updateClass});\n };\n});\n\n// ### PARSLEY auto-binding\n// Prevent it by setting `ParsleyConfig.autoBind` to `false`\nif (false !== window.ParsleyConfig.autoBind) {\n $(function () {\n // Works only on `data-parsley-validate`.\n if ($('[data-parsley-validate]').length)\n $('[data-parsley-validate]').parsley();\n });\n}\n\nexport default Parsley;\n","import $ from 'jquery';\nimport Field from './field';\nimport Form from './form';\nimport Utils from './utils';\n\nvar o = $({});\nvar deprecated = function () {\n Utils.warnOnce(\"Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley\");\n};\n\n// Returns an event handler that calls `fn` with the arguments it expects\nfunction adapt(fn, context) {\n // Store to allow unbinding\n if (!fn.parsleyAdaptedCallback) {\n fn.parsleyAdaptedCallback = function () {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift(this);\n fn.apply(context || o, args);\n };\n }\n return fn.parsleyAdaptedCallback;\n}\n\nvar eventPrefix = 'parsley:';\n// Converts 'parsley:form:validate' into 'form:validate'\nfunction eventName(name) {\n if (name.lastIndexOf(eventPrefix, 0) === 0)\n return name.substr(eventPrefix.length);\n return name;\n}\n\n// $.listen is deprecated. Use Parsley.on instead.\n$.listen = function (name, callback) {\n var context;\n deprecated();\n if ('object' === typeof arguments[1] && 'function' === typeof arguments[2]) {\n context = arguments[1];\n callback = arguments[2];\n }\n\n if ('function' !== typeof callback)\n throw new Error('Wrong parameters');\n\n window.Parsley.on(eventName(name), adapt(callback, context));\n};\n\n$.listenTo = function (instance, name, fn) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong parameters');\n\n instance.on(eventName(name), adapt(fn));\n};\n\n$.unsubscribe = function (name, fn) {\n deprecated();\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong arguments');\n window.Parsley.off(eventName(name), fn.parsleyAdaptedCallback);\n};\n\n$.unsubscribeTo = function (instance, name) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n instance.off(eventName(name));\n};\n\n$.unsubscribeAll = function (name) {\n deprecated();\n window.Parsley.off(eventName(name));\n $('form,input,textarea,select').each(function () {\n var instance = $(this).data('Parsley');\n if (instance) {\n instance.off(eventName(name));\n }\n });\n};\n\n// $.emit is deprecated. Use jQuery events instead.\n$.emit = function (name, instance) {\n deprecated();\n var instanceGiven = (instance instanceof Field) || (instance instanceof Form);\n var args = Array.prototype.slice.call(arguments, instanceGiven ? 2 : 1);\n args.unshift(eventName(name));\n if (!instanceGiven) {\n instance = window.Parsley;\n }\n instance.trigger(...args);\n};\n\nexport default {};\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\n\nimport Parsley from './main';\n\n$.extend(true, Parsley, {\n asyncValidators: {\n 'default': {\n fn: function (xhr) {\n // By default, only status 2xx are deemed successful.\n // Note: we use status instead of state() because responses with status 200\n // but invalid messages (e.g. an empty body for content type set to JSON) will\n // result in state() === 'rejected'.\n return xhr.status >= 200 && xhr.status < 300;\n },\n url: false\n },\n reverse: {\n fn: function (xhr) {\n // If reverse option is set, a failing ajax request is considered successful\n return xhr.status < 200 || xhr.status >= 300;\n },\n url: false\n }\n },\n\n addAsyncValidator: function (name, fn, url, options) {\n Parsley.asyncValidators[name] = {\n fn: fn,\n url: url || false,\n options: options || {}\n };\n\n return this;\n }\n\n});\n\nParsley.addValidator('remote', {\n requirementType: {\n '': 'string',\n 'validator': 'string',\n 'reverse': 'boolean',\n 'options': 'object'\n },\n\n validateString: function (value, url, options, instance) {\n var data = {};\n var ajaxOptions;\n var csr;\n var validator = options.validator || (true === options.reverse ? 'reverse' : 'default');\n\n if ('undefined' === typeof Parsley.asyncValidators[validator])\n throw new Error('Calling an undefined async validator: `' + validator + '`');\n\n url = Parsley.asyncValidators[validator].url || url;\n\n // Fill current value\n if (url.indexOf('{value}') > -1) {\n url = url.replace('{value}', encodeURIComponent(value));\n } else {\n data[instance.element.getAttribute('name') || instance.element.getAttribute('id')] = value;\n }\n\n // Merge options passed in from the function with the ones in the attribute\n var remoteOptions = $.extend(true, options.options || {} , Parsley.asyncValidators[validator].options);\n\n // All `$.ajax(options)` could be overridden or extended directly from DOM in `data-parsley-remote-options`\n ajaxOptions = $.extend(true, {}, {\n url: url,\n data: data,\n type: 'GET'\n }, remoteOptions);\n\n // Generate store key based on ajax options\n instance.trigger('field:ajaxoptions', instance, ajaxOptions);\n\n csr = $.param(ajaxOptions);\n\n // Initialise querry cache\n if ('undefined' === typeof Parsley._remoteCache)\n Parsley._remoteCache = {};\n\n // Try to retrieve stored xhr\n var xhr = Parsley._remoteCache[csr] = Parsley._remoteCache[csr] || $.ajax(ajaxOptions);\n\n var handleXhr = function () {\n var result = Parsley.asyncValidators[validator].fn.call(instance, xhr, url, options);\n if (!result) // Map falsy results to rejected promise\n result = $.Deferred().reject();\n return $.when(result);\n };\n\n return xhr.then(handleXhr, handleXhr);\n },\n\n priority: -1\n});\n\nParsley.on('form:submit', function () {\n Parsley._remoteCache = {};\n});\n\nBase.prototype.addAsyncValidator = function () {\n Utils.warnOnce('Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`');\n return Parsley.addAsyncValidator(...arguments);\n};\n","// This is included with the Parsley library itself,\n// thus there is no use in adding it to your project.\nimport Parsley from '../parsley/main';\n\nParsley.addMessages('en', {\n defaultMessage: \"This value seems to be invalid.\",\n type: {\n email: \"This value should be a valid email.\",\n url: \"This value should be a valid url.\",\n number: \"This value should be a valid number.\",\n integer: \"This value should be a valid integer.\",\n digits: \"This value should be digits.\",\n alphanum: \"This value should be alphanumeric.\"\n },\n notblank: \"This value should not be blank.\",\n required: \"This value is required.\",\n pattern: \"This value seems to be invalid.\",\n min: \"This value should be greater than or equal to %s.\",\n max: \"This value should be lower than or equal to %s.\",\n range: \"This value should be between %s and %s.\",\n minlength: \"This value is too short. It should have %s characters or more.\",\n maxlength: \"This value is too long. It should have %s characters or fewer.\",\n length: \"This value length is invalid. It should be between %s and %s characters long.\",\n mincheck: \"You must select at least %s choices.\",\n maxcheck: \"You must select %s choices or fewer.\",\n check: \"You must select between %s and %s choices.\",\n equalto: \"This value should be the same.\",\n euvatin: \"It's not a valid VAT Identification Number.\",\n});\n\nParsley.setLocale('en');\n","/**\n * inputevent - Alleviate browser bugs for input events\n * https://github.com/marcandre/inputevent\n * @version v0.0.3 - (built Thu, Apr 14th 2016, 5:58 pm)\n * @author Marc-Andre Lafortune \n * @license MIT\n */\n\nimport $ from 'jquery';\n\nfunction InputEvent() {\n let globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n Object.assign(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: evt => {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: evt => {\n if (this.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: evt => {\n if (this.isNativeEvent(evt)) {\n this.behavesOk(evt);\n $(document)\n .on('change.inputevent', evt.data.selector, this.fakeInputEvent);\n this.fakeInputEvent(evt);\n }\n },\n\n behavesOk: evt => {\n if (this.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, this.behavesOk)\n .off('change.inputevent', evt.data.selector, this.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: () => {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n for (let selector of ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]']) {\n $(document)\n .on('input.inputevent', selector, {selector}, this.behavesOk)\n .on('change.inputevent', selector, {selector}, this.misbehaves);\n }\n },\n\n uninstall: () => {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n};\n\nexport default new InputEvent();\n","import $ from 'jquery';\nimport Parsley from './parsley/main';\nimport './parsley/pubsub';\nimport './parsley/remote';\nimport './i18n/en';\nimport inputevent from './vendor/inputevent';\n\ninputevent.install();\n\nexport default Parsley;\n"],"names":["Object","globalID","pastWarnings","Utils","attr","element","namespace","obj","i","attribute","attributes","regex","RegExp","hasOwnProperty","length","specified","test","name","this","camelize","slice","deserializeValue","value","checkAttr","hasAttribute","setAttr","setAttribute","dasherize","String","getType","getAttribute","generateID","num","isNaN","Number","JSON","parse","e","str","replace","match","chr","toUpperCase","toLowerCase","warn","window","console","arguments","warnOnce","msg","_resetWarnings","trimString","string","date","parsed","map","x","parseInt","year","month","day","Date","getFullYear","getMonth","getDate","integer","number","parseFloat","object","regexp","flags","parseRequirement","requirementType","converter","converted","namespaceEvents","events","split","$","evt","join","difference","array","remove","result","each","_","elem","indexOf","push","all","promises","when","objectCreate","create","prototype","Error","_typeof","TypeError","_SubmitSelector","Defaults","inputs","excluded","priorityEnabled","multiple","group","uiEnabled","validationThreshold","focus","trigger","triggerAfterFailure","errorClass","successClass","classHandler","Field","errorsContainer","errorsWrapper","errorTemplate","Base","__id__","asyncSupport","_pipeAccordingToValidationResult","pipe","r","Deferred","_this","validationResult","reject","resolve","promise","actualizeOptions","options","domOptions","parent","_resetOptions","initOptions","_listeners","on","fn","subscribe","listenTo","off","queue","splice","unsubscribe","unsubscribeTo","target","extraArg","call","asyncIsValid","force","whenValid","_findRelated","querySelectorAll","$element","Validator","spec","extend","validate","requirementFirstArg","Array","isArray","validateMultiple","instance","validateDate","_isDateInput","validateNumber","validateString","parseRequirements","requirements","extraOptionReader","type","values","m","convertArrayRequirement","isPlainObject","requirementSpec","main","extra","key","convertExtraOptionRequirement","priority","ValidatorRegistry","validators","catalog","__class__","locale","init","typeTesters","email","digits","alphanum","url","range","decimalPlaces","Math","max","operatorToValidator","operator","requirementsAndInput","pop","comparisonOperator","_extends","addValidator","Parsley","setLocale","addCatalog","messages","set","addMessage","message","addMessages","nameMessageObject","arg1","arg2","_setValidator","hasValidator","updateValidator","removeValidator","validator","getErrorMessage","constraint","formatMessage","defaultMessage","en","parameters","notblank","required","step","base","tester","nb","decimals","toInt","f","round","pow","pattern","minlength","requirement","maxlength","min","mincheck","maxcheck","check","equalto","refOrValue","$reference","val","euvatin","UI","Form","_actualizeTriggers","onSubmitValidate","onSubmitButton","_focusedField","fields","field","noFocus","_destroyUI","_reflowUI","_buildUI","_ui","diff","diffResults","newResult","oldResult","deep","added","kept","found","j","assert","removed","lastValidationResult","_manageStatusClass","_manageErrorsMessages","_failedOnce","getErrorsMessages","errorMessage","_getErrorMessage","addError","updateClass","_addError","_errorClass","updateError","_updateError","removeError","_removeError","hasConstraints","needsValidation","_successClass","_resetClass","errorsMessagesDisabled","_insertErrorWrapper","$errorsWrapper","find","append","addClass","html","removeClass","$errorClassHandler","errorsWrapperId","removeAttr","customConstraintErrorMessage","_manageClassHandler","validationInformationVisible","$handlerFunction","$handler","jQuery","_inputHolder","nodeName","$errorsContainer","after","$toBind","_this2","_validateIfNeeded","event","getValue","debounce","clearTimeout","_debounced","setTimeout","_this3","_resetUI","children","statusMapping","pending","resolved","rejected","parsley","submitSource","_submitSource","prop","_remoteCache","whenValidate","state","_trigger","stopImmediatePropagation","preventDefault","done","_submit","currentTarget","$synthetic","appendTo","Event","submitEvent","_refreshFields","_withoutReactualizingFormOptions","fail","always","isValid","refresh","reset","destroy","removeData","_bindFields","oldFields","fieldsMappedById","_this4","not","fieldInstance","Factory","uniqueId","oldActualizeOptions","eventName","Constraint","parsleyField","isDomConstraint","validatorSpec","_validatorRegistry","_parseRequirements","parsleyFormInstance","constraints","constraintsByName","_bindConstraints","requirementList","_isInGroup","_refreshed","_isRequired","validateIfEmpty","inArray","groupedConstraints","_getGroupedConstraints","_validateConstraint","_handleWhitespace","_refreshConstraints","refreshConstraints","addConstraint","removeConstraint","updateConstraint","undefined","_bindHtml5Constraints","trimValue","whitespace","c","index","p","sort","a","b","Multiple","addElement","$elements","fieldConstraints","has","data","filter","_init","savedparsleyFormInstance","__version__","is","bind","isMultiple","handleMultiple","parsleyMultipleInstance","input","$previouslyRelated","get","doNotStore","parsleyInstance","ParsleyExtend","vernums","jquery","forEach","document","version","psly","instances","ParsleyConfig","ParsleyUtils","registry","i18n","ParsleyValidator","method","ParsleyUI","doNotUpdateClass","autoBind","o","deprecated","adapt","context","parsleyAdaptedCallback","args","unshift","apply","eventPrefix","lastIndexOf","substr","listen","callback","unsubscribeAll","emit","instanceGiven","asyncValidators","xhr","status","reverse","addAsyncValidator","ajaxOptions","csr","encodeURIComponent","remoteOptions","param","ajax","handleXhr","then","globals","global","isNativeEvent","originalEvent","isTrusted","fakeInputEvent","misbehaves","behavesOk","selector","install","inputEventPatched","uninstall"],"mappings":"m3CAEA,IA6LQA,EA7LJC,EAAW,EACXC,EAAe,GAEfC,EAAQ,CAGVC,KAAM,SAAUC,EAASC,EAAWC,OAC9BC,EACAC,EACAC,EACAC,EAAQ,IAAIC,OAAO,IAAMN,EAAW,aAEpC,IAAuBC,EACzBA,EAAM,YAGDC,KAAKD,EACJA,EAAIM,eAAeL,WACdD,EAAIC,OAIZH,EACH,OAAOE,MAGJC,GADLE,EAAaL,EAAQK,YAC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,EAAE2V,UACChS,GAAG,mBAAoBkV,EAAU,CAACA,SAAAA,GAAW9V,EAAK6V,WAClDjV,GAAG,oBAAqBkV,EAAU,CAACA,SAAAA,GAAW9V,EAAK4V,eAI1DK,UAAW,kBACFX,EAAQU,kBACf/Y,EAAE2V,UAAU5R,IAAI,oBCrDX+U"} \ No newline at end of file +{"version":3,"file":"parsley.min.js","sources":["../src/parsley/utils.js","../src/parsley/base.js","../src/parsley/defaults.js","../src/parsley/validator.js","../src/parsley/validator_registry.js","../src/parsley/ui.js","../src/parsley/form.js","../src/parsley/constraint.js","../src/parsley/field.js","../src/parsley/multiple.js","../src/parsley/factory.js","../src/parsley/main.js","../src/parsley/pubsub.js","../src/parsley/remote.js","../src/i18n/en.js","../src/vendor/inputevent.js","../src/parsley.js"],"sourcesContent":["import $ from 'jquery';\n\nvar globalID = 1;\nvar pastWarnings = {};\n\nvar Utils = {\n // Parsley DOM-API\n // returns object from dom attributes and values\n attr: function (element, namespace, obj) {\n var i;\n var attribute;\n var attributes;\n var regex = new RegExp('^' + namespace, 'i');\n\n if ('undefined' === typeof obj)\n obj = {};\n else {\n // Clear all own properties. This won't affect prototype's values\n for (i in obj) {\n if (obj.hasOwnProperty(i))\n delete obj[i];\n }\n }\n\n if (!element)\n return obj;\n\n attributes = element.attributes;\n for (i = attributes.length; i--; ) {\n attribute = attributes[i];\n\n if (attribute && attribute.specified && regex.test(attribute.name)) {\n obj[this.camelize(attribute.name.slice(namespace.length))] = this.deserializeValue(attribute.value);\n }\n }\n\n return obj;\n },\n\n checkAttr: function (element, namespace, checkAttr) {\n return element.hasAttribute(namespace + checkAttr);\n },\n\n setAttr: function (element, namespace, attr, value) {\n element.setAttribute(this.dasherize(namespace + attr), String(value));\n },\n\n getType: function(element) {\n return element.getAttribute('type') || 'text';\n },\n\n generateID: function () {\n return '' + globalID++;\n },\n\n /** Third party functions **/\n deserializeValue: function (value) {\n var num;\n\n try {\n return value ?\n value == \"true\" ||\n (value == \"false\" ? false :\n value == \"null\" ? null :\n !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? JSON.parse(value) :\n value)\n : value;\n } catch (e) { return value; }\n },\n\n // Zepto camelize function\n camelize: function (str) {\n return str.replace(/-+(.)?/g, function (match, chr) {\n return chr ? chr.toUpperCase() : '';\n });\n },\n\n // Zepto dasherize function\n dasherize: function (str) {\n return str.replace(/::/g, '/')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .replace(/_/g, '-')\n .toLowerCase();\n },\n\n warn: function () {\n if (window.console && 'function' === typeof window.console.warn)\n window.console.warn(...arguments);\n },\n\n warnOnce: function(msg) {\n if (!pastWarnings[msg]) {\n pastWarnings[msg] = true;\n this.warn(...arguments);\n }\n },\n\n _resetWarnings: function () {\n pastWarnings = {};\n },\n\n trimString: function(string) {\n return string.replace(/^\\s+|\\s+$/g, '');\n },\n\n parse: {\n date: function(string) {\n let parsed = string.match(/^(\\d{4,})-(\\d\\d)-(\\d\\d)$/);\n if (!parsed)\n return null;\n let [_, year, month, day] = parsed.map(x => parseInt(x, 10));\n let date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day)\n return null;\n return date;\n },\n string: function(string) {\n return string;\n },\n integer: function(string) {\n if (isNaN(string))\n return null;\n return parseInt(string, 10);\n },\n number: function(string) {\n if (isNaN(string))\n throw null;\n return parseFloat(string);\n },\n 'boolean': function _boolean(string) {\n return !(/^\\s*false\\s*$/i.test(string));\n },\n object: function(string) {\n return Utils.deserializeValue(string);\n },\n regexp: function(regexp) {\n var flags = '';\n\n // Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern\n if (/^\\/.*\\/(?:[gimy]*)$/.test(regexp)) {\n // Replace the regexp literal string with the first match group: ([gimy]*)\n // If no flag is present, this will be a blank string\n flags = regexp.replace(/.*\\/([gimy]*)$/, '$1');\n // Again, replace the regexp literal string with the first match group:\n // everything excluding the opening and closing slashes and the flags\n regexp = regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');\n } else {\n // Anchor regexp:\n regexp = '^' + regexp + '$';\n }\n return new RegExp(regexp, flags);\n }\n },\n\n parseRequirement: function(requirementType, string) {\n var converter = this.parse[requirementType || 'string'];\n if (!converter)\n throw 'Unknown requirement specification: \"' + requirementType + '\"';\n let converted = converter(string);\n if (converted === null)\n throw `Requirement is not a ${requirementType}: \"${string}\"`;\n return converted;\n },\n\n namespaceEvents: function(events, namespace) {\n events = this.trimString(events || '').split(/\\s+/);\n if (!events[0])\n return '';\n return $.map(events, evt => `${evt}.${namespace}`).join(' ');\n },\n\n difference: function(array, remove) {\n // This is O(N^2), should be optimized\n let result = [];\n $.each(array, (_, elem) => {\n if (remove.indexOf(elem) == -1)\n result.push(elem);\n });\n return result;\n },\n\n // Alter-ego to native Promise.all, but for jQuery\n all: function(promises) {\n // jQuery treats $.when() and $.when(singlePromise) differently; let's avoid that and add spurious elements\n return $.when(...promises, 42, 42);\n },\n\n // Object.create polyfill, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill\n objectCreate: Object.create || (function () {\n var Object = function () {};\n return function (prototype) {\n if (arguments.length > 1) {\n throw Error('Second argument not supported');\n }\n if (typeof prototype != 'object') {\n throw TypeError('Argument must be an object');\n }\n Object.prototype = prototype;\n var result = new Object();\n Object.prototype = null;\n return result;\n };\n })(),\n\n _SubmitSelector: 'input[type=\"submit\"], button:submit'\n};\n\nexport default Utils;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Base = function () {\n this.__id__ = Utils.generateID();\n};\n\nBase.prototype = {\n asyncSupport: true, // Deprecated\n\n _pipeAccordingToValidationResult: function () {\n var pipe = () => {\n var r = $.Deferred();\n if (true !== this.validationResult)\n r.reject();\n return r.resolve().promise();\n };\n return [pipe, pipe];\n },\n\n actualizeOptions: function () {\n Utils.attr(this.element, this.options.namespace, this.domOptions);\n if (this.parent && this.parent.actualizeOptions)\n this.parent.actualizeOptions();\n return this;\n },\n\n _resetOptions: function (initOptions) {\n this.domOptions = Utils.objectCreate(this.parent.options);\n this.options = Utils.objectCreate(this.domOptions);\n // Shallow copy of ownProperties of initOptions:\n for (var i in initOptions) {\n if (initOptions.hasOwnProperty(i))\n this.options[i] = initOptions[i];\n }\n this.actualizeOptions();\n },\n\n _listeners: null,\n\n // Register a callback for the given event name\n // Callback is called with context as the first argument and the `this`\n // The context is the current parsley instance, or window.Parsley if global\n // A return value of `false` will interrupt the calls\n on: function (name, fn) {\n this._listeners = this._listeners || {};\n var queue = this._listeners[name] = this._listeners[name] || [];\n queue.push(fn);\n\n return this;\n },\n\n // Deprecated. Use `on` instead\n subscribe: function(name, fn) {\n $.listenTo(this, name.toLowerCase(), fn);\n },\n\n // Unregister a callback (or all if none is given) for the given event name\n off: function (name, fn) {\n var queue = this._listeners && this._listeners[name];\n if (queue) {\n if (!fn) {\n delete this._listeners[name];\n } else {\n for (var i = queue.length; i--; )\n if (queue[i] === fn)\n queue.splice(i, 1);\n }\n }\n return this;\n },\n\n // Deprecated. Use `off`\n unsubscribe: function(name, fn) {\n $.unsubscribeTo(this, name.toLowerCase());\n },\n\n // Trigger an event of the given name\n // A return value of `false` interrupts the callback chain\n // Returns false if execution was interrupted\n trigger: function (name, target, extraArg) {\n target = target || this;\n var queue = this._listeners && this._listeners[name];\n var result;\n var parentResult;\n if (queue) {\n for (var i = queue.length; i--; ) {\n result = queue[i].call(target, target, extraArg);\n if (result === false) return result;\n }\n }\n if (this.parent) {\n return this.parent.trigger(name, target, extraArg);\n }\n return true;\n },\n\n asyncIsValid: function (group, force) {\n Utils.warnOnce(\"asyncIsValid is deprecated; please use whenValid instead\");\n return this.whenValid({group, force});\n },\n\n _findRelated: function () {\n return this.options.multiple ?\n $(this.parent.element.querySelectorAll(`[${this.options.namespace}multiple=\"${this.options.multiple}\"]`))\n : this.$element;\n }\n};\n\nexport default Base;\n","// All these options could be overriden and specified directly in DOM using\n// `data-parsley-` default DOM-API\n// eg: `inputs` can be set in DOM using `data-parsley-inputs=\"input, textarea\"`\n// eg: `data-parsley-stop-on-first-failing-constraint=\"false\"`\n\nvar Defaults = {\n // ### General\n\n // Default data-namespace for DOM API\n namespace: 'data-parsley-',\n\n // Supported inputs by default\n inputs: 'input, textarea, select',\n\n // Excluded inputs by default\n excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden]',\n\n // Stop validating field on highest priority failing constraint\n priorityEnabled: true,\n\n // ### Field only\n\n // identifier used to group together inputs (e.g. radio buttons...)\n multiple: null,\n\n // identifier (or array of identifiers) used to validate only a select group of inputs\n group: null,\n\n // ### UI\n // Enable\\Disable error messages\n uiEnabled: true,\n\n // Key events threshold before validation\n validationThreshold: 3,\n\n // Focused field on form validation error. 'first'|'last'|'none'\n focus: 'first',\n\n // event(s) that will trigger validation before first failure. eg: `input`...\n trigger: false,\n\n // event(s) that will trigger validation after first failure.\n triggerAfterFailure: 'input',\n\n // Class that would be added on every failing validation Parsley field\n errorClass: 'parsley-error',\n\n // Same for success validation\n successClass: 'parsley-success',\n\n // Return the `$element` that will receive these above success or error classes\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n classHandler: function (Field) {},\n\n // Return the `$element` where errors will be appended\n // Could also be (and given directly from DOM) a valid selector like `'#div'`\n errorsContainer: function (Field) {},\n\n // ul elem that would receive errors' list\n errorsWrapper: '
          ',\n\n // li elem that would receive error message\n errorTemplate: '
        • '\n};\n\nexport default Defaults;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar convertArrayRequirement = function(string, length) {\n var m = string.match(/^\\s*\\[(.*)\\]\\s*$/);\n if (!m)\n throw 'Requirement is not an array: \"' + string + '\"';\n var values = m[1].split(',').map(Utils.trimString);\n if (values.length !== length)\n throw 'Requirement has ' + values.length + ' values when ' + length + ' are needed';\n return values;\n};\n\nvar convertExtraOptionRequirement = function(requirementSpec, string, extraOptionReader) {\n var main = null;\n var extra = {};\n for (var key in requirementSpec) {\n if (key) {\n var value = extraOptionReader(key);\n if ('string' === typeof value)\n value = Utils.parseRequirement(requirementSpec[key], value);\n extra[key] = value;\n } else {\n main = Utils.parseRequirement(requirementSpec[key], string);\n }\n }\n return [main, extra];\n};\n\n// A Validator needs to implement the methods `validate` and `parseRequirements`\n\nvar Validator = function(spec) {\n $.extend(true, this, spec);\n};\n\nValidator.prototype = {\n // Returns `true` iff the given `value` is valid according the given requirements.\n validate: function(value, requirementFirstArg) {\n if (this.fn) { // Legacy style validator\n\n if (arguments.length > 3) // If more args then value, requirement, instance...\n requirementFirstArg = [].slice.call(arguments, 1, -1); // Skip first arg (value) and last (instance), combining the rest\n return this.fn(value, requirementFirstArg);\n }\n\n if (Array.isArray(value)) {\n if (!this.validateMultiple)\n throw 'Validator `' + this.name + '` does not handle multiple values';\n return this.validateMultiple(...arguments);\n } else {\n let instance = arguments[arguments.length - 1];\n if (this.validateDate && instance._isDateInput()) {\n arguments[0] = Utils.parse.date(arguments[0]);\n if (arguments[0] === null)\n return false;\n return this.validateDate(...arguments);\n }\n if (this.validateNumber) {\n if (!value) // Builtin validators all accept empty strings, except `required` of course\n return true;\n if (isNaN(value))\n return false;\n arguments[0] = parseFloat(arguments[0]);\n return this.validateNumber(...arguments);\n }\n if (this.validateString) {\n return this.validateString(...arguments);\n }\n throw 'Validator `' + this.name + '` only handles multiple values';\n }\n },\n\n // Parses `requirements` into an array of arguments,\n // according to `this.requirementType`\n parseRequirements: function(requirements, extraOptionReader) {\n if ('string' !== typeof requirements) {\n // Assume requirement already parsed\n // but make sure we return an array\n return Array.isArray(requirements) ? requirements : [requirements];\n }\n var type = this.requirementType;\n if (Array.isArray(type)) {\n var values = convertArrayRequirement(requirements, type.length);\n for (var i = 0; i < values.length; i++)\n values[i] = Utils.parseRequirement(type[i], values[i]);\n return values;\n } else if ($.isPlainObject(type)) {\n return convertExtraOptionRequirement(type, requirements, extraOptionReader);\n } else {\n return [Utils.parseRequirement(type, requirements)];\n }\n },\n // Defaults:\n requirementType: 'string',\n\n priority: 2\n\n};\n\nexport default Validator;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Validator from './validator';\n\nvar ValidatorRegistry = function (validators, catalog) {\n this.__class__ = 'ValidatorRegistry';\n\n // Default Parsley locale is en\n this.locale = 'en';\n\n this.init(validators || {}, catalog || {});\n};\n\nvar typeTesters = {\n email: /^((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-zA-Z]|\\d|-|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-zA-Z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))$/,\n\n // Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers\n number: /^-?(\\d*\\.)?\\d+(e[-+]?\\d+)?$/i,\n\n integer: /^-?\\d+$/,\n\n digits: /^\\d+$/,\n\n alphanum: /^\\w+$/i,\n\n date: {\n test: value => Utils.parse.date(value) !== null\n },\n\n url: new RegExp(\n \"^\" +\n // protocol identifier\n \"(?:(?:https?|ftp)://)?\" + // ** mod: make scheme optional\n // user:pass authentication\n \"(?:\\\\S+(?::\\\\S*)?@)?\" +\n \"(?:\" +\n // IP address exclusion\n // private & local networks\n // \"(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})\" + // ** mod: allow local networks\n // \"(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // \"(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})\" + // ** mod: allow local networks\n // IP address dotted notation octets\n // excludes loopback network 0.0.0.0\n // excludes reserved space >= 224.0.0.0\n // excludes network & broacast addresses\n // (first & last IP address of each class)\n \"(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])\" +\n \"(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}\" +\n \"(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))\" +\n \"|\" +\n // host name\n \"(?:(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)\" +\n // domain name\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff0-9]-*)*[a-zA-Z\\\\u00a1-\\\\uffff0-9]+)*\" +\n // TLD identifier\n \"(?:\\\\.(?:[a-zA-Z\\\\u00a1-\\\\uffff]{2,}))\" +\n \")\" +\n // port number\n \"(?::\\\\d{2,5})?\" +\n // resource path\n \"(?:/\\\\S*)?\" +\n \"$\"\n )\n};\ntypeTesters.range = typeTesters.number;\n\n// See http://stackoverflow.com/a/10454560/8279\nvar decimalPlaces = num => {\n var match = ('' + num).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n if (!match) { return 0; }\n return Math.max(\n 0,\n // Number of digits right of decimal point.\n (match[1] ? match[1].length : 0) -\n // Adjust for scientific notation.\n (match[2] ? +match[2] : 0));\n};\n\n// parseArguments('number', ['1', '2']) => [1, 2]\nlet parseArguments = (type, args) => args.map(Utils.parse[type]);\n// operatorToValidator returns a validating function for an operator function, applied to the given type\nlet operatorToValidator = (type, operator) => {\n return (value, ...requirementsAndInput) => {\n requirementsAndInput.pop(); // Get rid of `input` argument\n return operator(value, ...parseArguments(type, requirementsAndInput));\n };\n};\n\nlet comparisonOperator = operator => ({\n validateDate: operatorToValidator('date', operator),\n validateNumber: operatorToValidator('number', operator),\n requirementType: operator.length <= 2 ? 'string' : ['string', 'string'], // Support operators with a 1 or 2 requirement(s)\n priority: 30\n});\n\nValidatorRegistry.prototype = {\n init: function (validators, catalog) {\n this.catalog = catalog;\n // Copy prototype's validators:\n this.validators = Object.assign({}, this.validators);\n\n for (var name in validators)\n this.addValidator(name, validators[name].fn, validators[name].priority);\n\n window.Parsley.trigger('parsley:validator:init');\n },\n\n // Set new messages locale if we have dictionary loaded in ParsleyConfig.i18n\n setLocale: function (locale) {\n if ('undefined' === typeof this.catalog[locale])\n throw new Error(locale + ' is not available in the catalog');\n\n this.locale = locale;\n\n return this;\n },\n\n // Add a new messages catalog for a given locale. Set locale for this catalog if set === `true`\n addCatalog: function (locale, messages, set) {\n if ('object' === typeof messages)\n this.catalog[locale] = messages;\n\n if (true === set)\n return this.setLocale(locale);\n\n return this;\n },\n\n // Add a specific message for a given constraint in a given locale\n addMessage: function (locale, name, message) {\n if ('undefined' === typeof this.catalog[locale])\n this.catalog[locale] = {};\n\n this.catalog[locale][name] = message;\n\n return this;\n },\n\n // Add messages for a given locale\n addMessages: function (locale, nameMessageObject) {\n for (var name in nameMessageObject)\n this.addMessage(locale, name, nameMessageObject[name]);\n\n return this;\n },\n\n // Add a new validator\n //\n // addValidator('custom', {\n // requirementType: ['integer', 'integer'],\n // validateString: function(value, from, to) {},\n // priority: 22,\n // messages: {\n // en: \"Hey, that's no good\",\n // fr: \"Aye aye, pas bon du tout\",\n // }\n // })\n //\n // Old API was addValidator(name, function, priority)\n //\n addValidator: function (name, arg1, arg2) {\n if (this.validators[name])\n Utils.warn('Validator \"' + name + '\" is already defined.');\n else if (Defaults.hasOwnProperty(name)) {\n Utils.warn('\"' + name + '\" is a restricted keyword and is not a valid validator name.');\n return;\n }\n return this._setValidator(...arguments);\n },\n\n hasValidator: function (name) {\n return !!this.validators[name];\n },\n\n updateValidator: function (name, arg1, arg2) {\n if (!this.validators[name]) {\n Utils.warn('Validator \"' + name + '\" is not already defined.');\n return this.addValidator(...arguments);\n }\n return this._setValidator(...arguments);\n },\n\n removeValidator: function (name) {\n if (!this.validators[name])\n Utils.warn('Validator \"' + name + '\" is not defined.');\n\n delete this.validators[name];\n\n return this;\n },\n\n _setValidator: function (name, validator, priority) {\n if ('object' !== typeof validator) {\n // Old style validator, with `fn` and `priority`\n validator = {\n fn: validator,\n priority: priority\n };\n }\n if (!validator.validate) {\n validator = new Validator(validator);\n }\n this.validators[name] = validator;\n\n for (var locale in validator.messages || {})\n this.addMessage(locale, name, validator.messages[locale]);\n\n return this;\n },\n\n getErrorMessage: function (constraint) {\n var message;\n\n // Type constraints are a bit different, we have to match their requirements too to find right error message\n if ('type' === constraint.name) {\n var typeMessages = this.catalog[this.locale][constraint.name] || {};\n message = typeMessages[constraint.requirements];\n } else\n message = this.formatMessage(this.catalog[this.locale][constraint.name], constraint.requirements);\n\n return message || this.catalog[this.locale].defaultMessage || this.catalog.en.defaultMessage;\n },\n\n // Kind of light `sprintf()` implementation\n formatMessage: function (string, parameters) {\n if ('object' === typeof parameters) {\n for (var i in parameters)\n string = this.formatMessage(string, parameters[i]);\n\n return string;\n }\n\n return 'string' === typeof string ? string.replace(/%s/i, parameters) : '';\n },\n\n // Here is the Parsley default validators list.\n // A validator is an object with the following key values:\n // - priority: an integer\n // - requirement: 'string' (default), 'integer', 'number', 'regexp' or an Array of these\n // - validateString, validateMultiple, validateNumber: functions returning `true`, `false` or a promise\n // Alternatively, a validator can be a function that returns such an object\n //\n validators: {\n notblank: {\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 2\n },\n required: {\n validateMultiple: function(values) {\n return values.length > 0;\n },\n validateString: function(value) {\n return /\\S/.test(value);\n },\n priority: 512\n },\n type: {\n validateString: function(value, type, {step = 'any', base = 0} = {}) {\n var tester = typeTesters[type];\n if (!tester) {\n throw new Error('validator type `' + type + '` is not supported');\n }\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n if (!tester.test(value))\n return false;\n if ('number' === type) {\n if (!/^any$/i.test(step || '')) {\n var nb = Number(value);\n var decimals = Math.max(decimalPlaces(step), decimalPlaces(base));\n if (decimalPlaces(nb) > decimals) // Value can't have too many decimals\n return false;\n // Be careful of rounding errors by using integers.\n var toInt = f => Math.round(f * Math.pow(10, decimals));\n if ((toInt(nb) - toInt(base)) % toInt(step) != 0)\n return false;\n }\n }\n return true;\n },\n requirementType: {\n '': 'string',\n step: 'string',\n base: 'number'\n },\n priority: 256\n },\n pattern: {\n validateString: function(value, regexp) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return regexp.test(value);\n },\n requirementType: 'regexp',\n priority: 64\n },\n minlength: {\n validateString: function (value, requirement) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxlength: {\n validateString: function (value, requirement) {\n return value.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n length: {\n validateString: function (value, min, max) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n return value.length >= min && value.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n mincheck: {\n validateMultiple: function (values, requirement) {\n return values.length >= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n maxcheck: {\n validateMultiple: function (values, requirement) {\n return values.length <= requirement;\n },\n requirementType: 'integer',\n priority: 30\n },\n check: {\n validateMultiple: function (values, min, max) {\n return values.length >= min && values.length <= max;\n },\n requirementType: ['integer', 'integer'],\n priority: 30\n },\n min: comparisonOperator((value, requirement) => value >= requirement),\n max: comparisonOperator((value, requirement) => value <= requirement),\n range: comparisonOperator((value, min, max) => value >= min && value <= max),\n equalto: {\n validateString: function (value, refOrValue) {\n if (!value)\n return true; // Builtin validators all accept empty strings, except `required` of course\n var $reference = $(refOrValue);\n if ($reference.length)\n return value === $reference.val();\n else\n return value === refOrValue;\n },\n priority: 256\n },\n euvatin: {\n validateString: function (value, refOrValue) {\n if (!value) {\n return true; // Builtin validators all accept empty strings, except `required` of course\n }\n\n var re = /^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/;\n return re.test(value);\n },\n priority: 30,\n },\n }\n};\n\nexport default ValidatorRegistry;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar UI = {};\n\nvar diffResults = function (newResult, oldResult, deep) {\n var added = [];\n var kept = [];\n\n for (var i = 0; i < newResult.length; i++) {\n var found = false;\n\n for (var j = 0; j < oldResult.length; j++)\n if (newResult[i].assert.name === oldResult[j].assert.name) {\n found = true;\n break;\n }\n\n if (found)\n kept.push(newResult[i]);\n else\n added.push(newResult[i]);\n }\n\n return {\n kept: kept,\n added: added,\n removed: !deep ? diffResults(oldResult, newResult, true).added : []\n };\n};\n\nUI.Form = {\n\n _actualizeTriggers: function () {\n this.$element.on('submit.Parsley', evt => { this.onSubmitValidate(evt); });\n this.$element.on('click.Parsley', Utils._SubmitSelector, evt => { this.onSubmitButton(evt); });\n\n // UI could be disabled\n if (false === this.options.uiEnabled)\n return;\n\n this.element.setAttribute('novalidate', '');\n },\n\n focus: function () {\n this._focusedField = null;\n\n if (true === this.validationResult || 'none' === this.options.focus)\n return null;\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i];\n if (true !== field.validationResult && field.validationResult.length > 0 && 'undefined' === typeof field.options.noFocus) {\n this._focusedField = field.$element;\n if ('first' === this.options.focus)\n break;\n }\n }\n\n if (null === this._focusedField)\n return null;\n\n return this._focusedField.focus();\n },\n\n _destroyUI: function () {\n // Reset all event listeners\n this.$element.off('.Parsley');\n }\n\n};\n\nUI.Field = {\n\n _reflowUI: function () {\n this._buildUI();\n\n // If this field doesn't have an active UI don't bother doing something\n if (!this._ui)\n return;\n\n // Diff between two validation results\n var diff = diffResults(this.validationResult, this._ui.lastValidationResult);\n\n // Then store current validation result for next reflow\n this._ui.lastValidationResult = this.validationResult;\n\n // Handle valid / invalid / none field class\n this._manageStatusClass();\n\n // Add, remove, updated errors messages\n this._manageErrorsMessages(diff);\n\n // Triggers impl\n this._actualizeTriggers();\n\n // If field is not valid for the first time, bind keyup trigger to ease UX and quickly inform user\n if ((diff.kept.length || diff.added.length) && !this._failedOnce) {\n this._failedOnce = true;\n this._actualizeTriggers();\n }\n },\n\n // Returns an array of field's error message(s)\n getErrorsMessages: function () {\n // No error message, field is valid\n if (true === this.validationResult)\n return [];\n\n var messages = [];\n\n for (var i = 0; i < this.validationResult.length; i++)\n messages.push(this.validationResult[i].errorMessage ||\n this._getErrorMessage(this.validationResult[i].assert));\n\n return messages;\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n addError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._addError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n updateError: function (name, {message, assert, updateClass = true} = {}) {\n this._buildUI();\n this._updateError(name, {message, assert});\n\n if (updateClass)\n this._errorClass();\n },\n\n // It's a goal of Parsley that this method is no longer required [#1073]\n removeError: function (name, {updateClass = true} = {}) {\n this._buildUI();\n this._removeError(name);\n\n // edge case possible here: remove a standard Parsley error that is still failing in this.validationResult\n // but highly improbable cuz' manually removing a well Parsley handled error makes no sense.\n if (updateClass)\n this._manageStatusClass();\n },\n\n _manageStatusClass: function () {\n if (this.hasConstraints() && this.needsValidation() && true === this.validationResult)\n this._successClass();\n else if (this.validationResult.length > 0)\n this._errorClass();\n else\n this._resetClass();\n },\n\n _manageErrorsMessages: function (diff) {\n if ('undefined' !== typeof this.options.errorsMessagesDisabled)\n return;\n\n // Case where we have errorMessage option that configure an unique field error message, regardless failing validators\n if ('undefined' !== typeof this.options.errorMessage) {\n if ((diff.added.length || diff.kept.length)) {\n this._insertErrorWrapper();\n\n if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length)\n this._ui.$errorsWrapper\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-custom-error-message')\n );\n\n this._ui.$errorClassHandler.attr('aria-describedby', this._ui.errorsWrapperId);\n\n return this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .find('.parsley-custom-error-message')\n .html(this.options.errorMessage);\n }\n\n this._ui.$errorClassHandler.removeAttr('aria-describedby');\n\n return this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-custom-error-message')\n .remove();\n }\n\n // Show, hide, update failing constraints messages\n for (var i = 0; i < diff.removed.length; i++)\n this._removeError(diff.removed[i].assert.name);\n\n for (i = 0; i < diff.added.length; i++)\n this._addError(diff.added[i].assert.name, {message: diff.added[i].errorMessage, assert: diff.added[i].assert});\n\n for (i = 0; i < diff.kept.length; i++)\n this._updateError(diff.kept[i].assert.name, {message: diff.kept[i].errorMessage, assert: diff.kept[i].assert});\n },\n\n\n _addError: function (name, {message, assert}) {\n this._insertErrorWrapper();\n this._ui.$errorClassHandler\n .attr('aria-describedby', this._ui.errorsWrapperId);\n this._ui.$errorsWrapper\n .addClass('filled')\n .attr('aria-hidden', 'false')\n .append(\n $(this.options.errorTemplate)\n .addClass('parsley-' + name)\n .html(message || this._getErrorMessage(assert))\n );\n },\n\n _updateError: function (name, {message, assert}) {\n this._ui.$errorsWrapper\n .addClass('filled')\n .find('.parsley-' + name)\n .html(message || this._getErrorMessage(assert));\n },\n\n _removeError: function (name) {\n this._ui.$errorClassHandler\n .removeAttr('aria-describedby');\n this._ui.$errorsWrapper\n .removeClass('filled')\n .attr('aria-hidden', 'true')\n .find('.parsley-' + name)\n .remove();\n },\n\n _getErrorMessage: function (constraint) {\n var customConstraintErrorMessage = constraint.name + 'Message';\n\n if ('undefined' !== typeof this.options[customConstraintErrorMessage])\n return window.Parsley.formatMessage(this.options[customConstraintErrorMessage], constraint.requirements);\n\n return window.Parsley.getErrorMessage(constraint);\n },\n\n _buildUI: function () {\n // UI could be already built or disabled\n if (this._ui || false === this.options.uiEnabled)\n return;\n\n var _ui = {};\n\n // Give field its Parsley id in DOM\n this.element.setAttribute(this.options.namespace + 'id', this.__id__);\n\n /** Generate important UI elements and store them in this **/\n // $errorClassHandler is the $element that woul have parsley-error and parsley-success classes\n _ui.$errorClassHandler = this._manageClassHandler();\n\n // $errorsWrapper is a div that would contain the various field errors, it will be appended into $errorsContainer\n _ui.errorsWrapperId = 'parsley-id-' + (this.options.multiple ? 'multiple-' + this.options.multiple : this.__id__);\n _ui.$errorsWrapper = $(this.options.errorsWrapper).attr('id', _ui.errorsWrapperId);\n\n // ValidationResult UI storage to detect what have changed bwt two validations, and update DOM accordingly\n _ui.lastValidationResult = [];\n _ui.validationInformationVisible = false;\n\n // Store it in this for later\n this._ui = _ui;\n },\n\n // Determine which element will have `parsley-error` and `parsley-success` classes\n _manageClassHandler: function () {\n // Class handled could also be determined by function given in Parsley options\n if ('string' === typeof this.options.classHandler && $(this.options.classHandler).length)\n return $(this.options.classHandler);\n\n // Class handled could also be determined by function given in Parsley options\n var $handlerFunction = this.options.classHandler;\n\n // It might also be the function name of a global function\n if ('string' === typeof this.options.classHandler && 'function' === typeof window[this.options.classHandler])\n $handlerFunction = window[this.options.classHandler];\n\n if ('function' === typeof $handlerFunction) {\n var $handler = $handlerFunction.call(this, this);\n\n // If this function returned a valid existing DOM element, go for it\n if ('undefined' !== typeof $handler && $handler.length)\n return $handler;\n } else if ('object' === typeof $handlerFunction && $handlerFunction instanceof jQuery && $handlerFunction.length) {\n return $handlerFunction;\n } else if ($handlerFunction) {\n Utils.warn('The class handler `' + $handlerFunction + '` does not exist in DOM nor as a global JS function');\n }\n\n return this._inputHolder();\n },\n\n _inputHolder: function() {\n // if simple element (input, texatrea, select...) it will perfectly host the classes and precede the error container\n if (!this.options.multiple || this.element.nodeName === 'SELECT')\n return this.$element;\n\n // But if multiple element (radio, checkbox), that would be their parent\n return this.$element.parent();\n },\n\n _insertErrorWrapper: function () {\n var $errorsContainer = this.options.errorsContainer;\n\n // Nothing to do if already inserted\n if (0 !== this._ui.$errorsWrapper.parent().length)\n return this._ui.$errorsWrapper.parent();\n\n if ('string' === typeof $errorsContainer) {\n if ($($errorsContainer).length)\n return $($errorsContainer).append(this._ui.$errorsWrapper);\n else if ('function' === typeof window[$errorsContainer])\n $errorsContainer = window[$errorsContainer];\n else\n Utils.warn('The errors container `' + $errorsContainer + '` does not exist in DOM nor as a global JS function');\n }\n\n if ('function' === typeof $errorsContainer)\n $errorsContainer = $errorsContainer.call(this, this);\n\n if ('object' === typeof $errorsContainer && $errorsContainer.length)\n return $errorsContainer.append(this._ui.$errorsWrapper);\n\n return this._inputHolder().after(this._ui.$errorsWrapper);\n },\n\n _actualizeTriggers: function () {\n var $toBind = this._findRelated();\n var trigger;\n\n // Remove Parsley events already bound on this field\n $toBind.off('.Parsley');\n if (this._failedOnce)\n $toBind.on(Utils.namespaceEvents(this.options.triggerAfterFailure, 'Parsley'), () => {\n this._validateIfNeeded();\n });\n else if (trigger = Utils.namespaceEvents(this.options.trigger, 'Parsley')) {\n $toBind.on(trigger, event => {\n this._validateIfNeeded(event);\n });\n }\n },\n\n _validateIfNeeded: function (event) {\n // For keyup, keypress, keydown, input... events that could be a little bit obstrusive\n // do not validate if val length < min threshold on first validation. Once field have been validated once and info\n // about success or failure have been displayed, always validate with this trigger to reflect every yalidation change.\n if (event && /key|input/.test(event.type))\n if (!(this._ui && this._ui.validationInformationVisible) && this.getValue().length <= this.options.validationThreshold)\n return;\n\n if (this.options.debounce) {\n window.clearTimeout(this._debounced);\n this._debounced = window.setTimeout(() => this.validate(), this.options.debounce);\n } else\n this.validate();\n },\n\n _resetUI: function () {\n // Reset all event listeners\n this._failedOnce = false;\n this._actualizeTriggers();\n\n // Nothing to do if UI never initialized for this field\n if ('undefined' === typeof this._ui)\n return;\n\n // Reset all errors' li\n this._ui.$errorsWrapper\n .removeClass('filled')\n .children()\n .remove();\n\n // Reset validation class\n this._resetClass();\n\n // Reset validation flags and last validation result\n this._ui.lastValidationResult = [];\n this._ui.validationInformationVisible = false;\n },\n\n _destroyUI: function () {\n this._resetUI();\n\n if ('undefined' !== typeof this._ui)\n this._ui.$errorsWrapper.remove();\n\n delete this._ui;\n },\n\n _successClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass);\n },\n _errorClass: function () {\n this._ui.validationInformationVisible = true;\n this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass);\n },\n _resetClass: function () {\n this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass);\n }\n};\n\nexport default UI;\n","import $ from 'jquery';\nimport Base from './base';\nimport Utils from './utils';\n\nvar Form = function (element, domOptions, options) {\n this.__class__ = 'Form';\n\n this.element = element;\n this.$element = $(element);\n this.domOptions = domOptions;\n this.options = options;\n this.parent = window.Parsley;\n\n this.fields = [];\n this.validationResult = null;\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nForm.prototype = {\n onSubmitValidate: function (event) {\n // This is a Parsley generated submit event, do not validate, do not prevent, simply exit and keep normal behavior\n if (true === event.parsley)\n return;\n\n // If we didn't come here through a submit button, use the first one in the form\n var submitSource = this._submitSource || this.$element.find(Utils._SubmitSelector)[0];\n this._submitSource = null;\n this.$element.find('.parsley-synthetic-submit-button').prop('disabled', true);\n if (submitSource && null !== submitSource.getAttribute('formnovalidate'))\n return;\n\n window.Parsley._remoteCache = {};\n\n var promise = this.whenValidate({event});\n\n if ('resolved' === promise.state() && false !== this._trigger('submit')) {\n // All good, let event go through. We make this distinction because browsers\n // differ in their handling of `submit` being called from inside a submit event [#1047]\n } else {\n // Rejected or pending: cancel this submit\n event.stopImmediatePropagation();\n event.preventDefault();\n if ('pending' === promise.state())\n promise.done(() => { this._submit(submitSource); });\n }\n },\n\n onSubmitButton: function(event) {\n this._submitSource = event.currentTarget;\n },\n // internal\n // _submit submits the form, this time without going through the validations.\n // Care must be taken to \"fake\" the actual submit button being clicked.\n _submit: function (submitSource) {\n if (false === this._trigger('submit'))\n return;\n // Add submit button's data\n if (submitSource) {\n var $synthetic = this.$element.find('.parsley-synthetic-submit-button').prop('disabled', false);\n if (0 === $synthetic.length)\n $synthetic = $('').appendTo(this.$element);\n $synthetic.attr({\n name: submitSource.getAttribute('name'),\n value: submitSource.getAttribute('value')\n });\n }\n\n this.$element.trigger(Object.assign($.Event('submit'), {parsley: true}));\n },\n\n // Performs validation on fields while triggering events.\n // @returns `true` if all validations succeeds, `false`\n // if a failure is immediately detected, or `null`\n // if dependant on a promise.\n // Consider using `whenValidate` instead.\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley form without passing arguments as an object is deprecated.');\n var [group, force, event] = arguments;\n options = {group, force, event};\n }\n return statusMapping[ this.whenValidate(options).state() ];\n },\n\n whenValidate: function ({group, force, event} = {}) {\n this.submitEvent = event;\n if (event) {\n this.submitEvent = Object.assign({}, event, {preventDefault: () => {\n Utils.warnOnce(\"Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`\");\n this.validationResult = false;\n }});\n }\n this.validationResult = true;\n\n // fire validate event to eventually modify things before every validation\n this._trigger('validate');\n\n // Refresh form DOM options and form's fields that could have changed\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValidate({force, group}));\n });\n\n return Utils.all(promises)\n .done( () => { this._trigger('success'); })\n .fail( () => {\n this.validationResult = false;\n this.focus();\n this._trigger('error');\n })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n // Iterate over refreshed fields, and stop on first failure.\n // Returns `true` if all fields are valid, `false` if a failure is detected\n // or `null` if the result depends on an unresolved promise.\n // Prefer using `whenValid` instead.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley form without passing arguments as an object is deprecated.');\n var [group, force] = arguments;\n options = {group, force};\n }\n return statusMapping[ this.whenValid(options).state() ];\n },\n\n // Iterate over refreshed fields and validate them.\n // Returns a promise.\n // A validation that immediately fails will interrupt the validations.\n whenValid: function ({group, force} = {}) {\n this._refreshFields();\n\n var promises = this._withoutReactualizingFormOptions(() => {\n return $.map(this.fields, field => field.whenValid({group, force}));\n });\n return Utils.all(promises);\n },\n\n refresh: function() {\n this._refreshFields();\n return this;\n },\n\n // Reset UI\n reset: function () {\n // Form case: emit a reset event for each field\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].reset();\n\n this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n\n // Form case: destroy all its fields and then destroy stored instance\n for (var i = 0; i < this.fields.length; i++)\n this.fields[i].destroy();\n\n this.$element.removeData('Parsley');\n this._trigger('destroy');\n },\n\n _refreshFields: function () {\n return this.actualizeOptions()._bindFields();\n },\n\n _bindFields: function () {\n var oldFields = this.fields;\n\n this.fields = [];\n this.fieldsMappedById = {};\n\n this._withoutReactualizingFormOptions(() => {\n this.$element\n .find(this.options.inputs)\n .not(this.options.excluded)\n .not(`[${this.options.namespace}excluded=true]`)\n .each((_, element) => {\n var fieldInstance = new window.Parsley.Factory(element, {}, this);\n\n // Only add valid and not excluded `Field` and `FieldMultiple` children\n if ('Field' === fieldInstance.__class__ || 'FieldMultiple' === fieldInstance.__class__) {\n let uniqueId = fieldInstance.__class__ + '-' + fieldInstance.__id__;\n if ('undefined' === typeof this.fieldsMappedById[uniqueId]) {\n this.fieldsMappedById[uniqueId] = fieldInstance;\n this.fields.push(fieldInstance);\n }\n }\n });\n\n $.each(Utils.difference(oldFields, this.fields), (_, field) => {\n field.reset();\n });\n });\n return this;\n },\n\n // Internal only.\n // Looping on a form's fields to do validation or similar\n // will trigger reactualizing options on all of them, which\n // in turn will reactualize the form's options.\n // To avoid calling actualizeOptions so many times on the form\n // for nothing, _withoutReactualizingFormOptions temporarily disables\n // the method actualizeOptions on this form while `fn` is called.\n _withoutReactualizingFormOptions: function (fn) {\n var oldActualizeOptions = this.actualizeOptions;\n this.actualizeOptions = function () { return this; };\n var result = fn();\n this.actualizeOptions = oldActualizeOptions;\n return result;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n // Returns true iff event is not interrupted and default not prevented.\n _trigger: function (eventName) {\n return this.trigger('form:' + eventName);\n }\n\n};\n\nexport default Form;\n","import Utils from './utils';\nimport Validator from './validator';\n\nconst Constraint = function(parsleyField, name, requirements, priority, isDomConstraint) {\n const validatorSpec = window.Parsley._validatorRegistry.validators[name];\n const validator = new Validator(validatorSpec);\n priority = priority || parsleyField.options[name + 'Priority'] || validator.priority;\n isDomConstraint = (true === isDomConstraint);\n\n Object.assign(this, {\n validator,\n name,\n requirements,\n priority,\n isDomConstraint\n });\n this._parseRequirements(parsleyField.options);\n};\n\nconst capitalize = function(str) {\n const cap = str[0].toUpperCase();\n return cap + str.slice(1);\n};\n\nConstraint.prototype = {\n validate: function(value, instance) {\n return this.validator.validate(value, ...this.requirementList, instance);\n },\n\n _parseRequirements: function(options) {\n this.requirementList = this.validator.parseRequirements(this.requirements,\n key => options[this.name + capitalize(key)]\n );\n }\n};\n\nexport default Constraint;\n","import $ from 'jquery';\nimport Constraint from './constraint';\nimport UI from './ui';\nimport Utils from './utils';\n\nvar Field = function (field, domOptions, options, parsleyFormInstance) {\n this.__class__ = 'Field';\n\n this.element = field;\n this.$element = $(field);\n\n // Set parent if we have one\n if ('undefined' !== typeof parsleyFormInstance) {\n this.parent = parsleyFormInstance;\n }\n\n this.options = options;\n this.domOptions = domOptions;\n\n // Initialize some properties\n this.constraints = [];\n this.constraintsByName = {};\n this.validationResult = true;\n\n // Bind constraints\n this._bindConstraints();\n};\n\nvar statusMapping = {pending: null, resolved: true, rejected: false};\n\nField.prototype = {\n // # Public API\n // Validate field and trigger some events for mainly `UI`\n // @returns `true`, an array of the validators that failed, or\n // `null` if validation is not finished. Prefer using whenValidate\n validate: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling validate on a parsley field without passing arguments as an object is deprecated.');\n options = {options};\n }\n var promise = this.whenValidate(options);\n if (!promise) // If excluded with `group` option\n return true;\n switch (promise.state()) {\n case 'pending': return null;\n case 'resolved': return true;\n case 'rejected': return this.validationResult;\n }\n },\n\n // Validate field and trigger some events for mainly `UI`\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if field is not in the given `group`.\n whenValidate: function ({force, group} = {}) {\n // do not validate a field if not the same as given validation group\n this.refresh();\n if (group && !this._isInGroup(group))\n return;\n\n this.value = this.getValue();\n\n // Field Validate event. `this.value` could be altered for custom needs\n this._trigger('validate');\n\n return this.whenValid({force, value: this.value, _refreshed: true})\n .always(() => { this._reflowUI(); })\n .done(() => { this._trigger('success'); })\n .fail(() => { this._trigger('error'); })\n .always(() => { this._trigger('validated'); })\n .pipe(...this._pipeAccordingToValidationResult());\n },\n\n hasConstraints: function () {\n return 0 !== this.constraints.length;\n },\n\n // An empty optional field does not need validation\n needsValidation: function (value) {\n if ('undefined' === typeof value)\n value = this.getValue();\n\n // If a field is empty and not required, it is valid\n // Except if `data-parsley-validate-if-empty` explicitely added, useful for some custom validators\n if (!value.length && !this._isRequired() && 'undefined' === typeof this.options.validateIfEmpty)\n return false;\n\n return true;\n },\n\n _isInGroup: function (group) {\n if (Array.isArray(this.options.group))\n return -1 !== $.inArray(group, this.options.group);\n return this.options.group === group;\n },\n\n // Just validate field. Do not trigger any event.\n // Returns `true` iff all constraints pass, `false` if there are failures,\n // or `null` if the result can not be determined yet (depends on a promise)\n // See also `whenValid`.\n isValid: function (options) {\n if (arguments.length >= 1 && !$.isPlainObject(options)) {\n Utils.warnOnce('Calling isValid on a parsley field without passing arguments as an object is deprecated.');\n var [force, value] = arguments;\n options = {force, value};\n }\n var promise = this.whenValid(options);\n if (!promise) // Excluded via `group`\n return true;\n return statusMapping[promise.state()];\n },\n\n // Just validate field. Do not trigger any event.\n // @returns a promise that succeeds only when all validations do\n // or `undefined` if the field is not in the given `group`.\n // The argument `force` will force validation of empty fields.\n // If a `value` is given, it will be validated instead of the value of the input.\n whenValid: function ({force = false, value, group, _refreshed} = {}) {\n // Recompute options and rebind constraints to have latest changes\n if (!_refreshed)\n this.refresh();\n // do not validate a field if not the same as given validation group\n if (group && !this._isInGroup(group))\n return;\n\n this.validationResult = true;\n\n // A field without constraint is valid\n if (!this.hasConstraints())\n return $.when();\n\n // Value could be passed as argument, needed to add more power to 'field:validate'\n if ('undefined' === typeof value || null === value)\n value = this.getValue();\n\n if (!this.needsValidation(value) && true !== force)\n return $.when();\n\n var groupedConstraints = this._getGroupedConstraints();\n var promises = [];\n $.each(groupedConstraints, (_, constraints) => {\n // Process one group of constraints at a time, we validate the constraints\n // and combine the promises together.\n var promise = Utils.all(\n $.map(constraints, constraint => this._validateConstraint(value, constraint))\n );\n promises.push(promise);\n if (promise.state() === 'rejected')\n return false; // Interrupt processing if a group has already failed\n });\n return Utils.all(promises);\n },\n\n // @returns a promise\n _validateConstraint: function(value, constraint) {\n var result = constraint.validate(value, this);\n // Map false to a failed promise\n if (false === result)\n result = $.Deferred().reject();\n // Make sure we return a promise and that we record failures\n return Utils.all([result]).fail(errorMessage => {\n if (!(this.validationResult instanceof Array))\n this.validationResult = [];\n this.validationResult.push({\n assert: constraint,\n errorMessage: 'string' === typeof errorMessage && errorMessage\n });\n });\n },\n\n // @returns Parsley field computed value that could be overrided or configured in DOM\n getValue: function () {\n var value;\n\n // Value could be overriden in DOM or with explicit options\n if ('function' === typeof this.options.value)\n value = this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n value = this.options.value;\n else\n value = this.$element.val();\n\n // Handle wrong DOM or configurations\n if ('undefined' === typeof value || null === value)\n return '';\n\n return this._handleWhitespace(value);\n },\n\n // Reset UI\n reset: function () {\n this._resetUI();\n return this._trigger('reset');\n },\n\n // Destroy Parsley instance (+ UI)\n destroy: function () {\n // Field case: emit destroy event to clean UI and then destroy stored instance\n this._destroyUI();\n this.$element.removeData('Parsley');\n this.$element.removeData('FieldMultiple');\n this._trigger('destroy');\n },\n\n // Actualize options and rebind constraints\n refresh: function () {\n this._refreshConstraints();\n return this;\n },\n\n _refreshConstraints: function () {\n return this.actualizeOptions()._bindConstraints();\n },\n\n refreshConstraints: function() {\n Utils.warnOnce(\"Parsley's refreshConstraints is deprecated. Please use refresh\");\n return this.refresh();\n },\n\n /**\n * Add a new constraint to a field\n *\n * @param {String} name\n * @param {Mixed} requirements optional\n * @param {Number} priority optional\n * @param {Boolean} isDomConstraint optional\n */\n addConstraint: function (name, requirements, priority, isDomConstraint) {\n\n if (window.Parsley._validatorRegistry.validators[name]) {\n var constraint = new Constraint(this, name, requirements, priority, isDomConstraint);\n\n // if constraint already exist, delete it and push new version\n if ('undefined' !== this.constraintsByName[constraint.name])\n this.removeConstraint(constraint.name);\n\n this.constraints.push(constraint);\n this.constraintsByName[constraint.name] = constraint;\n }\n\n return this;\n },\n\n // Remove a constraint\n removeConstraint: function (name) {\n for (var i = 0; i < this.constraints.length; i++)\n if (name === this.constraints[i].name) {\n this.constraints.splice(i, 1);\n break;\n }\n delete this.constraintsByName[name];\n return this;\n },\n\n // Update a constraint (Remove + re-add)\n updateConstraint: function (name, parameters, priority) {\n return this.removeConstraint(name)\n .addConstraint(name, parameters, priority);\n },\n\n // # Internals\n\n // Internal only.\n // Bind constraints from config + options + DOM\n _bindConstraints: function () {\n var constraints = [];\n var constraintsByName = {};\n\n // clean all existing DOM constraints to only keep javascript user constraints\n for (var i = 0; i < this.constraints.length; i++)\n if (false === this.constraints[i].isDomConstraint) {\n constraints.push(this.constraints[i]);\n constraintsByName[this.constraints[i].name] = this.constraints[i];\n }\n\n this.constraints = constraints;\n this.constraintsByName = constraintsByName;\n\n // then re-add Parsley DOM-API constraints\n for (var name in this.options)\n this.addConstraint(name, this.options[name], undefined, true);\n\n // finally, bind special HTML5 constraints\n return this._bindHtml5Constraints();\n },\n\n // Internal only.\n // Bind specific HTML5 constraints to be HTML5 compliant\n _bindHtml5Constraints: function () {\n // html5 required\n if (null !== this.element.getAttribute('required'))\n this.addConstraint('required', true, undefined, true);\n\n // html5 pattern\n if (null !== this.element.getAttribute('pattern'))\n this.addConstraint('pattern', this.element.getAttribute('pattern'), undefined, true);\n\n // range\n let min = this.element.getAttribute('min');\n let max = this.element.getAttribute('max');\n if (null !== min && null !== max)\n this.addConstraint('range', [min, max], undefined, true);\n\n // HTML5 min\n else if (null !== min)\n this.addConstraint('min', min, undefined, true);\n\n // HTML5 max\n else if (null !== max)\n this.addConstraint('max', max, undefined, true);\n\n\n // length\n if (null !== this.element.getAttribute('minlength') && null !== this.element.getAttribute('maxlength'))\n this.addConstraint('length', [this.element.getAttribute('minlength'), this.element.getAttribute('maxlength')], undefined, true);\n\n // HTML5 minlength\n else if (null !== this.element.getAttribute('minlength'))\n this.addConstraint('minlength', this.element.getAttribute('minlength'), undefined, true);\n\n // HTML5 maxlength\n else if (null !== this.element.getAttribute('maxlength'))\n this.addConstraint('maxlength', this.element.getAttribute('maxlength'), undefined, true);\n\n\n // html5 types\n var type = Utils.getType(this.element);\n\n // Small special case here for HTML5 number: integer validator if step attribute is undefined or an integer value, number otherwise\n if ('number' === type) {\n return this.addConstraint('type', ['number', {\n step: this.element.getAttribute('step') || '1',\n base: min || this.element.getAttribute('value')\n }], undefined, true);\n // Regular other HTML5 supported types\n } else if (/^(email|url|range|date)$/i.test(type)) {\n return this.addConstraint('type', type, undefined, true);\n }\n return this;\n },\n\n // Internal only.\n // Field is required if have required constraint without `false` value\n _isRequired: function () {\n if ('undefined' === typeof this.constraintsByName.required)\n return false;\n\n return false !== this.constraintsByName.required.requirements;\n },\n\n // Internal only.\n // Shortcut to trigger an event\n _trigger: function (eventName) {\n return this.trigger('field:' + eventName);\n },\n\n // Internal only\n // Handles whitespace in a value\n // Use `data-parsley-whitespace=\"squish\"` to auto squish input value\n // Use `data-parsley-whitespace=\"trim\"` to auto trim input value\n _handleWhitespace: function (value) {\n if (true === this.options.trimValue)\n Utils.warnOnce('data-parsley-trim-value=\"true\" is deprecated, please use data-parsley-whitespace=\"trim\"');\n\n if ('squish' === this.options.whitespace)\n value = value.replace(/\\s{2,}/g, ' ');\n\n if (('trim' === this.options.whitespace) || ('squish' === this.options.whitespace) || (true === this.options.trimValue))\n value = Utils.trimString(value);\n\n return value;\n },\n\n _isDateInput: function() {\n var c = this.constraintsByName.type;\n return c && c.requirements === 'date';\n },\n\n // Internal only.\n // Returns the constraints, grouped by descending priority.\n // The result is thus an array of arrays of constraints.\n _getGroupedConstraints: function () {\n if (false === this.options.priorityEnabled)\n return [this.constraints];\n\n var groupedConstraints = [];\n var index = {};\n\n // Create array unique of priorities\n for (var i = 0; i < this.constraints.length; i++) {\n var p = this.constraints[i].priority;\n if (!index[p])\n groupedConstraints.push(index[p] = []);\n index[p].push(this.constraints[i]);\n }\n // Sort them by priority DESC\n groupedConstraints.sort(function (a, b) { return b[0].priority - a[0].priority; });\n\n return groupedConstraints;\n }\n\n};\n\nexport default Field;\n","import $ from 'jquery';\nimport Utils from './utils';\n\nvar Multiple = function () {\n this.__class__ = 'FieldMultiple';\n};\n\nMultiple.prototype = {\n // Add new `$element` sibling for multiple field\n addElement: function ($element) {\n this.$elements.push($element);\n\n return this;\n },\n\n // See `Field._refreshConstraints()`\n _refreshConstraints: function () {\n var fieldConstraints;\n\n this.constraints = [];\n\n // Select multiple special treatment\n if (this.element.nodeName === 'SELECT') {\n this.actualizeOptions()._bindConstraints();\n\n return this;\n }\n\n // Gather all constraints for each input in the multiple group\n for (var i = 0; i < this.$elements.length; i++) {\n\n // Check if element have not been dynamically removed since last binding\n if (!$('html').has(this.$elements[i]).length) {\n this.$elements.splice(i, 1);\n continue;\n }\n\n fieldConstraints = this.$elements[i].data('FieldMultiple')._refreshConstraints().constraints;\n\n for (var j = 0; j < fieldConstraints.length; j++)\n this.addConstraint(fieldConstraints[j].name, fieldConstraints[j].requirements, fieldConstraints[j].priority, fieldConstraints[j].isDomConstraint);\n }\n\n return this;\n },\n\n // See `Field.getValue()`\n getValue: function () {\n // Value could be overriden in DOM\n if ('function' === typeof this.options.value)\n return this.options.value(this);\n else if ('undefined' !== typeof this.options.value)\n return this.options.value;\n\n // Radio input case\n if (this.element.nodeName === 'INPUT') {\n var type = Utils.getType(this.element);\n if (type === 'radio')\n return this._findRelated().filter(':checked').val() || '';\n\n // checkbox input case\n if (type === 'checkbox') {\n var values = [];\n\n this._findRelated().filter(':checked').each(function () {\n values.push($(this).val());\n });\n\n return values;\n }\n }\n\n // Select multiple case\n if (this.element.nodeName === 'SELECT' && null === this.$element.val())\n return [];\n\n // Default case that should never happen\n return this.$element.val();\n },\n\n _init: function () {\n this.$elements = [this.$element];\n\n return this;\n }\n};\n\nexport default Multiple;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\n\nvar Factory = function (element, options, parsleyFormInstance) {\n this.element = element;\n this.$element = $(element);\n\n // If the element has already been bound, returns its saved Parsley instance\n var savedparsleyFormInstance = this.$element.data('Parsley');\n if (savedparsleyFormInstance) {\n\n // If the saved instance has been bound without a Form parent and there is one given in this call, add it\n if ('undefined' !== typeof parsleyFormInstance && savedparsleyFormInstance.parent === window.Parsley) {\n savedparsleyFormInstance.parent = parsleyFormInstance;\n savedparsleyFormInstance._resetOptions(savedparsleyFormInstance.options);\n }\n\n if ('object' === typeof options) {\n Object.assign(savedparsleyFormInstance.options, options);\n }\n\n return savedparsleyFormInstance;\n }\n\n // Parsley must be instantiated with a DOM element or jQuery $element\n if (!this.$element.length)\n throw new Error('You must bind Parsley on an existing element.');\n\n if ('undefined' !== typeof parsleyFormInstance && 'Form' !== parsleyFormInstance.__class__)\n throw new Error('Parent instance must be a Form instance');\n\n this.parent = parsleyFormInstance || window.Parsley;\n return this.init(options);\n};\n\nFactory.prototype = {\n init: function (options) {\n this.__class__ = 'Parsley';\n this.__version__ = 'VERSION';\n this.__id__ = Utils.generateID();\n\n // Pre-compute options\n this._resetOptions(options);\n\n // A Form instance is obviously a `` element but also every node that is not an input and has the `data-parsley-validate` attribute\n if (this.element.nodeName === 'FORM' || (Utils.checkAttr(this.element, this.options.namespace, 'validate') && !this.$element.is(this.options.inputs)))\n return this.bind('parsleyForm');\n\n // Every other element is bound as a `Field` or `FieldMultiple`\n return this.isMultiple() ? this.handleMultiple() : this.bind('parsleyField');\n },\n\n isMultiple: function () {\n var type = Utils.getType(this.element);\n return ((type === 'radio' || type === 'checkbox') ||\n (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')));\n },\n\n // Multiples fields are a real nightmare :(\n // Maybe some refactoring would be appreciated here...\n handleMultiple: function () {\n var name;\n var multiple;\n var parsleyMultipleInstance;\n\n // Handle multiple name\n this.options.multiple = this.options.multiple ||\n (name = this.element.getAttribute('name')) ||\n this.element.getAttribute('id');\n\n // Special select multiple input\n if (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')) {\n this.options.multiple = this.options.multiple || this.__id__;\n return this.bind('parsleyFieldMultiple');\n\n // Else for radio / checkboxes, we need a `name` or `data-parsley-multiple` to properly bind it\n } else if (!this.options.multiple) {\n Utils.warn('To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.', this.$element);\n return this;\n }\n\n // Remove special chars\n this.options.multiple = this.options.multiple.replace(/(:|\\.|\\[|\\]|\\{|\\}|\\$)/g, '');\n\n // Add proper `data-parsley-multiple` to siblings if we have a valid multiple name\n if (name) {\n $('input[name=\"' + name + '\"]').each((i, input) => {\n var type = Utils.getType(input);\n if ((type === 'radio' || type === 'checkbox'))\n input.setAttribute(this.options.namespace + 'multiple', this.options.multiple);\n });\n }\n\n // Check here if we don't already have a related multiple instance saved\n var $previouslyRelated = this._findRelated();\n for (var i = 0; i < $previouslyRelated.length; i++) {\n parsleyMultipleInstance = $($previouslyRelated.get(i)).data('Parsley');\n if ('undefined' !== typeof parsleyMultipleInstance) {\n\n if (!this.$element.data('FieldMultiple')) {\n parsleyMultipleInstance.addElement(this.$element);\n }\n\n break;\n }\n }\n\n // Create a secret Field instance for every multiple field. It will be stored in `data('FieldMultiple')`\n // And will be useful later to access classic `Field` stuff while being in a `FieldMultiple` instance\n this.bind('parsleyField', true);\n\n return parsleyMultipleInstance || this.bind('parsleyFieldMultiple');\n },\n\n // Return proper `Form`, `Field` or `FieldMultiple`\n bind: function (type, doNotStore) {\n var parsleyInstance;\n\n switch (type) {\n case 'parsleyForm':\n parsleyInstance = $.extend(\n new Form(this.element, this.domOptions, this.options),\n new Base(),\n window.ParsleyExtend\n )._bindFields();\n break;\n case 'parsleyField':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Base(),\n window.ParsleyExtend\n );\n break;\n case 'parsleyFieldMultiple':\n parsleyInstance = $.extend(\n new Field(this.element, this.domOptions, this.options, this.parent),\n new Multiple(),\n new Base(),\n window.ParsleyExtend\n )._init();\n break;\n default:\n throw new Error(type + 'is not a supported Parsley type');\n }\n\n if (this.options.multiple)\n Utils.setAttr(this.element, this.options.namespace, 'multiple', this.options.multiple);\n\n if ('undefined' !== typeof doNotStore) {\n this.$element.data('FieldMultiple', parsleyInstance);\n\n return parsleyInstance;\n }\n\n // Store the freshly bound instance in a DOM element for later access using jQuery `data()`\n this.$element.data('Parsley', parsleyInstance);\n\n // Tell the world we have a new Form or Field instance!\n parsleyInstance._actualizeTriggers();\n parsleyInstance._trigger('init');\n\n return parsleyInstance;\n }\n};\n\nexport default Factory;\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Defaults from './defaults';\nimport Base from './base';\nimport ValidatorRegistry from './validator_registry';\nimport UI from './ui';\nimport Form from './form';\nimport Field from './field';\nimport Multiple from './multiple';\nimport Factory from './factory';\n\nvar vernums = $.fn.jquery.split('.');\nif (parseInt(vernums[0]) <= 1 && parseInt(vernums[1]) < 8) {\n throw \"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.\";\n}\nif (!vernums.forEach) {\n Utils.warn('Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim');\n}\n// Inherit `on`, `off` & `trigger` to Parsley:\nvar Parsley = Object.assign(new Base(), {\n element: document,\n $element: $(document),\n actualizeOptions: null,\n _resetOptions: null,\n Factory: Factory,\n version: 'VERSION'\n });\n\n// Supplement Field and Form with Base\n// This way, the constructors will have access to those methods\nObject.assign(Field.prototype, UI.Field, Base.prototype);\nObject.assign(Form.prototype, UI.Form, Base.prototype);\n// Inherit actualizeOptions and _resetOptions:\nObject.assign(Factory.prototype, Base.prototype);\n\n// ### jQuery API\n// `$('.elem').parsley(options)` or `$('.elem').psly(options)`\n$.fn.parsley = $.fn.psly = function (options) {\n if (this.length > 1) {\n var instances = [];\n\n this.each(function () {\n instances.push($(this).parsley(options));\n });\n\n return instances;\n }\n\n // Return undefined if applied to non existing DOM element\n if (this.length == 0) {\n return;\n }\n\n return new Factory(this[0], options);\n};\n\n// ### Field and Form extension\n// Ensure the extension is now defined if it wasn't previously\nif ('undefined' === typeof window.ParsleyExtend)\n window.ParsleyExtend = {};\n\n// ### Parsley config\n// Inherit from ParsleyDefault, and copy over any existing values\nParsley.options = Object.assign(Utils.objectCreate(Defaults), window.ParsleyConfig);\nwindow.ParsleyConfig = Parsley.options; // Old way of accessing global options\n\n// ### Globals\nwindow.Parsley = window.psly = Parsley;\nParsley.Utils = Utils;\nwindow.ParsleyUtils = {};\n$.each(Utils, (key, value) => {\n if ('function' === typeof value) {\n window.ParsleyUtils[key] = (...args) => {\n Utils.warnOnce('Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead.');\n return Utils[key](...args);\n };\n }\n});\n\n// ### Define methods that forward to the registry, and deprecate all access except through window.Parsley\nvar registry = window.Parsley._validatorRegistry = new ValidatorRegistry(window.ParsleyConfig.validators, window.ParsleyConfig.i18n);\nwindow.ParsleyValidator = {};\n$.each('setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator hasValidator'.split(' '), function (i, method) {\n window.Parsley[method] = (...args) => registry[method](...args);\n window.ParsleyValidator[method] = function () {\n Utils.warnOnce(`Accessing the method '${method}' through Validator is deprecated. Simply call 'window.Parsley.${method}(...)'`);\n return window.Parsley[method](...arguments);\n };\n});\n\n// ### UI\n// Deprecated global object\nwindow.Parsley.UI = UI;\nwindow.ParsleyUI = {\n removeError: function (instance, name, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance.removeError(name, {updateClass});\n },\n getErrorsMessages: function (instance) {\n Utils.warnOnce(`Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly.`);\n return instance.getErrorsMessages();\n }\n};\n$.each('addError updateError'.split(' '), function (i, method) {\n window.ParsleyUI[method] = function (instance, name, message, assert, doNotUpdateClass) {\n var updateClass = true !== doNotUpdateClass;\n Utils.warnOnce(`Accessing UI is deprecated. Call '${method}' on the instance directly. Please comment in issue 1073 as to your need to call this method.`);\n return instance[method](name, {message, assert, updateClass});\n };\n});\n\n// ### PARSLEY auto-binding\n// Prevent it by setting `ParsleyConfig.autoBind` to `false`\nif (false !== window.ParsleyConfig.autoBind) {\n $(function () {\n // Works only on `data-parsley-validate`.\n if ($('[data-parsley-validate]').length)\n $('[data-parsley-validate]').parsley();\n });\n}\n\nexport default Parsley;\n","import $ from 'jquery';\nimport Field from './field';\nimport Form from './form';\nimport Utils from './utils';\n\nvar o = $({});\nvar deprecated = function () {\n Utils.warnOnce(\"Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley\");\n};\n\n// Returns an event handler that calls `fn` with the arguments it expects\nfunction adapt(fn, context) {\n // Store to allow unbinding\n if (!fn.parsleyAdaptedCallback) {\n fn.parsleyAdaptedCallback = function () {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift(this);\n fn.apply(context || o, args);\n };\n }\n return fn.parsleyAdaptedCallback;\n}\n\nvar eventPrefix = 'parsley:';\n// Converts 'parsley:form:validate' into 'form:validate'\nfunction eventName(name) {\n if (name.lastIndexOf(eventPrefix, 0) === 0)\n return name.substr(eventPrefix.length);\n return name;\n}\n\n// $.listen is deprecated. Use Parsley.on instead.\n$.listen = function (name, callback) {\n var context;\n deprecated();\n if ('object' === typeof arguments[1] && 'function' === typeof arguments[2]) {\n context = arguments[1];\n callback = arguments[2];\n }\n\n if ('function' !== typeof callback)\n throw new Error('Wrong parameters');\n\n window.Parsley.on(eventName(name), adapt(callback, context));\n};\n\n$.listenTo = function (instance, name, fn) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong parameters');\n\n instance.on(eventName(name), adapt(fn));\n};\n\n$.unsubscribe = function (name, fn) {\n deprecated();\n if ('string' !== typeof name || 'function' !== typeof fn)\n throw new Error('Wrong arguments');\n window.Parsley.off(eventName(name), fn.parsleyAdaptedCallback);\n};\n\n$.unsubscribeTo = function (instance, name) {\n deprecated();\n if (!(instance instanceof Field) && !(instance instanceof Form))\n throw new Error('Must give Parsley instance');\n instance.off(eventName(name));\n};\n\n$.unsubscribeAll = function (name) {\n deprecated();\n window.Parsley.off(eventName(name));\n $('form,input,textarea,select').each(function () {\n var instance = $(this).data('Parsley');\n if (instance) {\n instance.off(eventName(name));\n }\n });\n};\n\n// $.emit is deprecated. Use jQuery events instead.\n$.emit = function (name, instance) {\n deprecated();\n var instanceGiven = (instance instanceof Field) || (instance instanceof Form);\n var args = Array.prototype.slice.call(arguments, instanceGiven ? 2 : 1);\n args.unshift(eventName(name));\n if (!instanceGiven) {\n instance = window.Parsley;\n }\n instance.trigger(...args);\n};\n\nexport default {};\n","import $ from 'jquery';\nimport Utils from './utils';\nimport Base from './base';\n\nimport Parsley from './main';\n\n$.extend(true, Parsley, {\n asyncValidators: {\n 'default': {\n fn: function (xhr) {\n // By default, only status 2xx are deemed successful.\n // Note: we use status instead of state() because responses with status 200\n // but invalid messages (e.g. an empty body for content type set to JSON) will\n // result in state() === 'rejected'.\n return xhr.status >= 200 && xhr.status < 300;\n },\n url: false\n },\n reverse: {\n fn: function (xhr) {\n // If reverse option is set, a failing ajax request is considered successful\n return xhr.status < 200 || xhr.status >= 300;\n },\n url: false\n }\n },\n\n addAsyncValidator: function (name, fn, url, options) {\n Parsley.asyncValidators[name] = {\n fn: fn,\n url: url || false,\n options: options || {}\n };\n\n return this;\n }\n\n});\n\nParsley.addValidator('remote', {\n requirementType: {\n '': 'string',\n 'validator': 'string',\n 'reverse': 'boolean',\n 'options': 'object'\n },\n\n validateString: function (value, url, options, instance) {\n var data = {};\n var ajaxOptions;\n var csr;\n var validator = options.validator || (true === options.reverse ? 'reverse' : 'default');\n\n if ('undefined' === typeof Parsley.asyncValidators[validator])\n throw new Error('Calling an undefined async validator: `' + validator + '`');\n\n url = Parsley.asyncValidators[validator].url || url;\n\n // Fill current value\n if (url.indexOf('{value}') > -1) {\n url = url.replace('{value}', encodeURIComponent(value));\n } else {\n data[instance.element.getAttribute('name') || instance.element.getAttribute('id')] = value;\n }\n\n // Merge options passed in from the function with the ones in the attribute\n var remoteOptions = $.extend(true, options.options || {} , Parsley.asyncValidators[validator].options);\n\n // All `$.ajax(options)` could be overridden or extended directly from DOM in `data-parsley-remote-options`\n ajaxOptions = $.extend(true, {}, {\n url: url,\n data: data,\n type: 'GET'\n }, remoteOptions);\n\n // Generate store key based on ajax options\n instance.trigger('field:ajaxoptions', instance, ajaxOptions);\n\n csr = $.param(ajaxOptions);\n\n // Initialise querry cache\n if ('undefined' === typeof Parsley._remoteCache)\n Parsley._remoteCache = {};\n\n // Try to retrieve stored xhr\n var xhr = Parsley._remoteCache[csr] = Parsley._remoteCache[csr] || $.ajax(ajaxOptions);\n\n var handleXhr = function () {\n var result = Parsley.asyncValidators[validator].fn.call(instance, xhr, url, options);\n if (!result) // Map falsy results to rejected promise\n result = $.Deferred().reject();\n return $.when(result);\n };\n\n return xhr.then(handleXhr, handleXhr);\n },\n\n priority: -1\n});\n\nParsley.on('form:submit', function () {\n Parsley._remoteCache = {};\n});\n\nBase.prototype.addAsyncValidator = function () {\n Utils.warnOnce('Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`');\n return Parsley.addAsyncValidator(...arguments);\n};\n","// This is included with the Parsley library itself,\n// thus there is no use in adding it to your project.\nimport Parsley from '../parsley/main';\n\nParsley.addMessages('en', {\n defaultMessage: \"This value seems to be invalid.\",\n type: {\n email: \"This value should be a valid email.\",\n url: \"This value should be a valid url.\",\n number: \"This value should be a valid number.\",\n integer: \"This value should be a valid integer.\",\n digits: \"This value should be digits.\",\n alphanum: \"This value should be alphanumeric.\"\n },\n notblank: \"This value should not be blank.\",\n required: \"This value is required.\",\n pattern: \"This value seems to be invalid.\",\n min: \"This value should be greater than or equal to %s.\",\n max: \"This value should be lower than or equal to %s.\",\n range: \"This value should be between %s and %s.\",\n minlength: \"This value is too short. It should have %s characters or more.\",\n maxlength: \"This value is too long. It should have %s characters or fewer.\",\n length: \"This value length is invalid. It should be between %s and %s characters long.\",\n mincheck: \"You must select at least %s choices.\",\n maxcheck: \"You must select %s choices or fewer.\",\n check: \"You must select between %s and %s choices.\",\n equalto: \"This value should be the same.\",\n euvatin: \"It's not a valid VAT Identification Number.\",\n});\n\nParsley.setLocale('en');\n","/**\n * inputevent - Alleviate browser bugs for input events\n * https://github.com/marcandre/inputevent\n * @version v0.0.3 - (built Thu, Apr 14th 2016, 5:58 pm)\n * @author Marc-Andre Lafortune \n * @license MIT\n */\n\nimport $ from 'jquery';\n\nfunction InputEvent() {\n let globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n Object.assign(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: evt => {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: evt => {\n if (this.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: evt => {\n if (this.isNativeEvent(evt)) {\n this.behavesOk(evt);\n $(document)\n .on('change.inputevent', evt.data.selector, this.fakeInputEvent);\n this.fakeInputEvent(evt);\n }\n },\n\n behavesOk: evt => {\n if (this.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, this.behavesOk)\n .off('change.inputevent', evt.data.selector, this.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: () => {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n for (let selector of ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]']) {\n $(document)\n .on('input.inputevent', selector, {selector}, this.behavesOk)\n .on('change.inputevent', selector, {selector}, this.misbehaves);\n }\n },\n\n uninstall: () => {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n};\n\nexport default new InputEvent();\n","import $ from 'jquery';\nimport Parsley from './parsley/main';\nimport './parsley/pubsub';\nimport './parsley/remote';\nimport './i18n/en';\nimport inputevent from './vendor/inputevent';\n\ninputevent.install();\n\nexport default Parsley;\n"],"names":["globalID","pastWarnings","Utils","attr","element","namespace","obj","i","attribute","attributes","regex","RegExp","hasOwnProperty","length","specified","test","name","this","camelize","slice","deserializeValue","value","checkAttr","hasAttribute","setAttr","setAttribute","dasherize","String","getType","getAttribute","generateID","num","isNaN","Number","JSON","parse","e","str","replace","match","chr","toUpperCase","toLowerCase","warn","window","console","arguments","warnOnce","msg","_resetWarnings","trimString","string","date","parsed","map","x","parseInt","year","month","day","Date","getFullYear","getMonth","getDate","integer","number","parseFloat","object","regexp","flags","parseRequirement","requirementType","converter","converted","namespaceEvents","events","split","$","evt","join","difference","array","remove","result","each","_","elem","indexOf","push","all","promises","when","objectCreate","Object","create","prototype","Error","_typeof","TypeError","_SubmitSelector","Base","__id__","Defaults","inputs","excluded","priorityEnabled","multiple","group","uiEnabled","validationThreshold","focus","trigger","triggerAfterFailure","errorClass","successClass","classHandler","errorsContainer","errorsWrapper","errorTemplate","asyncSupport","_pipeAccordingToValidationResult","pipe","r","Deferred","_this","validationResult","reject","resolve","promise","actualizeOptions","options","domOptions","parent","_resetOptions","initOptions","_listeners","on","fn","subscribe","listenTo","off","queue","splice","unsubscribe","unsubscribeTo","target","extraArg","call","asyncIsValid","force","whenValid","_findRelated","querySelectorAll","$element","Validator","spec","extend","validate","requirementFirstArg","Array","isArray","validateMultiple","instance","validateDate","_isDateInput","validateNumber","validateString","parseRequirements","requirements","extraOptionReader","type","values","m","convertArrayRequirement","isPlainObject","requirementSpec","main","extra","key","convertExtraOptionRequirement","priority","ValidatorRegistry","validators","catalog","__class__","locale","init","typeTesters","email","digits","alphanum","url","range","decimalPlaces","Math","max","operatorToValidator","operator","requirementsAndInput","pop","comparisonOperator","_extends","addValidator","Parsley","setLocale","addCatalog","messages","set","addMessage","message","addMessages","nameMessageObject","arg1","arg2","_setValidator","hasValidator","updateValidator","removeValidator","validator","getErrorMessage","constraint","formatMessage","defaultMessage","en","parameters","notblank","required","step","base","tester","nb","decimals","toInt","f","round","pow","pattern","minlength","requirement","maxlength","min","mincheck","maxcheck","check","equalto","refOrValue","$reference","val","euvatin","UI","Form","_actualizeTriggers","onSubmitValidate","onSubmitButton","_focusedField","fields","field","noFocus","_destroyUI","Field","_reflowUI","_buildUI","_ui","diff","diffResults","newResult","oldResult","deep","added","kept","found","j","assert","removed","lastValidationResult","_manageStatusClass","_manageErrorsMessages","_failedOnce","getErrorsMessages","errorMessage","_getErrorMessage","addError","updateClass","_addError","_errorClass","updateError","_updateError","removeError","_removeError","hasConstraints","needsValidation","_successClass","_resetClass","errorsMessagesDisabled","_insertErrorWrapper","$errorsWrapper","find","append","addClass","$errorClassHandler","errorsWrapperId","html","removeAttr","removeClass","customConstraintErrorMessage","_manageClassHandler","validationInformationVisible","$handlerFunction","$handler","jQuery","_inputHolder","nodeName","$errorsContainer","after","$toBind","_this2","_validateIfNeeded","event","getValue","debounce","clearTimeout","_debounced","setTimeout","_this3","_resetUI","children","statusMapping","pending","resolved","rejected","parsley","submitSource","_submitSource","prop","_remoteCache","whenValidate","state","_trigger","stopImmediatePropagation","preventDefault","done","_submit","currentTarget","$synthetic","appendTo","Event","submitEvent","_refreshFields","_withoutReactualizingFormOptions","fail","always","isValid","refresh","reset","destroy","removeData","_bindFields","oldFields","fieldsMappedById","_this4","not","fieldInstance","Factory","uniqueId","oldActualizeOptions","eventName","Constraint","parsleyField","isDomConstraint","validatorSpec","_validatorRegistry","_parseRequirements","parsleyFormInstance","constraints","constraintsByName","_bindConstraints","requirementList","_isInGroup","_refreshed","_isRequired","validateIfEmpty","inArray","groupedConstraints","_getGroupedConstraints","_validateConstraint","_handleWhitespace","_refreshConstraints","refreshConstraints","addConstraint","removeConstraint","updateConstraint","undefined","_bindHtml5Constraints","trimValue","whitespace","c","index","p","sort","a","b","Multiple","addElement","$elements","fieldConstraints","has","data","filter","_init","savedparsleyFormInstance","__version__","is","bind","isMultiple","handleMultiple","parsleyMultipleInstance","input","$previouslyRelated","get","doNotStore","parsleyInstance","ParsleyExtend","vernums","jquery","forEach","document","version","psly","instances","ParsleyConfig","ParsleyUtils","registry","i18n","ParsleyValidator","method","ParsleyUI","doNotUpdateClass","autoBind","deprecated","o","adapt","context","parsleyAdaptedCallback","args","unshift","apply","eventPrefix","lastIndexOf","substr","listen","callback","unsubscribeAll","emit","instanceGiven","asyncValidators","xhr","status","reverse","addAsyncValidator","ajaxOptions","csr","encodeURIComponent","remoteOptions","param","handleXhr","ajax","then","globals","global","isNativeEvent","originalEvent","isTrusted","fakeInputEvent","misbehaves","behavesOk","selector","install","inputEventPatched","uninstall"],"mappings":"i+CAEA,IAAIA,EAAW,EACXC,EAAe,GAEfC,EAAQ,CAGVC,KAAM,SAAUC,EAASC,EAAWC,OAC9BC,EACAC,EACAC,EACAC,EAAQ,IAAIC,OAAO,IAAMN,EAAW,aAEpC,IAAuBC,EACzBA,EAAM,YAGDC,KAAKD,EACJA,EAAIM,eAAeL,WACdD,EAAIC,OAIZH,EACH,OAAOE,MAGJC,GADLE,EAAaL,EAAQK,YACDI,OAAQN,MAC1BC,EAAYC,EAAWF,KAENC,EAAUM,WAAaJ,EAAMK,KAAKP,EAAUQ,QAC3DV,EAAIW,KAAKC,SAASV,EAAUQ,KAAKG,MAAMd,EAAUQ,UAAYI,KAAKG,iBAAiBZ,EAAUa,eAI1Ff,GAGTgB,UAAW,SAAUlB,EAASC,EAAWiB,UAChClB,EAAQmB,aAAalB,EAAYiB,IAG1CE,QAAS,SAAUpB,EAASC,EAAWF,EAAMkB,GAC3CjB,EAAQqB,aAAaR,KAAKS,UAAUrB,EAAYF,GAAOwB,OAAON,KAGhEO,QAAS,SAASxB,UACTA,EAAQyB,aAAa,SAAW,QAGzCC,WAAY,iBACH,GAAK9B,KAIdoB,iBAAkB,SAAUC,OACtBU,aAGKV,EACI,QAATA,GACU,SAATA,IACQ,QAATA,EAAkB,KACjBW,MAAMD,EAAME,OAAOZ,IAC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html index 30300ca58..915f50adb 100644 --- a/doc/annotated-source/base.html +++ b/doc/annotated-source/base.html @@ -121,7 +121,7 @@

          base.js

          Base.prototype = { asyncSupport: true, // Deprecated - _pipeAccordingToValidationResult: function () { + _pipeAccordingToValidationResult: function () { var pipe = () => { var r = $.Deferred(); if (true !== this.validationResult) diff --git a/doc/annotated-source/field.html b/doc/annotated-source/field.html index 50264f4a1..805380e0d 100644 --- a/doc/annotated-source/field.html +++ b/doc/annotated-source/field.html @@ -657,7 +657,7 @@

          Public API

          * @param {Number} priority optional * @param {Boolean} isDomConstraint optional */ - addConstraint: function (name, requirements, priority, isDomConstraint) { + addConstraint: function (name, requirements, priority, isDomConstraint) { if (window.Parsley._validatorRegistry.validators[name]) { var constraint = new Constraint(this, name, requirements, priority, isDomConstraint); diff --git a/doc/annotated-source/main.html b/doc/annotated-source/main.html index 6059d3712..76455cece 100644 --- a/doc/annotated-source/main.html +++ b/doc/annotated-source/main.html @@ -297,7 +297,7 @@

          Globals

          -

          Define methods that forward to the registry, and deprecate all access except through window.Parsley

          +

          Define methods that forward to the registry, and deprecate all access except through window.Parsley

          diff --git a/doc/annotated-source/ui.html b/doc/annotated-source/ui.html index 67c6b8e7e..2165a099b 100644 --- a/doc/annotated-source/ui.html +++ b/doc/annotated-source/ui.html @@ -477,14 +477,20 @@

          ui.js

          .addClass('parsley-custom-error-message') ); + this._ui.$errorClassHandler.attr('aria-describedby', this._ui.errorsWrapperId); + return this._ui.$errorsWrapper .addClass('filled') + .attr('aria-hidden', 'false') .find('.parsley-custom-error-message') .html(this.options.errorMessage); } + this._ui.$errorClassHandler.removeAttr('aria-describedby'); + return this._ui.$errorsWrapper .removeClass('filled') + .attr('aria-hidden', 'true') .find('.parsley-custom-error-message') .remove(); } @@ -519,6 +525,7 @@

          ui.js

          .attr('aria-describedby', this._ui.errorsWrapperId); this._ui.$errorsWrapper .addClass('filled') + .attr('aria-hidden', 'false') .append( $(this.options.errorTemplate) .addClass('parsley-' + name) @@ -538,6 +545,7 @@

          ui.js

          .removeAttr('aria-describedby'); this._ui.$errorsWrapper .removeClass('filled') + .attr('aria-hidden', 'true') .find('.parsley-' + name) .remove(); }, diff --git a/doc/annotated-source/utils.html b/doc/annotated-source/utils.html index db7551535..93e7926f2 100644 --- a/doc/annotated-source/utils.html +++ b/doc/annotated-source/utils.html @@ -193,7 +193,7 @@

          utils.js

          }, /** Third party functions **/ - deserializeValue: function (value) { + deserializeValue: function (value) { var num; try { diff --git a/doc/annotated-source/validator_registry.html b/doc/annotated-source/validator_registry.html index 9ba20e6b2..a44d66b43 100644 --- a/doc/annotated-source/validator_registry.html +++ b/doc/annotated-source/validator_registry.html @@ -138,7 +138,7 @@

          validator_registry.js

          }; var typeTesters = { - email: /^((([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([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@@

          validator_registry.js

          validateDate: operatorToValidator('date', operator), validateNumber: operatorToValidator('number', operator), requirementType: operator.length <= 2 ? 'string' : ['string', 'string'], // Support operators with a 1 or 2 requirement(s) - priority: 30 + priority: 30 }); ValidatorRegistry.prototype = { @@ -462,10 +462,10 @@

          validator_registry.js

          if ('object' === typeof messages) this.catalog[locale] = messages; - if (true === set) - return this.setLocale(locale); + if (true === set) + return this.setLocale(locale); - return this; + return this; }, diff --git a/doc/assets/spec-build.js b/doc/assets/spec-build.js index acaef0aff..5070fa8fd 100644 --- a/doc/assets/spec-build.js +++ b/doc/assets/spec-build.js @@ -1,6 +1,6 @@ /*! * Parsley.js -* Version 2.9.1 - built Tue, Apr 30th 2019, 1:56 am +* Version 2.9.2 - built Tue, Dec 10th 2019, 6:18 pm * http://parsleyjs.org * Guillaume Potier - * Marc-Andre Lafortune - @@ -14,7 +14,7 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : - (factory(global.jQuery)); + (global = global || self, factory(global.jQuery)); }(this, (function ($) { 'use strict'; function setup_ew () { @@ -131,6 +131,10 @@ } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; @@ -598,7 +602,7 @@ }; var typeTesters = { - email: /^((([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/, + email: /^((([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))$/, // Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers number: /^-?(\d*\.)?\d+(e[-+]?\d+)?$/i, integer: /^-?\d+$/, @@ -1099,10 +1103,15 @@ this._insertErrorWrapper(); if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length) this._ui.$errorsWrapper.append($(this.options.errorTemplate).addClass('parsley-custom-error-message')); - return this._ui.$errorsWrapper.addClass('filled').find('.parsley-custom-error-message').html(this.options.errorMessage); + + this._ui.$errorClassHandler.attr('aria-describedby', this._ui.errorsWrapperId); + + return this._ui.$errorsWrapper.addClass('filled').attr('aria-hidden', 'false').find('.parsley-custom-error-message').html(this.options.errorMessage); } - return this._ui.$errorsWrapper.removeClass('filled').find('.parsley-custom-error-message').remove(); + this._ui.$errorClassHandler.removeAttr('aria-describedby'); + + return this._ui.$errorsWrapper.removeClass('filled').attr('aria-hidden', 'true').find('.parsley-custom-error-message').remove(); } // Show, hide, update failing constraints messages @@ -1132,7 +1141,7 @@ this._ui.$errorClassHandler.attr('aria-describedby', this._ui.errorsWrapperId); - this._ui.$errorsWrapper.addClass('filled').append($(this.options.errorTemplate).addClass('parsley-' + name).html(message || this._getErrorMessage(assert))); + this._ui.$errorsWrapper.addClass('filled').attr('aria-hidden', 'false').append($(this.options.errorTemplate).addClass('parsley-' + name).html(message || this._getErrorMessage(assert))); }, _updateError: function _updateError(name, _ref5) { var message = _ref5.message, @@ -1143,7 +1152,7 @@ _removeError: function _removeError(name) { this._ui.$errorClassHandler.removeAttr('aria-describedby'); - this._ui.$errorsWrapper.removeClass('filled').find('.parsley-' + name).remove(); + this._ui.$errorsWrapper.removeClass('filled').attr('aria-hidden', 'true').find('.parsley-' + name).remove(); }, _getErrorMessage: function _getErrorMessage(constraint) { var customConstraintErrorMessage = constraint.name + 'Message'; @@ -2034,7 +2043,7 @@ Factory.prototype = { init: function init(options) { this.__class__ = 'Parsley'; - this.__version__ = '2.9.1'; + this.__version__ = '2.9.2'; this.__id__ = Utils.generateID(); // Pre-compute options this._resetOptions(options); // A Form instance is obviously a `` element but also every node that is not an input and has the `data-parsley-validate` attribute @@ -2152,7 +2161,7 @@ actualizeOptions: null, _resetOptions: null, Factory: Factory, - version: '2.9.1' + version: '2.9.2' }); // Supplement Field and Form with Base // This way, the constructors will have access to those methods @@ -2494,9 +2503,8 @@ } globals.inputEventPatched = '0.0.3'; - var _arr = ['select', 'input[type="checkbox"]', 'input[type="radio"]', 'input[type="file"]']; - for (var _i = 0; _i < _arr.length; _i++) { + for (var _i = 0, _arr = ['select', 'input[type="checkbox"]', 'input[type="radio"]', 'input[type="file"]']; _i < _arr.length; _i++) { var selector = _arr[_i]; $(document).on('input.inputevent', selector, { selector: selector @@ -4450,6 +4458,8 @@ it('should have a type="email" validator', () => { expectValidation('', 'type', 'email').to.be(true); expectValidation('foo', 'type', 'email').not.to.be(true); + expectValidation('foo@bar.y', 'type', 'email').not.to.be(true); + expectValidation('foo@bar.y.zz', 'type', 'email').to.be(true); expectValidation('foo@bar.baz', 'type', 'email').to.be(true); expectValidation('foo+bar@bar.baz', 'type', 'email').to.be(true); expectValidation('foo.bar@bar.baz', 'type', 'email').to.be(true); diff --git a/doc/download.html b/doc/download.html index 58babf666..7e1451842 100644 --- a/doc/download.html +++ b/doc/download.html @@ -63,13 +63,13 @@

          Parsley

          -

          Download Parsley v2.9.1

          +

          Download Parsley v2.9.2


          Whole project..

          $ bower install --save parsleyjs
          $ npm install --save parsleyjs
          - +

          ..or pick & go!

          diff --git a/index.html b/index.html index fc6bdcb52..4dea66d94 100644 --- a/index.html +++ b/index.html @@ -123,7 +123,7 @@

          Parsley

          Parsley, the ultimate JavaScript form validation library

          Validating forms frontend have never been so powerful and easy.

          Get started today

          -

           v2.9.1

          +

           v2.9.2

          diff --git a/package.json b/package.json index e74c0f516..6f35636a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parsleyjs", - "version": "2.9.1", + "version": "2.9.2", "homepage": "http://parsleyjs.org", "license": "MIT", "description": "Validate your forms, frontend, without writing a single line of javascript!",