import{a as G}from"./chunk-SUNWWSFH.js";import{b as W}from"./chunk-KLBLN7W7.js";import{h as b}from"./chunk-COIDSRJ4.js";import{b as I}from"./chunk-KI7OL63D.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-PPHXRTFX.js";import"./chunk-TGGGSUIC.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-747XQIKV.js";import{i as p}from"./chunk-D3F7ONO7.js";var L={VALIDATORS:[O.required],MESSAGES:{required:"\u064A\u062C\u0628 \u062A\u0623\u0643\u064A\u062F \u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651."}};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("\u062A\u0639\u0630\u0631 \u0627\u0644\u0639\u062B\u0648\u0631 \u0639\u0644\u0649 \u0645\u0639\u0631\u0641 \u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645 \u0623\u0648 \u0633\u0644\u0633\u0644\u0629 \u0627\u0644\u062A\u062D\u0642\u0642."),this.router.navigate(["/"]));}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("\u0623\u064F\u0639\u064A\u062F\u064E \u062A\u0639\u064A\u064A\u0646 \u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651 \u0628\u0646\u062C\u0627\u062D!"),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="\u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651";let i;i="\u0623\u064F\u0643\u0651\u0650\u062F \u0627\u0644\u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651";let o;o="\u0623\u0639\u0650\u062F \u062A\u0639\u064A\u064A\u0646 \u0643\u0644\u0645\u0629 \u0633\u0631\u064A";let E;E="\u0623\u0639\u0650\u062F \u062A\u0639\u064A\u064A\u0646 \u0643\u0644\u0645\u0629 \u0633\u0631\u064A";let R;R="\u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651";let f;return f="\u0623\u0643\u062F \u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651",[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:"\u0625\u0639\u0627\u062F\u0629 \u062A\u0639\u064A\u064A\u0646 \u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631\u0651"}}}];export{re as default};/**i18n:6f27118bd781e1b187bee9d5d6ca55c8b3017949bcb9fb3e18a73e038f249d42*///# sourceMappingURL=chunk-DAFOPVB5.js.map