1import{a as X}from"./chunk-SESSIIFC.js";import{a as p}from"./chunk-VVIPPFUV.js";import"./chunk-3T5BYZQR.js";import{a as j}from"./chunk-EDTXKNLG.js";import{c as k,e as z,f as x,g as F,h as g,j as B,m as V,n as q,t as H,w as U,x as Z}from"./chunk-6UADWHTS.js";import"./chunk-DKZ7RQCP.js";import{B as W,E as y,F as b,M as L,O as G,m as $}from"./chunk-TZQTITY5.js";import{Kb as i,Lb as o,Mb as s,Nb as E,Rb as R,Sb as m,Xa as r,Zb as S,cc as D,ea as d,ec as T,lb as w,mc as P,pa as h,qb as l}from"./chunk-GOSJYVSP.js";function K(e,n){e&1&&(o(0,"div",26),E(1,"i",27),o(2,"span"),S(3,4),s()()),e&2&&i("@fadeInResize",void 0);}function Q(e,n){e&1&&(o(0,"div",28)(1,"div"),S(2,5),s(),o(3,"a",29),S(4,6),s()()),e&2&&i("@fadeInResize",void 0);}function Y(e,n){e&1&&(R(0),S(1,7),m());}function ee(e,n){e&1&&(R(0),S(1,8),m());}function ne(e,n){if(e&1&&(o(0,"div",30),l(1,Y,2,0,"ng-container",25)(2,ee,2,0,"ng-container",25),s()),e&2){let _=T();i("@fadeInResize",void 0),r(),i("ngIf",_.form.get("password").getError("required")),r(),i("ngIf",_.form.get("password").getError("pattern"));}}function te(e,n){e&1&&(R(0),S(1,9),m());}function ie(e,n){if(e&1&&(o(0,"div",30),l(1,te,2,0,"ng-container",25),s()),e&2){let _=T();i("@fadeInResize",void 0),r(),i("ngIf",_.form.hasError("notmatched"));}}function oe(e,n){e&1&&E(0,"span",31);}function re(e,n){e&1&&(o(0,"span"),S(1,10),s());}var J=class e{form;isSaving=!1;isError=!1;isInvalidOrExpired=!1;authService=d(G);destroyRef=d(h);router=d(y);activatedRoute=d(W);token="";constructor(){this.initializeForm();}ngOnInit(){let n=this.activatedRoute.snapshot.paramMap.get("token");this.token=n?decodeURIComponent(n):"",this.token||this.router.navigate(["/login"]);}onSave(){if(this.form.invalid){p.validateAllFormFields(this.form);return;}this.isSaving=!0,this.form.disable(),this.resetError(),this.authService.resetPassword(this.form.get("password").value,this.token).pipe(L(this.destroyRef)).subscribe({next:()=>{this.onSuccess();},error:n=>{this.onError(n);}});}onSuccess(){this.authService.clearLocalAuth(),this.router.navigate(["/login"],{queryParams:{passwordReset:"success"},replaceUrl:!0});}onError(n){this.scrollToTop(),this.isInvalidOrExpired=n.status===400,this.isError=!this.isInvalidOrExpired,this.isSaving=!1,this.resetForm();}scrollToTop(){window.scrollTo(0,0);}resetError(){this.isError=!1,this.isInvalidOrExpired=!1;}resetForm(){this.form.enable(),this.form.reset();}initializeForm(){this.form=new F({password:new g("",p.passwordValidator()),passwordConfirm:new g("",p.passwordValidator())},p.passwordMatchingValidator());}static ɵfac=function(_){return new(_||e)();};static ɵcmp=w({type:e,selectors:[["app-password-reset"]],decls:22,vars:12,consts:()=>{let n;n="Password";let _;_="Repeat";let t;t="Change password";let f;f="Password";let u;u="Min. 8 characters, including 1 number, 1 uppercase letter, and 1 special character.";let c;c="Repeat password";let C;C="An error occurred. Please try again.";let O;O="The link is invalid or has expired. Please request a new password reset link.";let A;A="Neuen Reset-Link anfordern";let M;M=" Please enter a password. ";let N;N=" The password does not meet the requirements. ";let v;v=" The confirmation does not match your password. ";let I;return I="Save",[t,f,u,c,C,O,A,M,N,v,I,[1,"fs-4","fw-bolder"],[1,"pt-2","d-flex","flex-column",3,"formGroup"],["class","alert alert-danger d-flex align-items-center","role","alert",4,"ngIf"],["class","alert alert-danger","role","alert",4,"ngIf"],[1,"form-floating","mb-3"],["type","password","id","password","placeholder",n,"formControlName","password","required","",1,"form-control"],["for","password"],["id","passwordHelp",1,"form-text","text-muted"],["class","invalid-feedback",4,"ngIf"],["type","password","id","passwordConfirm","placeholder",_,"formControlName","passwordConfirm","required","",1,"form-control"],["for","passwordConfirm"],[1,"form-group","text-center","d-flex","flex-column","gap-2"],["type","button",1,"btn","btn-primary","w-100",3,"click","disabled"],["class","spinner-border spinner-border-sm text-dark me-2","aria-hidden","true",4,"ngIf"],[4,"ngIf"],["role","alert",1,"alert","alert-danger","d-flex","align-items-center"],[1,"bi","bi-exclamation-triangle-fill","pe-3"],["role","alert",1,"alert","alert-danger"],["routerLink","/forgot-password",1,"alert-link"],[1,"invalid-feedback"],["aria-hidden","true",1,"spinner-border","spinner-border-sm","text-dark","me-2"]];},template:function(_,t){_&1&&(o(0,"sprade-card-site")(1,"h1",11),S(2,0),s(),o(3,"form",12),l(4,K,4,1,"div",13)(5,Q,5,1,"div",14),o(6,"div",15),E(7,"input",16),o(8,"label",17),S(9,1),s(),o(10,"small",18),S(11,2),s(),l(12,ne,3,3,"div",19),s(),o(13,"div",15),E(14,"input",20),o(15,"label",21),S(16,3),s(),l(17,ie,2,2,"div",19),s(),o(18,"div",22)(19,"button",23),D("click",function(){return t.onSave();}),l(20,oe,1,0,"span",24)(21,re,2,0,"span",25),s()()()()),_&2&&(r(3),i("formGroup",t.form),r(),i("ngIf",t.isError),r(),i("ngIf",t.isInvalidOrExpired),r(2),P("is-invalid",t.form.get("password").invalid&&!t.form.get("password").untouched),r(5),i("ngIf",t.form.get("password").invalid&&!t.form.get("password").untouched),r(2),P("is-invalid",t.form.hasError("notmatched")&&!t.form.get("passwordConfirm").untouched),r(3),i("ngIf",t.form.hasError("notmatched")&&!t.form.get("passwordConfirm").untouched),r(2),i("disabled",t.isSaving),r(),i("ngIf",t.isSaving),r(),i("ngIf",!t.isSaving));},dependencies:[j,U,B,k,z,x,H,$,Z,V,q,b],encapsulation:2,data:{animation:[X]}});};export{J as PasswordResetComponent};/**i18n:6889aab487ebe96b973f298784299bcc3708d76bb1493c70981ffbfe86f1252e*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.