Jucundus/client/dist/angular-material-template/228.09b3735f8b2791e2.js

1 line
13 KiB
JavaScript

"use strict";(self.webpackChunkangular_material_template=self.webpackChunkangular_material_template||[]).push([[228],{4847:(B,E,a)=>{a.r(E),a.d(E,{AccountModule:()=>U});var _=a(1368),P=a(2992),t=a(3200),e=a(2116),b=a(4476),u=a(2276),O=a(2080),h=a(180),i=a(6504),p=a(119),L=a(8656),G=a(3548),y=a(4440),f=a(1560),Y=a(7816),x=a(7536),C=a(4060);function g(n,R){1&n&&(e.I0R(0,"mat-error"),e.OEk(1," Please enter a your current password "),e.C$Y())}function k(n,R){1&n&&(e.I0R(0,"mat-error"),e.OEk(1," Please enter a new password "),e.C$Y())}function D(n,R){1&n&&(e.I0R(0,"mat-error"),e.OEk(1," Please confirm your new password "),e.C$Y())}let $=(()=>{class n{constructor(r,s,o,m){this.authService=r,this.logger=s,this.spinnerService=o,this.notificationService=m,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.logger.info(`User ${r} changed password.`),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(p.A),e.GI1(L.QF),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,g,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,k,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:[_.u_,i.sz,i.ot,i.ue,i.u,i.uW,i.Wo,u.sZ,u.CA,f.qL,Y.Gw,x.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})(),A=(()=>{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(p.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 w=[{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(b.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:[u.sZ,u.qG,u.CA,O.SM,O.WK,h.aJ,h._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:[P.qQ.forChild(w),P.qQ]})}return n})();var S=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:[_.MD,S.k,I]})}return n})()},3200:(B,E,a)=>{a.d(E,{Y:()=>o});var _=a(4548),P=a(6928),t=a(2116),e=a(1216),b=a(3548),u=a(119),O=a(9920),h=a(2992),i=a(1368),p=a(9964),L=a(1560),G=a(964),y=a(7816),f=a(6664),Y=a(3584),x=a(3576),C=a(9092),g=a(7500),k=a(6496),D=a(8156),$=a(2978);function A(m,F){1&m&&t.wR5(0,"mat-progress-bar",26)}const T=()=>["/"],w=()=>["/account/profile"],I=()=>["/auth/login"],S=()=>["/dashboard"],U=()=>["/sales"],n=()=>["/favorites"],R=()=>["/pictures"],r=()=>["/users"],s=()=>["/about"];let o=(()=>{class m{constructor(d,c,l,v,M){this.changeDetectorRef=d,this.media=c,this.spinnerService=l,this.authService=v,this.authGuard=M,this.showSpinner=!1,this.userName="",this.isAdmin=!1,this.autoLogoutSubscription=new P.wH,this.mobileQuery=this.media.matchMedia("(max-width: 1000px)"),this._mobileQueryListener=()=>d.detectChanges(),this.mobileQuery.addListener(this._mobileQueryListener)}ngOnInit(){const d=this.authService.getCurrentUser();this.isAdmin=d.isAdmin,this.userName=d.fullName;const c=(0,_.k)(2e3,5e3);this.autoLogoutSubscription=c.subscribe(()=>{this.authGuard.canActivate()})}ngOnDestroy(){this.mobileQuery.removeListener(this._mobileQueryListener),this.autoLogoutSubscription.unsubscribe()}ngAfterViewInit(){this.changeDetectorRef.detectChanges()}static#t=this.\u0275fac=function(c){return new(c||m)(t.GI1(t.kD9),t.GI1(e.iG),t.GI1(b.m),t.GI1(u.A),t.GI1(O.Q))};static#e=this.\u0275cmp=t.In1({type:m,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(c,l){if(1&c){const v=t.KQA();t.I0R(0,"div",0)(1,"mat-toolbar",1)(2,"button",2),t.qCj("click",function(){t.usT(v);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,A,1,0,"mat-progress-bar",25),t.wVc(89,"async"),t.C$Y(),t.wR5(90,"router-outlet"),t.C$Y()()()}if(2&c){const v=t.Gew(13),M=t.Gew(26);t.eAK("example-is-mobile",l.mobileQuery.matches),t.yG2(5),t.E7m("routerLink",t.q4q(24,T)),t.yG2(4),t.E7m("matMenuTriggerFor",v),t.yG2(3),t.E7m("overlapTrigger",!1),t.yG2(8),t.E7m("matMenuTriggerFor",M),t.yG2(4),t.oRS(" ",l.userName," "),t.yG2(),t.E7m("overlapTrigger",!1),t.yG2(2),t.E7m("routerLink",t.q4q(25,w)),t.yG2(5),t.E7m("routerLink",t.q4q(26,I)),t.yG2(6),t.E7m("opened",!l.mobileQuery.matches)("mode",l.mobileQuery.matches?"over":"side")("fixedInViewport",l.mobileQuery.matches),t.yG2(5),t.E7m("routerLink",t.q4q(27,S)),t.yG2(5),t.E7m("routerLink",t.q4q(28,U)),t.yG2(5),t.E7m("routerLink",t.q4q(29,n)),t.yG2(5),t.E7m("routerLink",t.q4q(30,R)),t.yG2(5),t.E7m("routerLink",t.q4q(31,r)),t.yG2(8),t.E7m("routerLink",t.q4q(32,w)),t.yG2(5),t.E7m("routerLink",t.q4q(33,I)),t.yG2(5),t.E7m("routerLink",t.q4q(34,s)),t.yG2(7),t.E7m("ngIf",t.kDX(89,22,l.spinnerService.visibility))}},dependencies:[h.cP,h.ER,h.LC,i.u_,p.Ar,p.WS,p.Uq,L.qL,G.EZ,y.Gw,y.um,f.G2,f.g9,f.Y1,f.Qp,Y.k,x.Cs,C.wx,g.aM,g.OQ,g.yG,k.a4,D.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 m})()}}]);