Jucundus/client/dist/angular-material-template/228.d6e857ac56777d70.js

1 line
13 KiB
JavaScript

"use strict";(self.webpackChunkangular_material_template=self.webpackChunkangular_material_template||[]).push([[228],{4847:(B,g,a)=>{a.r(g),a.d(g,{AccountModule:()=>U});var P=a(1368),O=a(2992),t=a(3200),e=a(4496),L=a(4476),l=a(2276),y=a(2080),d=a(180),i=a(6504),h=a(119),G=a(3548),Y=a(4440),w=a(1560),p=a(7816),k=a(7536),C=a(1544);function x(n,M){1&n&&(e.I0R(0,"mat-error"),e.OEk(1," Please enter a your current password "),e.C$Y())}function v(n,M){1&n&&(e.I0R(0,"mat-error"),e.OEk(1," Please enter a new password "),e.C$Y())}function D(n,M){1&n&&(e.I0R(0,"mat-error"),e.OEk(1," Please confirm your new password "),e.C$Y())}let A=(()=>{class n{constructor(r,s,o){this.authService=r,this.spinnerService=s,this.notificationService=o,this.hideCurrentPassword=!0,this.hideNewPassword=!0}ngOnInit(){this.form=new i.k1({currentPassword:new i.yM("",i.AQ.required),newPassword:new i.yM("",i.AQ.required),newPasswordConfirm:new i.yM("",i.AQ.required)}),this.form.get("currentPassword")?.valueChanges.subscribe(r=>{this.currentPassword=r}),this.form.get("newPassword")?.valueChanges.subscribe(r=>{this.newPassword=r}),this.form.get("newPasswordConfirm")?.valueChanges.subscribe(r=>{this.newPasswordConfirm=r}),this.spinnerService.visibility.subscribe(r=>{this.disableSubmit=r})}changePassword(){if(this.newPassword!==this.newPasswordConfirm)return void this.notificationService.openSnackBar("New passwords do not match.");const r=this.authService.getCurrentUser().email;this.authService.changePassword(r,this.currentPassword,this.newPassword).subscribe(s=>{this.form.reset(),this.notificationService.openSnackBar("Your password has been changed.")},s=>{this.notificationService.openSnackBar(s.error)})}static#t=this.\u0275fac=function(s){return new(s||n)(e.GI1(h.A),e.GI1(G.m),e.GI1(Y.g))};static#e=this.\u0275cmp=e.In1({type:n,selectors:[["app-change-password"]],decls:22,vars:11,consts:[[3,"formGroup"],["fxLayout","row"],["fxFlex","40%","fxFlex.md","60%","fxFlex.sm","50%","fxFlex.xs","100%"],[1,"full-width"],["matInput","","placeholder","Current Password","formControlName","currentPassword","autocomplete","current-password",3,"type"],["matSuffix","",3,"click"],[4,"ngIf"],["matInput","","placeholder","New Password","formControlName","newPassword","autocomplete","new-password",3,"type"],["matInput","","placeholder","Confirm New Password","formControlName","newPasswordConfirm","autocomplete","new-password",3,"type"],["mat-raised-button","","color","primary",3,"disabled","click"]],template:function(s,o){1&s&&(e.I0R(0,"form",0)(1,"p"),e.OEk(2,"Use the form below to change your password."),e.C$Y(),e.I0R(3,"div",1)(4,"div",2)(5,"mat-form-field",3),e.wR5(6,"input",4),e.I0R(7,"mat-icon",5),e.qCj("click",function(){return o.hideCurrentPassword=!o.hideCurrentPassword}),e.OEk(8),e.C$Y(),e.yuY(9,x,2,0,"mat-error",6),e.C$Y(),e.I0R(10,"mat-form-field",3),e.wR5(11,"input",7),e.I0R(12,"mat-icon",5),e.qCj("click",function(){return o.hideNewPassword=!o.hideNewPassword}),e.OEk(13),e.C$Y(),e.yuY(14,v,2,0,"mat-error",6),e.C$Y(),e.I0R(15,"mat-form-field",3),e.wR5(16,"input",8),e.I0R(17,"mat-icon",5),e.qCj("click",function(){return o.hideNewPassword=!o.hideNewPassword}),e.OEk(18),e.C$Y(),e.yuY(19,D,2,0,"mat-error",6),e.C$Y(),e.I0R(20,"button",9),e.qCj("click",function(){return o.changePassword()}),e.OEk(21,"Save"),e.C$Y()()()()),2&s&&(e.E7m("formGroup",o.form),e.yG2(6),e.E7m("type",o.hideCurrentPassword?"password":"text"),e.yG2(2),e.oRS(" ",o.hideCurrentPassword?"visibility":"visibility_off"," "),e.yG2(),e.E7m("ngIf",o.form.controls.currentPassword.hasError("required")),e.yG2(2),e.E7m("type",o.hideNewPassword?"password":"text"),e.yG2(2),e.oRS(" ",o.hideNewPassword?"visibility":"visibility_off"," "),e.yG2(),e.E7m("ngIf",o.form.controls.newPassword.hasError("required")),e.yG2(2),e.E7m("type",o.hideNewPassword?"password":"text"),e.yG2(2),e.oRS(" ",o.hideNewPassword?"visibility":"visibility_off"," "),e.yG2(),e.E7m("ngIf",o.form.controls.newPasswordConfirm.hasError("required")),e.yG2(),e.E7m("disabled",o.form.invalid||o.disableSubmit))},dependencies:[P.u_,i.sz,i.ot,i.ue,i.u,i.uW,i.Wo,l.sZ,l.CA,w.qL,p.Gw,k.yi,C.Up,C.wJ,C.Gm],styles:[".password-rules[_ngcontent-%COMP%] .mat-divider[_ngcontent-%COMP%]{position:unset!important}.container[_ngcontent-%COMP%]{padding-top:20px}"]})}return n})(),$=(()=>{class n{constructor(r){this.authService=r,this.fullName="",this.email="",this.alias=""}ngOnInit(){this.fullName=this.authService.getCurrentUser().fullName,this.email=this.authService.getCurrentUser().email}static#t=this.\u0275fac=function(s){return new(s||n)(e.GI1(h.A))};static#e=this.\u0275cmp=e.In1({type:n,selectors:[["app-profile-details"]],decls:8,vars:4,consts:[[1,"profile-card"],["src","assets/images/user.png",3,"alt"],[1,"title"]],template:function(s,o){1&s&&(e.I0R(0,"div",0),e.wR5(1,"img",1),e.I0R(2,"h2",2),e.OEk(3),e.C$Y(),e.I0R(4,"label"),e.OEk(5),e.C$Y(),e.I0R(6,"label"),e.OEk(7),e.C$Y()()),2&s&&(e.yG2(),e.E7m("alt",o.fullName),e.yG2(2),e.oRS(" ",o.fullName," "),e.yG2(2),e.oRS(" ",o.alias," "),e.yG2(2),e.oRS(" ",o.email," "))},styles:[".profile-card[_ngcontent-%COMP%]{text-align:center}"]})}return n})();const S=[{path:"",component:t.Y,children:[{path:"profile",component:(()=>{class n{constructor(r){this.titleService=r}ngOnInit(){this.titleService.setTitle("Jucundus - Account")}static#t=this.\u0275fac=function(s){return new(s||n)(e.GI1(L.OY))};static#e=this.\u0275cmp=e.In1({type:n,selectors:[["app-account-page"]],decls:14,vars:0,consts:[["fxLayout","row","fxLayoutAlign","center none",1,"container"],["fxFlex","95%"],["fxLayout","row","fxLayout.sm","column","fxLayout.xs","column"],["fxFlex","30%","fxFlex.sm","95%","fxFlex.xs","95%"],["fxFlex",""],["fxFlex","65%","fxFlex.sm","95%","fxFlex.xs","950%"],["label","Change Password"]],template:function(s,o){1&s&&(e.I0R(0,"div",0)(1,"div",1)(2,"mat-card")(3,"mat-card-content")(4,"h2"),e.OEk(5,"My Profile"),e.C$Y(),e.I0R(6,"div",2)(7,"div",3),e.wR5(8,"app-profile-details"),e.C$Y(),e.wR5(9,"div",4),e.I0R(10,"div",5)(11,"mat-tab-group")(12,"mat-tab",6),e.wR5(13,"app-change-password"),e.C$Y()()()()()()()())},dependencies:[l.sZ,l.qG,l.CA,y.SM,y.WK,d.aJ,d._q,A,$]})}return n})()}]}];let I=(()=>{class n{static#t=this.\u0275fac=function(s){return new(s||n)};static#e=this.\u0275mod=e.a4G({type:n});static#a=this.\u0275inj=e.s3X({imports:[O.qQ.forChild(S),O.qQ]})}return n})();var R=a(9588);let U=(()=>{class n{static#t=this.\u0275fac=function(s){return new(s||n)};static#e=this.\u0275mod=e.a4G({type:n});static#a=this.\u0275inj=e.s3X({imports:[P.MD,R.k,I]})}return n})()},3200:(B,g,a)=>{a.d(g,{Y:()=>E});var P=a(4548),O=a(6928),t=a(4496),e=a(1216),L=a(3548),l=a(119),y=a(9920),d=a(2992),i=a(1368),h=a(9964),G=a(1560),Y=a(964),w=a(7816),p=a(6664),k=a(3584),C=a(3576),x=a(9092),v=a(7500),D=a(6496),A=a(8156),$=a(2978);function T(f,K){1&f&&t.wR5(0,"mat-progress-bar",26)}const S=()=>["/"],I=()=>["/account/profile"],R=()=>["/auth/login"],U=()=>["/dashboard"],n=()=>["/sales"],M=()=>["/favorites"],r=()=>["/pictures"],s=()=>["/users"],o=()=>["/about"];let E=(()=>{class f{constructor(u,m,c,_,b){this.changeDetectorRef=u,this.media=m,this.spinnerService=c,this.authService=_,this.authGuard=b,this.showSpinner=!1,this.userName="",this.isAdmin=!1,this.autoLogoutSubscription=new O.wH,this.mobileQuery=this.media.matchMedia("(max-width: 1000px)"),this._mobileQueryListener=()=>u.detectChanges(),this.mobileQuery.addListener(this._mobileQueryListener)}ngOnInit(){const u=this.authService.getCurrentUser();this.isAdmin=u.isAdmin,this.userName=u.fullName;const m=(0,P.k)(2e3,5e3);this.autoLogoutSubscription=m.subscribe(()=>{this.authGuard.canActivate()})}ngOnDestroy(){this.mobileQuery.removeListener(this._mobileQueryListener),this.autoLogoutSubscription.unsubscribe()}ngAfterViewInit(){this.changeDetectorRef.detectChanges()}static#t=this.\u0275fac=function(m){return new(m||f)(t.GI1(t.kD9),t.GI1(e.iG),t.GI1(L.m),t.GI1(l.A),t.GI1(y.Q))};static#e=this.\u0275cmp=t.In1({type:f,selectors:[["app-layout"]],decls:91,vars:35,consts:[[1,"navbar-container"],["color","primary",1,"navbar"],["mat-icon-button","",3,"click"],["matTooltip","Home",1,"navbar-brand",3,"routerLink"],[1,"navbar-spacer"],["mat-icon-button","",3,"matMenuTriggerFor"],["matBadge","2","matBadgeColor","accent"],["xPosition","before","yPosition","above",3,"overlapTrigger"],["notificationMenu","matMenu"],["mat-menu-item",""],["mat-button","",3,"matMenuTriggerFor"],["fxShow","","fxHide.xs",""],["userMenu","matMenu"],["mat-menu-item","",3,"routerLink"],[1,"navbar-sidenav-container"],["fixedTopGap","56",1,"sidenav",3,"opened","mode","fixedInViewport"],["snav",""],["mat-subheader",""],["mat-list-item","","routerLinkActive","active",3,"routerLink"],["matListItemIcon",""],["mat-line",""],["mat-list-item","",3,"routerLink"],["id","push-bottom","mat-list-item","","routerLinkActive","active",3,"routerLink"],[1,"sidenav-content"],[1,"progress-bar-container"],["color","accent","mode","indeterminate",4,"ngIf"],["color","accent","mode","indeterminate"]],template:function(m,c){if(1&m){const _=t.KQA();t.I0R(0,"div",0)(1,"mat-toolbar",1)(2,"button",2),t.qCj("click",function(){t.usT(_);const W=t.Gew(39);return t.CGJ(W.toggle())}),t.I0R(3,"mat-icon"),t.OEk(4,"menu"),t.C$Y()(),t.I0R(5,"a",3)(6,"h1"),t.OEk(7," Jucundus "),t.C$Y()(),t.wR5(8,"span",4),t.I0R(9,"button",5)(10,"mat-icon",6),t.OEk(11,"notifications"),t.C$Y()(),t.I0R(12,"mat-menu",7,8)(14,"a",9)(15,"span"),t.OEk(16,"You have new tasks"),t.C$Y()(),t.I0R(17,"a",9)(18,"span"),t.OEk(19,"You have a new message"),t.C$Y()()(),t.I0R(20,"button",10)(21,"mat-icon"),t.OEk(22,"person"),t.C$Y(),t.I0R(23,"span",11),t.OEk(24),t.C$Y()(),t.I0R(25,"mat-menu",7,12)(27,"a",13)(28,"mat-icon"),t.OEk(29,"person"),t.C$Y(),t.I0R(30,"span"),t.OEk(31,"Account"),t.C$Y()(),t.I0R(32,"a",13)(33,"mat-icon"),t.OEk(34,"exit_to_app"),t.C$Y(),t.I0R(35,"span"),t.OEk(36,"Log out"),t.C$Y()()()(),t.I0R(37,"mat-sidenav-container",14)(38,"mat-sidenav",15,16)(40,"mat-nav-list")(41,"h3",17),t.OEk(42,"Home"),t.C$Y(),t.I0R(43,"a",18)(44,"mat-icon",19),t.OEk(45," dashboard "),t.C$Y(),t.I0R(46,"p",20),t.OEk(47," Dashboard "),t.C$Y()(),t.I0R(48,"a",18)(49,"mat-icon",19),t.OEk(50," today "),t.C$Y(),t.I0R(51,"p",20),t.OEk(52," Sales "),t.C$Y()(),t.I0R(53,"a",18)(54,"mat-icon",19),t.OEk(55," bookmark "),t.C$Y(),t.I0R(56,"p",20),t.OEk(57," Favorites "),t.C$Y()(),t.I0R(58,"a",18)(59,"mat-icon",19),t.OEk(60," image "),t.C$Y(),t.I0R(61,"p",20),t.OEk(62," Pictures "),t.C$Y()(),t.I0R(63,"a",18)(64,"mat-icon",19),t.OEk(65," people "),t.C$Y(),t.I0R(66,"p",20),t.OEk(67," Users "),t.C$Y()(),t.wR5(68,"mat-divider"),t.I0R(69,"h3",17),t.OEk(70,"User"),t.C$Y(),t.I0R(71,"a",21)(72,"mat-icon",19),t.OEk(73,"person"),t.C$Y(),t.I0R(74,"p",20),t.OEk(75," Account "),t.C$Y()(),t.I0R(76,"a",21)(77,"mat-icon",19),t.OEk(78,"exit_to_app"),t.C$Y(),t.I0R(79,"p",20),t.OEk(80," Log out "),t.C$Y()(),t.I0R(81,"a",22)(82,"mat-icon",19),t.OEk(83," info_outline "),t.C$Y(),t.I0R(84,"p",20),t.OEk(85," About "),t.C$Y()()()(),t.I0R(86,"mat-sidenav-content",23)(87,"div",24),t.yuY(88,T,1,0,"mat-progress-bar",25),t.wVc(89,"async"),t.C$Y(),t.wR5(90,"router-outlet"),t.C$Y()()()}if(2&m){const _=t.Gew(13),b=t.Gew(26);t.eAK("example-is-mobile",c.mobileQuery.matches),t.yG2(5),t.E7m("routerLink",t.q4q(24,S)),t.yG2(4),t.E7m("matMenuTriggerFor",_),t.yG2(3),t.E7m("overlapTrigger",!1),t.yG2(8),t.E7m("matMenuTriggerFor",b),t.yG2(4),t.oRS(" ",c.userName," "),t.yG2(),t.E7m("overlapTrigger",!1),t.yG2(2),t.E7m("routerLink",t.q4q(25,I)),t.yG2(5),t.E7m("routerLink",t.q4q(26,R)),t.yG2(6),t.E7m("opened",!c.mobileQuery.matches)("mode",c.mobileQuery.matches?"over":"side")("fixedInViewport",c.mobileQuery.matches),t.yG2(5),t.E7m("routerLink",t.q4q(27,U)),t.yG2(5),t.E7m("routerLink",t.q4q(28,n)),t.yG2(5),t.E7m("routerLink",t.q4q(29,M)),t.yG2(5),t.E7m("routerLink",t.q4q(30,r)),t.yG2(5),t.E7m("routerLink",t.q4q(31,s)),t.yG2(8),t.E7m("routerLink",t.q4q(32,I)),t.yG2(5),t.E7m("routerLink",t.q4q(33,R)),t.yG2(5),t.E7m("routerLink",t.q4q(34,o)),t.yG2(7),t.E7m("ngIf",t.kDX(89,22,c.spinnerService.visibility))}},dependencies:[d.cP,d.ER,d.LC,i.u_,h.Ar,h.WS,h.Uq,G.qL,Y.EZ,w.Gw,w.um,p.G2,p.g9,p.Y1,p.Qp,k.k,C.Cs,x.wx,v.aM,v.OQ,v.yG,D.a4,A.S,$.s9,i.a],styles:[".navbar-spacer[_ngcontent-%COMP%]{flex:1 1 auto}.navbar[_ngcontent-%COMP%]{z-index:2}.navbar-brand[_ngcontent-%COMP%]{text-decoration:none;color:#fff}.navbar-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:absolute;inset:0}.navbar-is-mobile[_ngcontent-%COMP%] .navbar[_ngcontent-%COMP%]{position:fixed;z-index:2}.navbar-sidenav-container[_ngcontent-%COMP%]{flex:1}.navbar-is-mobile[_ngcontent-%COMP%] .navbar-sidenav-container[_ngcontent-%COMP%]{flex:1 0 auto}mat-sidenav[_ngcontent-%COMP%]{min-width:180px!important;border-right:1px solid #eee;box-shadow:6px 0 6px #0000001a}.progress-bar-container[_ngcontent-%COMP%]{height:5px}a.mat-list-item.active[_ngcontent-%COMP%]{background:#0000000a}#push-bottom[_ngcontent-%COMP%]{position:absolute;bottom:0}"]})}return f})()}}]);