{"version":3,"sources":["aspnet-validation.js"],"names":["root","factory","exports","module","window","define","amd","modules","./src/index.ts","__webpack_exports__","__webpack_require__","r","d","MvcValidationProviders","__awaiter","mode","thisArg","value","P","generator","Promise","resolve","reject","step","next","e","defineProperty","rejected","result","done","then","fulfilled","apply","_arguments","__generator","body","y","t","getDefault","sent","getModuleExports","trys","ops","g","verb","throw","return","Symbol","iterator","this","n","v","op","f","TypeError","_","call","label","pop","length","undefined","push","getRelativeFormElement","elementName","selector","realSelector","substr","dotLocation","lastIndexOf","objectName","relativeElement","document","getElementsByName","required","element","params","Boolean","stringLength","min","parseInt","max","other","otherElement","name","range","val","parseFloat","isNaN","regex","RegExp","pattern","test","email","creditcard","cDigit","nDigit","replace","charAt","bEven","nCheck","url","lowerCaseValue","indexOf","phone","remote","compare","fieldSelectors","additionalfields","split","fields","_i","fieldSelectors_1","fieldSelector","fieldElement","fieldName","encodedParams","encodedParam","encodeURIComponent","join","ok","request","XMLHttpRequest","type","postData","FormData","append","open","setRequestHeader","send","payload","onload","data","status","responseText","statusText","onerror","ValidationService","prototype","addProvider","callback","providers","addMvcProviders","mvc","scanMessages","validationMessageElements","i","name_1","getAttribute","messageFor","parseDirectives","attributes","elementUIDs","validationAtributes","cut","a","elementByUID","key","debounce","parameters","Object","keys","filter","Q","directive","error","pcut","pvalue","pkey","summary","directives","_loop_1","guid4","validateForm","c","formValidationEvent","_this","elementEvents","getElementUID","node","x","focusFirstInvalid","formInputUIDs","uid","invalidFormInputUIDs","firstInvalid","getFormValidationTask","formUID","formInputs","formValidators","isValid","prevalidate","validators","inputUID","tasks","map","all","every","shouldValidate","trackFormInput","form","fieldUID","field","addEventListener","cb","validate","success","isProgrammaticValidate","validationEvent_1","CustomEvent","detail","valid","dispatchEvent","stopImmediatePropagation","validationEvent","catch","log","uids_1","input","spans","classList","remove","renderSummary","addInput","delay","isDropdown","createValidator","setTimeout","tagName","toLowerCase","dataset","valEvent","validateEvent","inputs","createSummaryDOM","ul","createElement","li","innerHTML","appendChild","summaryElements","querySelectorAll","shadow","JSON","stringify","renderedSummaryJSON","className","cloneNode","addError","message","removeError","_b","resolution","_c","_a","provider","preventDefault","isHidden","offsetWidth","offsetHeight","getClientRects","bootstrap","readyState","scan","allowHiddenFields","focus","isFieldValid","closest","installedModules","m","getter","o","enumerable","get","toStringTag","__esModule","ns","create","bind","hasOwnProperty","object","property","p","moduleId","l"],"mappings":"CAAA,SAA2CA,EAAMC,GACxB,iBAAZC,SAA0C,iBAAXC,OAKzCC,OAAQF,QAAAD,IACT,mBAAAI,QAAAA,OAAAC,IAAAD,OAAA,GAAAJ,GAAO,iBAAAC,QAAAA,QAAA,iBAAAD,IAAUD,EAAA,iBAAmBC,IAPtC,CAMGG,OAEC,WADF,OAA2BG,EAmEzB,CAmEQC,iBAjEC,SAAAL,EAAAM,EAAAC,gBACTA,EAAAC,EAAAF,GAASC,EAAAE,EAyEDH,EAxER,yBAAS,WA2EC,OAAOI,IAGoBH,EAAoBE,EA5EzDH,EA8EQ,oBACA,WA/ECC,OAAAA,IAEP,IAAAI,EAAaC,SAAUC,EAAOC,EAAPC,EAAAC,GA2Ff,OAAO,IAAWD,EAANA,GAAUE,SAAU,SAAUC,EAASC,GAlFlDZ,SAAAA,EAAAO,GACT,IAoFcM,EAAKJ,EAAUK,KAAKP,IACpB,MAAOQ,GArFLC,EAAAA,IAAP,SAAAC,EAAAV,GAIT,IAuFcM,EAAKJ,EAAS,MAAUF,IAvFzB,MAAYQ,GAMVR,EAAPQ,IAsFE,SAASF,EAAKK,GAzGxB,IAAAX,EAsBSW,EAAAC,KACTR,EAAAO,EAAAX,SAvBAA,EAHOW,EAAAX,iBAuF2BC,EAnFhCD,EAMF,IAAAC,EAAA,SAAAG,GAgFgBA,EAAQJ,MA1FjBa,KAAAC,EAAAJ,GAiHGJ,GApFZJ,EAAAA,EAAAa,MAAShB,EAuFOiB,GAAc,KAtF9BT,WACEU,EAEM,SAAAlB,EAAAmB,GAAS,IAMNzB,EACT0B,EA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AAAQ,EAAAgR,GACS,GAAAf,EAAAe,GAKI,OAAOf,EAAiBe,GAAUxR,QAH7C,IAAAC,EAAAwQ,EAAAe,GAAA,CAQWzI,EAAGyI,EAPdC,GAAA,EAASzR,QAAA,IAOKwR,OALHnR,EAAOoQ,GAAgBnN,KAahCrD,EAZAD,QACDC,EACDA,EAAAD,QAASQ,GAiBAP,EAAOwR,GAAI,EAhBgCxR,EAAAD,QAdvC,IAAUK,EAGZoQ","file":"../aspnet-validation.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\r\n if (typeof exports === 'object' && typeof module === 'object')\r\n module.exports = factory();\r\n else if (typeof define === 'function' && define.amd) define([], factory);\r\n else if (typeof exports === 'object') exports['aspnetValidation'] = factory();\r\n else root['aspnetValidation'] = factory();\r\n})(window, function () {\r\n return /******/ (function (modules) {\r\n // webpackBootstrap\r\n /******/ // The module cache\r\n /******/ var installedModules = {};\r\n /******/\r\n /******/ // The require function\r\n /******/ function __webpack_require__(moduleId) {\r\n /******/\r\n /******/ // Check if module is in cache\r\n /******/ if (installedModules[moduleId]) {\r\n /******/ return installedModules[moduleId].exports;\r\n /******/\r\n }\r\n /******/ // Create a new module (and put it into the cache)\r\n /******/ var module = (installedModules[moduleId] = {\r\n /******/ i: moduleId,\r\n /******/ l: false,\r\n /******/ exports: {},\r\n /******/\r\n });\r\n /******/\r\n /******/ // Execute the module function\r\n /******/ modules[moduleId].call(\r\n module.exports,\r\n module,\r\n module.exports,\r\n __webpack_require__\r\n );\r\n /******/\r\n /******/ // Flag the module as loaded\r\n /******/ module.l = true;\r\n /******/\r\n /******/ // Return the exports of the module\r\n /******/ return module.exports;\r\n /******/\r\n }\r\n /******/\r\n /******/\r\n /******/ // expose the modules object (__webpack_modules__)\r\n /******/ __webpack_require__.m = modules;\r\n /******/\r\n /******/ // expose the module cache\r\n /******/ __webpack_require__.c = installedModules;\r\n /******/\r\n /******/ // define getter function for harmony exports\r\n /******/ __webpack_require__.d = function (exports, name, getter) {\r\n /******/ if (!__webpack_require__.o(exports, name)) {\r\n /******/ Object.defineProperty(exports, name, {\r\n enumerable: true,\r\n get: getter,\r\n });\r\n /******/\r\n }\r\n /******/\r\n };\r\n /******/\r\n /******/ // define __esModule on exports\r\n /******/ __webpack_require__.r = function (exports) {\r\n /******/ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {\r\n /******/ Object.defineProperty(exports, Symbol.toStringTag, {\r\n value: 'Module',\r\n });\r\n /******/\r\n }\r\n /******/ Object.defineProperty(exports, '__esModule', { value: true });\r\n /******/\r\n };\r\n /******/\r\n /******/ // create a fake namespace object\r\n /******/ // mode & 1: value is a module id, require it\r\n /******/ // mode & 2: merge all properties of value into the ns\r\n /******/ // mode & 4: return value when already ns object\r\n /******/ // mode & 8|1: behave like require\r\n /******/ __webpack_require__.t = function (value, mode) {\r\n /******/ if (mode & 1) value = __webpack_require__(value);\r\n /******/ if (mode & 8) return value;\r\n /******/ if (\r\n mode & 4 &&\r\n typeof value === 'object' &&\r\n value &&\r\n value.__esModule\r\n )\r\n return value;\r\n /******/ var ns = Object.create(null);\r\n /******/ __webpack_require__.r(ns);\r\n /******/ Object.defineProperty(ns, 'default', {\r\n enumerable: true,\r\n value: value,\r\n });\r\n /******/ if (mode & 2 && typeof value != 'string')\r\n for (var key in value)\r\n __webpack_require__.d(\r\n ns,\r\n key,\r\n function (key) {\r\n return value[key];\r\n }.bind(null, key)\r\n );\r\n /******/ return ns;\r\n /******/\r\n };\r\n /******/\r\n /******/ // getDefaultExport function for compatibility with non-harmony modules\r\n /******/ __webpack_require__.n = function (module) {\r\n /******/ var getter =\r\n module && module.__esModule\r\n ? /******/ function getDefault() {\r\n return module['default'];\r\n }\r\n : /******/ function getModuleExports() {\r\n return module;\r\n };\r\n /******/ __webpack_require__.d(getter, 'a', getter);\r\n /******/ return getter;\r\n /******/\r\n };\r\n /******/\r\n /******/ // Object.prototype.hasOwnProperty.call\r\n /******/ __webpack_require__.o = function (object, property) {\r\n return Object.prototype.hasOwnProperty.call(object, property);\r\n };\r\n /******/\r\n /******/ // __webpack_public_path__\r\n /******/ __webpack_require__.p = '';\r\n /******/\r\n /******/\r\n /******/ // Load entry module and return exports\r\n /******/ return __webpack_require__(\r\n (__webpack_require__.s = './src/index.ts')\r\n );\r\n /******/\r\n })(\r\n /************************************************************************/\r\n /******/ {\r\n /***/ './src/index.ts':\r\n /*!**********************!*\\\r\n !*** ./src/index.ts ***!\r\n \\**********************/\r\n /*! exports provided: MvcValidationProviders, ValidationService */\r\n /***/ function (module, __webpack_exports__, __webpack_require__) {\r\n 'use strict';\r\n __webpack_require__.r(__webpack_exports__);\r\n /* harmony export (binding) */ __webpack_require__.d(\r\n __webpack_exports__,\r\n 'MvcValidationProviders',\r\n function () {\r\n return MvcValidationProviders;\r\n }\r\n );\r\n /* harmony export (binding) */ __webpack_require__.d(\r\n __webpack_exports__,\r\n 'ValidationService',\r\n function () {\r\n return ValidationService;\r\n }\r\n );\r\n var __awaiter =\r\n (undefined && undefined.__awaiter) ||\r\n function (thisArg, _arguments, P, generator) {\r\n function adopt(value) {\r\n return value instanceof P\r\n ? value\r\n : new P(function (resolve) {\r\n resolve(value);\r\n });\r\n }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) {\r\n try {\r\n step(generator.next(value));\r\n } catch (e) {\r\n reject(e);\r\n }\r\n }\r\n function rejected(value) {\r\n try {\r\n step(generator['throw'](value));\r\n } catch (e) {\r\n reject(e);\r\n }\r\n }\r\n function step(result) {\r\n result.done\r\n ? resolve(result.value)\r\n : adopt(result.value).then(fulfilled, rejected);\r\n }\r\n step(\r\n (generator = generator.apply(\r\n thisArg,\r\n _arguments || []\r\n )).next()\r\n );\r\n });\r\n };\r\n var __generator =\r\n (undefined && undefined.__generator) ||\r\n function (thisArg, body) {\r\n var _ = {\r\n label: 0,\r\n sent: function () {\r\n if (t[0] & 1) throw t[1];\r\n return t[1];\r\n },\r\n trys: [],\r\n ops: [],\r\n },\r\n f,\r\n y,\r\n t,\r\n g;\r\n return (\r\n (g = { next: verb(0), throw: verb(1), return: verb(2) }),\r\n typeof Symbol === 'function' &&\r\n (g[Symbol.iterator] = function () {\r\n return this;\r\n }),\r\n g\r\n );\r\n function verb(n) {\r\n return function (v) {\r\n return step([n, v]);\r\n };\r\n }\r\n function step(op) {\r\n if (f) throw new TypeError('Generator is already executing.');\r\n while (_)\r\n try {\r\n if (\r\n ((f = 1),\r\n y &&\r\n (t =\r\n op[0] & 2\r\n ? y['return']\r\n : op[0]\r\n ? y['throw'] || ((t = y['return']) && t.call(y), 0)\r\n : y.next) &&\r\n !(t = t.call(y, op[1])).done)\r\n )\r\n return t;\r\n if (((y = 0), t)) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0:\r\n case 1:\r\n t = op;\r\n break;\r\n case 4:\r\n _.label++;\r\n return { value: op[1], done: false };\r\n case 5:\r\n _.label++;\r\n y = op[1];\r\n op = [0];\r\n continue;\r\n case 7:\r\n op = _.ops.pop();\r\n _.trys.pop();\r\n continue;\r\n default:\r\n if (\r\n !((t = _.trys),\r\n (t = t.length > 0 && t[t.length - 1])) &&\r\n (op[0] === 6 || op[0] === 2)\r\n ) {\r\n _ = 0;\r\n continue;\r\n }\r\n if (\r\n op[0] === 3 &&\r\n (!t || (op[1] > t[0] && op[1] < t[3]))\r\n ) {\r\n _.label = op[1];\r\n break;\r\n }\r\n if (op[0] === 6 && _.label < t[1]) {\r\n _.label = t[1];\r\n t = op;\r\n break;\r\n }\r\n if (t && _.label < t[2]) {\r\n _.label = t[2];\r\n _.ops.push(op);\r\n break;\r\n }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop();\r\n continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) {\r\n op = [6, e];\r\n y = 0;\r\n } finally {\r\n f = t = 0;\r\n }\r\n if (op[0] & 5) throw op[1];\r\n return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n };\r\n /**\r\n * Resolves and returns the element referred by original element using ASP.NET selector logic.\r\n * @param elementName\r\n */\r\n function getRelativeFormElement(elementName, selector) {\r\n // example elementName: Form.PasswordConfirm, Form.Email\r\n // example selector (dafuq): *.Password, *.__RequestVerificationToken\r\n // example result element name: Form.Password, __RequestVerificationToken\r\n var realSelector = selector.substr(2); // Password, __RequestVerificationToken\r\n var objectName = '';\r\n var dotLocation = elementName.lastIndexOf('.');\r\n if (dotLocation > -1) {\r\n // Form\r\n objectName = elementName.substr(0, dotLocation);\r\n // Form.Password\r\n var relativeElementName = objectName + '.' + realSelector;\r\n var relativeElement =\r\n document.getElementsByName(relativeElementName)[0];\r\n if (relativeElement) {\r\n return relativeElement;\r\n }\r\n }\r\n // __RequestVerificationToken\r\n return document.getElementsByName(realSelector)[0];\r\n }\r\n /**\r\n * Contains default implementations for ASP.NET Core MVC validation attributes.\r\n */\r\n var MvcValidationProviders = /** @class */ (function () {\r\n function MvcValidationProviders() {\r\n /**\r\n * Validates whether the input has a value.\r\n */\r\n this.required = function (value, element, params) {\r\n return Boolean(value);\r\n };\r\n /**\r\n * Validates whether the input value satisfies the length contstraint.\r\n */\r\n this.stringLength = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n if (params.min) {\r\n var min = parseInt(params.min);\r\n if (value.length < min) {\r\n return false;\r\n }\r\n }\r\n if (params.max) {\r\n var max = parseInt(params.max);\r\n if (value.length > max) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * Validates whether the input value is equal to another input value.\r\n */\r\n this.compare = function (value, element, params) {\r\n if (!params.other) {\r\n return true;\r\n }\r\n var otherElement = getRelativeFormElement(\r\n element.name,\r\n params.other\r\n );\r\n if (!otherElement) {\r\n return true;\r\n }\r\n return otherElement.value === value;\r\n };\r\n /**\r\n * Validates whether the input value is a number within a given range.\r\n */\r\n this.range = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n var val = parseFloat(value);\r\n if (isNaN(val)) {\r\n return false;\r\n }\r\n if (params.min) {\r\n var min = parseFloat(params.min);\r\n if (val < min) {\r\n return false;\r\n }\r\n }\r\n if (params.max) {\r\n var max = parseFloat(params.max);\r\n if (val > max) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * Validates whether the input value satisfies a regular expression pattern.\r\n */\r\n this.regex = function (value, element, params) {\r\n if (!value || !params.pattern) {\r\n return true;\r\n }\r\n var r = new RegExp(params.pattern);\r\n return r.test(value);\r\n };\r\n /**\r\n * Validates whether the input value is an email in accordance to RFC822 specification, with a top level domain.\r\n */\r\n this.email = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n // RFC822 email address with .TLD validation\r\n // (c) Richard Willis, Chris Ferdinandi, MIT Licensed\r\n // https://gist.github.com/badsyntax/719800\r\n // https://gist.github.com/cferdinandi/d04aad4ce064b8da3edf21e26f8944c4\r\n var r =\r\n /^([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22))*\\x40([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d))*(\\.\\w{2,})+$/;\r\n return r.test(value);\r\n };\r\n /**\r\n * Validates whether the input value is a credit card number, with Luhn's Algorithm.\r\n */\r\n this.creditcard = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n // (c) jquery-validation, MIT Licensed\r\n // https://github.com/jquery-validation/jquery-validation/blob/master/src/additional/creditcard.js\r\n // based on https://en.wikipedia.org/wiki/Luhn_algorithm\r\n // Accept only spaces, digits and dashes\r\n if (/[^0-9 \\-]+/.test(value)) {\r\n return false;\r\n }\r\n var nCheck = 0,\r\n nDigit = 0,\r\n bEven = false,\r\n n,\r\n cDigit;\r\n value = value.replace(/\\D/g, '');\r\n // Basing min and max length on https://developer.ean.com/general_info/Valid_Credit_Card_Types\r\n if (value.length < 13 || value.length > 19) {\r\n return false;\r\n }\r\n for (n = value.length - 1; n >= 0; n--) {\r\n cDigit = value.charAt(n);\r\n nDigit = parseInt(cDigit, 10);\r\n if (bEven) {\r\n if ((nDigit *= 2) > 9) {\r\n nDigit -= 9;\r\n }\r\n }\r\n nCheck += nDigit;\r\n bEven = !bEven;\r\n }\r\n return nCheck % 10 === 0;\r\n };\r\n /**\r\n * Validates whether the input value is a URL.\r\n */\r\n this.url = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n var lowerCaseValue = value.toLowerCase();\r\n // Match the logic in `UrlAttribute`\r\n return (\r\n lowerCaseValue.indexOf('http://') > -1 ||\r\n lowerCaseValue.indexOf('https://') > -1 ||\r\n lowerCaseValue.indexOf('ftp://') > -1\r\n );\r\n };\r\n /**\r\n * Validates whether the input value is a phone number.\r\n */\r\n this.phone = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n // Allows whitespace or dash as number separator because some people like to do that...\r\n var consecutiveSeparator = /[\\+\\-\\s][\\-\\s]/g;\r\n if (consecutiveSeparator.test(value)) {\r\n return false;\r\n }\r\n var r = /^\\+?[0-9\\-\\s]+$/;\r\n return r.test(value);\r\n };\r\n /**\r\n * Asynchronously validates the input value to a JSON GET API endpoint.\r\n */\r\n this.remote = function (value, element, params) {\r\n if (!value) {\r\n return true;\r\n }\r\n // params.additionalfields: *.Email,*.Username\r\n var fieldSelectors = params.additionalfields.split(',');\r\n var fields = {};\r\n for (\r\n var _i = 0, fieldSelectors_1 = fieldSelectors;\r\n _i < fieldSelectors_1.length;\r\n _i++\r\n ) {\r\n var fieldSelector = fieldSelectors_1[_i];\r\n var fieldName = fieldSelector.substr(2);\r\n var fieldElement = getRelativeFormElement(\r\n element.name,\r\n fieldSelector\r\n );\r\n var hasValue = Boolean(fieldElement && fieldElement.value);\r\n if (!hasValue) {\r\n continue;\r\n }\r\n fields[fieldName] = fieldElement.value;\r\n }\r\n var url = params['url'];\r\n // console.log(fields);\r\n var encodedParams = [];\r\n for (var fieldName in fields) {\r\n var encodedParam =\r\n encodeURIComponent(fieldName) +\r\n '=' +\r\n encodeURIComponent(fields[fieldName]);\r\n encodedParams.push(encodedParam);\r\n }\r\n var payload = encodedParams.join('&');\r\n // console.log(payload);\r\n return new Promise(function (ok, reject) {\r\n var request = new XMLHttpRequest();\r\n if (params.type === 'Post') {\r\n var postData = new FormData();\r\n for (var fieldName in fields) {\r\n postData.append(fieldName, fields[fieldName]);\r\n }\r\n request.open('post', url);\r\n request.setRequestHeader(\r\n 'Content-Type',\r\n 'application/x-www-form-urlencoded'\r\n );\r\n request.send(payload);\r\n } else {\r\n request.open('get', url + '?' + payload);\r\n request.send();\r\n }\r\n request.onload = function (e) {\r\n if (request.status >= 200 && request.status < 300) {\r\n var data = JSON.parse(request.responseText);\r\n ok(data);\r\n } else {\r\n reject({\r\n status: request.status,\r\n statusText: request.statusText,\r\n data: request.responseText,\r\n });\r\n }\r\n };\r\n request.onerror = function (e) {\r\n reject({\r\n status: request.status,\r\n statusText: request.statusText,\r\n data: request.responseText,\r\n });\r\n };\r\n });\r\n };\r\n }\r\n return MvcValidationProviders;\r\n })();\r\n\r\n /**\r\n * Responsibles for managing the DOM elements and running the validation providers.\r\n */\r\n var ValidationService = /** @class */ (function () {\r\n function ValidationService() {\r\n var _this = this;\r\n /**\r\n * A key-value collection of loaded validation plugins.\r\n */\r\n this.providers = {};\r\n /**\r\n * A key-value collection of elements for displaying validation messages for an input (by DOM ID).\r\n */\r\n this.messageFor = {};\r\n /**\r\n * A list of managed elements, each having a randomly assigned unique identifier (UID).\r\n */\r\n this.elementUIDs = [];\r\n /**\r\n * A key-value collection of UID to Element for quick lookup.\r\n */\r\n this.elementByUID = {};\r\n /**\r\n * A key-value collection of input UIDs for a
UID.\r\n */\r\n this.formInputs = {};\r\n /**\r\n * A key-value map for input UID to its validator factory.\r\n */\r\n this.validators = {};\r\n /**\r\n * A key-value map for element UID to its trigger element (submit event for , input event for