import{b}from"./chunk-OKEZY6F6.js";import{h as G}from"./chunk-TDT5ENQH.js";import{a as W}from"./chunk-VPBM64EO.js";import{b as I}from"./chunk-EB3EO7XT.js";import{C as v,D as $,d as O,g as C,h as M,o as N,r as w,u as D}from"./chunk-MJIAB7QL.js";import"./chunk-QBAPWXTV.js";import{Ab as T,Ga as _,Ra as P,Va as c,Xh as h,aa as s,ah as y,db as S,ka as u,mb as a,nb as t,nd as g,ob as d,rd as A,wb as m}from"./chunk-2GYONVCW.js";import{i as p}from"./chunk-6PUAHDUH.js";var L={VALIDATORS:[O.required],MESSAGES:{required:"Y\xEAu c\u1EA7u x\xE1c nh\u1EADn m\u1EADt kh\u1EA9u."}};var F=(()=>{let r=class r extends W{formReactiveService=s(I);userService=s(h);notifier=s(y);router=s(A);route=s(g);userId;verificationString;ngOnInit(){this.buildForm({password:G,"password-confirm":L}),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"];}};p(r,"\u0275fac",(()=>{let e;return function(o){return(e||(e=u(r)))(o||r);};})()),p(r,"\u0275cmp",P({type:r,selectors:[["ng-component"]],features:[c],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 E;E="\u0110\u1EB7t l\u1EA1i m\u1EADt kh\u1EA9u c\u1EE7a t\xF4i";let R;R="M\u1EADt kh\u1EA9u";let f;return f="X\xE1c nh\u1EADn m\u1EADt kh\u1EA9u",[E,R,f,[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&&(a(0,"div",3)(1,"h1",4),m(2,0),t(),a(3,"form",5),T("ngSubmit",function(){return o.resetPassword();}),a(4,"div",6)(5,"label",7),m(6,1),t(),d(7,"my-input-text",8),t(),a(8,"div",6)(9,"label",9),m(10,2),t(),d(11,"my-input-text",10),t(),d(12,"input",11),t()()),i&2&&(_(3),S("formGroup",o.form),_(4),S("formError",o.formErrors.password),_(4),S("formError",o.formErrors["password-confirm"]),_(),S("disabled",!o.form.valid||!o.isConfirmedPasswordValid()));},dependencies:[v,N,C,M,$,w,D,b],styles:[`my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}
/*# sourceMappingURL=reset-password.component-6BDFTI2K.css.map */`]}));let l=r;return l;})();var re=[{path:"",component:F,data:{meta:{title:"\u0110\u1EB7t l\u1EA1i m\u1EADt kh\u1EA9u"}}}];export{re as default};/**i18n:7c691147a9ded88b46d9cd2285c6afa220006ce26eb0d02eb4522192723b6cd8*///# sourceMappingURL=chunk-UE2N43NF.js.map