/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/suf-password@0.7.0/lib/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var Password;Object.defineProperty(exports,"__esModule",{value:!0}),function(e){function s(e,s){switch(this.check=e,this.password=s,this.error=void 0,this.passed=!0,this.data={invertCheck:this.check.invertCheck,errType:void 0},this.check.type){case"custom":t.call(this,"custom");break;case"customRegex":t.call(this,"customRegex");break;case"numbers":r.call(this,/\d/g,["number"]);break;case"letters":r.call(this,/[a-z][A-Z]/g,["letter"]);break;case"lowercase":r.call(this,/[a-z]/g,["lowercase letter"]);break;case"uppercase":r.call(this,/[A-Z]/g,["uppercase letter"]);break;case"spaces":r.call(this,/\s/g,["space"]);break;case"symbols":r.call(this,/[`~\!@#\$%\^\&\*\(\)\-_\=\+\[\{\}\]\\\|;:'",<.>\/\?€£¥₹]/g,"symbol");break;default:this.error="checking type not valid."}return{err:this.error,passed:this.passed,data:this.data}}function t(e){this.check[e]?(this.passed="custom"===e?this.check.custom(this.password):this.check.customRegex.test(this.password),this.check.invertCheck&&(this.passed=!this.passed),this.error=this.passed?void 0:this.check.customError):this.error=`${e} has to be defined.`,this.data.errType=e}function r(e,s){this.regexMatch=function(e,s,t){if(null===e)return{errType:t?"times":"normal",passed:!!s};if(t)return{errType:"times",passed:s?e.length<=t:e.length>=t};return{errType:"normal",passed:s?e.length<1:e.length>0}}(this.password.match(e),this.check.invertCheck,this.check.times),this.data.errType=this.regexMatch.errType,this.passed=this.regexMatch.passed,this.check.customError&&!0!==this.passed?this.error=this.check.customError:this.passed||(this.error=a.call(this,s))}function a(e){if(!this.regexMatch.passed)return"normal"===this.regexMatch.errType?this.check.invertCheck?`password cannot contain ${e}s.`:`password has to contain at least one ${e}.`:this.check.invertCheck?`password cannot contain more than ${this.check.times} ${e}s.`:`password has to contain ${this.check.times} or more ${e}s.`}e.Validate=function(e,t,r={maxLength:100,minLength:0,passData:!1}){const a=[],h=[];let c=!0;if(e.length>r.maxLength||e.length<r.minLength){const s=e.length>r.maxLength;a.push(`password is to ${s?"long":"short"}, has to be ${s?"less than":"at least"} ${s?r.maxLength:r.minLength} characters long.`),c=!1}for(let r=0;r<t.length;r++){const i=s.call({},t[r],e);h.push(i.data),i.err&&a.push(i.err),!1===i.passed&&(c=!1)}return r.passData?{passed:c,errors:a,validationData:h}:{passed:c,errors:a}},e.ValidateSimple=function(e){return Password.Validate(e,[{type:"uppercase"},{type:"numbers"},{type:"spaces",invertCheck:!0}]).passed}}(Password=exports.Password||(exports.Password={}));
//# sourceMappingURL=/sm/656006875017a1aa1ff58404fa1f0389369e019e85f1d710e369c9f68461b705.map