import{a as o,b as f}from"./chunk-5REFTIZS.js";import{Aj as u,Bj as I,a as s,b as A,mf as l,nf as D,o as a,p as q}from"./chunk-XBRJZCAD.js";import{a as S,b as R}from"./chunk-AIHAZUSZ.js";import{b as M,c as w}from"./chunk-IOINCEV4.js";import{Gd as v,d as m,ma as b,na as p,sa as P,x as h,xa as d}from"./chunk-JSJB5BKT.js";import{a as r,b as i,e as g}from"./chunk-SZAW6ZBW.js";var F,j=g(()=>{p();b();f();A();q();R();D();v();I();w();F=(()=>{class n{constructor(e,t){this.assetServices=e,this.translatorService=t,this.generationModes=new Map,this.generationModes.set(s.Default,this.generateSpecifiedPasswords.bind(this)),this.generationModes.set(s.SpecifiedSettings,this.generateSpecifiedPasswords.bind(this)),this.generationModes.set(s.HumanReadable,this.generateReadablePasswords.bind(this)),this.generationModes.set(s.Pattern,this.generatePatternPasswords.bind(this)),this.generationModes.set(s.Pronounceable,this.generatePronounceablePasswords.bind(this)),this.generationModes.set(s.Strong,this.generateStrongPasswords.bind(this)),this.generationModes.set(s.Passphrase,this.generatePassphrase.bind(this))}generatePasswords(e){return this.generationModes.get(e?.mode??s.Default)(e)}generatePassword(e){return this.assetServices.GenerateSpecifiedPasswordsWithValidationSettings(e).pipe(h(t=>new l(t.data)))}generateOnePassword(e){return this.generatePasswords(e).pipe(h(t=>t.data&&t.data.length>0?new l(t.data[0]):null))}isRequiredLengthMatchesConfiguration(e){let t=0;return t+=e.bracketsMin=e.includeBrackets?e.bracketsMin:0,t+=e.customCharactersMin=e.customCharacters?e.customCharactersMin:0,t+=e.digitsMin=e.includeDigits?e.digitsMin:0,t+=e.lowerCaseMin=e.includeLowerCase?e.lowerCaseMin:0,t+=e.highAnsiMin=e.includeHighAnsi?e.highAnsiMin:0,t+=e.minusMin=e.includeMinus?e.minusMin:0,t+=e.spaceMin=e.includeSpace?e.spaceMin:0,t+=e.specialCharMin=e.includeSpecialChar?e.specialCharMin:0,t+=e.underlineMin=e.includeUnderline?e.underlineMin:0,t+=e.upperCaseMin=e.includeUpperCase?e.upperCaseMin:0,t<=e.length}generateSpecifiedPasswords(e){return this.isRequiredLengthMatchesConfiguration(e)?this.assetServices.GenerateSpecifiedPasswords(e):m.create(t=>{let c=new o;c.result=S.InvalidData,c.errorMessage=this.translatorService.translate("PasswordLengthMustBeEqualOrGreaterThanTheAmountOfRequiredCharacters"),t.next(c),t.complete()})}generateReadablePasswords(e){return this.generateSpecifiedPasswords(new a(i(r({},e),{mode:s.HumanReadable})))}generatePatternPasswords(e){return this.generateSpecifiedPasswords(new a(i(r({},e),{mode:s.Pattern})))}generatePronounceablePasswords(e){return this.generateSpecifiedPasswords(new a(i(r({},e),{mode:s.Pronounceable})))}generateStrongPasswords(e){return this.generateSpecifiedPasswords(new a(i(r({},e),{mode:s.Strong})))}generatePassphrase(e){return this.generateSpecifiedPasswords(new a(i(r({},e),{mode:s.Passphrase})))}static{this.\u0275fac=function(t){return new(t||n)(d(u),d(M))}}static{this.\u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})()});export{F as a,j as b};
