1import{b as O}from"./chunk-CV4OKJDT.js";import{M as V,Pa as q,R as G,Xa as B,ea as M,q as L,sa as D}from"./chunk-YQOD7X2Z.js";import"./chunk-563YFTIG.js";import"./chunk-36JN3LZY.js";import"./chunk-WPHW6CRH.js";import{J as j,e as u,h as k,i as P,p as R,s as x,t as F,w as _}from"./chunk-76O7YCWW.js";import{c as E,e as N}from"./chunk-YYIIKC2W.js";import{d as I,e as A}from"./chunk-3WYGUSDH.js";import"./chunk-LU7SZU5X.js";import"./chunk-PO2RDVKE.js";import{E as v,Ic as T,Pb as y,Rb as b,Wb as d,Xb as o,Yb as s,Zb as r,_a as w,db as a,jc as C,lc as S,pb as n,ub as g,zc as p}from"./chunk-3URBZWPM.js";import"./chunk-ODN5LVDJ.js";function J(m,l){if(m&1&&(o(0,"div"),r(1,"fab-notification",11),s()),m&2){let U=S();a(),d("isNotificationOpen",!0)("notification",U.notification)}}var oe=(()=>{let l=class l{constructor(t,i,e,h,c,z,W,H){this.authService=t,this.fb=i,this.activatedRoute=e,this.router=h,this.layoutSetupService=c,this.titleService=z,this.meta=W,this.s3GetterService=H,this.enabled=!1,this.newTitle="MyAAT: reset your password | AAT",this.submitButton={text:"Reset password",action:{type:"callback",callback:this.submit.bind(this)},type:"primary",aria:"Reset password"},this.passwordInterface={id:"password",label:"<strong>Password</strong>",required:!0,codeType:"PasswordChoice",autocomplete:"off"},this.passwordConfrimationInterface={id:"passwordConfirmation",label:"<strong>Confirm password</strong>",required:!0,codeType:"Password",autocomplete:"off"},this.notification={type:"warning",message:"",glyph:"warning"},this.layoutSetupService.setLayoutConfig({showHeader:!1,showFooter:!1,showLeftNav:!1}),this.meta.updateTag({name:"description",content:"We can help you reset your password using the email address linked to your MyAAT account."}),this.setTitle(this.newTitle),this.activatedRoute.params.subscribe(f=>{this.email=f.email,this.resetCode=f.resetcode}),this.form=this.fb.group({resetcode:[this.resetCode,u.required],password:[""],passwordConfirmation:[""],username:[this.email,u.required]}),this.form.valueChanges.subscribe(f=>{this.checkConfirmationValidator(this.form.controls.password,this.form.controls.passwordConfirmation,"Passwords"),this.enabled=!this.form.invalid,this.submitButton.disabled=!this.form.valid})}setTitle(t){this.titleService.setTitle(t)}ngOnInit(){this.homeLogo=this.s3GetterService.getUrl({objName:V.aatLogo})}submit(){this.authService.resetPassword(this.form.value.resetcode,this.form.value.password,this.form.value.username).pipe(v(t=>{throw this.enabled=!0,this.notification.isOpened=!0,this.notification.type="warning",this.notification.glyph="warning",this.notification.message=t.error.message,t})).subscribe(t=>{t==="RequestNewForgotPassword"?(this.notification.isOpened=!0,this.notification.type="warning",this.notification.glyph="warning",this.notification.message="For security reasons your reset code has expired. We have sent you a new email to reset your password, you can close this window and follow the instructions on the email"):(this.authService.isPasswordReset=!0,this.router.navigate(["../../.."],{relativeTo:this.activatedRoute}))})}checkConfirmationValidator(t,i,e){t.value!=i.value?i.errors||i.setErrors({formControlValidationErrors:{value:e+" don't match"}}):(i.setErrors(null),i.updateValueAndValidity({onlySelf:!0}))}keyDownFunction(t){t.keyCode==13&&this.form.valid&&this.submit()}};l.\u0275fac=function(i){return new(i||l)(n(L),n(j),n(E),n(N),n(M),n(A),n(I),n(G))},l.\u0275cmp=g({type:l,selectors:[["reset-pass-page"]],decls:22,vars:10,consts:[[1,"container","container-fixed","col-md-5","col-sm-10","col-xs-10"],[1,"logo"],["href",""],["alt","AAT logo",3,"src"],[1,"col-md-8","col-sm-10","col-xs-10"],["novalidate","","autocomplete","off",3,"keydown","formGroup"],[1,"form__fieldgroup"],["formControlName","password",3,"content","formControl"],["formControlName","passwordConfirmation",3,"content","formControl"],[1,"button_right","col-md-8","col-sm-10","col-xs-10"],[3,"enabled","button"],[3,"isNotificationOpen","notification"]],template:function(i,e){i&1&&(o(0,"div",0),r(1,"br")(2,"br"),o(3,"div",1)(4,"a",2),r(5,"img",3),s()(),r(6,"br"),o(7,"h3"),p(8,"MyAAT: reset your password"),s(),r(9,"br"),o(10,"div",4),y(11,J,2,2,"div"),s(),o(12,"p"),p(13,"Choose a new password"),s(),o(14,"form",5),C("keydown",function(c){return e.keyDownFunction(c)}),o(15,"div",6),r(16,"fab-input-text-2",7),s(),o(17,"div",6),r(18,"fab-input-text-2",8),s(),r(19,"br"),o(20,"div",9),r(21,"fab-button",10),s()()()),i&2&&(a(5),d("src",T(e.homeLogo),w),a(6),b(e.notification.message&&e.notification.message!==""?11:-1),a(3),d("formGroup",e.form),a(2),d("content",e.passwordInterface)("formControl",e.form.controls.password),a(2),d("content",e.passwordConfrimationInterface)("formControl",e.form.controls.passwordConfirmation),a(3),d("enabled",e.enabled)("button",e.submitButton))},dependencies:[O,B,R,k,P,x,F,_,q,D],styles:[`:root{--aat-ui-grey-25: #bfbfbf;--aat-ui-grey-55: #737373;--aat-slate: #3a5066;--aat-ui-grey-05: #f2f2f2}.container{margin:0 auto;font-size:14px}.container hr{background-color:#dce6f0;color:#dce6f0;border:none;height:1px}form .form-control{width:100%}.logo{width:95px;margin-bottom:15px} 2`],encapsulation:2});let m=l;return m})();export{oe as ResetPassPageComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.