2024-09-02 10:12:20 +02:00

1 line
8.2 KiB
JavaScript

"use strict";(self.webpackChunkstaffdb=self.webpackChunkstaffdb||[]).push([[826],{74826:(b,l,t)=>{t.r(l),t.d(l,{LoginModule:()=>F});var g=t(60177),d=t(18498),u=t(40605),p=t(75445),i=t(54438),f=t(12748),v=t(19057),L=t(53573),m=t(62560),h=t(66664),B=t(37085),n=t(76461),o=t(20962),c=t(1776),P=t(19664);function O(e,S){if(1&e&&(i.j41(0,"div",4)(1,"p"),i.EFF(2),i.k0s()()),2&e){const a=i.XpG();i.R7$(2),i.JRh(a.title)}}function E(e,S){if(1&e&&(i.j41(0,"mat-card",5)(1,"mat-card-header")(2,"mat-card-title"),i.EFF(3),i.nI1(4,"translate"),i.k0s()()()),2&e){const a=i.XpG();i.R7$(3),i.Lme("",i.bMT(4,2,"core.msg.greeting")," ",null==a.authorizationService.user?null:a.authorizationService.user.name,"!")}}function M(e,S){1&e&&(i.j41(0,"mat-card",5)(1,"mat-card-header")(2,"mat-card-title"),i.EFF(3),i.nI1(4,"translate"),i.k0s()(),i.j41(5,"mat-card",6),i.nrm(6,"mat-spinner",7),i.k0s()()),2&e&&(i.R7$(3),i.JRh(i.bMT(4,1,"core.msg.waitingconnecton")))}function U(e,S){1&e&&(i.j41(0,"mat-card",5)(1,"mat-card-header")(2,"mat-card-title"),i.EFF(3),i.nI1(4,"translate"),i.k0s()(),i.j41(5,"mat-card",6),i.nrm(6,"mat-spinner",7),i.k0s()()),2&e&&(i.R7$(3),i.JRh(i.bMT(4,1,"core.msg.checkuser")))}const z=[{path:"**",component:(()=>{class e{constructor(a,r,s,x,T,V,W,A,H){this.translate=a,this.globals=r,this.serverInfoService=s,this.routerService=x,this.authorizationService=T,this.appLogsService=V,this.uiNotifier=W,this.route=A,this.pageLoadingService=H,this.title=this.globals.appTitle,this.userLoginSubscription=this.authorizationService.loginAction$.subscribe(I=>{if(I.result){!this.globals.isTheMainPage(this.returnUrl)&&this.authorizationService.isLoggedUserChanged()&&(this.returnUrl="/"+r.mainPage.path);const C=this.returnUrl;this.appLogsService.dlog("After login goto "+C),this.routerService.navigate([C])}else this.authorizationService.loginStatus!==this.authorizationService.EN_LoginStatus_Password&&this.authorizationService.loginPopup(I.errMsg)})}ngOnInit(){this.connectionReadySubscription=this.serverInfoService.connectionReady.subscribe(a=>{a&&(this.serverInfo=a,this.doLogin())}),this.checkLoginPopupSubscription=(0,u.Y)(500).subscribe(()=>{this.serverInfo&&!this.authorizationService.isLoggedIn()&&this.authorizationService.loginStatus!==this.authorizationService.EN_LoginStatus_Unknown&&!p.N.LOGIN_IS_SHOWN&&this.doLogin()})}ngAfterViewInit(){}doLogin(){this.returnUrl=this.route.snapshot.queryParams.returnUrl,this.appLogsService.dlog("show login",this.authorizationService.user),this.returnUrl||(this.returnUrl="/"+this.globals.mainPage.path),this.authorizationService.loginStatus===this.authorizationService.EN_LoginStatus_Unknown?this.authorizationService.login():(this.serverInfoService.serverInfoVisible=this.serverInfoService.defaultServerInfoVisible||this.serverInfoService.serverInfoVisible,this.authorizationService.loginPopup(null,!0))}ngOnDestroy(){this.userLoginSubscription?.unsubscribe(),this.connectionReadySubscription?.unsubscribe(),this.checkLoginPopupSubscription?.unsubscribe()}static#i=this.\u0275fac=function(r){return new(r||e)(i.rXU(f.X),i.rXU(v.RV),i.rXU(L.z),i.rXU(d.Ix),i.rXU(m.V),i.rXU(h.w),i.rXU(B.u),i.rXU(d.nX),i.rXU(n.V))};static#t=this.\u0275cmp=i.VBU({type:e,selectors:[["app-login"]],decls:6,vars:4,consts:[[1,"login-wrapper"],["class","login-header",4,"ngIf"],[1,"login-body"],["class","box",4,"ngIf"],[1,"login-header"],[1,"box"],[1,"sub-box"],["mode","indeterminate"]],template:function(r,s){1&r&&(i.j41(0,"section",0),i.DNE(1,O,3,1,"div",1),i.j41(2,"div",2),i.DNE(3,E,5,4,"mat-card",3)(4,M,7,3,"mat-card",3)(5,U,7,3,"mat-card",3),i.k0s()()),2&r&&(i.R7$(),i.Y8G("ngIf",!s.serverInfo||s.authorizationService.isLoggedIn()||s.authorizationService.loginStatus===s.authorizationService.EN_LoginStatus_Unknown),i.R7$(2),i.Y8G("ngIf",s.authorizationService.isLoggedIn()),i.R7$(),i.Y8G("ngIf",!s.serverInfo),i.R7$(),i.Y8G("ngIf",s.serverInfo&&!s.authorizationService.isLoggedIn()&&s.authorizationService.loginStatus===s.authorizationService.EN_LoginStatus_Unknown))},dependencies:[g.bT,o._m,o.XB,o.YU,c.wS,P.D9],styles:['.cell_positive_balance{color:#76b82a} .cell_negative_balance{color:#b22222}.login-wrapper[_ngcontent-%COMP%]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);padding:0;margin:0;overflow:visible;display:grid;grid-column-gap:15px;grid-row-gap:0;grid-template-columns:repeat(1,minmax(0,auto));grid-template-rows:auto repeat(1,minmax(0,1fr));grid-template-areas:"login-header" "login-body"}.login-body[_ngcontent-%COMP%]{grid-area:login-body}.login-header[_ngcontent-%COMP%]{grid-area:login-header;color:#0b3a62;font-size:30px;text-align:center;margin:0}.box[_ngcontent-%COMP%]{margin:2px;padding:50px;width:auto;border-radius:10px;max-width:330px}.sub-box[_ngcontent-%COMP%]{display:flex;justify-content:center;width:auto}.mat-stroked-button.mat-accent[_ngcontent-%COMP%]{color:#fff;background:#0b3a62}']})}return e})()}];let k=(()=>{class e{static#i=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275mod=i.$C({type:e});static#n=this.\u0275inj=i.G2t({imports:[d.iI.forChild(z),d.iI]})}return e})();var y=t(18406),R=t(89417),D=t(92);let F=(()=>{class e{static#i=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275mod=i.$C({type:e});static#n=this.\u0275inj=i.G2t({imports:[g.MD,k,y.e,R.YN,D.d,P.h.forChild()]})}return e})()},76461:(b,l,t)=>{t.d(l,{V:()=>m});var g=t(54438),d=t(33570),u=t(84412),p=t(21413),i=t(12748),f=t(19057),v=t(66664),L=t(36554);let m=(()=>{class h{static#i=this.delayBackgroundPageLoaded=750;get noOfHttpQueries4Page(){return this._noOfHttpQueries4Page}set noOfHttpQueries4Page(n){n.forEach((o,c)=>{this._noOfHttpQueries4Page[c]>-1&&(this._noOfHttpQueries4Page[c]=o)})}get onPageLoagingWaitBackgroundLoadingFinished(){return this._onPageLoagingWaitBackgroundLoadingFinished}set onPageLoagingWaitBackgroundLoadingFinished(n){this._onPageLoagingWaitBackgroundLoadingFinished=n,this.waitBackgroundLoadingFinished=n}constructor(n,o,c){this.globals=n,this.appLogsservice=o,this.spinnerService=c,this.spinnerVisible=0,this.forgroundLoading$=new u.t(null),this.backgroundLoading$=new u.t(null),this.pageActive$=new p.B,this._noOfHttpQueries4Page=[],this.startBackgroundLoading=!1,this.waitBackgroundLoadingFinished=!1,this.arLoadedCompletedCallBacks=[],this.translationService=(0,g.WQX)(i.X),this._onPageLoagingWaitBackgroundLoadingFinished=!1,this.startBackgroundLoadingAfterPageIsLoaded=!0,this.globals.appPages.forEach(P=>this.noOfHttpQueries4Page.push(-1))}startSpinner(n=!0,o){this.startBackgroundLoading=n||this.startBackgroundLoading,o&&this.arLoadedCompletedCallBacks.push(o),this.showSpinner()}showSpinner(){0==this.spinnerVisible++&&(this.appLogsservice.dlog("%cshow spinner",{guid:"spinner"},"color:"+d.W1.hideSpinnerColor),this.spinnerService.show())}allData4PageAreLoaded(n=-1){return n>-1&&n<this.noOfHttpQueries4Page.length?this.noOfHttpQueries4Page[n]<=0:this.noOfHttpQueries4Page.every(o=>o<=0)}updatePageLoadedCounters(n){if(null!==n){const o=this.globals.isTheLoginPage(this.globals.appPages[n].path)?n:this.globals.getPageIndex(this.globals.currentPage);this.noOfHttpQueries4Page[n]>0&&this.noOfHttpQueries4Page[n]--,n<this.noOfHttpQueries4Page.length&&0===this.noOfHttpQueries4Page[n]&&this.appLogsservice.dlog("%c"+this.translationService.instant(this.globals.appPages[n].messageCaption)+" data are loaded","color:brown"),o===n&&!this.startBackgroundLoadingAfterPageIsLoaded&&this.doBackgroundLoading(),this.allData4PageAreLoaded(this.waitBackgroundLoadingFinished?-1:o)&&setTimeout(()=>{this.hideSpinner(),this.doCallBacks(),this.waitBackgroundLoadingFinished=this.onPageLoagingWaitBackgroundLoadingFinished,o===n&&this.startBackgroundLoadingAfterPageIsLoaded&&(this.spinnerVisible+=1,this.waitBackgroundLoadingFinished=!0,this.doBackgroundLoading(),this.spinnerVisible-=1)},h.delayBackgroundPageLoaded)}}doBackgroundLoading(){this.startBackgroundLoading&&(this.startBackgroundLoading=!1,this.backgroundLoading$.next())}hideSpinner(){this.spinnerVisible>0&&0==--this.spinnerVisible&&(this.appLogsservice.dlog("%chide spinner",{guid:"spinner"},"color:"+d.W1.hideSpinnerColor),this.spinnerService.hide())}doCallBacks(){const n=this.arLoadedCompletedCallBacks;this.arLoadedCompletedCallBacks=[],n.forEach(o=>{o&&o()})}static#t=this.\u0275fac=function(o){return new(o||h)(g.KVO(f.RV),g.KVO(v.w),g.KVO(L.ex))};static#n=this.\u0275prov=g.jDH({token:h,factory:h.\u0275fac,providedIn:"root"})}return h})()}}]);