1import{a as Ce}from"./chunk-7JP6Y5S2.js";import{a as xe}from"./chunk-4BVONZWO.js";import"./chunk-3WROMZIU.js";import"./chunk-A3E27WDE.js";import{n as ie}from"./chunk-VM5OC7EY.js";import{a as ve}from"./chunk-QOYYSCB3.js";import{a as ge,b as fe}from"./chunk-DJGKYIDP.js";import{a as ue}from"./chunk-C5Z7LZ75.js";import{a as M}from"./chunk-CSLXO2TK.js";import{b as W,c as q,d as R,u as b}from"./chunk-7R5JBG5O.js";import{b as he}from"./chunk-AJAJFYAL.js";import"./chunk-Q4WNEHHE.js";import{a as te}from"./chunk-ZHEVVJCK.js";import{a as S}from"./chunk-JNYYNB56.js";import{b as G,c as z,e as O}from"./chunk-XI7OEVLD.js";import{Ca as Z,Da as Y,Fa as J,Ha as K,Ja as X,Ka as ee,Na as we,Oa as _e,va as Q,wa as U,ya as H}from"./chunk-HJ22JSJV.js";import{g as $,h as D,r as B}from"./chunk-5ALDQSIV.js";import{A as ce,B as me,C as pe,b as oe,d as F,g as re,h as ne,n as ae,q as se,r as de,z as le}from"./chunk-DZXPISIV.js";import{Ac as h,Bb as A,Bc as y,Cc as _,O as E,Rb as c,Sb as m,Xb as p,Yb as a,Zb as n,_b as x,fc as P,gb as o,ic as C,lc as s,pb as u,pc as N,qa as f,qc as j,ra as v,rc as L,sa as T,ta as V,vb as k,vc as w}from"./chunk-TUX6BVKC.js";import{a as I}from"./chunk-JGDRNPQP.js";var Ve=["changePasswordNgForm"];function ke(t,d){if(t&1&&(a(0,"fuse-alert",16),h(1),n()),t&2){let e=s(2);p("appearance","outline")("showIcon",!1)("type",e.alert.type)("@shake",e.alert.type==="error"),o(),_(" ",e.alert.message," ")}}function Ae(t,d){if(t&1){let e=P();a(0,"mat-icon",30),C("click",function(){f(e),s();let i=w(19);return v(i.type==="password"?i.type="text":i.type="password")}),n()}t&2&&p("svgIcon","heroicons_solid:eye")}function Ne(t,d){if(t&1){let e=P();a(0,"mat-icon",30),C("click",function(){f(e),s();let i=w(19);return v(i.type==="password"?i.type="text":i.type="password")}),n()}t&2&&p("svgIcon","heroicons_solid:eye-slash")}function je(t,d){if(t&1&&(a(0,"mat-error"),h(1),n()),t&2){let e=s().$implicit;o(),_(" ",e("Old Password is required")," ")}}function Le(t,d){if(t&1){let e=P();a(0,"mat-icon",30),C("click",function(){f(e),s();let i=w(27);return v(i.type==="password"?i.type="text":i.type="password")}),n()}t&2&&p("svgIcon","heroicons_solid:eye")}function $e(t,d){if(t&1){let e=P();a(0,"mat-icon",30),C("click",function(){f(e),s();let i=w(27);return v(i.type==="password"?i.type="text":i.type="password")}),n()}t&2&&p("svgIcon","heroicons_solid:eye-slash")}function De(t,d){if(t&1&&(a(0,"mat-error"),h(1),n()),t&2){let e=s(2).$implicit;o(),_(" ",e("Password needs to have a minimum of eight characters!")," ")}}function Be(t,d){if(t&1&&(a(0,"mat-error"),h(1),n()),t&2){let e=s(2).$implicit;o(),_(" ",e("Password needs to have atleast one number!")," ")}}function We(t,d){if(t&1&&(a(0,"mat-error"),h(1),n()),t&2){let e=s(2).$implicit;o(),_(" ",e("Password needs to have atleast one lower case letter!")," ")}}function qe(t,d){if(t&1&&(a(0,"mat-error"),h(1),n()),t&2){let e=s(2).$implicit;o(),_(" ",e("Password needs to have atleast one upper case letter!")," ")}}function Re(t,d){if(t&1&&(a(0,"mat-error"),h(1),n()),t&2){let e=s(2).$implicit;o(),_(" ",e("Password needs to have atleast one special character letter!")," ")}}function Ge(t,d){if(t&1&&(c(0,De,2,1,"mat-error"),c(1,Be,2,1,"mat-error"),c(2,We,2,1,"mat-error"),c(3,qe,2,1,"mat-error"),c(4,Re,2,1,"mat-error")),t&2){let e=s(2);m(e.validate.minLength?-1:0),o(),m(e.validate.digits?-1:1),o(),m(e.validate.lower?-1:2),o(),m(e.validate.upper?-1:3),o(),m(e.validate.nonWords?-1:4)}}function ze(t,d){if(t&1){let e=P();a(0,"mat-icon",30),C("click",function(){f(e),s();let i=w(35);return v(i.type==="password"?i.type="text":i.type="password")}),n()}t&2&&p("svgIcon","heroicons_solid:eye")}function Oe(t,d){if(t&1){let e=P();a(0,"mat-icon",30),C("click",function(){f(e),s();let i=w(35);return v(i.type==="password"?i.type="text":i.type="password")}),n()}t&2&&p("svgIcon","heroicons_solid:eye-slash")}function Qe(t,d){if(t&1&&(a(0,"mat-error"),h(1),n()),t&2){let e=s(2);o(),y(e.error2)}}function Ue(t,d){if(t&1&&(a(0,"span"),h(1),n()),t&2){let e=s().$implicit;o(),_(" ",e("Save Password")," ")}}function He(t,d){t&1&&x(0,"mat-progress-spinner",27),t&2&&p("diameter",24)("mode","indeterminate")}function Ze(t,d){if(t&1){let e=P();a(0,"div",5),T(),a(1,"svg",6)(2,"g",7),x(3,"circle",8)(4,"circle",9),n()(),a(5,"svg",10),x(6,"rect",11),n(),V(),a(7,"div",12)(8,"div",13)(9,"div",14),x(10,"img",15),n(),c(11,ke,2,5,"fuse-alert",16),a(12,"form",17,0)(14,"mat-card")(15,"mat-form-field",18)(16,"mat-label"),h(17),n(),x(18,"input",19,1),c(20,Ae,1,1,"mat-icon",20),c(21,Ne,1,1,"mat-icon",20),c(22,je,2,1,"mat-error"),n(),a(23,"mat-form-field",21)(24,"mat-label"),h(25),n(),x(26,"input",22,2),c(28,Le,1,1,"mat-icon",20),c(29,$e,1,1,"mat-icon",20),n(),c(30,Ge,5,5),a(31,"mat-form-field",23)(32,"mat-label"),h(33),n(),x(34,"input",24,3),c(36,ze,1,1,"mat-icon",20),c(37,Oe,1,1,"mat-icon",20),x(38,"p",25),c(39,Qe,2,1,"mat-error"),n(),a(40,"button",26),C("click",function(){f(e);let i=s();return v(i.check())}),c(41,Ue,2,1,"span"),c(42,He,1,2,"mat-progress-spinner",27),n(),a(43,"div",28)(44,"a",29),C("click",function(){f(e);let i=s();return v(i.returnLogin())}),h(45),n()()()()()()()}if(t&2){let e=d.$implicit,r=w(19),i=w(27),g=w(35),l=s();o(11),m(l.showAlert?11:-1),o(),p("formGroup",l.changePasswordForm),o(5),y(e("Old Password")),o(),p("type",l.hide?"password":"text")("formControlName","oldPassword"),o(2),m(r.type==="password"?20:-1),o(),m(r.type==="text"?21:-1),o(),m(l.changePasswordForm.get("oldPassword").hasError("required")?22:-1),o(3),y(e("New Password")),o(),p("type",l.hide1?"password":"text"),o(2),m(i.type==="password"?28:-1),o(),m(i.type==="text"?29:-1),o(),m(l.changePasswordForm.value.newPassword!==""?30:-1),o(3),y(e("Confirm Password")),o(),p("type",l.hide2?"password":"text")("formControlName","confirmPassword"),o(2),m(g.type==="password"?36:-1),o(),m(g.type==="text"?37:-1),o(2),m(l.check?39:-1),o(),p("color","primary")("disabled",l.changePasswordForm.disabled),o(),m(l.changePasswordForm.disabled?-1:41),o(),m(l.changePasswordForm.disabled?42:-1),o(3),_(" ",e("Cancel")," ")}}var Pe=(()=>
1{class t{constructor(e,r,i,g,l,ye,Se,Fe,Ie,be,Me,Ee){this._authService=e,this._formBuilder=r,this.saveMsg=i,this.userService=g,this.message=l,this.router=ye,this.fb=Se,this.deviceInfoService=Fe,this.http=Ie,this.handler=be,this.translocoService=Me,this.auth=Ee,this.error="",this.errorDigits="",this.errorUpper="",this.errorLower="",this.errorNonWords="",this.errorLength="",this.error2="",this.alert={type:"success",message:""},this.showAlert=!1,this.isSave=!1,this.successMessage=I({},q),this.failedMessage=I({},R),this.hide=!0,this.hide1=!0,this.hide2=!0;let Te=sessionStorage.getItem("activeLang")||"en";this.translocoService.setActiveLang(Te)}ngOndestroy(){sessionStorage.setItem("allowed","true")}ngOnInit(){sessionStorage.getItem("activeLang"),this.changePasswordForm=this._formBuilder.group({oldPassword:["",[F.required]],newPassword:["",[F.pattern(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]).{8,}/)]],confirmPassword:["",[F.required]]}),this.translocoService.langChanges$.subscribe(e=>{sessionStorage.setItem("activeLang",e)})}get f(){return this.changePasswordForm.controls}sendResetLink(){this.changePasswordForm.invalid||(this.changePasswordForm.disable(),this.showAlert=!1,this._authService.resetPassword(this.changePasswordForm.get("oldPassword").value),this._authService.resetPassword(this.changePasswordForm.get("newPassword").value),this._authService.resetPassword(this.changePasswordForm.get("confirmPassword").value).pipe(E(()=>{this.changePasswordForm.enable(),this.changePasswordNgForm.resetForm(),this.showAlert=!0})).subscribe(e=>{this.alert={type:"success",message:"Password reset sent! You'll receive an email if you are registered on our system."}},e=>{this.alert={type:"error",message:"Email does not found! Are you sure you are already a member?"}}))}get validate(){return{digits:/\d/.test(this.changePasswordForm.get("newPassword").value),lower:/[a-z]/.test(this.changePasswordForm.get("newPassword").value),upper:/[A-Z]/.test(this.changePasswordForm.get("newPassword").value),nonWords:/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+/.test(this.changePasswordForm.get("newPassword").value),minLength:this.changePasswordForm.get("newPassword").value.length>7}}check(){this.showAlert=!1;let e=this.changePasswordForm.get("oldPassword").value,r=this.changePasswordForm.get("newPassword").value,i=this.changePasswordForm.get("confirmPassword").value;if(S.IsEmpty(e)||S.IsEmpty(r)||S.IsEmpty(i)){this.showAlert=S.IsEmpty(r),this.alert={type:"error",message:"New Password is required."};return}else r==i?this.changePasswordForm.valid&&this.submit():(this.showAlert=!0,this.alert={type:"error",message:"Password don't match"})}digits(e){return{invaliddigits:!/\d/.test(e.value)}}lower(e){return{invalidlower:/[a-z]/.test(e.value)}}upper(e){return/[A-Z]/.test(e.value)?null:{invalidupper:!0}}nonwords(e){return/[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(e.value)?null:{invalidnonWords:!0}}length(e){return/^.{8,}$/.test(e.value)?null:{invalidminWord:!0}}submit(){this.changepass=this.fb.group({username:sessionStorage.getItem("un"),password:this.changePasswordForm.value.oldPassword,companyCode:[sessionStorage.getItem("cc"),F.required],remember:M.remember==null?!1:M.remember==!0,ip1:"",ip2:"",device:this.deviceInfoService.getDeviceInfo().os,browser:this.deviceInfoService.getDeviceInfo().browser});var e=this.changePasswordForm.value.oldPassword,r=this.changePasswordForm.value.newPassword;this.message.open(W).afterClosed().subscribe(g=>{g=="confirmed"&&(this.isSave=!0,this.userService.postUpdatePassword(e,r).subscribe({next:l=>{l.statusCode==200?l.payload?(this.successMessage.message="Password updated successfully",this.message.open(this.successMessage),this.isSave=!1,setTimeout(()=>{this.router.navigate(["/login"])},500)):(this.failedMessage.message=l.message,this.message.open(this.failedMessage)):(this.failedMessage.message=l.message,this.message.open(this.failedMessage))}}))})}returnLogin(){this.router.navigate(["/login"])}static{this.\u0275fac=function(r){return new(r||t)(u(Ce),u(ce),u(b),u(ue),u(b),u(B),u(le),u(ve),u(D),u($),u(G),u(te))}}static{this.\u0275cmp=k({type:t,selectors:[["app-change-password"]],viewQuery:function(r,i){if(r&1&&N(Ve,5),r&2){let g;j(g=L())&&(i.changePasswordNgForm=g.first)}},decls:1,vars:0,consts:[["changePasswordNgForm","ngForm"],["passwordField1",""],["passwordField2",""],["passwordField",""],["class","flex flex-col sm:flex-row items-center md:items-center sm:justify-center md:justify-center flex-auto min-w-0 bg-gray-800",4,"transloco"],[1,"flex","flex-col","sm:flex-row","items-center","md:items-center","sm:justify-center","md:justify-center","flex-auto","min-w-0","bg-gray-800"],["viewBox","0 0 960 540","width","100%","height","100%","preserveAspectRatio","xMidYMax slice","xmlns","http://www.w3.org/2000/svg",1,"absolute","
1inset-0","pointer-events-none"],["fill","none","stroke","currentColor","stroke-width","100",1,"text-gray-700","opacity-25"],["r","234","cx","196","cy","23"],["r","234","cx","790","cy","491"],["viewBox","0 0 220 192","width","220","height","192","fill","none",1,"absolute","-top-16","-right-16","text-gray-700"],["width","220","height","192","fill","url(#837c3e70-6c3a-44e6-8854-cc48c737b659)"],[1,"md:flex","md:items-center","bg-card","w-full","sm:w-auto","md:h-[h-50%]","py-8","px-4","sm:p-12","md:p-16","sm:rounded-2xl","md:rounded-none","sm:shadow","md:shadow-none","sm:bg-card"],[1,"w-full","max-w-80","sm:w-80","mx-auto","sm:mx-0"],[1,"w-50%"],["src","images/logo/logo.webp"],[1,"mt-8","-mb-4",3,"appearance","showIcon","type"],[1,"mt-8",3,"formGroup"],["appearance","outline",1,"w-full","h-18","text-lg"],["id","old","matInput","",1,"inputs",3,"type","formControlName"],["matSuffix","",1,"mr-2","mt-[1px]",3,"svgIcon"],["appearance","outline",1,"w-full","h-18","mt-3","text-lg"],["matInput","","placeholder","Password","formControlName","newPassword",1,"inputs",3,"type"],["appearance","outline",1,"w-full","h-18","text-lg","mt-3"],["matInput","","placeholder","Password",1,"inputs",3,"type","formControlName"],["id","message"],["mat-flat-button","",1,"fuse-mat-button-large","w-full","mt-3",3,"click","color","disabled"],[3,"diameter","mode"],[1,"mt-8","text-md","font-medium","text-secondary"],[1,"ml-1","text-primary-500","hover:underline",3,"click"],["matSuffix","",1,"mr-2","mt-[1px]",3,"click","svgIcon"]],template:function(r,i){r&1&&A(0,Ze,46,24,"div",4)},dependencies:[xe,me,ae,oe,re,ne,pe,de,se,Y,Z,Q,U,H,_e,we,K,J,ee,X,he,fe,ge,O,z],styles:[`.password-correct{color:green}.password-incorrect{color:red}.icon{height:15px!important;min-height:40px;padding:3px!important}.inputs{padding-top:4px!important}.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:9px!important;padding-bottom:6px!important}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:17px!important;left:5px!important} 2`],encapsulation:2,data:{animation:ie},changeDetection:0})}}return t})();var Mt=[{path:"",redirectTo:"change-password",pathMatch:"full"},{path:"change-password",component:Pe}];export{Mt as default};
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.