import{b}from"./chunk-LT3D367Q.js";import{h as G}from"./chunk-JKGET6SI.js";import{b as y,c as W}from"./chunk-2XLVWFPJ.js";import{B as D,C as $,d as O,g as C,h as M,n as N,q as w,t as v}from"./chunk-HYHNBP3O.js";import"./chunk-L4RULAQQ.js";import{Db as T,Ha as _,Pg as h,Sa as P,Wa as c,Xf as I,ba as s,gb as S,la as u,ld as g,pb as a,pd as A,qb as t,rb as d,zb as m}from"./chunk-7W5IJG57.js";import{i as p}from"./chunk-RB5FWREQ.js";var L={VALIDATORS:[O.required],MESSAGES:{required:"Necesas konfirmi la pasvorton."}};var F=(()=>{let r=class r extends W{formReactiveService=s(y);userService=s(h);notifier=s(I);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("Ne povas trovi identigilon a\u016D konfirman \u0109enon de uzanto."),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("Via pasvorto estas sukcese restarigita!"),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="Pasvorto";let i;i="Konfirmita pasvorto";let o;o="Restarigi mian pasvorton";let E;E="Restarigi mian pasvorton";let R;R="Pasvorto";let f;return f="Konfirmu pasvorton",[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:[D,N,C,M,$,w,v,b],styles:[`my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}
/*# sourceMappingURL=reset-password.component-PH4QHJH6.css.map */`]}));let l=r;return l;})();var re=[{path:"",component:F,data:{meta:{title:"Reset password"}}}];export{re as default};/**i18n:3558f4fa3a6acf6a8a484a0589828971efacd00f9f89386e64ec00a5fc269cc5*///# sourceMappingURL=chunk-E4UWZTI2.js.map