import{b as G}from"./chunk-EN3GHNYR.js";import{h as L}from"./chunk-O4NWZCXV.js";import{b as $,c as y}from"./chunk-BNV6WX3E.js";import{A as D,B as I,d as O,g as C,h as M,m as N,p as v,s as w}from"./chunk-7VHQBARM.js";import"./chunk-ZJ7WKAH3.js";import{Da as S,Ea as n,Eg as W,La as c,Lb as T,Wa as d,Wf as h,ad as g,ba as f,db as m,dd as A,eb as t,fb as E,nb as p,rb as P}from"./chunk-QXV2GR6R.js";import{i as r}from"./chunk-JJ4RDTEF.js";var b={VALIDATORS:[O.required],MESSAGES:{required:"Y\xEAu c\u1EA7u x\xE1c nh\u1EADn m\u1EADt kh\u1EA9u."}};var F=(()=>{let s=class s extends y{constructor(e,i,o,_,l){super();r(this,"formReactiveService");r(this,"userService");r(this,"notifier");r(this,"router");r(this,"route");r(this,"userId");r(this,"verificationString");this.formReactiveService=e,this.userService=i,this.notifier=o,this.router=_,this.route=l;}ngOnInit(){this.buildForm({password:L,"password-confirm":b}),this.userId=this.route.snapshot.queryParams.userId,this.verificationString=this.route.snapshot.queryParams.verificationString,(!this.userId||!this.verificationString)&&(this.notifier.error("Kh\xF4ng th\u1EC3 t\xECm th\u1EA5y id ng\u01B0\u1EDDi d\xF9ng ho\u1EB7c chu\u1ED7i x\xE1c minh."),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("B\u1EA1n \u0111\xE3 \u0111\u1ED5i m\u1EADt kh\u1EA9u th\xE0nh c\xF4ng!"),this.router.navigate(["/login"]);},error:e=>this.notifier.error(e.message)});}isConfirmedPasswordValid(){let e=this.form.value;return e.password===e["password-confirm"];}};r(s,"\u0275fac",function(i){return new(i||s)(n($),n(W),n(h),n(A),n(g));}),r(s,"\u0275cmp",f({type:s,selectors:[["ng-component"]],standalone:!0,features:[c,T],decls:13,vars:4,consts:()=>{let e;e="M\u1EADt kh\u1EA9u";let i;i="\u0110\xE3 x\xE1c nh\u1EADn m\u1EADt kh\u1EA9u";let o;o="\u0110\u1EB7t l\u1EA1i m\u1EADt kh\u1EA9u c\u1EE7a t\xF4i";let _;_="\u0110\u1EB7t l\u1EA1i m\u1EADt kh\u1EA9u c\u1EE7a t\xF4i";let l;l="M\u1EADt kh\u1EA9u";let u;return u="X\xE1c nh\u1EADn m\u1EADt kh\u1EA9u",[_,l,u,[1,"margin-content"],[1,"title-page"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","password"],["formControlName","password","inputId","password","placeholder",e,"autocomplete","new-password",3,"formError"],["for","password-confirm"],["formControlName","password-confirm","inputId","password-confirm","placeholder",i,"autocomplete","new-password",3,"formError"],["type","submit","value",o,1,"peertube-button","primary-button",3,"disabled"]];},template:function(i,o){i&1&&(m(0,"div",3)(1,"h1",4),p(2,0),t(),m(3,"form",5),P("ngSubmit",function(){return o.resetPassword();}),m(4,"div",6)(5,"label",7),p(6,1),t(),E(7,"my-input-text",8),t(),m(8,"div",6)(9,"label",9),p(10,2),t(),E(11,"my-input-text",10),t(),E(12,"input",11),t()()),i&2&&(S(3),d("formGroup",o.form),S(4),d("formError",o.formErrors.password),S(4),d("formError",o.formErrors["password-confirm"]),S(),d("disabled",!o.form.valid||!o.isConfirmedPasswordValid()));},dependencies:[D,N,C,M,I,v,w,G],styles:[`my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}
/*# sourceMappingURL=reset-password.component-6CW2LNIG.css.map */`]}));let R=s;return R;})();var oe=[{path:"",component:F,data:{meta:{title:"\u0110\u1EB7t l\u1EA1i m\u1EADt kh\u1EA9u"}}}];export{oe as default};/**i18n:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*///# sourceMappingURL=chunk-HPYCZBEY.js.map