File: /mnt/data/smarthr-co-in/demo/angular/template/chunk-GRWUXDH2.js
import{a as f}from"./chunk-ILLDEPHH.js";import{d as k,e as E}from"./chunk-K3YFDFGL.js";import"./chunk-WA2UGD5L.js";import"./chunk-BT37DHWM.js";import{Gc as g,Hd as L,Jc as b,Sb as r,Tb as t,Ub as s,Vb as m,cc as v,fb as n,rb as y,sb as w,tc as p,ud as _,yb as C}from"./chunk-AQ27DSQO.js";import"./chunk-EQDQRRRY.js";var I=(l,o,i,e)=>({"poor-active":l,"avg-active":o,"strong-active":i,"heavy-active":e}),u=l=>({active:l}),R=class l{constructor(o,i){this.router=o;this.renderer=i}routes=f;navigation(){this.router.navigate([f.success])}password=[!1,!1];togglePassword(o){this.password[o]=!this.password[o]}ngOnInit(){this.renderer.addClass(document.body,"bg-linear-gradiant")}ngOnDestroy(){this.renderer.removeClass(document.body,"bg-linear-gradiant")}passwordValue="";strengthLevel="";passwordInfoMessage=null;passwordInfoColor="";poorRegExp=/[a-z]/;weakRegExp=/(?=.*?[0-9])/;strongRegExp=/(?=.*?[#?!@$%^&*-])/;whitespaceRegExp=/^$|\s+/;checkPasswordStrength(o){let e=o.target.value;this.passwordValue=e;let a=e.length,d=this.poorRegExp.test(e),h=this.weakRegExp.test(e),c=this.strongRegExp.test(e),S=this.whitespaceRegExp.test(e);if(e===""){this.resetStrength();return}if(S){this.passwordInfoMessage="Whitespaces are not allowed",this.passwordInfoColor="red",this.strengthLevel="";return}a<8?(this.strengthLevel="poor",this.passwordInfoMessage="Weak. Must contain at least 8 characters.",this.passwordInfoColor="red"):(d||h||c)&&(this.strengthLevel="weak",this.passwordInfoMessage="Average. Must contain at least 1 letter or number.",this.passwordInfoColor="#FFB54A"),a>=8&&d&&(h||c)&&(this.strengthLevel="strong",this.passwordInfoMessage="Almost strong. Must contain a special symbol.",this.passwordInfoColor="#1D9CFD"),a>=8&&d&&h&&c&&(this.strengthLevel="heavy",this.passwordInfoMessage="Awesome! You have a secure password.",this.passwordInfoColor="#159F46")}resetStrength(){this.strengthLevel="",this.passwordInfoMessage=null}static \u0275fac=function(i){return new(i||l)(w(k),w(y))};static \u0275cmp=C({type:l,selectors:[["app-reset-password-3"]],decls:42,vars:23,consts:[[1,"container-fuild"],[1,"w-100","overflow-hidden","position-relative","flex-wrap","d-block","vh-100"],[1,"row","justify-content-center","align-items-center","vh-100","overflow-auto","flex-wrap"],[1,"col-md-4","mx-auto","vh-100"],[1,"vh-100"],[1,"vh-100","d-flex","flex-column","justify-content-between","p-4","pb-0"],[1,"mx-auto","mb-5","text-center"],["src","assets/img/logo.svg","alt","Logo",1,"img-fluid"],[1,""],[1,"text-center","mb-3"],[1,"mb-2"],[1,"mb-0"],[1,"input-block","mb-3"],[1,"mb-3"],["for","password"],["id","passwordInput",1,"form-group"],[1,"pass-group","mb-3"],["id","password",1,"pass-input","form-control",3,"input","type"],["tabindex","0",1,"ti","toggle-password",3,"click","keydown.enter","ngClass"],["id","passwordStrength",1,"strength-meter",3,"ngClass"],["id","poor",3,"ngClass"],["id","weak",3,"ngClass"],["id","strong",3,"ngClass"],["id","heavy",3,"ngClass"],["id","passwordInfo",1,"fs-12"],[1,"form-label"],[1,"pass-group"],[1,"pass-input","form-control",3,"type"],[1,"btn","btn-primary","w-100",3,"routerLink"],[1,"mt-5","pb-4","text-center"],[1,"mb-0","text-gray-9"]],template:function(i,e){i&1&&(t(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"form",4)(5,"div",5)(6,"div",6),m(7,"img",7),s(),t(8,"div",8)(9,"div",9)(10,"h2",10),p(11,"Reset Password"),s(),t(12,"p",11),p(13,"Your new password must be different from previous used passwords."),s()(),t(14,"div")(15,"div",12)(16,"div",13)(17,"label",14),p(18,"Password"),s(),t(19,"div",15)(20,"div",16)(21,"input",17),v("input",function(d){return e.checkPasswordStrength(d)}),s(),t(22,"span",18),v("click",function(){return e.togglePassword(0)})("keydown.enter",function(){return e.togglePassword(0)}),s()(),t(23,"div",19),m(24,"span",20)(25,"span",21)(26,"span",22)(27,"span",23),s()()(),t(28,"p",24),p(29," Use 8 or more characters with a mix of letters, numbers & symbols. "),s()(),t(30,"div",13)(31,"label",25),p(32,"Confirm Password"),s(),t(33,"div",26),m(34,"input",27),t(35,"span",18),v("click",function(){return e.togglePassword(1)})("keydown.enter",function(){return e.togglePassword(1)}),s()()(),t(36,"div",13)(37,"a",28),p(38,"Submit"),s()()()(),t(39,"div",29)(40,"p",30),p(41,"Copyright \xA9 2024 - Smarthr"),s()()()()()()()()),i&2&&(n(21),r("type",e.password[0]?"text":"password"),n(),r("ngClass",e.password[0]?"ti-eye":"ti-eye-off"),n(),r("ngClass",b(10,I,e.strengthLevel==="poor",e.strengthLevel==="weak",e.strengthLevel==="strong",e.strengthLevel==="heavy")),n(),r("ngClass",g(15,u,e.strengthLevel==="poor"||e.strengthLevel==="weak"||e.strengthLevel==="strong"||e.strengthLevel==="heavy")),n(),r("ngClass",g(17,u,e.strengthLevel==="weak"||e.strengthLevel==="strong"||e.strengthLevel==="heavy")),n(),r("ngClass",g(19,u,e.strengthLevel==="strong"||e.strengthLevel==="heavy")),n(),r("ngClass",g(21,u,e.strengthLevel==="heavy")),n(7),r("type",e.password[1]?"text":"password"),n(),r("ngClass",e.password[1]?"ti-eye":"ti-eye-off"),n(2),r("routerLink",e.routes.success3))},dependencies:[L,_,E],encapsulation:2})};export{R as ResetPassword3Component};