import{a as G}from"./chunk-2GEAOCQW.js";import{b as W}from"./chunk-W3AOD4ZM.js";import{h as b}from"./chunk-2HCZIN7D.js";import{b as I}from"./chunk-N6HA4CTN.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-VJWG2YMW.js";import"./chunk-FZ5W3QGW.js";import{Bb as T,Ha as _,Sa as P,Wa as c,aa as s,ai as h,eb as S,fh as y,la as u,nb as a,ob as t,pb as d,rd as g,vd as A,xb as m}from"./chunk-QIQJDAPQ.js";import{i as p}from"./chunk-3HGMGVFC.js";var L={VALIDATORS:[O.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 F=(()=>{let r=class r extends G{formReactiveService=s(I);userService=s(h);notifier=s(y);router=s(A);route=s(g);userId;verificationString;ngOnInit(){this.buildForm({password:b,"password-confirm":L}),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.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="\u041F\u0430\u0440\u043E\u043B\u044C";let i;i="\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 E;E="\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",[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,W],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:"\u0421\u0431\u0440\u043E\u0441 \u043F\u0430\u0440\u043E\u043B\u044F"}}}];export{re as default};/**i18n:d946b30bd8b2b104e368c275b91cb34bb911fa22291c946a5e8c8a6facd9306d*///# sourceMappingURL=chunk-MPT2RIR6.js.map