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:"Confirma\xE7\xE3o da senha \xE9 necess\xE1ria."}};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("N\xE3o foi poss\xEDvel localizar o id de usu\xE1rio ou string de verifica\xE7\xE3o."),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("Sua senha foi redefinida com sucesso!"),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="Palavra-passe";let i;i="Palavra-passe confirmada";let o;o="Redefinir a minha palavra-passe";let _;_="Redefinir a minha palavra-passe";let l;l="Palavra-passe";let u;return u="Confirmar palavra-passe",[_,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:"Redefinir senha"}}}];export{oe as default};/**i18n:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*///# sourceMappingURL=chunk-HPYCZBEY.js.map