Files
Pipi Chen b8a3516cd6 update
2020-05-07 01:02:44 +08:00

3 lines
46 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("tslib"),require("validator"),require("google-libphonenumber")):"function"==typeof define&&define.amd?define(["exports","tslib","validator","google-libphonenumber"],n):n((t=t||self).ClassValidator={},t.tslib_1,t.validator,t.googleLibphonenumber)}(this,function(t,i,e,a){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var o=function(t){this.groups=[],this.always=!1,this.each=!1,this.context=void 0,this.type=t.type,this.target=t.target,this.propertyName=t.propertyName,this.constraints=t.constraints,this.constraintCls=t.constraintCls,this.validationTypeOptions=t.validationTypeOptions,t.validationOptions&&(this.message=t.validationOptions.message,this.groups=t.validationOptions.groups,this.always=t.validationOptions.always,this.each=t.validationOptions.each,this.context=t.validationOptions.context)},r=(n.prototype.transform=function(a){var i=[];return Object.keys(a.properties).forEach(function(e){a.properties[e].forEach(function(t){var n={message:t.message,groups:t.groups,always:t.always,each:t.each},r={type:t.type,target:a.name,propertyName:e,constraints:t.constraints,validationTypeOptions:t.options,validationOptions:n};i.push(new o(r))})}),i},n);function n(){}function s(){return"undefined"!=typeof window&&(window.global=window),global.classValidatorMetadataStorage||(global.classValidatorMetadataStorage=new u),global.classValidatorMetadataStorage}var u=(Object.defineProperty(c.prototype,"hasValidationMetaData",{get:function(){return!!this.validationMetadatas.length},enumerable:!0,configurable:!0}),c.prototype.addValidationSchema=function(t){var n=this;(new r).transform(t).forEach(function(t){return n.addValidationMetadata(t)})},c.prototype.addValidationMetadata=function(t){this.validationMetadatas.push(t)},c.prototype.addConstraintMetadata=function(t){this.constraintMetadatas.push(t)},c.prototype.groupByPropertyName=function(t){var n={};return t.forEach(function(t){n[t.propertyName]||(n[t.propertyName]=[]),n[t.propertyName].push(t)}),n},c.prototype.getTargetValidationMetadatas=function(n,r,e){var t=this.validationMetadatas.filter(function(t){return(t.target===n||t.target===r)&&(!!t.always||!(e&&0<e.length)||t.groups&&!!t.groups.find(function(t){return-1!==e.indexOf(t)}))}),a=this.validationMetadatas.filter(function(t){return"string"!=typeof t.target&&t.target!==n&&(!(t.target instanceof Function)||n.prototype instanceof t.target)&&(!!t.always||!(e&&0<e.length)||t.groups&&!!t.groups.find(function(t){return-1!==e.indexOf(t)}))}).filter(function(n){return!t.find(function(t){return t.propertyName===n.propertyName&&t.type===n.type})});return t.concat(a)},c.prototype.getTargetValidatorConstraints=function(n){return this.constraintMetadatas.filter(function(t){return t.target===n})},c);function c(){this.validationMetadatas=[],this.constraintMetadatas=[]}var l=(f.prototype.toString=function(n,t,r){var e=this;function a(t){return" - property "+i+r+t+o+" has failed the following constraints: "+i+Object.keys(e.constraints).join(", ")+o+" \n"}void 0===n&&(n=!1),void 0===t&&(t=!1),void 0===r&&(r="");var i=n?"":"",o=n?"":"";if(t){var s=Number.isInteger(+this.property)?"["+this.property+"]":(r?".":"")+this.property;return this.constraints?a(s):this.children.map(function(t){return t.toString(n,!0,r+s)}).join("")}return"An instance of "+i+(this.target?this.target.constructor.name:"an object")+o+" has failed the validation:\n"+(this.constraints?a(this.property):"")+this.children.map(function(t){return t.toString(n,!0,e.property)}).join("")},f);function f(){}var d=(p.isValid=function(t){var n=this;return"isValid"!==t&&"getMessage"!==t&&-1!==Object.keys(this).map(function(t){return n[t]}).indexOf(t)},p.CUSTOM_VALIDATION="customValidation",p.NESTED_VALIDATION="nestedValidation",p.PROMISE_VALIDATION="promiseValidation",p.CONDITIONAL_VALIDATION="conditionalValidation",p.WHITELIST="whitelistValidation",p.IS_DEFINED="isDefined",p);function p(){}var v=(m.replaceMessageSpecialTokens=function(t,n){var r;return t instanceof Function?r=t(n):"string"==typeof t&&(r=t),r&&n.constraints instanceof Array&&n.constraints.forEach(function(t,n){r=r.replace(new RegExp("\\$constraint"+(n+1),"g"),t)}),r&&void 0!==n.value&&null!==n.value&&"string"==typeof n.value&&(r=r.replace(/\$value/g,n.value)),r=(r=r&&r.replace(/\$property/g,n.property))&&r.replace(/\$target/g,n.targetName)},m);function m(){}function g(t){return null!==t&&"object"==typeof t&&"function"==typeof t.then}var y=(I.prototype.execute=function(a,t,i){var o=this;this.metadataStorage.hasValidationMetaData||console.warn("No metadata found. There is more than once class-validator version installed probably. You need to flatten your dependencies.");var n=this.validatorOptions?this.validatorOptions.groups:void 0,r=this.metadataStorage.getTargetValidationMetadatas(a.constructor,t,n),s=this.metadataStorage.groupByPropertyName(r);if(this.validatorOptions&&this.validatorOptions.forbidUnknownValues&&!r.length){var e=new l;return this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.target&&!0!==this.validatorOptions.validationError.target||(e.target=a),e.value=void 0,e.property=void 0,e.children=[],e.constraints={unknownValue:"an unknown value was passed to the validate function"},void i.push(e)}this.validatorOptions&&this.validatorOptions.whitelist&&this.whitelist(a,s,i),Object.keys(s).forEach(function(n){var t=a[n],r=s[n].filter(function(t){return t.type===d.IS_DEFINED}),e=s[n].filter(function(t){return t.type!==d.IS_DEFINED&&t.type!==d.WHITELIST});t instanceof Promise&&e.find(function(t){return t.type===d.PROMISE_VALIDATION})?o.awaitingPromises.push(t.then(function(t){o.performValidations(a,t,n,r,e,i)})):o.performValidations(a,t,n,r,e,i)})},I.prototype.whitelist=function(e,n,a){var i=this,r=[];Object.keys(e).forEach(function(t){n[t]&&0!==n[t].length||r.push(t)}),0<r.length&&(this.validatorOptions&&this.validatorOptions.forbidNonWhitelisted?r.forEach(function(t){var n,r=i.generateValidationError(e,e[t],t);r.constraints=((n={})[d.WHITELIST]="property "+t+" should not exist",n),r.children=void 0,a.push(r)}):r.forEach(function(t){return delete e[t]}))},I.prototype.stripEmptyErrors=function(t){var n=this;return t.filter(function(t){if(t.children&&(t.children=n.stripEmptyErrors(t.children)),0===Object.keys(t.constraints).length){if(0===t.children.length)return!1;delete t.constraints}return!0})},I.prototype.performValidations=function(t,n,r,e,a,i){var o=a.filter(function(t){return t.type===d.CUSTOM_VALIDATION}),s=a.filter(function(t){return t.type===d.NESTED_VALIDATION}),u=a.filter(function(t){return t.type===d.CONDITIONAL_VALIDATION}),c=this.generateValidationError(t,n,r);i.push(c),this.conditionalValidations(t,n,u)&&(this.customValidations(t,n,e,c),this.mapContexts(t,n,e,c),void 0===n&&this.validatorOptions&&!0===this.validatorOptions.skipUndefinedProperties||null===n&&this.validatorOptions&&!0===this.validatorOptions.skipNullProperties||null==n&&this.validatorOptions&&!0===this.validatorOptions.skipMissingProperties||(this.customValidations(t,n,o,c),this.nestedValidations(n,s,c.children),this.mapContexts(t,n,a,c),this.mapContexts(t,n,o,c)))},I.prototype.generateValidationError=function(t,n,r){var e=new l;return this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.target&&!0!==this.validatorOptions.validationError.target||(e.target=t),this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.value&&!0!==this.validatorOptions.validationError.value||(e.value=n),e.property=r,e.children=[],e.constraints={},e},I.prototype.conditionalValidations=function(n,r,t){return t.map(function(t){return t.constraints[0](n,r)}).reduce(function(t,n){return t&&n},!0)},I.prototype.customValidations=function(p,v,t,m){var y=this;t.forEach(function(d){y.metadataStorage.getTargetValidatorConstraints(d.constraintCls).forEach(function(a){if(!a.async||!y.ignoreAsyncValidations){var n={targetName:p.constructor?p.constructor.name:void 0,property:d.propertyName,object:p,value:v,constraints:d.constraints};if(d.each&&(v instanceof Array||v instanceof Set||v instanceof Map)){var t,r=((t=v)instanceof Map?Array.from(t.values()):Array.isArray(t)?t:Array.from(t)).map(function(t){return a.instance.validate(t,n)});if(r.some(function(t){return g(t)})){var e=r.map(function(t){return g(t)?t:Promise.resolve(t)}),i=Promise.all(e).then(function(t){if(!t.every(function(t){return t})){var n=y.createValidationError(p,v,d,a),r=n[0],e=n[1];m.constraints[r]=e,d.context&&(m.contexts||(m.contexts={}),m.contexts[r]=Object.assign(m.contexts[r]||{},d.context))}});y.awaitingPromises.push(i)}else if(!r.every(function(t){return t})){var o=y.createValidationError(p,v,d,a);f=o[0],l=o[1],m.constraints[f]=l}}else{var s=a.instance.validate(v,n);if(g(s)){var u=s.then(function(t){if(!t){var n=y.createValidationError(p,v,d,a),r=n[0],e=n[1];m.constraints[r]=e,d.context&&(m.contexts||(m.contexts={}),m.contexts[r]=Object.assign(m.contexts[r]||{},d.context))}});y.awaitingPromises.push(u)}else if(!s){var c=y.createValidationError(p,v,d,a),f=c[0],l=c[1];m.constraints[f]=l}}}})})},I.prototype.nestedValidations=function(s,u,c){var f=this;void 0!==s&&u.forEach(function(t){var n;if(t.type===d.NESTED_VALIDATION||t.type===d.PROMISE_VALIDATION)if(s instanceof Array||s instanceof Set||s instanceof Map)(s instanceof Set?Array.from(s):s).forEach(function(t,n){f.performValidations(s,t,n.toString(),[],u,c)});else if(s instanceof Object){var r="string"==typeof t.target?t.target:t.target.name;f.execute(s,r,c)}else{var e=new l;e.value=s,e.property=t.propertyName,e.target=t.target;var a=f.createValidationError(t.target,s,t),i=a[0],o=a[1];e.constraints=((n={})[i]=o,n),c.push(e)}})},I.prototype.mapContexts=function(t,n,r,e){var a=this;return r.forEach(function(t){if(t.context){var n=void 0;t.type===d.CUSTOM_VALIDATION&&(n=a.metadataStorage.getTargetValidatorConstraints(t.constraintCls)[0]);var r=a.getConstraintType(t,n);e.constraints[r]&&(e.contexts||(e.contexts={}),e.contexts[r]=Object.assign(e.contexts[r]||{},t.context))}})},I.prototype.createValidationError=function(t,n,r,e){var a=t.constructor?t.constructor.name:void 0,i=this.getConstraintType(r,e),o={targetName:a,property:r.propertyName,object:t,value:n,constraints:r.constraints},s=r.message||"";return r.message||this.validatorOptions&&(!this.validatorOptions||this.validatorOptions.dismissDefaultMessages)||e&&e.instance.defaultMessage instanceof Function&&(s=e.instance.defaultMessage(o)),[i,v.replaceMessageSpecialTokens(s,o)]},I.prototype.getConstraintType=function(t,n){return n&&n.name?n.name:t.type},I);function I(t,n){this.validator=t,this.validatorOptions=n,this.awaitingPromises=[],this.ignoreAsyncValidations=!1,this.metadataStorage=s()}var h=(S.prototype.coreValidate=function(t,n,r){var e="string"==typeof t?n:t,a="string"==typeof t?t:void 0,i=new y(this,"string"==typeof t?r:n),o=[];return i.execute(e,a,o),Promise.all(i.awaitingPromises).then(function(){return i.stripEmptyErrors(o)})},S.prototype.validate=function(t,n,r){return this.coreValidate(t,n,r)},S.prototype.validateOrReject=function(r,e,a){return i.__awaiter(this,void 0,void 0,function(){var n;return i.__generator(this,function(t){switch(t.label){case 0:return[4,this.coreValidate(r,e,a)];case 1:return(n=t.sent()).length?[2,Promise.reject(n)]:[2]}})})},S.prototype.validateSync=function(t,n,r){var e="string"==typeof t?n:t,a="string"==typeof t?t:void 0,i=new y(this,"string"==typeof t?r:n);i.ignoreAsyncValidations=!0;var o=[];return i.execute(e,a,o),i.stripEmptyErrors(o)},S);function S(){}var M,b,A=(N.prototype.get=function(n){var t=this.instances.find(function(t){return t.type===n});return t||(t={type:n,object:new n},this.instances.push(t)),t.object},new N);function N(){this.instances=[]}function O(t){if(M)try{var n=M.get(t);if(n)return n;if(!b||!b.fallback)return n}catch(t){if(!b||!b.fallbackOnErrors)throw t}return A.get(t)}var E=(Object.defineProperty(_.prototype,"instance",{get:function(){return O(this.target)},enumerable:!0,configurable:!0}),_);function _(t,n,r){void 0===r&&(r=!1),this.target=t,this.name=n,this.async=r}function $(t){var n;if(t.validator instanceof Function){if(n=t.validator,1<O(u).getTargetValidatorConstraints(t.validator).length)throw"More than one implementation of ValidatorConstraintInterface found for validator on: "+t.target+":"+t.propertyName}else{var r=t.validator;e.prototype.validate=function(t,n){return r.validate(t,n)},e.prototype.defaultMessage=function(t){return r.defaultMessage?r.defaultMessage(t):""},n=e,s().addConstraintMetadata(new E(n,t.name,t.async))}function e(){}var a={type:t.name&&d.isValid(t.name)?t.name:d.CUSTOM_VALIDATION,target:t.target,propertyName:t.propertyName,validationOptions:t.options,constraintCls:n,constraints:t.constraints};s().addValidationMetadata(new o(a))}function T(r,e){return function(t){var n=e&&e.each?"each value in ":"";return r(n,t)}}function C(r,e){return function(t,n){$({name:r.name,target:t.constructor,propertyName:n,options:e,constraints:r.constraints,validator:r.validator})}}var D=d.IS_DEFINED;function L(t){return null!=t}var V="isLatLong";function R(t){return"string"==typeof t&&e.isLatLong(t)}var P="isLatitude";function w(t){return("number"==typeof t||"string"==typeof t)&&R(t+",0")}var x="isLongitude";function B(t){return("number"==typeof t||"string"==typeof t)&&R("0,"+t)}var U="equals";function H(t,n){return t===n}var j="notEquals";function F(t,n){return t!==n}var W="isEmpty";function q(t){return""===t||null==t}var Y="isNotEmpty";function k(t){return""!==t&&null!=t}function G(n,t){return!(t instanceof Array)||t.some(function(t){return t===n})}var J="isNotIn";function z(n,t){return!(t instanceof Array&&t.some(function(t){return t===n}))}var Q="isDivisibleBy";function X(t,n){return"number"==typeof t&&"number"==typeof n&&e.isDivisibleBy(String(t),n)}var Z="isPositive";function K(t){return"number"==typeof t&&0<t}var tt="isNegative";function nt(t){return"number"==typeof t&&t<0}function rt(t,n){return"number"==typeof t&&"number"==typeof n&&t<=n}function et(t,n){return"number"==typeof t&&"number"==typeof n&&n<=t}var at="minDate";function it(t,n){return t instanceof Date&&t.getTime()>=n.getTime()}var ot="maxDate";function st(t,n){return t instanceof Date&&t.getTime()<=n.getTime()}var ut="contains";function ct(t,n){return"string"==typeof t&&e.contains(t,n)}var ft="notContains";function lt(t,n){return"string"==typeof t&&!e.contains(t,n)}var dt="isAlpha";function pt(t,n){return"string"==typeof t&&e.isAlpha(t,n)}var vt="isAlphanumeric";function mt(t,n){return"string"==typeof t&&e.isAlphanumeric(t,n)}var yt="isDecimal";function gt(t,n){return"string"==typeof t&&e.isDecimal(t,n)}var It="isAscii";function ht(t){return"string"==typeof t&&e.isAscii(t)}var St="isBase64";function Mt(t){return"string"==typeof t&&e.isBase64(t)}var bt="isByteLength";function At(t,n,r){return"string"==typeof t&&e.isByteLength(t,{min:n,max:r})}var Nt="isCreditCard";function Ot(t){return"string"==typeof t&&e.isCreditCard(t)}var Et="isCurrency";function _t(t,n){return"string"==typeof t&&e.isCurrency(t,n)}var $t="isEmail";function Tt(t,n){return"string"==typeof t&&e.isEmail(t,n)}function Ct(t,n){return"string"==typeof t&&e.isFQDN(t,n)}var Dt="isFullWidth";function Lt(t){return"string"==typeof t&&e.isFullWidth(t)}var Vt="isHalfWidth";function Rt(t){return"string"==typeof t&&e.isHalfWidth(t)}var Pt="isVariableWidth";function wt(t){return"string"==typeof t&&e.isVariableWidth(t)}var xt="isHexColor";function Bt(t){return"string"==typeof t&&e.isHexColor(t)}var Ut="isHexadecimal";function Ht(t){return"string"==typeof t&&e.isHexadecimal(t)}function jt(t){return!!t&&("each"in t||"message"in t||"groups"in t||"always"in t||"context"in t)}var Ft="isMacAddress";function Wt(t,n){return"string"==typeof t&&e.isMACAddress(t,n)}function qt(t,n){var r=n?""+n:void 0;return"string"==typeof t&&e.isIP(t,r)}function Yt(t){return"string"==typeof t&&e.isPort(t)}function kt(t,n){var r=n?""+n:void 0;return"string"==typeof t&&e.isISBN(t,r)}function Gt(t){return"string"==typeof t&&e.isISIN(t)}var Jt="isIso8601";function zt(t,n){return"string"==typeof t&&e.isISO8601(t,n)}function Qt(t){return"string"==typeof t&&e.isJSON(t)}function Xt(t){return"string"==typeof t&&e.isJWT(t)}var Zt="isLowercase";function Kt(t){return"string"==typeof t&&e.isLowercase(t)}var tn="isMobilePhone";function nn(t,n,r){return"string"==typeof t&&e.isMobilePhone(t,n,r)}var rn="isISO31661Alpha2";function en(t){return"string"==typeof t&&e.isISO31661Alpha2(t)}var an="isISO31661Alpha3";function on(t){return"string"==typeof t&&e.isISO31661Alpha3(t)}var sn="isMongoId";function un(t){return"string"==typeof t&&e.isMongoId(t)}var cn="isMultibyte";function fn(t){return"string"==typeof t&&e.isMultibyte(t)}var ln="isSurrogatePair";function dn(t){return"string"==typeof t&&e.isSurrogatePair(t)}function pn(t,n){return"string"==typeof t&&e.isURL(t,n)}function vn(t,n){return"string"==typeof t&&e.isUUID(t,n)}var mn="IsFirebasePushId";function yn(t){return"string"==typeof t&&20===t.length&&/^[a-zA-Z0-9_-]*$/.test(t)}var gn="isUppercase";function In(t){return"string"==typeof t&&e.isUppercase(t)}function hn(t,n,r){return"string"==typeof t&&e.isLength(t,{min:n,max:r})}var Sn="maxLength";function Mn(t,n){return"string"==typeof t&&e.isLength(t,{min:0,max:n})}var bn="minLength";function An(t,n){return"string"==typeof t&&e.isLength(t,{min:n})}var Nn="matches";function On(t,n,r){return"string"==typeof t&&e.matches(t,n,r)}var En="isPhoneNumber";function _n(t,n){var r=a.PhoneNumberUtil.getInstance();try{var e=r.parseAndKeepRawInput(t,n);return r.isValidNumber(e)}catch(t){return!1}}var $n="isMilitaryTime";function Tn(t){return"string"==typeof t&&e.matches(t,/^([01]\d|2[0-3]):?([0-5]\d)$/)}function Cn(t,n){return"string"==typeof t&&e.isHash(t,n)}function Dn(t,n){return"string"==typeof t&&e.isISSN(t,n)}var Ln="isDateString";function Vn(t){return"string"==typeof t&&/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[\+\-][0-2]\d(?:\:[0-5]\d)?)?$/g.test(t)}var Rn="isBooleanString";function Pn(t){return"string"==typeof t&&e.isBoolean(t)}var wn="isNumberString";function xn(t,n){return"string"==typeof t&&e.isNumeric(t,n)}var Bn="isBase32";function Un(t){return"string"==typeof t&&e.isBase32(t)}function Hn(t){return"string"==typeof t&&e.isBIC(t)}var jn="isBtcAddress";function Fn(t){return"string"==typeof t&&e.isBtcAddress(t)}var Wn="isDataURI";function qn(t){return"string"==typeof t&&e.isDataURI(t)}function Yn(t){return"string"==typeof t&&e.isEAN(t)}var kn="isEthereumAddress";function Gn(t){return"string"==typeof t&&e.isEthereumAddress(t)}function Jn(t){return"string"==typeof t&&e.isHSL(t)}function zn(t){return"string"==typeof t&&e.isIBAN(t)}var Qn="isIdentityCard";function Xn(t,n){return"string"==typeof t&&e.isIdentityCard(t,n)}function Zn(t){return"string"==typeof t&&e.isISRC(t)}var Kn="isLocale";function tr(t){return"string"==typeof t&&e.isLocale(t)}var nr="isMagnetURI";function rr(t){return"string"==typeof t&&e.isMagnetURI(t)}var er="isMimeType";function ar(t){return"string"==typeof t&&e.isMimeType(t)}var ir="isOctal";function or(t){return"string"==typeof t&&e.isOctal(t)}var sr="isPassportNumber";function ur(t,n){return"string"==typeof t&&e.isPassportNumber(t,n)}var cr="isPostalCode";function fr(t,n){return"string"==typeof t&&e.isPostalCode(t,n)}var lr="isRFC3339";function dr(t){return"string"==typeof t&&e.isRFC3339(t)}var pr="isRgbColor";function vr(t,n){return"string"==typeof t&&e.isRgbColor(t,n)}var mr="isSemVer";function yr(t){return"string"==typeof t&&e.isSemVer(t)}var gr="isBoolean";function Ir(t){return t instanceof Boolean||"boolean"==typeof t}function hr(t){return t instanceof Date&&!isNaN(t.getTime())}var Sr="isNumber";function Mr(t,n){if(void 0===n&&(n={}),"number"!=typeof t)return!1;if(t===1/0||t===-1/0)return n.allowInfinity;if(Number.isNaN(t))return n.allowNaN;if(void 0!==n.maxDecimalPlaces){var r=0;if(t%1!=0&&(r=t.toString().split(".")[1].length),r>n.maxDecimalPlaces)return!1}return Number.isFinite(t)}function br(t,n){return 0<=Object.keys(n).map(function(t){return n[t]}).indexOf(t)}function Ar(t){return"number"==typeof t&&Number.isInteger(t)}var Nr="isString";function Or(t){return t instanceof String||"string"==typeof t}var Er="isArray";function _r(t){return t instanceof Array}var $r="isObject";function Tr(t){return null!=t&&("object"==typeof t||"function"==typeof t)&&!Array.isArray(t)}var Cr="arrayContains";function Dr(n,t){return n instanceof Array&&t.every(function(t){return-1!==n.indexOf(t)})}var Lr="arrayNotContains";function Vr(n,t){return n instanceof Array&&t.every(function(t){return-1===n.indexOf(t)})}var Rr="arrayNotEmpty";function Pr(t){return t instanceof Array&&0<t.length}var wr="arrayMinSize";function xr(t,n){return t instanceof Array&&t.length>=n}var Br="arrayMaxSize";function Ur(t,n){return t instanceof Array&&t.length<=n}var Hr="arrayUnique";function jr(t){if(!(t instanceof Array))return!1;var n=t.filter(function(t,n,r){return r.indexOf(t)===n});return t.length===n.length}var Fr="isNotEmptyObject";function Wr(t){if(!Tr(t))return!1;for(var n in t)if(t.hasOwnProperty(n))return!0;return!1}var qr="isInstance";function Yr(t,n){return n&&"function"==typeof n&&t instanceof n}t.ARRAY_CONTAINS=Cr,t.ARRAY_MAX_SIZE=Br,t.ARRAY_MIN_SIZE=wr,t.ARRAY_NOT_CONTAINS=Lr,t.ARRAY_NOT_EMPTY=Rr,t.ARRAY_UNIQUE=Hr,t.Allow=function(e){return function(t,n){var r={type:d.WHITELIST,target:t.constructor,propertyName:n,validationOptions:e};s().addValidationMetadata(new o(r))}},t.ArrayContains=function(t,n){return C({name:Cr,constraints:[t],validator:{validate:function(t,n){return Dr(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must contain $constraint1 values"},n)}},n)},t.ArrayMaxSize=function(t,n){return C({name:Br,constraints:[t],validator:{validate:function(t,n){return Ur(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must contain not more than $constraint1 elements"},n)}},n)},t.ArrayMinSize=function(t,n){return C({name:wr,constraints:[t],validator:{validate:function(t,n){return xr(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must contain at least $constraint1 elements"},n)}},n)},t.ArrayNotContains=function(t,n){return C({name:Lr,constraints:[t],validator:{validate:function(t,n){return Vr(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property should not contain $constraint1 values"},n)}},n)},t.ArrayNotEmpty=function(t){return C({name:Rr,validator:{validate:function(t,n){return Pr(t)},defaultMessage:T(function(t){return t+"$property should not be empty"},t)}},t)},t.ArrayUnique=function(t){return C({name:Hr,validator:{validate:function(t,n){return jr(t)},defaultMessage:T(function(t){return t+"All $property's elements must be unique"},t)}},t)},t.CONTAINS=ut,t.Contains=function(t,n){return C({name:ut,constraints:[t],validator:{validate:function(t,n){return ct(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must contain a $constraint1 string"},n)}},n)},t.EQUALS=U,t.Equals=function(t,n){return C({name:U,constraints:[t],validator:{validate:function(t,n){return H(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be equal to $constraint1"},n)}},n)},t.IS_ALPHA=dt,t.IS_ALPHANUMERIC=vt,t.IS_ARRAY=Er,t.IS_ASCII=It,t.IS_BASE32=Bn,t.IS_BASE64=St,t.IS_BIC="isBIC",t.IS_BOOLEAN=gr,t.IS_BOOLEAN_STRING=Rn,t.IS_BTC_ADDRESS=jn,t.IS_BYTE_LENGTH=bt,t.IS_CREDIT_CARD=Nt,t.IS_CURRENCY=Et,t.IS_DATA_URI=Wn,t.IS_DATE="isDate",t.IS_DATE_STRING=Ln,t.IS_DECIMAL=yt,t.IS_DEFINED=D,t.IS_DIVISIBLE_BY=Q,t.IS_EAN="isEAN",t.IS_EMAIL=$t,t.IS_EMPTY=W,t.IS_ENUM="isEnum",t.IS_ETHEREUM_ADDRESS=kn,t.IS_FIREBASE_PUSH_ID=mn,t.IS_FQDN="isFqdn",t.IS_FULL_WIDTH=Dt,t.IS_HALF_WIDTH=Vt,t.IS_HASH="isHash",t.IS_HEXADECIMAL=Ut,t.IS_HEX_COLOR=xt,t.IS_HSL="isHSL",t.IS_IBAN="isIBAN",t.IS_IDENTITY_CARD=Qn,t.IS_IN="isIn",t.IS_INSTANCE=qr,t.IS_INT="isInt",t.IS_IP="isIp",t.IS_ISBN="isIsbn",t.IS_ISIN="isIsin",t.IS_ISO31661_ALPHA_2=rn,t.IS_ISO31661_ALPHA_3=an,t.IS_ISO8601=Jt,t.IS_ISRC="isISRC",t.IS_ISSN="isISSN",t.IS_JSON="isJson",t.IS_JWT="isJwt",t.IS_LATITUDE=P,t.IS_LATLONG=V,t.IS_LOCALE=Kn,t.IS_LONGITUDE=x,t.IS_LOWERCASE=Zt,t.IS_MAC_ADDRESS=Ft,t.IS_MAGNET_URI=nr,t.IS_MILITARY_TIME=$n,t.IS_MIME_TYPE=er,t.IS_MOBILE_PHONE=tn,t.IS_MONGO_ID=sn,t.IS_MULTIBYTE=cn,t.IS_NEGATIVE=tt,t.IS_NOT_EMPTY=Y,t.IS_NOT_EMPTY_OBJECT=Fr,t.IS_NOT_IN=J,t.IS_NUMBER=Sr,t.IS_NUMBER_STRING=wn,t.IS_OBJECT=$r,t.IS_OCTAL=ir,t.IS_PASSPORT_NUMBER=sr,t.IS_PHONE_NUMBER=En,t.IS_PORT="isPort",t.IS_POSITIVE=Z,t.IS_POSTAL_CODE=cr,t.IS_RFC_3339=lr,t.IS_RGB_COLOR=pr,t.IS_SEM_VER=mr,t.IS_STRING=Nr,t.IS_SURROGATE_PAIR=ln,t.IS_UPPERCASE=gn,t.IS_URL="isUrl",t.IS_UUID="isUuid",t.IS_VARIABLE_WIDTH=Pt,t.IsAlpha=function(t,n){return C({name:dt,constraints:[t],validator:{validate:function(t,n){return pt(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must contain only letters (a-zA-Z)"},n)}},n)},t.IsAlphanumeric=function(t,n){return C({name:vt,constraints:[t],validator:{validate:function(t,n){return mt(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must contain only letters and numbers"},n)}},n)},t.IsArray=function(t){return C({name:Er,validator:{validate:function(t,n){return _r(t)},defaultMessage:T(function(t){return t+"$property must be an array"},t)}},t)},t.IsAscii=function(t){return C({name:It,validator:{validate:function(t,n){return ht(t)},defaultMessage:T(function(t){return t+"$property must contain only ASCII characters"},t)}},t)},t.IsBIC=function(t){return C({name:"isBIC",validator:{validate:function(t,n){return Hn(t)},defaultMessage:T(function(t){return t+"$property must be a BIC or SWIFT code"},t)}},t)},t.IsBase32=function(t){return C({name:Bn,validator:{validate:function(t,n){return Un(t)},defaultMessage:T(function(t){return t+"$property must be base32 encoded"},t)}},t)},t.IsBase64=function(t){return C({name:St,validator:{validate:function(t,n){return Mt(t)},defaultMessage:T(function(t){return t+"$property must be base64 encoded"},t)}},t)},t.IsBoolean=function(t){return C({name:gr,validator:{validate:function(t,n){return Ir(t)},defaultMessage:T(function(t){return t+"$property must be a boolean value"},t)}},t)},t.IsBooleanString=function(t){return C({name:Rn,validator:{validate:function(t,n){return Pn(t)},defaultMessage:T(function(t){return t+"$property must be a boolean string"},t)}},t)},t.IsBtcAddress=function(t){return C({name:jn,validator:{validate:function(t,n){return Fn(t)},defaultMessage:T(function(t){return t+"$property must be a BTC address"},t)}},t)},t.IsByteLength=function(t,n,r){return C({name:bt,constraints:[t,n],validator:{validate:function(t,n){return At(t,n.constraints[0],n.constraints[1])},defaultMessage:T(function(t){return t+"$property's byte length must fall into ($constraint1, $constraint2) range"},r)}},r)},t.IsCreditCard=function(t){return C({name:Nt,validator:{validate:function(t,n){return Ot(t)},defaultMessage:T(function(t){return t+"$property must be a credit card"},t)}},t)},t.IsCurrency=function(t,n){return C({name:Et,constraints:[t],validator:{validate:function(t,n){return _t(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be a currency"},n)}},n)},t.IsDataURI=function(t){return C({name:Wn,validator:{validate:function(t,n){return qn(t)},defaultMessage:T(function(t){return t+"$property must be a data uri format"},t)}},t)},t.IsDate=function(t){return C({name:"isDate",validator:{validate:function(t,n){return hr(t)},defaultMessage:T(function(t){return t+"$property must be a Date instance"},t)}},t)},t.IsDateString=function(t){return C({name:Ln,validator:{validate:function(t,n){return Vn(t)},defaultMessage:T(function(t){return t+"$property must be a ISOString"},t)}},t)},t.IsDecimal=function(t,n){return C({name:yt,constraints:[t],validator:{validate:function(t,n){return gt(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property is not a valid decimal number."},n)}},n)},t.IsDefined=function(t){return C({name:D,validator:{validate:function(t){return L(t)},defaultMessage:T(function(t){return t+"$property should not be null or undefined"},t)}},t)},t.IsDivisibleBy=function(t,n){return C({name:Q,constraints:[t],validator:{validate:function(t,n){return X(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be divisible by $constraint1"},n)}},n)},t.IsEAN=function(t){return C({name:"isEAN",validator:{validate:function(t,n){return Yn(t)},defaultMessage:T(function(t){return t+"$property must be an EAN (European Article Number)"},t)}},t)},t.IsEmail=function(t,n){return C({name:$t,constraints:[t],validator:{validate:function(t,n){return Tt(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be an email"},n)}},n)},t.IsEmpty=function(t){return C({name:W,validator:{validate:function(t,n){return q(t)},defaultMessage:T(function(t){return t+"$property must be empty"},t)}},t)},t.IsEnum=function(t,n){return C({name:"isEnum",constraints:[t],validator:{validate:function(t,n){return br(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be a valid enum value"},n)}},n)},t.IsEthereumAddress=function(t){return C({name:kn,validator:{validate:function(t,n){return Gn(t)},defaultMessage:T(function(t){return t+"$property must be an Ethereum address"},t)}},t)},t.IsFQDN=function(t,n){return C({name:"isFqdn",constraints:[t],validator:{validate:function(t,n){return Ct(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be a valid domain name"},n)}},n)},t.IsFirebasePushId=function(t){return C({name:mn,validator:{validate:function(t,n){return yn(t)},defaultMessage:T(function(t){return t+"$property must be a Firebase Push Id"},t)}},t)},t.IsFullWidth=function(t){return C({name:Dt,validator:{validate:function(t,n){return Lt(t)},defaultMessage:T(function(t){return t+"$property must contain a full-width characters"},t)}},t)},t.IsHSL=function(t){return C({name:"isHSL",validator:{validate:function(t,n){return Jn(t)},defaultMessage:T(function(t){return t+"$property must be a HSL color"},t)}},t)},t.IsHalfWidth=function(t){return C({name:Vt,validator:{validate:function(t,n){return Rt(t)},defaultMessage:T(function(t){return t+"$property must contain a half-width characters"},t)}},t)},t.IsHash=function(t,n){return C({name:"isHash",constraints:[t],validator:{validate:function(t,n){return Cn(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be a hash of type $constraint1"},n)}},n)},t.IsHexColor=function(t){return C({name:xt,validator:{validate:function(t,n){return Bt(t)},defaultMessage:T(function(t){return t+"$property must be a hexadecimal color"},t)}},t)},t.IsHexadecimal=function(t){return C({name:Ut,validator:{validate:function(t,n){return Ht(t)},defaultMessage:T(function(t){return t+"$property must be a hexadecimal number"},t)}},t)},t.IsIBAN=function(t){return C({name:"isIBAN",validator:{validate:function(t,n){return zn(t)},defaultMessage:T(function(t){return t+"$property must be an IBAN"},t)}},t)},t.IsIP=function(t,n){return C({name:"isIp",constraints:[t],validator:{validate:function(t,n){return qt(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be an ip address"},n)}},n)},t.IsISBN=function(t,n){return C({name:"isIsbn",constraints:[t],validator:{validate:function(t,n){return kt(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be an ISBN"},n)}},n)},t.IsISIN=function(t){return C({name:"isIsin",validator:{validate:function(t,n){return Gt(t)},defaultMessage:T(function(t){return t+"$property must be an ISIN (stock/security identifier)"},t)}},t)},t.IsISO31661Alpha2=function(t){return C({name:rn,validator:{validate:function(t,n){return en(t)},defaultMessage:T(function(t){return t+"$property must be a valid ISO31661 Alpha2 code"},t)}},t)},t.IsISO31661Alpha3=function(t){return C({name:an,validator:{validate:function(t,n){return on(t)},defaultMessage:T(function(t){return t+"$property must be a valid ISO31661 Alpha3 code"},t)}},t)},t.IsISO8601=function(t,n){return C({name:Jt,constraints:[t],validator:{validate:function(t,n){return zt(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be a valid ISO 8601 date string"},n)}},n)},t.IsISRC=function(t){return C({name:"isISRC",validator:{validate:function(t,n){return Zn(t)},defaultMessage:T(function(t){return t+"$property must be an ISRC"},t)}},t)},t.IsISSN=function(t,n){return C({name:"isISSN",constraints:[t],validator:{validate:function(t,n){return Dn(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be a ISSN"},n)}},n)},t.IsIdentityCard=function(t,n){return C({name:Qn,constraints:[t],validator:{validate:function(t,n){return Xn(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be a identity card number"},n)}},n)},t.IsIn=function(t,n){return C({name:"isIn",constraints:[t],validator:{validate:function(t,n){return G(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be one of the following values: $constraint1"},n)}},n)},t.IsInstance=function(t,n){return C({name:qr,constraints:[t],validator:{validate:function(t,n){return Yr(t,n.constraints[0])},defaultMessage:T(function(t,n){return n.constraints[0]?t+("$property must be an instance of "+n.constraints[0].name):t+qr+" decorator expects and object as value, but got falsy value."},n)}},n)},t.IsInt=function(t){return C({name:"isInt",validator:{validate:function(t,n){return Ar(t)},defaultMessage:T(function(t){return t+"$property must be an integer number"},t)}},t)},t.IsJSON=function(t){return C({name:"isJson",validator:{validate:function(t,n){return Qt(t)},defaultMessage:T(function(t){return t+"$property must be a json string"},t)}},t)},t.IsJWT=function(t){return C({name:"isJwt",validator:{validate:function(t,n){return Xt(t)},defaultMessage:T(function(t){return t+"$property must be a jwt string"},t)}},t)},t.IsLatLong=function(t){return C({name:V,validator:{validate:function(t,n){return R(t)},defaultMessage:T(function(t){return t+"$property must be a latitude,longitude string"},t)}},t)},t.IsLatitude=function(t){return C({name:P,validator:{validate:function(t,n){return w(t)},defaultMessage:T(function(t){return t+"$property must be a latitude string or number"},t)}},t)},t.IsLocale=function(t){return C({name:Kn,validator:{validate:function(t,n){return tr(t)},defaultMessage:T(function(t){return t+"$property must be locale"},t)}},t)},t.IsLongitude=function(t){return C({name:x,validator:{validate:function(t,n){return B(t)},defaultMessage:T(function(t){return t+"$property must be a longitude string or number"},t)}},t)},t.IsLowercase=function(t){return C({name:Zt,validator:{validate:function(t,n){return Kt(t)},defaultMessage:T(function(t){return t+"$property must be a lowercase string"},t)}},t)},t.IsMACAddress=function(t,n){var r=jt(t)?void 0:t,e=jt(t)?t:n;return C({name:Ft,constraints:[r],validator:{validate:function(t,n){return Wt(t,r)},defaultMessage:T(function(t){return t+"$property must be a MAC Address"},e)}},e)},t.IsMagnetURI=function(t){return C({name:nr,validator:{validate:function(t,n){return rr(t)},defaultMessage:T(function(t){return t+"$property must be magnet uri format"},t)}},t)},t.IsMilitaryTime=function(t){return C({name:$n,validator:{validate:function(t,n){return Tn(t)},defaultMessage:T(function(t){return t+"$property must be a valid representation of military time in the format HH:MM"},t)}},t)},t.IsMimeType=function(t){return C({name:er,validator:{validate:function(t,n){return ar(t)},defaultMessage:T(function(t){return t+"$property must be MIME type format"},t)}},t)},t.IsMobilePhone=function(t,n,r){return C({name:tn,constraints:[t,n],validator:{validate:function(t,n){return nn(t,n.constraints[0],n.constraints[1])},defaultMessage:T(function(t){return t+"$property must be a phone number"},r)}},r)},t.IsMongoId=function(t){return C({name:sn,validator:{validate:function(t,n){return un(t)},defaultMessage:T(function(t){return t+"$property must be a mongodb id"},t)}},t)},t.IsMultibyte=function(t){return C({name:cn,validator:{validate:function(t,n){return fn(t)},defaultMessage:T(function(t){return t+"$property must contain one or more multibyte chars"},t)}},t)},t.IsNegative=function(t){return C({name:tt,validator:{validate:function(t,n){return nt(t)},defaultMessage:T(function(t){return t+"$property must be a negative number"},t)}},t)},t.IsNotEmpty=function(t){return C({name:Y,validator:{validate:function(t,n){return k(t)},defaultMessage:T(function(t){return t+"$property should not be empty"},t)}},t)},t.IsNotEmptyObject=function(t){return C({name:Fr,validator:{validate:function(t,n){return Wr(t)},defaultMessage:T(function(t){return t+"$property must be a non-empty object"},t)}},t)},t.IsNotIn=function(t,n){return C({name:J,constraints:[t],validator:{validate:function(t,n){return z(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property should not be one of the following values: $constraint1"},n)}},n)},t.IsNumber=function(t,n){return void 0===t&&(t={}),C({name:Sr,constraints:[t],validator:{validate:function(t,n){return Mr(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be a number conforming to the specified constraints"},n)}},n)},t.IsNumberString=function(t,n){return C({name:wn,constraints:[t],validator:{validate:function(t,n){return xn(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be a number string"},n)}},n)},t.IsObject=function(t){return C({name:$r,validator:{validate:function(t,n){return Tr(t)},defaultMessage:T(function(t){return t+"$property must be an object"},t)}},t)},t.IsOctal=function(t){return C({name:ir,validator:{validate:function(t,n){return or(t)},defaultMessage:T(function(t){return t+"$property must be valid octal number"},t)}},t)},t.IsOptional=function(e){return function(t,r){var n={type:d.CONDITIONAL_VALIDATION,target:t.constructor,propertyName:r,constraints:[function(t,n){return null!==t[r]&&void 0!==t[r]}],validationOptions:e};s().addValidationMetadata(new o(n))}},t.IsPassportNumber=function(t,n){return C({name:sr,constraints:[t],validator:{validate:function(t,n){return ur(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be valid passport number"},n)}},n)},t.IsPhoneNumber=function(t,n){return C({name:En,constraints:[t],validator:{validate:function(t,n){return _n(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be a valid phone number"},n)}},n)},t.IsPort=function(t){return C({name:"isPort",validator:{validate:function(t,n){return Yt(t)},defaultMessage:T(function(t){return t+"$property must be a port"},t)}},t)},t.IsPositive=function(t){return C({name:Z,validator:{validate:function(t,n){return K(t)},defaultMessage:T(function(t){return t+"$property must be a positive number"},t)}},t)},t.IsPostalCode=function(t,n){return C({name:cr,constraints:[t],validator:{validate:function(t,n){return fr(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be a postal code"},n)}},n)},t.IsRFC3339=function(t){return C({name:lr,validator:{validate:function(t,n){return dr(t)},defaultMessage:T(function(t){return t+"$property must be RFC 3339 date"},t)}},t)},t.IsRgbColor=function(t,n){return C({name:pr,constraints:[t],validator:{validate:function(t,n){return vr(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be RGB color"},n)}},n)},t.IsSemVer=function(t){return C({name:mr,validator:{validate:function(t,n){return yr(t)},defaultMessage:T(function(t){return t+"$property must be a Semantic Versioning Specification"},t)}},t)},t.IsString=function(t){return C({name:Nr,validator:{validate:function(t,n){return Or(t)},defaultMessage:T(function(t){return t+"$property must be a string"},t)}},t)},t.IsSurrogatePair=function(t){return C({name:ln,validator:{validate:function(t,n){return dn(t)},defaultMessage:T(function(t){return t+"$property must contain any surrogate pairs chars"},t)}},t)},t.IsUUID=function(t,n){return C({name:"isUuid",constraints:[t],validator:{validate:function(t,n){return vn(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be an UUID"},n)}},n)},t.IsUppercase=function(t){return C({name:gn,validator:{validate:function(t,n){return In(t)},defaultMessage:T(function(t){return t+"$property must be uppercase"},t)}},t)},t.IsUrl=function(t,n){return C({name:"isUrl",constraints:[t],validator:{validate:function(t,n){return pn(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be an URL address"},n)}},n)},t.IsVariableWidth=function(t){return C({name:Pt,validator:{validate:function(t,n){return wt(t)},defaultMessage:T(function(t){return t+"$property must contain a full-width and half-width characters"},t)}},t)},t.LENGTH="length",t.Length=function(t,n,r){return C({name:"length",constraints:[t,n],validator:{validate:function(t,n){return hn(t,n.constraints[0],n.constraints[1])},defaultMessage:T(function(t,n){var r=null!==n.constraints[0]&&void 0!==n.constraints[0],e=null!==n.constraints[1]&&void 0!==n.constraints[1];return r&&(!n.value||n.value.length<n.constraints[0])?t+"$property must be longer than or equal to $constraint1 characters":e&&n.value.length>n.constraints[1]?t+"$property must be shorter than or equal to $constraint2 characters":t+"$property must be longer than or equal to $constraint1 and shorter than or equal to $constraint2 characters"},r)}},r)},t.MATCHES=Nn,t.MAX="max",t.MAX_DATE=ot,t.MAX_LENGTH=Sn,t.MIN="min",t.MIN_DATE=at,t.MIN_LENGTH=bn,t.Matches=function(t,n,r){var e;return n&&n instanceof Object&&!r?r=n:e=n,C({name:Nn,constraints:[t,e],validator:{validate:function(t,n){return On(t,n.constraints[0],n.constraints[0])},defaultMessage:T(function(t,n){return t+"$property must match $constraint1 regular expression"},r)}},r)},t.Max=function(t,n){return C({name:"max",constraints:[t],validator:{validate:function(t,n){return rt(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must not be greater than $constraint1"},n)}},n)},t.MaxDate=function(t,n){return C({name:ot,constraints:[t],validator:{validate:function(t,n){return st(t,n.constraints[0])},defaultMessage:T(function(t){return"maximal allowed date for "+t+"$property is $constraint1"},n)}},n)},t.MaxLength=function(t,n){return C({name:Sn,constraints:[t],validator:{validate:function(t,n){return Mn(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be shorter than or equal to $constraint1 characters"},n)}},n)},t.MetadataStorage=u,t.Min=function(t,n){return C({name:"min",constraints:[t],validator:{validate:function(t,n){return et(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must not be less than $constraint1"},n)}},n)},t.MinDate=function(t,n){return C({name:at,constraints:[t],validator:{validate:function(t,n){return it(t,n.constraints[0])},defaultMessage:T(function(t){return"minimal allowed date for "+t+"$property is $constraint1"},n)}},n)},t.MinLength=function(t,n){return C({name:bn,constraints:[t],validator:{validate:function(t,n){return An(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property must be longer than or equal to $constraint1 characters"},n)}},n)},t.NOT_CONTAINS=ft,t.NOT_EQUALS=j,t.NotContains=function(t,n){return C({name:ft,constraints:[t],validator:{validate:function(t,n){return lt(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property should not contain a $constraint1 string"},n)}},n)},t.NotEquals=function(t,n){return C({name:j,constraints:[t],validator:{validate:function(t,n){return F(t,n.constraints[0])},defaultMessage:T(function(t){return t+"$property should not be equal to $constraint1"},n)}},n)},t.Validate=function(e,a,i){return function(t,n){var r={type:d.CUSTOM_VALIDATION,target:t.constructor,propertyName:n,constraintCls:e,constraints:a instanceof Array?a:void 0,validationOptions:a instanceof Array?i:a};s().addValidationMetadata(new o(r))}},t.ValidateBy=C,t.ValidateIf=function(e,a){return function(t,n){var r={type:d.CONDITIONAL_VALIDATION,target:t.constructor,propertyName:n,constraints:[e],validationOptions:a};s().addValidationMetadata(new o(r))}},t.ValidateNested=function(t){var e=i.__assign({},t),n=e.each?"each value in ":"";return e.message=e.message||n+"nested property $property must be either object or array",function(t,n){var r={type:d.NESTED_VALIDATION,target:t.constructor,propertyName:n,validationOptions:e};s().addValidationMetadata(new o(r))}},t.ValidatePromise=function(e){return function(t,n){var r={type:d.PROMISE_VALIDATION,target:t.constructor,propertyName:n,validationOptions:e};s().addValidationMetadata(new o(r))}},t.ValidationError=l,t.ValidationTypes=d,t.Validator=h,t.ValidatorConstraint=function(a){return function(t){var n=!(!a||!a.async),r=a&&a.name?a.name:"";r=r||((r=t.name)||r.replace(/\.?([A-Z]+)/g,function(t,n){return"_"+n.toLowerCase()}).replace(/^_/,""));var e=new E(t,r,n);s().addConstraintMetadata(e)}},t.arrayContains=Dr,t.arrayMaxSize=Ur,t.arrayMinSize=xr,t.arrayNotContains=Vr,t.arrayNotEmpty=Pr,t.arrayUnique=jr,t.buildMessage=T,t.contains=ct,t.equals=H,t.getFromContainer=O,t.getMetadataStorage=s,t.isAlpha=pt,t.isAlphanumeric=mt,t.isArray=_r,t.isAscii=ht,t.isBIC=Hn,t.isBase32=Un,t.isBase64=Mt,t.isBoolean=Ir,t.isBooleanString=Pn,t.isBtcAddress=Fn,t.isByteLength=At,t.isCreditCard=Ot,t.isCurrency=_t,t.isDataURI=qn,t.isDate=hr,t.isDateString=Vn,t.isDecimal=gt,t.isDefined=L,t.isDivisibleBy=X,t.isEAN=Yn,t.isEmail=Tt,t.isEmpty=q,t.isEnum=br,t.isEthereumAddress=Gn,t.isFQDN=Ct,t.isFirebasePushId=yn,t.isFullWidth=Lt,t.isHSL=Jn,t.isHalfWidth=Rt,t.isHash=Cn,t.isHexColor=Bt,t.isHexadecimal=Ht,t.isIBAN=zn,t.isIP=qt,t.isISBN=kt,t.isISIN=Gt,t.isISO31661Alpha2=en,t.isISO31661Alpha3=on,t.isISO8601=zt,t.isISRC=Zn,t.isISSN=Dn,t.isIdentityCard=Xn,t.isIn=G,t.isInstance=Yr,t.isInt=Ar,t.isJSON=Qt,t.isJWT=Xt,t.isLatLong=R,t.isLatitude=w,t.isLocale=tr,t.isLongitude=B,t.isLowercase=Kt,t.isMACAddress=Wt,t.isMagnetURI=rr,t.isMilitaryTime=Tn,t.isMimeType=ar,t.isMobilePhone=nn,t.isMongoId=un,t.isMultibyte=fn,t.isNegative=nt,t.isNotEmpty=k,t.isNotEmptyObject=Wr,t.isNotIn=z,t.isNumber=Mr,t.isNumberString=xn,t.isObject=Tr,t.isOctal=or,t.isPassportNumber=ur,t.isPhoneNumber=_n,t.isPort=Yt,t.isPositive=K,t.isPostalCode=fr,t.isRFC3339=dr,t.isRgbColor=vr,t.isSemVer=yr,t.isString=Or,t.isSurrogatePair=dn,t.isURL=pn,t.isUUID=vn,t.isUppercase=In,t.isValidationOptions=jt,t.isVariableWidth=wt,t.length=hn,t.matches=On,t.max=rt,t.maxDate=st,t.maxLength=Mn,t.min=et,t.minDate=it,t.minLength=An,t.notContains=lt,t.notEquals=F,t.registerDecorator=$,t.registerSchema=function(t){s().addValidationSchema(t)},t.useContainer=function(t,n){M=t,b=n},t.validate=function(t,n,r){return"string"==typeof t?O(h).validate(t,n,r):O(h).validate(t,n)},t.validateOrReject=function(t,n,r){return"string"==typeof t?O(h).validateOrReject(t,n,r):O(h).validateOrReject(t,n)},t.validateSync=function(t,n,r){return"string"==typeof t?O(h).validateSync(t,n,r):O(h).validateSync(t,n)},Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=index.umd.min.js.map