import {J,a5 as fh,a6 as pi,hb as qh,ec as ND,ae as x,hc as ns,c as tS,ag as lp,U as RN,hd as ls,H as ul,b3 as w,ei as I4,ay as df,ah as ot,ai as o$1,al as Kv,he as te,hf as de,aa as ye,am as Dh,ab as LN,hg as hs,N as Sr,bd as K,ad as ce}from'./main-WUGO6e7n.js';var H,U=J(()=>{fh();pi();qh();ND();x();ns();tS();lp();RN();ls();ul();w();H=(()=>{class i extends I4{constructor(e,r,w,S,P){super(S,P),this.assetService=e,this.dvlConfirmationService=r,this.pwnedDialogService=w;}changePassword(e){return this.assetService.ChangePassword(e).pipe(df(r=>this.handleResponse(r)))}validatePassword(e){return this.assetService.ValidateLoginPassword(e).pipe(ot(r=>r.isValid))}resetPassword(e){return this.assetService.ResetPassword(e).pipe(df(r=>this.handleResponse(r)))}handleResponse(e){if(e.result===o$1.InvalidData){if(e.passwordResult){let r={details:e.details,result:e.result,passwordResult:e.passwordResult};return this.handleInvalidPassword(r)}return this.displayError(e),Kv(null)}return e.result===o$1.Success?Kv(e):(this.handleApiResult(e,this.translatorService.translate(o$1.getEnumKey(e.result))),Kv(null))}handleInvalidPassword(e){let r;switch(e.passwordResult){case te.InvalidTemplate:this.dvlConfirmationService.confirm({intent:"danger",actionMode:"ok",title:this.translatorService.translate("lblError"),message:`${this.translatorService.translate("ThePasswordDoesNotMeetThePasswordPolicyRequirements")}
          ${e.details}`}),r=Kv(null);break;case te.PwnedInvalid:r=this.pwnedDialogService.showPwnedDialog(de.Required);break;default:r=this.pwnedDialogService.handleError(e.result);break}return r.pipe(ot(()=>null))}displayError(e){this.dvlConfirmationService.confirm({intent:"danger",actionMode:"ok",title:this.translatorService.translate("lblError"),message:`${this.translatorService.translate(e.errorMessage)}`});}static{this.\u0275fac=function(r){return new(r||i)(ye(Dh),ye(LN),ye(hs),ye(Sr),ye(K))};}static{this.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();});export{H,U};