import{r}from'./chunk-F7sai10S.js';import{g,I as w,P as Pc,$ as $t,a as rc,b2 as mt,aO as jr,bQ as ye,b9 as m,bE as Uu,b as Pa,J as Jn,Z as Zn,q as qn,a0 as $n,Q as Qn,a1 as Vn,a2 as yn,ct as He,ce as I0,s as sp,y as yV,u as ub,F as Fp,e as Pp,t as GH,z as zB,a3 as B0,W as WH}from'./main-WLWfNrEm.js';var F={VALIDATORS:[ye.required],MESSAGES:{required:"\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0435 \u043F\u0430\u0440\u043E\u043B\u044F."}};var X=(()=>{class s extends r{formReactiveService=g(w);userService=g(Pc);serverService=g($t);notifier=g(rc);router=g(mt);route=g(jr);userId;verificationString;ngOnInit(){let{minLength:e,maxLength:r}=this.serverService.getHTMLConfig().fieldsConstraints.users.password;this.buildForm({password:m(e,r),"password-confirm":F}),this.userId=this.route.snapshot.queryParams.userId,this.verificationString=this.route.snapshot.queryParams.verificationString,(!this.userId||!this.verificationString)&&(this.notifier.error("\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0439\u0442\u0438 ID \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438\u043B\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u043E\u0447\u043D\u0443\u044E \u0441\u0442\u0440\u043E\u043A\u0443."),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("\u0412\u0430\u0448 \u043F\u0430\u0440\u043E\u043B\u044C \u0431\u044B\u043B \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0441\u0431\u0440\u043E\u0448\u0435\u043D!"),this.router.navigate(["/login"]);},error:e=>this.notifier.handleError(e)});}isConfirmedPasswordValid(){let e=this.form.value;return e.password===e["password-confirm"];}static ɵfac=(()=>{let e;return function(o){return(e||(e=Uu(s)))(o||s);};})();static ɵcmp=Pa({type:s,selectors:[["ng-component"]],features:[I0],decls:13,vars:4,consts:()=>{let e;e="\u041F\u0430\u0440\u043E\u043B\u044C";let r;r="\u041F\u0430\u0440\u043E\u043B\u044C \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D";let o;o="\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C";let l;l="\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C";let R;R="\u041F\u0430\u0440\u043E\u043B\u044C";let f;return f="\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C",[l,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",r,"autocomplete","new-password",3,"formError"],["type","submit","value",o,1,"peertube-button","primary-button",3,"disabled"]];},template:function(r,o){r&1&&(sp(0,"div",3)(1,"h1",4),yV(2,0),ub(),sp(3,"form",5),Fp("ngSubmit",function(){return o.resetPassword();}),sp(4,"div",6)(5,"label",7),yV(6,1),ub(),Pp(7,"my-input-text",8),GH(),ub(),sp(8,"div",6)(9,"label",9),yV(10,2),ub(),Pp(11,"my-input-text",10),GH(),ub(),Pp(12,"input",11),ub()()),r&2&&(zB(3),B0("formGroup",o.form),zB(4),B0("formError",o.formErrors.password),WH(),zB(4),B0("formError",o.formErrors["password-confirm"]),WH(),zB(),B0("disabled",!o.form.valid||!o.isConfirmedPasswordValid()));},dependencies:[Jn,Zn,qn,$n,Qn,Vn,yn,He],styles:["my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}"],changeDetection:1});}return s;})();var te=[{path:"",component:X,data:{meta:{title:"\u0421\u0431\u0440\u043E\u0441 \u043F\u0430\u0440\u043E\u043B\u044F"}}}];/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{te as default};//# sourceMappingURL=chunk-DCnl4y1P.js.map