"use strict";(self.webpackChunkPeerTube=self.webpackChunkPeerTube||[]).push([[3196],{63196:(A,u,t)=>{t.r(u),t.d(u,{ResetPasswordModule:()=>c});var R=t(15504),P=t(67029),d=t(31007),i=t(31777);const f={VALIDATORS:[i.kI.required],MESSAGES:{required:"Lozinka se mora potvrditi."}};var m=t(44560),e=t(51109),E=t(10047),p=t(8003);const T=[{path:"",component:(()=>{class o extends R.OI{constructor(s,r,S,_,l){super(),this.formReactiveService=s,this.userService=r,this.notifier=S,this.router=_,this.route=l}ngOnInit(){this.buildForm({password:m.$T,"password-confirm":f}),this.userId=this.route.snapshot.queryParams.userId,this.verificationString=this.route.snapshot.queryParams.verificationString,(!this.userId||!this.verificationString)&&(this.notifier.error("Nije mogu\u0107e prona\u0107i korisni\u010Dki ID ili znakovni niz potvr\u0111ivanja."),this.router.navigate(["/"]))}resetPassword(){this.userService.resetPassword(this.userId,this.verificationString,this.form.value.password).subscribe({next:()=>{this.notifier.success("Tvoja je lozinka uspje\u0161no obnovljena!"),this.router.navigate(["/login"])},error:s=>this.notifier.error(s.message)})}isConfirmedPasswordValid(){const s=this.form.value;return s.password===s["password-confirm"]}}return o.\u0275fac=function(s){return new(s||o)(e.Y36(R.RL),e.Y36(E.KD),e.Y36(E.d4),e.Y36(d.F0),e.Y36(d.gz))},o.\u0275cmp=e.Xpm({type:o,selectors:[["my-login"]],features:[e.qOj],decls:13,vars:4,consts:function(){let n,s,r,S,_,l;return n="Obnovi moju lozinku",s="Lozinka",r="Lozinka",S="Potvrdi lozinku",_="Potvr\u0111ena lozinka",l="Obnovi moju lozinku",[[1,"margin-content"],[1,"title-page"],n,["role","form",3,"formGroup","ngSubmit"],[1,"form-group"],["for","password"],s,["formControlName","password","inputId","password","placeholder",r,"autocomplete","new-password",3,"formError"],["for","password-confirm"],S,["formControlName","password-confirm","inputId","password-confirm","placeholder",_,"autocomplete","new-password",3,"formError"],["type","submit","value",l,1,"peertube-button","orange-button",3,"disabled"]]},template:function(s,r){1&s&&(e.TgZ(0,"div",0)(1,"h1",1),e.SDv(2,2),e.qZA(),e.TgZ(3,"form",3),e.NdJ("ngSubmit",function(){return r.resetPassword()}),e.TgZ(4,"div",4)(5,"label",5),e.SDv(6,6),e.qZA(),e._UZ(7,"my-input-text",7),e.qZA(),e.TgZ(8,"div",4)(9,"label",8),e.SDv(10,9),e.qZA(),e._UZ(11,"my-input-text",10),e.qZA(),e._UZ(12,"input",11),e.qZA()()),2&s&&(e.xp6(3),e.Q6J("formGroup",r.form),e.xp6(4),e.Q6J("formError",r.formErrors.password),e.xp6(4),e.Q6J("formError",r.formErrors["password-confirm"]),e.xp6(1),e.Q6J("disabled",!r.form.valid||!r.isConfirmedPasswordValid()))},dependencies:[i._Y,i.JJ,i.JL,i.sg,i.u,p.m],styles:["my-input-text[_ngcontent-%COMP%]{max-width:340px;display:block}"]}),o})(),data:{meta:{title:"Obnovi lozinku"}}}];let g=(()=>{class o{}return o.\u0275fac=function(s){return new(s||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[d.Bz.forChild(T),d.Bz]}),o})(),c=(()=>{class o{}return o.\u0275fac=function(s){return new(s||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[g,P.nC,R.hA]}),o})()}}]);
//# sourceMappingURL=3196.024798a6a0106a52.js.map