1(self.webpackChunkselfblue=self.webpackChunkselfblue||[]).push([[761],{37148:(g,C,s)=>{"use strict";s.d(C,{kb:()=>B,u5:()=>u});class h{}class o{}class u{constructor(){this.priceListNumber=0,this.scaleFactor=1,this.machineType=new h,this.machineGroup=new o,this.policyMask=0,this.tritechSelectionCounter="0",this.tritechRecyclerEnabled=0}}class B extends u{}},58761:(g,C,s)=>{"use strict";s.r(C),s.d(C,{StatsModule:()=>De});var h=s(31635),o=s(17705),u=s(99403),B=s(82180),Me=s(60627),H=s(52032),_=s(75743),Te=s(32037),Ee=s.n(Te);var R=s(41780),S=s(97586),M=s(85641),T=s(13316),G=s(77559),se=s(37660),Oe=s(62460);let z=class{constructor(e,t,a,r){this.statsService=e,this.translate=t,this.merchant=a,this.localeService=r,this.dataSourceAvailable=!0,this.dateFromMinDate=this.merchant.createdAt,this.dateToMaxDate=new Date,this.datesInterval=31,this.lineChartOptions={fullWidth:!0,showLine:!0,responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1,borderDash:[12,4]},ticks:{autoSkip:!0}},y:{grid:{borderColor:"transparent"},title:{display:!0,text:this.merchant.currency},min:0,ticks:{callback:d=>(new T.V).transform(Number(d),2)}}}},this.barChartOptions={fullWidth:!0,showLine:!0,responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1,borderDash:[12,4]},ticks:{autoSkip:!0}},y:{grid:{borderColor:"transparent"},title:{display:!0,text:this.merchant.currency},min:0,ticks:{callback:d=>(new T.V).transform(Number(d),2)}}}};for(const d in se)(0,Oe.mO)(se[d].abbr,se[d]);const n=localStorage.getItem("lang");this.localeService.use(n||"en"),this.dataSourcesState={barChartsData:"loading"}}ngOnInit(){this.dateFrom=new Date,this.dateFrom.setDate(this.dateFrom.getDate()-this.datesInterval),this.dateTo=new Date,this.loadStats()}loadStats(){this.dataSourceAvailable=!0,this.statsService.getStats(this.merchant.id,this.dateFrom,this.dateTo).subscribe(e=>{const t=[],a=[],r=[],n=[],d=[],c=[],m=[],v=[],p=e.statistics;for(let l=new Date(this.dateFrom.getTime());l<=this.dateTo;l.setDate(l.getDate()+1))r.push(S(l).format("DD-MM-YYYY")),n.push(0),t.push(S(l).format("DD-MM-YYYY")),a.push(0),d.push(S(l).format("DD-MM-YYYY")),c.push(0),m.push(S(l).format("DD-MM-YYYY")),v.push(0);p.forEach(l=>{l.entries.forEach(f=>{if(1===f.entryType){const b=t.indexOf(S(l.date).format("DD-MM-YYYY"));a[b]=f.amount/Math.pow(10,this.merchant.decimalPlaces),c[b]=f.entryNumber}else if(2===f.entryType){const b=r.indexOf(S(l.date).format("DD-MM-YYYY"));n[b]=f.amount/Math.pow(10,this.merchant.decimalPlaces),v[b]=f.entryNumber}})}),this.numberOfSalesData={labels:d,datasets:[{data:c,backgroundColor:"#fcab11",borderColor:"#fcab11"}]},this.numberOfRechargesData={labels:m,datasets:[{data:v,backgroundColor:"#fcab11",borderColor:"#fcab11"}]},this.revenuesData={labels:r,datasets:[{data:n,backgroundColor:"#3ab54b",borderColor:"#3ab54b",radiu
1s:0}]},this.salesData={labels:t,datasets:[{data:a,backgroundColor:"#3ab54b",borderColor:"#3ab54b",radius:0}]},this.dataSourcesState.barChartsData="loaded"},e=>{this.dataSourceAvailable=!1,this.dataSourcesState.barChartsData="error"})}ngOnDestroy(){}dateToChanged(e){if(e){let t=new Date(e.getTime());t.setDate(t.getDate()-this.datesInterval),this.dateFrom=t>this.dateFrom?t:this.dateFrom}}dateFromChanged(e){if(e){let t=new Date(e.getTime());t.setDate(t.getDate()+this.datesInterval),this.dateTo=t<this.dateTo?t:this.dateTo}}static{this.ctorParameters=()=>[{type:G.b},{type:R.c$},{type:M.j},{type:B.ZJ}]}};z=(0,h.Cg)([(0,o.uAl)({selector:"general",template:'<div class="row">\r\n <div class="col-md-12">\r\n <page-header [companyName]="merchant.companyName"\r\n [pathComponentsStringsKeys]="[\'Menu.Stats.Main\', \'Common.General\']"></page-header>\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col">\r\n <aggregated-data></aggregated-data>\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col-md-8">\r\n <load-guard-card-with-header [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.Sales\' | translate">\r\n <canvas baseChart type="line" [data]="salesData" [options]="lineChartOptions" style="height: 300px"\r\n load-guarded-template>\r\n </canvas>\r\n </load-guard-card-with-header>\r\n\r\n \x3c!--<mat-card>\r\n <mat-card-title>{{\'Stats.Sales\' | translate}}</mat-card-title>\r\n <mat-card-content>\r\n <ng-container *ngIf="dataSourceAvailable; else dataSourceUnavailable">\r\n <chart type="line" [data]="salesData" [options]="lineChartOptions" style="height: 300px;"></chart>\r\n </ng-container>\r\n </mat-card-content>\r\n </mat-card> --\x3e\r\n </div>\r\n \x3c!-- Filtro date --\x3e\r\n <div class="col-md-4">\r\n <mat-card>\r\n <mat-card-title>{{ "Stats.Filters" | translate }}</mat-card-title>\r\n <mat-card-content>\r\n <label>\r\n {{ "Stats.From" | translate }}\r\n </label>\r\n <div class="input-group date">\r\n <div class="input-group-prepend">\r\n <span class="input-group-text" (click)="dpFrom.toggle()">\r\n <i class="ion-android-calendar"></i>\r\n </span>\r\n </div>\r\n <input type="text" name="dateFrom" class="form-control m-input m-input--solid" [maxDate]="dateTo"\r\n [minDate]="dateFromMinDate" #dpFrom="bsDatepicker" [bsConfig]="{ dateInputFormat: \'DD-MM-YYYY\' }"\r\n bsDatepicker [(ngModel)]="dateFrom" (bsValueChange)="dateFromChanged($event)" />\r\n </div>\r\n <br />\r\n <label>\r\n {{ "Stats.To" | translate }}\r\n </label>\r\n <div class="input-group date">\r\n <div class="input-group-prepend">\r\n <span class="input-group-text" (click)="dpTo.toggle()">\r\n <i class="ion-android-calendar"></i>\r\n </span>\r\n </div>\r\n <input type="text" name="dateTo" class="form-control m-input m-input--solid" [maxDate]="dateToMaxDate"\r\n [minDate]="dateFrom" #dpTo="bsDatepicker" [bsConfig]="{ dateInputFormat: \'DD-MM-YYYY\' }" bsDatepicker\r\n [(ngModel)]="dateTo" (bsValueChange)="dateToChanged($event)" />\r\n </div>\r\n <br />\r\n <button class="btn" (click)="loadStats()">\r\n {{ "Stats.Filter" | translate }}\r\n </button>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col-md-8">\r\n <load-guard-card-with-header [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.NumberOfSales\' | translate">\r\n <canvas baseChart type="bar" [data]="numberOfSalesData" [options]="barChartOptions" style="height: 300px"\r\n load-guarded-template>\r\n </canvas>\r\n </load-guard-card-with-header>\r\n\r\n \x3c!-- <mat-card>\r\n <mat-card-title> {{\'Stats.NumberOfSales\' | translate}}</mat-card-title>\r\n <mat-card-content>\r\n <ng-container *ngIf="dataSourceAvailable; else dataSourceUnavailable">\r\n <chart type="bar" [data]="numberOfSalesData" [options]="barChartOptions" style="height: 300px;">\r\n </chart>\r\n </ng-container>\r\n </mat-card-content>\r\n </mat-card>
1 --\x3e\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col-md-8">\r\n <load-guard-card-with-header [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.Revenues\' | translate">\r\n <canvas baseChart type="line" [data]="revenuesData" [options]="lineChartOptions" style="height: 300px"\r\n load-guarded-template>\r\n </canvas>\r\n </load-guard-card-with-header>\r\n\r\n \x3c!--<mat-card>\r\n <mat-card-title>{{\'Stats.Revenues\' | translate}}</mat-card-title>\r\n <mat-card-content>\r\n <ng-container *ngIf="dataSourceAvailable; else dataSourceUnavailable">\r\n <chart type="line" [data]="revenuesData" [options]="lineChartOptions" style="height: 300px;">\r\n </chart>\r\n </ng-container>\r\n </mat-card-content>\r\n </mat-card> --\x3e\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col-md-8">\r\n <load-guard-card-with-header [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.NumberOfRecharges\' | translate">\r\n <canvas baseChart type="bar" [data]="numberOfRechargesData" [options]="barChartOptions" style="height: 300px"\r\n load-guarded-template>\r\n </canvas>\r\n </load-guard-card-with-header>\r\n\r\n \x3c!--<mat-card>\r\n <mat-card-title>{{\'Stats.NumberOfRecharges\' | translate}}</mat-card-title>\r\n <mat-card-content>\r\n <ng-container *ngIf="dataSourceAvailable; else dataSourceUnavailable">\r\n <chart type="bar" [data]="numberOfRechargesData" [options]="barChartOptions" style="height: 300px;">\r\n </chart>\r\n </ng-container>\r\n </mat-card-content>\r\n </mat-card>--\x3e\r\n </div>\r\n</div>\r\n\r\n<ng-template #dataSourceUnavailable>\r\n {{ "Common.ServiceUnavailable" | translate }}\r\n</ng-template>',providers:[G.b],styles:[Ee()]})],z);var Ue=s(53502),Ne=s.n(Ue);var V=s(27468),I=s(14462),U=s(63787),N=s(91574);let W=class{constructor(e,t){this.http=e,this.merchant=t}getMachineGroupInfo(e){return this.http.get(`wallet/v1/machine/groups/stat/info/${e}/merchant/${this.merchant.id}`)}getMachineGroupFullDetails(e){return this.http.get(`wallet/v1/machine/groups/stat/detail/full/${e}/merchant/${this.merchant.id}`)}getMachineGroupDetails(e,t=null,a=null){null===t&&(t=new Date).setDate(t.getDate()-30);const r=("0"+t.getDate()).slice(-2),n=("0"+(t.getMonth()+1)).slice(-2),c=t.getFullYear()+""+n+r;null===a&&(a=new Date);const m=("0"+a.getDate()).slice(-2),v=("0"+(a.getMonth()+1)).slice(-2),l=a.getFullYear()+""+v+m;return this.http.get(`wallet/v1/machine/groups/stat/detail/${e}/merchant/${this.merchant.id}?from=${c}&to=${l}`)}getMachineGroupActivities(e,t=null,a=null){null===t&&(t=new Date).setDate(t.getDate()-10);const r=("0"+t.getDate()).slice(-2),n=("0"+(t.getMonth()+1)).slice(-2),c=t.getFullYear()+""+n+r;null===a&&(a=new Date);const m=("0"+a.getDate()).slice(-2),v=("0"+(a.getMonth()+1)).slice(-2),l=a.getFullYear()+""+v+m;return this.http.get(`wallet/v1/machine/groups/stat/activities/${e}/merchant/${this.merchant.id}?from=${c}&to=${l}`)}getMachineGroupSaleHours(e,t=null,a=null){null===t&&(t=new Date).setDate(t.getDate()-10);const r=("0"+t.getDate()).slice(-2),n=("0"+(t.getMonth()+1)).slice(-2),c=t.getFullYear()+""+n+r;null===a&&(a=new Date);const m=("0"+a.getDate()).slice(-2),v=("0"+(a.getMonth()+1)).slice(-2),l=a.getFullYear()+""+v+m;return this.http.get(`wallet/v1/machine/groups/stat/sales/hour/${e}/merchant/${this.merchant.id}?from=${c}&to=${l}`)}static{this.ctorParameters=()=>[{type:N.k},{type:M.j}]}};W=(0,h.Cg)([(0,o._qm)()],W);let X=class{constructor(e,t,a,r,n){this.machineGroupStatsService=e,this.route=t,this.translate=a,this.merchant=r,this.dialog=n,this.dateFromMinDate=this.merchant.createdAt,this.dateFromMaxDate=new Date,this.dateToMinDate=new Date,this.dateToMaxDate=new Date,this.lineChartOptions={responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{display:!1}},scales:{x:{type:"category",ticks:{autoSkip:!0},grid:{borderDash:[12,4]}},y:{beginAtZero:!0,grid:{borderDash:[12,4]},ticks:{callback:d=>(new T.V).transform(Number(d),2)}}}},this.barChartOptions={responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{dis
1play:!1}},scales:{x:{type:"category",ticks:{autoSkip:!0},grid:{borderDash:[12,4]}},y:{beginAtZero:!0,grid:{borderDash:[12,4]},ticks:{callback:d=>(new T.V).transform(Number(d),0)}}}},this.dataSourcesState={summary:"loading",barChartsData:"loading",summaryDetails:"loading"}}ngOnInit(){this.dateFrom=new Date,this.dateFrom.setDate(this.dateFrom.getDate()-10),this.dateTo=new Date,this.dateToMinDate=this.merchant.createdAt,this.dateToMinDate.setDate(this.dateToMinDate.getDate()+10),this.loadStats(!0)}loadStats(e=!1){this.dataSourcesState.summaryDetails="loading",e&&(this.isLoading=!0),(0,V.p)(this.machineGroupStatsService.getMachineGroupInfo(this.machineGroupId),this.machineGroupStatsService.getMachineGroupDetails(this.machineGroupId,this.dateFrom,this.dateTo),this.machineGroupStatsService.getMachineGroupFullDetails(this.machineGroupId)).subscribe(([t,a,r])=>{this.setInfo(t),this.setDetails(a),this.setFullDetails(r),this.dataSourcesState.summary="loaded",this.dataSourcesState.summaryDetails="loaded"},t=>{this.dialog.error(t),this.isLoading=void 0,this.dataSourcesState.summary="error",this.dataSourcesState.summaryDetails="error"},()=>{e&&(this.isLoading=!1)}),this.machineGroupStatsService.getMachineGroupActivities(this.machineGroupId,this.dateFrom,this.dateTo).subscribe(t=>this.setActivities(t)),this.machineGroupStatsService.getMachineGroupSaleHours(this.machineGroupId,this.dateFrom,this.dateTo).subscribe(t=>this.setSaleHours(t))}loadStats_date(){this.dataSourcesState.summaryDetails="loading",this.dataSourcesState.barChartsData="loading",this.machineGroupStatsService.getMachineGroupDetails(this.machineGroupId,this.dateFrom,this.dateTo).subscribe(e=>{this.setDetails(e),this.dataSourcesState.summaryDetails="loaded"},e=>{this.dialog.error(e),this.isLoading=void 0,this.dataSourcesState.summaryDetails="error"}),this.machineGroupStatsService.getMachineGroupActivities(this.machineGroupId,this.dateFrom,this.dateTo).subscribe(e=>this.setActivities(e)),this.machineGroupStatsService.getMachineGroupSaleHours(this.machineGroupId,this.dateFrom,this.dateTo).subscribe(e=>this.setSaleHours(e))}setInfo(e){this.machineGroupInfo=e.machineGroupInfo}setDetails(e){this.statsDetails=e.machineDetail,this.statsDetails.totalSales=this.statsDetails.totalSales/Math.pow(10,this.merchant.decimalPlaces),this.statsDetails.totalRevenues=this.statsDetails.totalRevenues/Math.pow(10,this.merchant.decimalPlaces)}setFullDetails(e){this.statsFullDetails=e.machineDetail,this.statsFullDetails.totalSales=this.statsFullDetails.totalSales/Math.pow(10,this.merchant.decimalPlaces),this.statsFullDetails.totalRevenues=this.statsFullDetails.totalRevenues/Math.pow(10,this.merchant.decimalPlaces)}setActivities(e){this.dataSourcesState.barChartsData="loading";const t=[],a=[],r=[],n=[],d=[],c=[],m=[],v=[],p=e.statistics;for(const l=new Date(this.dateFrom.getTime());l<=this.dateTo;l.setDate(l.getDate()+1))r.push(S(l).format("DD-MM-YYYY")),n.push(0),t.push(S(l).format("DD-MM-YYYY")),a.push(0),d.push(S(l).format("DD-MM-YYYY")),c.push(0),m.push(S(l).format("DD-MM-YYYY")),v.push(0);if(0!==p.length)for(let l=0;l<p.length;l++)for(let f=0;f<p[l].entries.length;f++)if(1===p[l].entries[f].entryType){const b=t.indexOf(S(p[l].date).format("DD-MM-YYYY"));a[b]=p[l].entries[f].amount/Math.pow(10,this.merchant.decimalPlaces),c[b]=p[l].entries[f].entryNumber}else if(2===p[l].entries[f].entryType){const b=r.indexOf(S(p[l].date).format("DD-MM-YYYY"));n[b]=p[l].entries[f].amount/Math.pow(10,this.merchant.decimalPlaces),v[b]=p[l].entries[f].entryNumber}this.numberOfSalesData={labels:d,datasets:[{data:c,backgroundColor:"#fcab11",borderColor:"#fcab11",showPoint:!1,radius:0}]},this.numberOfRechargesData={labels:m,datasets:[{data:v,backgroundColor:"#fcab11",borderColor:"#fcab11",showPoint:!1,radius:0}]},this.revenuesData={labels:r,datasets:[{data:n,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]},this.salesData={labels:t,datasets:[{data:a,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]},this.dataSourcesState.barChartsData="loaded"}setSaleHours(e){this.dataSourcesState.barChartsData="loading";const t=[],a=[],r=e.purchases;if(0===r.length)t.push("0"),t.push("0"),a.push(0),a.push(0);else for(let n=0;n<r.length;n++)t.push(r[n].hour.toString()),a.push(r[n].total);this.purchasesByHourData={labels:t,datasets:[{data:a,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]},this.dataSourcesState.barChartsData="loaded"}ngOnDestroy(){}static{this.ctorParameters=()=>[{type:W},{type:_.nX},{type:R.c$},{type:M.j},{type:I.o}]}
1static{this.propDecorators={machineGroupId:[{type:o.pde}]}}};X=(0,h.Cg)([(0,o.uAl)({selector:"machine-group-stats",template:'\x3c!--<div class="row">\r\n <div class="col-md-12">\r\n <spinner *ngIf="isLoading === true" class="top-page-spinner"></spinner> \r\n <page-header *ngIf="isLoading; else specificHeader" [companyName]="merchant.companyName"\r\n [pathComponentsStringsKeys]="[ \'Menu.Stats.Main\', \'Menu.Stats.MachineGroups\' ]"></page-header>\r\n\r\n <ng-template #specificHeader>\r\n <page-header [companyName]="merchant.companyName" [doNotTranslate]="true"\r\n [pathComponentsStringsKeys]="[ \'Menu.Stats.Main\' | translate, \'Menu.Stats.MachineGroups\' | translate, machineGroupInfo.name ]">\r\n </page-header>\r\n </ng-template>\r\n </div>\r\n</div>--\x3e\r\n\r\n<load-guard [dataSourceState]="dataSourcesState.summary">\r\n <div\r\n *ngIf="statsFullDetails || statsDetails || machineGroupInfo"\r\n load-guarded-template\r\n style="margin-top: 0.5rem"\r\n >\r\n <div class="row" *ngIf="isLoading === false">\r\n <div class="col-md-6">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-1 icon">\r\n <i class="i-machine"></i>\r\n </div>\r\n <div class="col-md-11">\r\n <div class="row">\r\n <div class="col-md-12" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Machines.Common.MachineGroup" | translate }}:\r\n <strong> {{ machineGroupInfo.name }}</strong>\r\n </div>\r\n </div>\r\n <div class="col-md-12">\r\n <div class="value">\r\n {{ "Dashboard.NumberOfMachines" | translate }}:\r\n <strong> {{ machineGroupInfo.machines }}</strong>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">{{ "Stats.TotalSales" | translate }}</div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">\r\n {{ statsFullDetails.totalSales\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">{{ "Stats.TotalRevenues" | translate }}</div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">\r\n {{ statsFullDetails.totalRevenues\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n\r\n <div class="row" *ngIf="isLoading === false">\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Stats.RegisteredUsers" | translate }}\r\n </div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">\r\n {{ machineGroupInfo.registeredUsers }}\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">{{ "Stats.ActiveUsers" | translate }}</div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">{{ machineGroupInfo.activeUsers }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Stats.TotalNumberOfSales" | translate }}\r\n </div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">{{ statsFullDetails.countSales }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Stats.TotalNumberOfRecharges" | translate }}\r\n </div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">\r\n {{ statsFullDetails.countRecharges }}\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n </div>\r\n</load-guard>\r\n\r\n<load-guard [dataSourceState]="dataSourcesState.summaryDetails">\r\n <div\r\n *ngIf="statsFullDetails || statsDetails || machineGroupInfo"\r\n load-guarded-template\r\n >\r\n <div class="row">\r\n <div class="col-md-6">\r\n <mat-card style="height: 80%">\r\n <mat-card-title>{{ "Stats.Filters" | translate }}</mat-card-title>\r\n <mat-card-content>\r\n <label>\r\n {{ "Stats.From" | translate }}\r\n </label>\r\n <div class="input-group date">\r\n <div class="input-group-prepend">
1\r\n <span class="input-group-text" (click)="dpFrom.toggle()">\r\n <i class="ion-android-calendar"></i>\r\n </span>\r\n </div>\r\n <input\r\n type="text"\r\n name="dateFrom"\r\n class="form-control m-input m-input--solid"\r\n [maxDate]="dateFromMaxDate"\r\n [minDate]="dateFromMinDate"\r\n #dpFrom="bsDatepicker"\r\n [bsConfig]="{ dateInputFormat: \'DD-MM-YYYY\' }"\r\n bsDatepicker\r\n [(ngModel)]="dateFrom"\r\n />\r\n </div>\r\n <br />\r\n <label>\r\n {{ "Stats.To" | translate }}\r\n </label>\r\n <div class="input-group date">\r\n <div class="input-group-prepend">\r\n <span class="input-group-text" (click)="dpTo.toggle()">\r\n <i class="ion-android-calendar"></i>\r\n </span>\r\n </div>\r\n <input\r\n type="text"\r\n name="dateTo"\r\n class="form-control m-input m-input--solid"\r\n [maxDate]="dateToMaxDate"\r\n [minDate]="dateToMinDate"\r\n #dpTo="bsDatepicker"\r\n [bsConfig]="{ dateInputFormat: \'DD-MM-YYYY\' }"\r\n bsDatepicker\r\n [(ngModel)]="dateTo"\r\n />\r\n </div>\r\n <br />\r\n <button class="btn" (click)="loadStats_date()">\r\n {{ "Stats.Filter" | translate }}\r\n </button>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" *ngIf="isLoading === false">\r\n <div class="row">\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">{{ "Stats.Sales" | translate }}</div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">\r\n {{ statsDetails.totalSales\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">{{ "Stats.Revenues" | translate }}</div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">\r\n {{ statsDetails.totalRevenues\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">\r\n {{ "Stats.NumberOfSales" | translate }}\r\n </div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">{{ statsDetails.countSales }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">\r\n {{ "Stats.NumberOfRecharges" | translate }}\r\n </div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">\r\n {{ statsDetails.countRecharges }}\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</load-guard>\r\n\r\n<div>\r\n <div class="row">\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.Revenues\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="line"\r\n [data]="revenuesData"\r\n [options]="lineChartOptions"\r\n style="height: 300px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n \x3c!-- <mat-card>\r\n <mat-card-title>{{\'Stats.Revenues\'| translate}}</mat-card-title>\r\n <mat-card-content>\r\n <div>\r\n <chart type="line" [data]="revenuesData" [options]="lineChartOptions" style="height: 300px;">\r\n </chart>\r\n </div>\r\n </mat-card-content>\r\n </mat-card> --\x3e\r\n </div>\r\n\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.Sales\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="line"\r\n [data]="salesData"\r\n [options]="lineChartOptions"\r\n style="height: 300px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n \x3c!-- <mat-card>\r\n <mat-card-title>{{\'Stats.Sales\' | translate}}</mat-card-title>\r\n <mat-card-content>\r\n <div>\r\n <chart type="line" [data]="salesData" [options]="lineChartOptions" style="height: 300px;">\r\n </chart>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>--\x3e\r\n </div>\r\n </div>\r\n\r\n <div class="row">\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.NumberOfRecharges\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="numberOfRechargesData"\r\n [options]="barChartOptions"\r\n style="height: 300px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n \x3c!-- <mat-card>\r\n <mat-card-title>{{\'Stats.NumberOfRecharges\' | translate}}</mat-card-title>\r\n <mat-card-content>\r\n <div>\r\n <chart type="bar" [data]="numberOfRechargesData" [options]="barChartOptions"\r\n style="height: 300px;"></chart>\r\n </div>\r\n </mat-card-content>\r\n </mat-card> --\x3e\r\n </div>\r\n\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.NumberOfSales\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="numberOfSalesData"\r\n [options]="barChartOptions"\r\n style="height: 300px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n \x3c!--<mat-card>\r\n <mat-card-title>{{\'Stats.NumberOfSales\' | translate}}</mat-card-title>\r\n <mat-card-content>\r\n <div>\r\n <chart type="bar" [data]="numberOfSalesData" [options]="barChartOptions" style="height: 300px;">\r\n </chart>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>--\x3e\r\n </div>\r\n </div>\r\n\r\n <div class="row">\r\n <div\r\n class="col-md-12"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol12\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.SalesByHour\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="purchasesByHourData"\r\n [options]="barChartOptions"\r\n style="height: 320px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n \x3c!-- <mat-card>\r\n <mat-card-title>{{\'Stats.SalesByHour\' | translate}}</mat-card-title>\r\n <mat-card-content>\r\n <chart type="bar" [data]="purchasesByHourData" [options]="barChartOptions" style="height: 320px;">\r\n </chart>\r\n </mat-card-content>\r\n </mat-card>--\x3e\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #spinnerPlaceHolderCol6>\r\n <div class="col-md-6">\r\n <mat-card\r\n [nbSpinner]="true"\r\n nbSpinnerStatus="primary"\r\n class="equal-height"\r\n ></mat-card>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #spinnerPlaceHolderCol12>\r\n <div class="col-md-12">\r\n <mat-card\r\n [nbSpinner]="true"\r\n nbSpinnerStatus="primary"\r\n class="equal-height"\r\n ></mat-card>\r\n </div>\r\n</ng-template>\r\n',providers:[U.W,W],styles:[Ne()]})],X);var Fe=s(57451),He=s.n(Fe);var E=s(26450);let K=class{constructor(e,t,a,r,n){this.machineService=e,this.dialog=t,this.router=a,this.merchant=r,this.translate=n,this.dataSourceAvailable=!0,this.tabId=ie,this.selectedTab=0,this.columnsGroup=["name","description"],this.isLoadingGroup=!1,this.totalRowsGroup=0,this.pageSizeGroup=10,this.currentPageGroup=0,this.pageSizeOptionsGroup=[10,25,100],this.filtername="",this.filterdescription="";this.dataSourceGroup=new E.I6([])}ngOnInit(){this.getGroups()}ngOnDestroy(){this.machineGroupListSTSourceSubscription&&this.machineGroupListSTSourceSubscription.unsubscribe()}
1showStats(e){this.machineGroupId=e.id,this.machineGroupName=e.name,this.selectedTab=1}closeMachineGroup(e){1!=e.index&&(this.machineGroupId=void 0,this.selectedTab=e.index)}getGroups(){this.filtersGroup=""+this.filtername+this.filterdescription,this.filtercountGroup="?"+this.filtername+this.filterdescription,this.isLoadingGroup=!0,this.machineService.getMachineGroups(this.merchant.id,this.currentPageGroup,this.pageSizeGroup,"",this.filtersGroup).subscribe(e=>{this.dataSourceGroup.data=e,this.machineService.getMachineGroupsCount(this.merchant.id,"",this.filtercountGroup).subscribe(t=>{this.paginatorGroup.pageIndex=this.currentPageGroup,this.paginatorGroup.length=t,this.paginatorGroup.pageSize=this.pageSizeGroup,this.totalRowsGroup=t,this.isLoadingGroup=!1},t=>{console.log(t)})},e=>{console.log(e),this.dataSourceGroup.data=[],this.isLoadingGroup=!1})}pageChangedGroup(e){this.pageSizeGroup=e.pageSize,this.currentPageGroup=e.pageIndex,this.getGroups()}filterName(e){this.filtername=e?"&name="+e:"",this.getGroups()}filterDescription(e){this.filterdescription=e?"&description="+e:"",this.getGroups()}static{this.ctorParameters=()=>[{type:U.W},{type:I.o},{type:_.Ix},{type:M.j},{type:R.c$}]}static{this.propDecorators={paginatorGroup:[{type:o.Uct,args:["paginatorGroup",{static:!0}]}]}}};var ie,i;K=(0,h.Cg)([(0,o.uAl)({selector:"stats-machine-groups",template:'<div class="row">\r\n <div class="col-md-12">\r\n <page-header [companyName]="merchant.companyName"\r\n [pathComponentsStringsKeys]="[ \'Menu.Stats.Main\', \'Menu.Stats.MachineGroups\' ]"></page-header>\r\n </div>\r\n</div>\r\n <div class="row">\r\n <div class="col">\r\n <mat-tab-group [selectedIndex]="selectedTab" (selectedTabChange)="closeMachineGroup($event)">\r\n \x3c!-- PRIMO TAB --\x3e\r\n <mat-tab class="first-tab" label="{{ \'Machines.Groups.GroupsOfMachines\' | translate }}" id="tabId.MACHINE_GROUP_LIST" #generaliTab>\r\n <download-simulating-bar *ngIf="loadingSmartTable"></download-simulating-bar>\r\n <mat-card>\r\n <mat-card-title>{{\'Stats.SelectGroupMachine\' | translate}}</mat-card-title>\r\n <mat-card-content class="table-card">\r\n <mat-progress-bar mode="indeterminate" *ngIf="isLoadingGroup"></mat-progress-bar>\r\n <mat-table [dataSource]="dataSourceGroup" matSort>\r\n \x3c!-- Column --\x3e\r\n <ng-container matColumnDef="name">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Machines.Groups.Name\' | translate}} </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.name}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="description">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Common.Description\' | translate}} </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.description}} </mat-cell>\r\n </ng-container>\r\n \r\n \x3c!-- Filtri --\x3e\r\n <ng-container matColumnDef="header2">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input class="filter-input" type="text" placeholder="{{\'Machines.Groups.Name\' | translate}}" \r\n (keyup.enter)="filterName(name)" [(ngModel)]="name"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class">\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header3">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Common.Description\' | translate}}"\r\n (keyup.enter)="filterDescription(description)" [(ngModel)]="description"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class">\r\n </mat-header-cell>\r\n </ng-container>\r\n \r\n <mat-header-row *matHeaderRowDef="columnsGroup"></mat-header-row>\r\n <mat-header-row *matHeaderRowDef="[\'header2\', \'header3\']"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns: columnsGroup;" style="cursor: pointer;" (click)="showStats(row)"></mat-row>\r\n </mat-table>\r\n \r\n <mat-paginator #paginatorGroup [length]="totalRowsGroup" [pageIndex]="currentPageGroup" [pageSize]="pageSizeGroup"\r\n [pageSizeOptions]="pageSizeOptionsGroup" (page)="pageChangedGroup($event)" aria-label="Select page" [showFirstLastButtons]="true"></mat-paginator>\r\n \x3c!-- <ng-container *ngIf="dataSourceAvailable; else dataSourceUnavailable">\r\n <ng2-smart-table [settings]="settings" [source]="source" class="clickable"\r\n (userRowSelect)="showStats($event)"></ng2-smart-table>\r\n </ng-container>\r\n <ng-template #dataSourceUnavailable>\r\n {{ \'Common.ServiceUnavailable\' | translate}}\r\n </ng-template>--\x3e\r\n </mat-card-content>\r\n </mat-card>\r\n </mat-tab>\r\n \x3c!-- SECONDO TAB --\x3e\r\n <mat-tab *ngIf="machineGroupId" label="{{machineGroupName}}">\r\n <machine-group-stats [machineGroupId]="machineGroupId"></machine-group-stats>\r\n </mat-tab>\r\n </mat-tab-group>\r\n </div>\r\n</div>',providers:[U.W],styles:[He()]})],K),(i=ie||(ie={}))[i.MACHINE_GROUP_LIST=0]="MACHINE_GROUP_LIST",i[i.MACHINE_GROUP=1]="MACHINE_GROUP";var je=s(8075),$e=s.n(je);let Q=class{getSelectedUserTabTitle(){return`${this.selectedUser.lastName} ${this.selectedUser.firstName}`}constructor(e,t,a){this.merchant=e,this.route=t,this.router=a,this.tabId=Y,this.userNAME="",this.userSURNAME="",this.userEMAIL="",this.userID=this.route.
1snapshot.queryParamMap.get("id"),this.userNAME=this.route.snapshot.queryParamMap.get("name"),this.userSURNAME=this.route.snapshot.queryParamMap.get("surname"),this.userEMAIL=this.route.snapshot.queryParamMap.get("email"),this.userBirt=this.route.snapshot.queryParamMap.get("birth"),this.userGENDER=this.route.snapshot.queryParamMap.get("gender"),this.router.navigate([],{queryParams:{id:null,name:null,surname:null,email:null,birth:null,gender:null},queryParamsHandling:"merge"}),this.userID&&(this.selectedTab=2)}ngOnInit(){this.userID&&"NOME"!=this.userNAME?this.onUserSelected():this.selectedTab=0}onUserSelected(e){this.selectedUser=e||{birthDate:this.userBirt,email:this.userEMAIL,firstName:this.userNAME,gender:this.userGENDER,lastName:this.userSURNAME,userId:this.userID},this.summaryTab.active=!1,this.userListTab.active=!1,this.selectedTab=2}closeUser(e){2!=e.index&&(this.selectedUser=void 0,this.selectedTab=e.index)}onChangeTab(e){switch(+e.tabId){case Y.GENERALI:case Y.LISTA_UTENTI:return void(this.selectedUser=void 0);default:return}}static{this.ctorParameters=()=>[{type:M.j},{type:_.nX},{type:_.Ix}]}static{this.propDecorators={summaryTab:[{type:o.Uct,args:["summaryTab"]}],userListTab:[{type:o.Uct,args:["userListTab"]}]}}};var Y;Q=(0,h.Cg)([(0,o.uAl)({selector:"users-stats-container",template:'<div class="row" *ngIf="merchant">\r\n <div class="col-md-12">\r\n <page-header [companyName]="merchant.companyName"\r\n [pathComponentsStringsKeys]="[ \'Menu.Stats.Main\', \'Menu.Commons.Users\' ]"></page-header>\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col">\r\n <mat-tab-group [selectedIndex]="selectedTab" (selectedTabChange)="closeUser($event)">\r\n <mat-tab class="first-tab" label="{{ \'Common.General\' | translate }}" id="GENERALI" #summaryTab>\r\n <users-stats-summary (selectedUser)="onUserSelected($event)"></users-stats-summary>\r\n </mat-tab>\r\n <mat-tab label="{{ \'Stats.Users.Profiles\' | translate}}" id="LISTA_UTENTI" #userListTab>\r\n <profiles (selectedUser)="onUserSelected($event)"></profiles>\r\n </mat-tab>\r\n <mat-tab *ngIf="selectedUser" label="{{getSelectedUserTabTitle()}}">\r\n <profile [cachedUser]="selectedUser"></profile>\r\n </mat-tab>\r\n </mat-tab-group>\r\n </div>\r\n</div>',styles:[$e()]})],Q),function(i){i[i.GENERALI=0]="GENERALI",i[i.LISTA_UTENTI=1]="LISTA_UTENTI"}(Y||(Y={}));var ze=s(9463),Ve=s.n(ze);let Z=class{constructor(e){this.merchant=e,this.tabId=j,this.selectedTab=0}ngOnInit(){}onMachineSelected(e){this.selectedMachine=e,this.generaliTab.active=!1,this.machinesListTab.active=!1,this.selectedTab=2}closeMachine(e){2!=e.index&&(this.selectedMachine=void 0,this.selectedTab=e.index)}onChangeTab(e){switch(+e.tabId){case j.GENERALI:case j.LISTA_MACCHINE:return void(this.selectedMachine=void 0);default:return}}static{this.ctorParameters=()=>[{type:M.j}]}static{this.propDecorators={generaliTab:[{type:o.Uct,args:["generaliTab"]}],machinesListTab:[{type:o.Uct,args:["machinesListTab"]}]}}};var j;Z=(0,h.Cg)([(0,o.uAl)({selector:"machines-stats-container",template:'<div class="row">\r\n <div class="col">\r\n <page-header\r\n [companyName]="merchant.companyName"\r\n [pathComponentsStringsKeys]="[\'Menu.Stats.Main\', \'Menu.Machines.Main\']"\r\n ></page-header>\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col">\r\n <mat-tab-group\r\n [selectedIndex]="selectedTab"\r\n (selectedTabChange)="closeMachine($event)"\r\n >\r\n <mat-tab\r\n class="first-tab"\r\n label="{{ \'Common.General\' | translate }}"\r\n id="tabId.GENERALI"\r\n #generaliTab\r\n >\r\n <machines-stats-summary\r\n (selectedMachine)="onMachineSelected($event)"\r\n ></machines-stats-summary>\r\n </mat-tab>\r\n <mat-tab\r\n label="{{ \'Menu.Machines.Main\' | translate }}"\r\n id="tabId.LISTA_MACCHINE"\r\n #machinesListTab\r\n >\r\n <machines-list\r\n (selectedMachine)="onMachineSelected($event)"\r\n ></machines-list>\r\n </mat-tab>\r\n <mat-tab\r\n *ngIf="selectedMachine"\r\n label="{{ selectedMachine.friendlyName }}"\r\n >\r\n <machine-stats\r\n [machineId]="selectedMachine.machineId"\r\n [type]="selectedMachine.type"\r\n ></machine-stats>\r\n </mat-tab>\r\n </mat-tab-group>\r\n </div>\r\n</div>\r\n',styles:[Ve()]})],Z),function(i){i[i.GENERALI=0]="GENERALI",i[i.LISTA_MACCHINE=1]="LISTA_MACCHINE"}(j||(j={}));var Xe=s(80113),Ke=s.n(Xe),J=s(70818);let k=class{constructor(e){this.http=e}getUsersStatistics(e){return this.http.get(`/wallet/v1/user/stat/merchant/${e}`)}getUsersStatisticsBarChartsData(e){return this.http.get(`wallet/v1/user/stat/bar/merchant/${e}`)}getLoyaltyCardInfo(e,t,a,r,n){return J.q.injector.get(N.k).get(`wallet/v5/merchants/${e}/fidelity-cards?page=${t}&size=${a}${n}`)}getLoyaltyCardInfoCount(e,t,a=""){return J.q.injector.get(N.k).get(`wallet/v5/merchants/${e}/fidelity-cards/count${a}`)}getBonusInfo(e,t,a,r,n){return J.q.injector.get(N.k).get(`wallet/v1/merchants/${e}/bonus?page=${t}&size=${a}${n}`)}getBonusInfoCount(e,t,a=""){return J.q.injector.get(N.k).get(`wallet/v1/merchants/${e}/bonus/count${a}`)}getFidelityCardReport(e,t,a){return this.http.get(`wallet/v5/merchants/${e}/fidelity-cards/report`,t,a,"blob")}static{this.ctorParameters=()=>[{type:N.k}]}};k=(0,h.Cg)([(0,o._qm)({providedIn:"root"})],k);var Re=s(2578);let q=class{constructor(e,t,a,r){this.merchant=e,this.dialog=t,this.translate=a,this.statsService=r,this.dataSourceAvailable=!0,this.columnsUser=["lastName","firstName","email","points","totalRewards","fi
1delityCardStatus"],this.isLoadingUser=!1,this.totalRowsUser=0,this.pageSizeUser=10,this.currentPageUser=0,this.pageSizeOptionsUser=[10,25,100],this.filtername="",this.filtersurname="",this.filteruser="",this.filterpoints="",this.filterreward="",this.filternameR="",this.filtersurnameR="",this.filteruserR="",this.filterpointsR="",this.filterrewardR="",this.filterstatus="",this.formatResponse=d=>(this.userProfiles=[],this.users=d.users,this.users.forEach(c=>{c.userProfile.points=c.account.points,c.userProfile.totalRewards=c.account.totalRewards,this.userProfiles.push(c.userProfile)}),this.userProfiles);this.dataSourceUser=new E.I6([])}ngOnInit(){this.getLoyaltyCard()}getLoyaltyCard(){this.filtersUser=this.filtername+this.filtersurname+this.filteruser+this.filterpoints+this.filterreward+this.filterstatus,this.filtercountUser="?"+this.filtername+this.filtersurname+this.filteruser+this.filterpoints+this.filterreward+this.filterstatus,this.isLoadingUser=!0,this.statsService.getLoyaltyCardInfo(this.merchant.id,this.currentPageUser,this.pageSizeUser,"",this.filtersUser).subscribe(e=>{this.dataSourceUser.data=e.users,this.statsService.getLoyaltyCardInfoCount(this.merchant.id,this.pageSizeUser,this.filtercountUser).subscribe(t=>{this.paginatorUser.pageIndex=this.currentPageUser,this.paginatorUser.length=t,this.isLoadingUser=!1},t=>{console.log(t)})},e=>{console.log(e),this.dataSourceUser.data=[],this.isLoadingUser=!1})}pageChanged(e){this.pageSizeUser=e.pageSize,this.currentPageUser=e.pageIndex,this.getLoyaltyCard()}clickOnDownloadReport(){this.downloadingReport=!0;let e={totalRewards:this.filterrewardR,points:this.filterpointsR,firstName:this.filternameR,userName:this.filteruserR,lastName:this.filtersurnameR};this.statsService.getFidelityCardReport(this.merchant.id,e,this.translate.currentLang).subscribe(t=>{this.downloadingReport=!1,(0,Re.saveAs)(t,"report.xlsx")},t=>{this.downloadingReport=!1,this.dialog.error(t)})}filterName(e){this.filtername=e?"&firstName="+e:"",this.filternameR=e||"",this.getLoyaltyCard()}filterSurName(e){this.filtersurname=e?"&lastName="+e:"",this.filtersurnameR=e||"",this.getLoyaltyCard()}filterUserName(e){this.filteruser=e?"&email="+e:"",this.filteruserR=e||"",this.getLoyaltyCard()}filterPoints(e){this.filterpoints=e?"&points="+e:"",this.filterpointsR=e||"",this.getLoyaltyCard()}filterReward(e){this.filterreward=e?"&totalRewards="+e:"",this.filterrewardR=e||"",this.getLoyaltyCard()}filterStatus(e){this.filterstatus=e?"&fidelityCardStatus="+e:"",this.getLoyaltyCard()}static{this.ctorParameters=()=>[{type:M.j},{type:I.o},{type:R.c$},{type:k}]}static{this.propDecorators={paginatorUser:[{type:o.Uct,args:["paginator",{static:!1}]}]}}};q=(0,h.Cg)([(0,o.uAl)({selector:"loyalty-card",template:'<div class="row">\r\n <div class="col-md-12">\r\n <page-header [companyName]="merchant.companyName" [pathComponentsStringsKeys]="[\r\n \'Menu.Stats.Main\',\r\n \'Menu.Stats.LoyaltyCard\'\r\n ]"></page-header>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- Table Points Earned --\x3e\r\n<div class="row">\r\n <div class="col-md-12">\r\n <mat-card>\r\n <mat-card-title>{{ "Stats.LoyaltyCard.LoyaltyPointsEarn" | translate | translate }}\r\n <button class="btn" style="float: right" (click)="clickOnDownloadReport()">\r\n {{ "Common.DownloadReport" | translate }}\r\n </button>\r\n </mat-card-title>\r\n <mat-card-content class="table-card">\r\n <mat-progress-bar mode="indeterminate" *ngIf="isLoadingUser"></mat-progress-bar>\r\n <mat-table [dataSource]="dataSourceUser" matSort>\r\n \x3c!-- Column --\x3e\r\n <ng-container matColumnDef="lastName">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Users.List.LastName" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.userProfile.lastName }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="firstName">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Users.List.FirstName" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.userProfile.firstName }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="email">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Users.List.Email" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.userProfile.email }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="points">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Stats.LoyaltyCard.Points" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.account.points }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="totalRewards">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Stats.LoyaltyCard.NumberAwards" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.account.totalRewards }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="fidelityCardStatus">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.Active" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{\r\n row.account.fidelityCardStatus === 1\r\n ? ("Common.Yes" | translate)\r\n : ("Common.No" | translate)\r\n }}\r\n </mat-cell>\r\n </ng-container>\r\n\r\n \x3c!-- Filtri --\x3e\r\n <ng-container matColumnDef="header3">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input class="filter-input" type="text" placeholder="{{ \'Users.List.LastName\' | translate }}"\r\n (keyup.enter)="filterSurName(surname)" [(ngModel)]="surname"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}" placement="top" tooltipClass="tooltip-class" />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header4">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input class="filter-input" type="text" placeholder="{{ \'Users.List.FirstName\' | translate }}"\r\n (keyup.enter)="filterName(name)" [(ngModel)]="name"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}" placement="top" tooltipClass="tooltip-class" />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header5u">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input class="filter-input" type="text" placeholder="{{ \'Users.List.Email\' | translate }}"\r\n (keyup.enter)="filterUserName(user)" [(ngModel)]="user"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}" placement="top" tooltipClass="tooltip-class" />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header6">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input class="filter-input" type="text" placeholder="{{ \'Stats.LoyaltyCard.Points\' | translate }}"\r\n (keyup.enter)="filterPoints(points)" [(ngModel)]="points"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}" placement="top" tooltipClass="tooltip-class" />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header7">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input class="filter-input" type="text" placeholder="{{ \'Stats.LoyaltyCard.NumberAwards\' | translate }}"\r\n (keyup.enter)="filterReward(reward)" [(ngModel)]="reward"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}" placement="top" tooltipClass="tooltip-class" />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header8">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <select class="filter-input" type="text" [(ngModel)]="selectedFilterValue"\r\n (ngModelChange)="filterStatus($event)">\r\n <option value=""></option>\r\n <option value="1">{{ "Common.Yes" | translate }}</option>\r\n <option value="0">{{ "Common.No" | translate }}</option>\r\n </select>\r\n </mat-header-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef="columnsUser"></mat-header-row>\r\n <mat-header-row *matHeaderRowDef="[\r\n \'header3\',\r\n \'header4\',\r\n \'header5u\',\r\n \'header6\',\r\n \'header7\',\r\n \'header8\'\r\n ]" class="filter-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns: columnsUser" style="cursor: auto"></mat-row>\r\n </mat-table>\r\n\r\n <mat-paginator #paginator [length]="totalRowsUser" [pageIndex]="currentPageUser" [pageSize]="pageSizeUser"\r\n [pageSizeOptions]="pageSizeOptionsUser" (page)="pageChanged($event)" aria-label="Select page"\r\n [showFirstLastButtons]="true"></mat-paginator>\r\n \x3c!-- <ng-container *ngIf="dataSourceAvailable; else dataSourceUnavailable">\r\n <ng2-smart-table [settings]="settings" [source]="source">\r\n </ng2-smart-table>\r\n </ng-container>--\x3e\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n<ng-template #dataSourceUnavailable>\r\n {{ "Common.ServiceUnavailable" | translate }}\r\n</ng-template>',providers:[k],styles:[Ke()]})],q);var Ze=s(23217),Je=s.n(Ze);let ee=class{constructor(e,t,a,r){this.merchant=e,this.dialog=t,this.translate=a,this.statsService=r,this.columnsUser=["lastName","firstName","email","promotionCounter","totalRewards"],this.isLoadingUser=!1,this.totalRowsUser=0,this.pageSizeUser=10,this.currentPageUser=0,this.pageSizeOptionsUser=[
110,25,100],this.filtername="",this.filtersurname="",this.filteruser="",this.filterpoints="",this.filterreward="";this.dataSourceUser=new E.I6([])}ngOnInit(){this.getLoyaltyCard()}getLoyaltyCard(){this.filtersUser="&type=1"+this.filtername+this.filtersurname+this.filteruser+this.filterpoints+this.filterreward,this.filtercountUser="?type=1"+this.filtername+this.filtersurname+this.filteruser+this.filterpoints+this.filterreward,this.isLoadingUser=!0,this.statsService.getBonusInfo(this.merchant.id,this.currentPageUser,this.pageSizeUser,"",this.filtersUser).subscribe(e=>{this.dataSourceUser.data=e.users,this.statsService.getBonusInfoCount(this.merchant.id,this.pageSizeUser,this.filtercountUser).subscribe(t=>{this.paginatorUser.pageIndex=this.currentPageUser,this.paginatorUser.length=t,this.isLoadingUser=!1},t=>{console.log(t)})},e=>{console.log(e),this.dataSourceUser.data=[],this.isLoadingUser=!1})}pageChanged(e){this.pageSizeUser=e.pageSize,this.currentPageUser=e.pageIndex,this.getLoyaltyCard()}filterName(e){this.filtername=e?"&firstName="+e:"",this.getLoyaltyCard()}filterSurName(e){this.filtersurname=e?"&lastName="+e:"",this.getLoyaltyCard()}filterUserName(e){this.filteruser=e?"&email="+e:"",this.getLoyaltyCard()}filterPoints(e){this.filtersurname=e?"&promotionCounter="+e:"",this.getLoyaltyCard()}filterReward(e){this.filterreward=e?"&totalRewards="+e:"",this.getLoyaltyCard()}static{this.ctorParameters=()=>[{type:M.j},{type:I.o},{type:R.c$},{type:k}]}static{this.propDecorators={paginatorUser:[{type:o.Uct,args:["paginator",{static:!1}]}]}}};ee=(0,h.Cg)([(0,o.uAl)({selector:"bonus-stats",template:'<div class="row">\r\n <div class="col-md-12">\r\n <page-header [companyName]="merchant.companyName"\r\n [pathComponentsStringsKeys]="[ \'Menu.Stats.Main\', \'Bonus\' ]"></page-header>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- Table Points Earned --\x3e\r\n<div class="row">\r\n <div class="col-md-12">\r\n <mat-card>\r\n <mat-card-title>{{\'Stats.Bonus.NumberBonus\' | translate }}</mat-card-title>\r\n <mat-card-content class="table-card">\r\n <mat-progress-bar mode="indeterminate" *ngIf="isLoadingUser"></mat-progress-bar>\r\n <mat-table [dataSource]="dataSourceUser" matSort>\r\n <ng-container matColumnDef="lastName">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Users.List.LastName\' | translate}} </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.lastName}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="firstName">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Users.List.FirstName\' | translate}} </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.firstName}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="email">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Users.List.Email\' | translate}} </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.email}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="promotionCounter">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Stats.Bonus.RemainingConsumption\' | translate}} \r\n <mat-icon placement="top" tooltipClass="tooltip-class" class="mat-icon-info"\r\n ngbTooltip="{{\'Stats.Bonus.NumberDrinkRemaining\' | translate}}">info_outline</mat-icon>\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.promotionCounter}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="totalRewards">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Stats.Bonus.NumberBonus\' | translate}} \r\n <mat-icon placement="top" tooltipClass="tooltip-class" class="mat-icon-info"\r\n ngbTooltip="{{\'Stats.Bonus.NumberDrinkBonus\' | translate}}">info_outline</mat-icon>\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.totalRewards}} </mat-cell>\r\n </ng-container>\r\n \r\n \r\n <ng-container matColumnDef="header3">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Users.List.LastName\' | translate}}" \r\n (keyup.enter)="filterSurName(surname)" [(ngModel)]="surname"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class"> \r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header4">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Users.List.FirstName\' | translate}}" \r\n (keyup.enter)="filterName(name)" [(ngModel)]="name"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class"> \r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header5u">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Users.List.Email\' | translate}}" \r\n (keyup.enter)="filterUserName(user)" [(ngModel)]="user"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class"> \r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header6">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Stats.Bonus.RemainingConsumption\' | translate}}" \r\n (keyup.enter)="filterPoints(points)" [(ngModel)]="points"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class"> \r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header7">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Stats.Bonus.NumberBonus\' | translate}}" \r\n (keyup.enter)="filterReward(reward)" [(ngModel)]="reward"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class"> \r\n </mat-header-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef="columnsUser"></mat-header-row>\r\n <mat-header-row *matHeaderRowDef="[\'header3\',\'header4\', \'header5u\', \'header6\', \'header7\']" class="filter-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns: columnsUser;" style="cursor: auto;"></mat-row>\r\n </mat-table> \r\n\r\n <mat-paginator #paginator [length]="totalRowsUser" [pageIndex]="currentPageUser" [pageSize]="pageSizeUser"\r\n [pageSizeOptions]="pageSizeOptionsUser" (page)="pageChanged($event)" aria-label="Select page" [showFirstLastButtons]="true"></mat-paginator>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>',providers:[k],styles:[Je()]})],ee);var et=s(94211),tt=s.n(et);let te=class{constructor(e,t,a,r){this.translate=e,this.statsService=t,this.dialog=a,this.merchant=r,this.math=Math,this.columnsMonthlyReports=["machineGroupName","userRegistered","totalSales","totalNumberOfSales","sales","numberOfSales","charges","cashChargePercentage","cardCharges","cardChargePercentage"],this.filterMachineGroupName="",this.isLoadingTransaction=!1,this.totalRowsTransaction=0,this.pageSize=10,this.currentPage=0,this.pageSizeOptionsTransaction=[10,25,100],this.selectedColumn=0,this.dataSourceTransaction=new E.I6([]),this.dateFrom=new Date,this.defaultDate=new Date(this.dateFrom.getFullYear(),this.dateFrom.getMonth())}ngOnInit(){this.getReports(0)}showInfo(){return'<div class="InfoCellComment"> ? <img src=assets/images/info.png width="13px"/> <span class="InfoCellComment">'+this.translate.instant("Reports.InfoDeletedMachineGroup")+" </span> </div>"}sortColumn(e){this.selectedColumn=e,this.currentPage=0,this.pageSize=10,this.getReports(this.selectedColumn)}getReports(e){this.dateFrom?(this.month=("0"+(this.dateFrom.getMonth()+1)).slice(-2),this.year=this.dateFrom.getFullYear(),console.log(this.month,this.year)):console.error("La data di partenza (dateFrom) non \xe8 valida."),this.isLoadingTransaction=!0,void 0===this.filterMachineGroupName&&(this.filterMachineGroupName=""),this.statsService.getMonthlyReport(this.merchant.id,this.month,this.year,this.currentPage,this.pageSize,this.filterMachineGroupName,e).subscribe(t=>
1{console.log(t),t&&Array.isArray(t.stats)?(t.stats.forEach(a=>{console.log(a.machineGroupName,a.deleted)}),this.dataSourceTransaction.data=t.stats):console.error('La risposta non contiene un array valido in "stats":',t),this.statsService.getMonthlyReportCount(this.merchant.id,this.month,this.year,this.filterMachineGroupName).subscribe(a=>{console.log(a),this.totalRowsTransaction=a,this.isLoadingTransaction=!1},a=>{console.log(a),this.isLoadingTransaction=!1})},t=>{console.log(t),this.isLoadingTransaction=!1})}onNewFilterDates(e){this.dateFrom=e.dateFrom,this.getReports(this.selectedColumn)}pageChangedTransaction(e){this.pageSize=e.pageSize,this.currentPage=e.pageIndex,this.getReports(this.selectedColumn)}downloadFilteredReports(e){this.dateFrom?(this.month=("0"+(this.dateFrom.getMonth()+1)).slice(-2),this.year=this.dateFrom.getFullYear(),console.log(this.month,this.year)):console.error("La data di partenza (dateFrom) non \xe8 valida."),this.downloadingReport=!0,null==this.machineGroupName&&(this.machineGroupName=" "),this.filterMachineGroupName=e,this.statsService.downloadFilteredReports(this.merchant.id,this.month,this.year,this.machineGroupName,this.translate.currentLang).subscribe(t=>{console.log(t),this.downloadingReport=!1;const a=`${this.year}_${this.month}_report.xlsx`;(0,Re.saveAs)(t,a)},t=>{console.log(t),this.downloadingReport=!1,this.dialog.error(t)})}filterMachineGroup(e){this.filterMachineGroupName=e,console.log("Filtro applicato:",this.filterMachineGroupName),this.getReports(this.selectedColumn)}static{this.ctorParameters=()=>[{type:R.c$},{type:G.b},{type:I.o},{type:M.j}]}static{this.propDecorators={paginatorUser:[{type:o.Uct,args:["paginator",{static:!1}]}]}}};te=(0,h.Cg)([(0,o.uAl)({selector:"monthly-report",template:'<div class="row">\r\n <div class="col-md-12">\r\n <page-header [companyName]="merchant.companyName"\r\n [pathComponentsStringsKeys]="[\'Menu.Stats.Main\', \'Menu.Stats.Reports\']"></page-header>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- Table Monthly Reports --\x3e\r\n<div class="row">\r\n <div class="col-md-12">\r\n <mat-card>\r\n <mat-card-title>\r\n {{ "Stats.Reports.MonthlyReport" | translate | translate }}\r\n <div style="display: inline-block; margin-left: 1rem">\r\n <month-filter [dateToMaxDate]="defaultDate" (newFilter)="onNewFilterDates($event)">\r\n </month-filter>\r\n </div>\r\n\r\n <button class="btn" style="float: right" (click)="downloadFilteredReports()">\r\n {{ "Common.DownloadReport" | translate }}\r\n </button>\r\n </mat-card-title>\r\n\r\n <mat-card-content class="table-card">\r\n\r\n <mat-progress-bar mode="indeterminate" *ngIf="isLoadingTransaction"></mat-progress-bar>\r\n\r\n <mat-table [dataSource]="dataSourceTransaction">\r\n\r\n \x3c!-- Machine Group --\x3e\r\n <ng-container matColumnDef="machineGroupName">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Stats.Reports.MachineGroup" | translate }}\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef="let row" class="row-text" [ngClass]="{ \'deleted-row\': row.deleted }">\r\n {{ row.machineGroupName }}\r\n <img src="assets/images/info.png" width="13px" *ngIf="row.deleted" />\r\n\r\n <span class="InfoCellComment" *ngIf="row.deleted">\r\n {{ "Stats.Reports.InfoDeletedMachineGroup" | translate }}\r\n </span>\r\n\r\n </mat-cell>\r\n </ng-container>\r\n\r\n\r\n \x3c!-- Registered Users --\x3e\r\n <ng-container matColumnDef="userRegistered">\r\n\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Stats.Reports.RegisteredUsers" | translate }}\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef="let row" class="row-text" [ngClass]="{ \'deleted-row\': row.deleted }">\r\n {{ row.userRegistered }}\r\n </mat-cell>\r\n\r\n </ng-container>\r\n\r\n \x3c!-- Total Sales --\x3e\r\n <ng-container matColumnDef="totalSales">\r\n\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Stats.Reports.TotalSales" | translate }}\r\n\r\n <button class="sort-btn" (click)="sortColumn(1)">\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef="let row" class="row-text" [ngClass]="{ \'deleted-row\': row.deleted }">\r\n {{ row.totalSales / math.pow(10, this.merchant.decimalPlaces) }}\r\n {{ merchant.currency }}\r\n </mat-cell>\r\n\r\n </ng-container>\r\n\r\n \x3c!-- Sales Total Number --\x3e\r\n <ng-container matColumnDef="totalNumberOfSales">\r\n\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Stats.Reports.SalesTotalNumber" | translate }}\r\n\r\n <button class="sort-btn" (click)="sortColumn(2)">\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef="let row" class="row-text" [ngClass]="{ \'deleted-row\': row.deleted }">\r\n {{ row.totalNumberOfSales }}\r\n </mat-cell>\r\n\r\n </ng-container>\r\n\r\n\r\n \x3c!-- Monthly Sales --\x3e\r\n <ng-container matColumnDef="sales">\r\n\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Stats.Reports.MonthlySales" | translate }}\r\n\r\n <button class="sort-btn" (click)="sortColumn(3)">\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef="let row" class="row-text" [ngClass]="{ \'deleted-row\': row.deleted }">\r\n {{ row.sales / math.pow(10, this.merchant.decimalPlaces) }}\r\n {{ merchant.currency }}\r\n </mat-cell>\r\n\r\n </ng-container>\r\n\r\n\r\n \x3c!-- Monthly Sales Number --\x3e\r\n <ng-container matColumnDef="numberOfSales">\r\n\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Stats.Reports.MonthlySalesNumber" | translate }}\r\n\r\n <button class="sort-btn" (click)="sortColumn(4)">\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef="let row" class="row-text" [ngClass]="{ \'deleted-row\': row.deleted }">\r\n {{ row.numberOfSales }}\r\n </mat-cell>\r\n\r\n </ng-container>\r\n\r\n\r\n \x3c!-- Monthly Cash TopUp --\x3e\r\n <ng-container matColumnDef="charges">\r\n\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Stats.Reports.MonthlyCashTopUp" | translate }}\r\n\r\n <button class="sort-btn" (click)="sortColumn(5)">\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef="let row" class="row-text" [ngClass]="{ \'deleted-row\': row.deleted }">\r\n {{ row.charges / math.pow(10, this.merchant.decimalPlaces) }}\r\n {{ merchant.currency }}\r\n </mat-cell>\r\n\r\n </ng-container>\r\n\r\n\r\n \x3c!-- Cash Charge Percentage --\x3e\r\n <ng-container matColumnDef="cashChargePercentage">\r\n\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Stats.Reports.CashTopUpsPercentage" | translate }}\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef="let row" class="row-text" [ngClass]="{ \'deleted-row\': row.deleted }">\r\n {{ row.cashChargePercentage }}\r\n </mat-cell>\r\n\r\n </ng-container>\r\n\r\n\r\n \x3c!-- Monthly Cards TopUp --\x3e\r\n <ng-container matColumnDef="cardCharges">\r\n\r\n <mat-header-cell *matHeaderCellDef class="column-title">
1\r\n {{ "Stats.Reports.MonthlyCardsTopUp" | translate }}\r\n\r\n <button class="sort-btn" (click)="sortColumn(6)">\r\n <mat-icon>arrow_downward</mat-icon>\r\n </button>\r\n\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef="let row" class="row-text" [ngClass]="{ \'deleted-row\': row.deleted }">\r\n {{ row.cardCharges / math.pow(10, this.merchant.decimalPlaces) }}\r\n {{ merchant.currency }}\r\n </mat-cell>\r\n\r\n </ng-container>\r\n\r\n\r\n \x3c!-- Card Charge Percentage --\x3e\r\n <ng-container matColumnDef="cardChargePercentage">\r\n\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Stats.Reports.TopUpsWithCardsPercentage" | translate }}\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef="let row" class="row-text" [ngClass]="{ \'deleted-row\': row.deleted }">\r\n {{ row.cardChargePercentage }}\r\n </mat-cell>\r\n\r\n </ng-container>\r\n\r\n\r\n \x3c!-- Filtri --\x3e\r\n <ng-container matColumnDef="header1">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input class="filter-input" type="text" placeholder="{{ \'Stats.Reports.MachineGroup\' | translate }}"\r\n (keyup.enter)="filterMachineGroup(machineGroupName)" [(ngModel)]="machineGroupName"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}" placement="top" tooltipClass="tooltip-class" />\r\n </mat-header-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="header2">\r\n <mat-header-cell *matHeaderCellDef class="column-title"></mat-header-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="header3">\r\n <mat-header-cell *matHeaderCellDef class="column-title"></mat-header-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="header4">\r\n <mat-header-cell *matHeaderCellDef class="column-title"></mat-header-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="header5">\r\n <mat-header-cell *matHeaderCellDef class="column-title"></mat-header-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="header6">\r\n <mat-header-cell *matHeaderCellDef class="column-title"></mat-header-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="header7">\r\n <mat-header-cell *matHeaderCellDef class="column-title"></mat-header-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="header8">\r\n <mat-header-cell *matHeaderCellDef class="column-title"></mat-header-cell>\r\n </ng-container>\r\n\r\n\r\n <mat-header-row *matHeaderRowDef="columnsMonthlyReports"></mat-header-row>\r\n\r\n <mat-header-row *matHeaderRowDef="[\r\n \'header1\',\r\n \'header2\',\r\n \'header3\',\r\n \'header4\',\r\n \'header5\',\r\n \'header6\',\r\n \'header7\',\r\n \'header8\'\r\n ]" class="filter-row"></mat-header-row>\r\n\r\n <mat-row *matRowDef="let row; columns: columnsMonthlyReports" style="cursor: auto"></mat-row>\r\n\r\n </mat-table>\r\n\r\n \x3c!-- Paginazione --\x3e\r\n <mat-paginator #paginator [length]="totalRowsTransaction" [pageSize]="pageSize"\r\n [pageSizeOptions]="pageSizeOptionsTransaction" (page)="pageChangedTransaction($event)">\r\n </mat-paginator>\r\n\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n<ng-template #dataSourceUnavailable>\r\n {{ "Common.ServiceUnavailable" | translate }}\r\n</ng-template>',providers:[G.b],styles:[tt()]})],te);const at=[{path:"general",component:z},{path:"machines",component:Z},{path:"machine-groups",component:K},{path:"machine-groups/:id",component:X},{path:"users",component:Q},{path:"loyalty-card",component:q},{path:"bonus",component:ee},{path:"monthly-report",component:te}];let oe=class{};oe=(0,h.Cg)([(0,o.UQu)({imports:[_.iI.forChild(at)],exports:[_.iI]})],oe);const rt=[z,Z,K,X,Q,q,ee,te];var w,st=s(53392),it=s.n(st);!function(i){i[i.CASH_RECHARGES=1]="CASH_RECHARGES",i[i.CARDS_RECHARGES=2]="CARDS_RECHARGES",i[i.QR_RECHARGES=3]="QR_RECHARGES",i[i.OPERATOR_REFUNDS=4]="OPERATOR_REFUNDS",i[i.TOTAL_REVENUES=5]="TOTAL_REVENUES",i[i.FREE_RECHARGES=6]="FREE_RECHARGES",i[i.MACHINES_SALES=7]="MACHINES_SALES",i[i.TOTAL_WALLETS_BALANCES=8]="TOTAL_WALLETS_BALANCES",i[i.MACHINES_REFUNDS=9]="MACHINES_REFUNDS",i[i.RESOURCES=10]="RESOURCES",i[i.LOANS=11]="LOANS"}(w||(w={}));class A{constructor(e,t,a,r,n,d=null){this.titlePrefix=t?`(${e}) `:"",this.titlePostfix=d?` ${d}`:"",this.titleStringKey=`Stats.AggregatedData.${w[e]}`;const c=navigator.language;let m=a/Math.pow(10,n);
1this.value=m||0==m?m.toLocaleString(c,{style:"decimal",minimumFractionDigits:n,maximumFractionDigits:n}):void 0,this.currency=` ${r}`}}class ot{constructor(e,t,a){this.cashRecharges=new A(w.CASH_RECHARGES,!0,a.machineCharges,e,t),this.cardsRecharges=new A(w.CARDS_RECHARGES,!0,a.creditCardCharges,e,t),this.qrCodeRecharges=new A(w.QR_RECHARGES,!0,a.qrCodeCharges,e,t),this.refunds=new A(w.OPERATOR_REFUNDS,!0,a.refunds,e,t);let r=`(${w.CASH_RECHARGES}) + (${w.CARDS_RECHARGES}) + (${w.QR_RECHARGES}) + (${w.OPERATOR_REFUNDS})`;this.totalRevenues=new A(w.TOTAL_REVENUES,!0,a.totalRevenue,e,t,r),this.freeRecharges=new A(w.FREE_RECHARGES,!0,a.freeCredit,e,t),this.totalSales=new A(w.MACHINES_SALES,!0,a.machineSales,e,t),this.totalWalletsBalances=new A(w.TOTAL_WALLETS_BALANCES,!0,a.walletsCredit,e,t),this.totalMachineRefunds=new A(w.MACHINES_REFUNDS,!0,a.machineRefunds,e,t);let n=`(${w.TOTAL_REVENUES}) + (${w.FREE_RECHARGES})`;this.resources=new A(w.RESOURCES,!1,a.resources,e,t,n);let d=`(${w.MACHINES_SALES}) + (${w.TOTAL_WALLETS_BALANCES}) - (${w.MACHINES_REFUNDS})`;this.loans=new A(w.LOANS,!1,a.applications,e,t,d)}}var lt=s(24966);let ae=class{constructor(e,t,a){this.injector=e,this.appRef=t,this.componentFactoryResolver=a}getAppendableTooltipDomElementWithData(e){const t=document.createElement("users-stats-chart-tooltip"),r=this.componentFactoryResolver.resolveComponentFactory(lt.A).create(this.injector,[],t);return r.instance.model=e,this.appRef.attachView(r.hostView),r.changeDetectorRef.detectChanges(),{domElement:t,componentReference:r}}appendDomElementToBody(e){document.body.appendChild(e)}removeComponentFromBody(e){document.body.removeChild(e.domElement),this.appRef.detachView(e.componentReference.hostView),e.componentReference.destroy()}static{this.ctorParameters=()=>[{type:o.zZn},{type:o.o8S},{type:o.OM3}]}};ae=(0,h.Cg)([(0,o._qm)({providedIn:"root"})],ae);let le=class{constructor(e,t,a){this.statsService=e,this.merchant=t,this.dynamicComponentService=a,this.dataSourcesState={summary:"loading"}}ngOnInit(){let e=this.statsService.getSummaryStatistics(this.merchant.id).subscribe({next:t=>{this.dataModel=new ot(this.merchant.formattedCurrency,this.merchant.decimalPlaces,t),this.dataSourcesState.summary="loaded"},error:t=>{console.log(t),this.dataSourcesState.summary="error"},complete:()=>{e.unsubscribe()}})}static{this.ctorParameters=()=>[{type:G.b},{type:M.j},{type:ae}]}};le=(0,h.Cg)([(0,o.uAl)({selector:"aggregated-data",template:'\x3c!-- <ng-container *ngFor="let detail of details">\r\n <aggregated-data-detail [detail]="detail"></aggregated-data-detail>\r\n</ng-container> --\x3e\r\n<load-guard [dataSourceState]="dataSourcesState.summary">\r\n<div *ngIf="dataModel" load-guarded-template>\r\n <div class="row">\r\n <div class="col">\r\n <aggregated-data-detail [detail]="dataModel.cashRecharges"></aggregated-data-detail>\r\n </div>\r\n <div class="col">\r\n <aggregated-data-detail [detail]="dataModel.cardsRecharges"></aggregated-data-detail>\r\n </div>\r\n <div class="col">\r\n <aggregated-data-detail [detail]="dataModel.qrCodeRecharges"></aggregated-data-detail>\r\n </div>\r\n <div class="col">\r\n <aggregated-data-detail [detail]="dataModel.refunds"></aggregated-data-detail>\r\n </div>\r\n </div>\r\n <div class="row">\r\n <div class="col">\r\n <aggregated-data-detail [detail]="dataModel.totalRevenues"></aggregated-data-detail>\r\n </div>\r\n <div class="col">\r\n <aggregated-data-detail [detail]="dataModel.freeRecharges"></aggregated-data-detail>\r\n </div>\r\n </div>\r\n <div class="row">\r\n <div class="col">\r\n <aggregated-data-detail [detail]="dataModel.totalSales"></aggregated-data-detail>\r\n </div>\r\n <div class="col">\r\n <aggregated-data-detail [detail]="dataModel.totalWalletsBalances"></aggregated-data-detail>\r\n </div>\r\n <div class="col">\r\n <aggregated-data-detail [detail]="dataModel.totalMachineRefunds"></aggregated-data-detail>\r\n </div>\r\n </div>\r\n <div class="row">\r\n <div class="col">\r\n <aggregated-data-detail [detail]="dataModel.resources"></aggregated-data-detail>\r\n </div>\r\n <div class="col">\r\n <aggregated-data-detail [detail]="dataModel.loans"></aggregated-data-detail>\r\n </div>\r\n </div>\r\n</div>\r\n</load-guard>',styles:[it()]})],le);var dt=s(78422),ht=s.n(dt);let ce=class{static{this.propDecorators={detail:[{type:o.pde}]}}};ce=(0,h.Cg)([(0,o.uAl)({selector:"aggregated-data-detail",template:'<ng-container *ngIf="detail">\r\n <mat-card>\r\n <mat-card-content>\r\n <div class="detail-title">{{ detail.titlePrefix }}{{ detail.titleStringKey | translate }}{{ detail.titlePostfix }}</div>\r\n <br>\r\n <div *ngIf="detail.value || detail.value == 0" class="detail-value">{{ detail.value }} <span>{{ detail.currency }}</span> </div>\r\n </mat-card-content>\r\n </mat-card>\r\n</ng-container>',styles:[ht()]})],ce);var mt=s(35796),ut=s.n(mt);var re=s(70505);let de=class{constructor(e,t,a,r){this.translate=e,this.userService=t,this.router=a,this.merchant=r,this.dataSourceAvailable=!0,this.selectedUser=new o.bkB,this.columnsUser=["lastName","firstName","userName","createdAt","gender","birthDate"],this.isLoadingUser=!1,this.totalRowsUser=0,this.pageSizeUser=10,this.currentPageUser=0,this.pageSizeOptionsUser=[
110,25,100],this.filtername="",this.filtersurname="",this.filteruser="",this.filtercreated="",this.filtergender="",this.filterbirth="";this.dataSourceUser=new E.I6([])}ngOnInit(){this.getUsersProfiles()}getUsersProfiles(){this.filtersUser=this.filtername+this.filtersurname+this.filteruser+this.filtercreated+this.filtergender+this.filterbirth,this.filtercountUser="?"+this.filtername+this.filtersurname+this.filteruser+this.filtercreated+this.filtergender+this.filterbirth,this.isLoadingUser=!0,this.userService.getUsers(this.merchant.id,this.currentPageUser,this.pageSizeUser,"",this.filtersUser).subscribe(e=>{this.dataSourceUser.data=e.users,this.userService.getUsersCount(this.merchant.id,this.pageSizeUser,this.filtercountUser).subscribe(t=>{this.paginatorUser.pageIndex=this.currentPageUser,this.paginatorUser.length=t,this.isLoadingUser=!1},t=>{console.log(t)})},e=>{console.log(e),this.dataSourceUser.data=[],this.isLoadingUser=!1})}pageChanged(e){this.pageSizeUser=e.pageSize,this.currentPageUser=e.pageIndex,this.getUsersProfiles()}selectUser(e){this.selectedUser.emit(e.userProfile)}filterName(e){this.filtername=e?"&firstName="+e:"",this.getUsersProfiles()}filterSurName(e){this.filtersurname=e?"&lastName="+e:"",this.getUsersProfiles()}filterUserName(e){this.filteruser=e?"&userName="+e:"",this.getUsersProfiles()}filterCreated(e){let t="";if(e){const a=S(e,"DD/MM/YYYY",!0);t=a.isValid()?S(a).format("YYYYMMDD"):""}this.filtercreated=t?"&createdAt="+t:"",this.getUsersProfiles()}filterGender(e){let t="";e&&("M"===e.toUpperCase()?t="0":"F"===e.toUpperCase()&&(t="1")),this.filtergender=t?"&gender="+t:"",this.getUsersProfiles()}filterBirth(e){let t="";if(e){const a=S(e,"DD/MM/YYYY",!0);t=a.isValid()?S(a).format("YYYYMMDD"):""}this.filterbirth=t?"&birthDate="+t:"",this.getUsersProfiles()}static{this.ctorParameters=()=>[{type:R.c$},{type:re.g},{type:_.Ix},{type:M.j}]}static{this.propDecorators={gridUsers:[{type:o.Uct,args:["gridUsers"]}],selectedUser:[{type:o.k7i}],paginatorUser:[{type:o.Uct,args:["paginator",{static:!1}]}]}}};de=(0,h.Cg)([(0,o.uAl)({selector:"profiles",encapsulation:o.gXe.None,template:'<mat-card>\r\n <mat-card-title>{{\'Menu.Users.SelectUser\' | translate}}</mat-card-title>\r\n <mat-card-content class="table-card">\r\n <mat-progress-bar mode="indeterminate" *ngIf="isLoadingUser"></mat-progress-bar>\r\n <mat-table [dataSource]="dataSourceUser" matSort>\r\n \x3c!-- Column --\x3e\r\n <ng-container matColumnDef="lastName">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Users.List.LastName\' | translate}} </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.userProfile.lastName}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="firstName">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Users.List.FirstName\' | translate}} </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.userProfile.firstName}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="userName">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Users.List.Email\' | translate}} </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.userProfile.userName}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="createdAt">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Users.List.DateCreated\' | translate}} </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.userProfile.createdAt | date: \'dd-MM-yyyy HH:mm\'}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="gender">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Users.List.Gender\' | translate}} </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.userProfile.gender==0 ? \'M\' : (row.userProfile.gender==1 ? \'F\' : \'-\')}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="birthDate">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> {{\'Users.List.BirthDate\' | translate}} </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text"> {{row.userProfile.birthDate | date: \'dd-MM-yyyy\'}} </mat-cell>\r\n </ng-container>\r\n \r\n \x3c!-- Filtri --\x3e\r\n <ng-container matColumnDef="header3">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Users.List.LastName\' | translate}}" \r\n (keyup.enter)="filterSurName(surname)" [(ngModel)]="surname"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class"> \r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header4">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Users.List.FirstName\' | translate}}" \r\n (keyup.enter)="filterName(name)" [(ngModel)]="name"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class"> \r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header5u">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Users.List.Email\' | translate}}" \r\n (keyup.enter)="filterUserName(user)" [(ngModel)]="user"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class"> \r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header6">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Common.DateFormat\' | translate}}" \r\n (keyup.enter)="filterCreated(created)" [(ngModel)]="created"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class"> \r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header7">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Users.List.Gender\' | translate}}" \r\n (keyup.enter)="filterGender(gender)" [(ngModel)]="gender"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class"> \r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header8">\r\n <mat-header-cell *matHeaderCellDef class="column-title"> \r\n <input class="filter-input" type="text" placeholder="{{\'Common.DateFormat\' | translate}}" \r\n (keyup.enter)="filterBirth(birth)" [(ngModel)]="birth"\r\n ngbTooltip="{{\'Common.FilterMessage\' | translate}}" placement="top" tooltipClass="tooltip-class"> \r\n </mat-header-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef="columnsUser"></mat-header-row>\r\n <mat-header-row *matHeaderRowDef="[\'header3\',\'header4\', \'header5u\', \'header6\', \'header7\', \'header8\']" class="filter-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns: columnsUser;" style="cursor: pointer;" (click)="selectUser(row)"></mat-row>\r\n </mat-table>\r\n\r\n <mat-paginator #paginator [length]="totalRowsUser" [pageIndex]="currentPageUser" [pageSize]="pageSizeUser"\r\n [pageSizeOptions]="pageSizeOptionsUser" (page)="pageChanged($event)" aria-label="Select page" [showFirstLastButtons]="true"></mat-paginator>\r\n \x3c!--<ng-container *ngIf="dataSourceAvailable; else dataSourceUnavailable">\r\n <ng2-smart-table [settings]="settings" [source]="source" (userRowSelect)="selectUser($event)"\r\n class="clickable" #gridUsers></ng2-smart-table>\r\n </ng-container>\r\n <ng-template #dataSourceUnavailable>\r\n {{ \'Common.ServiceUnavailable\' | translate}}\r\n </ng-template>--\x3e\r\n\r\n </mat-card-content>\r\n</mat-card>',providers:[re.g],styles:[ut()]})],de);var vt=s(44318),ft=s.n(vt),St=s(37148);class bt{constructor(){this.device=new yt,this.machine=new St.u5}}class yt{}var Ct=s(99213),wt=s(345);let he=class{constructor(e,t,a,r,n,d){this.userService=e,this.dialog=t,this.merchant=a,this.translate=r,this.matIconRegistry=n,this.domSanitizer=d,this.wallets=[],this.showPointsChart=!1,this.pointsMessage="",this.isLoaded=!1,this.isWalletLoaded=!1,this.isUserWalletLoaded=!1,this.isMachineLoaded=!1,this.isAverageLoaded=!1,this.barChartOptions={fullWidth:!0,showLine:!0,responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{dis
1play:!1}},scales:{x:{grid:{display:!1,borderDash:[12,4]},ticks:{autoSkip:!1,callback:c=>"string"==typeof c&&c.indexOf("|")>=0?c.split("|")[0]:c}},y:{grid:{drawBorder:!1},title:{display:!0,text:this.merchant.formattedCurrency},ticks:{min:0,callback:c=>Number.isInteger(c)?c:null}}},tooltips:{callbacks:{label:function(c,m){const v=m.labels[c.index];return v.indexOf("|")>=0?["Machine S/N:"+v.split("|")[1],"Item:"+c.xLabel]:m.datasets[0].data[c.index]},title:function(){}},displayColors:!1}},this.pieChartOptions={responsive:!0,maintainAspectRatio:!1,showArea:!0,animation:!1,legend:{position:"left"},tooltips:{callbacks:{label:function(c,m){const v=m.labels[c.index],p=m.datasets[c.datasetIndex].data[c.index];return v&&p?` ${v}: ${p} %`:""}}}},this.doughnutOptions={animation:!1,responsive:!0,maintainAspectRatio:!1,cutout:"92%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:c=>` ${c.label||""}: ${c.parsed||""} %`}}},elements:{arc:{borderWidth:3,borderAlign:"center"}}},this.matIconRegistry.addSvgIcon("user",this.domSanitizer.bypassSecurityTrustResourceUrl("./assets/images/icons/menu/users_new.svg")),this.matIconRegistry.addSvgIcon("machine",this.domSanitizer.bypassSecurityTrustResourceUrl("./assets/images/icons/menu/machine_new.svg")),this.matIconRegistry.addSvgIcon("mean_new",this.domSanitizer.bypassSecurityTrustResourceUrl("./assets/images/icons/menu/mean_new.svg")),this.matIconRegistry.addSvgIcon("device",this.domSanitizer.bypassSecurityTrustResourceUrl("./assets/images/icons/menu/phone.svg"))}ngOnInit(){this.loadUser(this.cachedUser.userId)}loadUser(e){this.userService.getUser(this.merchant.id,e).subscribe(t=>{this.cachedUser.firstName=t.user.name,this.cachedUser.lastName=t.user.surname,this.cachedUser.email=t.user.email,this.cachedUser.gender=t.user.sex,this.cachedUser.birthDate=t.user.birthDate;for(const a of t.user.wallets){const r=new bt;r.accountId=a.accountNumber,r.balance=a.balance,r.locationCode=a.locationCode,this.wallets.push(r)}this.selectedWallet=this.wallets[0],this.isLoaded=!0,this.getChartsData()},t=>this.dialog.error(t))}selectWallet(e){this.selectedWallet=this.wallets.filter(t=>t.accountId===+e.target.value)[0],this.isWalletLoaded=!1,this.isUserWalletLoaded=!1,this.isMachineLoaded=!1,this.isAverageLoaded=!1,this.getChartsData()}getChartsData(){this.loadWalletStats(),this.loadMachineUserInfo(),this.loadAverageUserInfo(),this.loadWalletUser(),this.loadPurchasesByProductLine(),this.loadPurchasesByHour(),this.loadTypesOfPromotions(),this.loadTypesOfPurchases(),this.loadMachineUsedByPurchases(),this.loadMachineUsedByRecharges()}loadWalletStats(){this.userService.getWalletStats(this.selectedWallet.accountId).subscribe(e=>{this.selectedWallet=e.wallet,this.creationDate=S(this.selectedWallet.creationDate).format("DD-MM-YYYY HH:mm:ss");const t=Math.round(this.selectedWallet.balance/this.merchant.maxCharge*100);this.balanceData={labels:[this.translate.instant("Users.Profiles.Balance"),this.translate.instant("Users.Profiles.Remaining")],datasets:[{data:[t,100-t],backgroundColor:["#3ab54b","#6E716E"],borderWidth:[0,5],hoverBorderColor:["#FFF","#FFF"]}]};const a=this.merchant.threshold;if(a&&a>0){const r=Math.round(this.selectedWallet.points/a*100);this.pointsData={labels:[this.translate.instant("Users.Profiles.Balance"),this.translate.instant("Users.Profiles.Remaining")],datasets:[{data:[r,100-r],backgroundColor:["#3ab54b","#6E716E"],borderWidth:[0,5],hoverBorderColor:["#FFF","#FFF"]}]},this.showPointsChart=!0,this.pointsMessage=""}else this.showPointsChart=!1,this.pointsMessage=this.translate.instant("Users.Profiles.NoPointsAvailable");this.isWalletLoaded=!0},e=>this.dialog.error(e))}loadMachineUserInfo(){this.userService.getMachineUserInfo(this.selectedWallet.accountId).subscribe(e=>{this.machineInfo=e.machine,this.isMachineLoaded=!0},e=>this.dialog.error(e))}loadAverageUserInfo(){this.userService.getAverageUserInfo(this.selectedWallet.accountId).subscribe(e=>{this.averageInfo=e.averages,this.isAverageLoaded=!0},e=>this.dialog.error(e))}loadWalletUser(){this.userService.getWalletInfo(this.selectedWallet.accountId).subscribe(e=>{this.walletUser=e.wallet,this.walletUser.consumption=this.walletUser.consumption/Math.pow(10,this.merchant.decimalPlaces),this.walletUser.sent=this.walletUser.sent/Math.pow(10,this.merchant.decimalPlaces),this.walletUser.received=this.walletUser.received/Math.pow(10,this.merchant.decimalPlaces),this.walletUser.cardRecharge=this.walletUser.cardRecharge/Math.pow(10,this.merchant.decimalPlaces),this.walletUser.cashRecharge=this.walletUser.cashRecharge/Math.pow(10,this.merchant.decimalPlaces),this.walletUser.qrRecharge=this.walletUser.qrRecharge/Math.pow(10,this.merchant.decimalPlaces),this.walletUser.freeRecharge=this.walletUser.freeRecharge/Math.pow(10,this.merchant.decimalPlaces),this.walletUser.refund=this.walletUser.refund/Math.pow(10,this.merchant.decimalPlaces),this.isUserWalletLoaded=!0},e=>this.dialog.error(e))}loadPurchasesByProductLine(){this.userService.getPurchasesByProductLine(this.selectedWallet.accountId).subscribe(e=>{const t=[],a=[],r=e.productLineStats;if(0===r.length)t.push("0"),t.push("0"),a.push(0),a.push(0);else for(let n=0;n<r.length;n++)t.push(r[n].itemDescription?r[n].itemDescription:r[n].itemCode+"|"+r[n].serialNumber),a.push(r[n].total);this.purchasesByProductLineData={labels:t,datasets:[{data:a,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]}},e=>this.dialog.error(e))}loadPurchasesByHour(){this.userService.getPurchasesByHour(this.selectedWallet.accountId).subscribe(e=>{const t=[],a=[],r=e.purchases;if(0===r.length)t.push("0"),t.push("0"),a.push(0),a.push(0);else for(let n=0;n<r.length;n++)t.push(r[n].hour.toString()),a.push(r[n].total);this.purchasesByHourData={labels:t,datasets:[{data:a,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]}},e=>this.dialog.error(e))}loadTypesOfPurchases(){this.userService.getTypesOfPurchases(this.selectedWallet.accountId).subscribe(e=>{const t=[],a=[],r=e.pieChart;if(0===r.length)t.push("0"),t.push("0"),a.push(0),a.push(0);else for(let n=0;n<r.length;n++)1===r[n].type&&t.push(this.translate.instant("Recharges.QrCode")),2===r[n].type&&t.push(this.translate.instant("Recharges.Cards")),3===r[n].type&&t.push(this.translate.instant("Recharges.Cash")),4===r[n].type&&t.push(this.translate.instant("Users.Refund.Refund")),a.push(r[n].percentage);this.typesOfRechargesData={labels:t,datasets:[{data:a,backgroundColor:["#3ab54b","#fcab11","#2c9fb4","#fa343d","#11d6b1","#ea4c87","#6B507D","#71AABE","#645D53","#D1417E"]}]}},e=>this.dialog.error(e))}loadTypesOfPromotions(){this.userService.getTypesOfPromotions(this.selectedWallet.accountId).subscribe(e=>{const t=[],a=[],r=e.pieChart;if(0===r.length)t.push("0"),t.push("0"),a.push(0),a.push(0);else for(let n=0;n<r.length;n++)5===r[n].type&&t.push(this.translate.instant("Promotions.FreeRecharge.FreeRecharge")),6===r[n].type&&t.push(this.translate.instant("Recharges.LoyaltyReward")),7===r[n].type&&t.push(this.translate.instant("Recharges.Birthday")),a.push(r[n].percentage);this.typesOfPromotionsData={labels:t,datasets:[{data:a,backgroundColor:["#3ab54b","#fcab11","#2c9fb4","#fa343d","#11d6b1","#ea4c87","#6B507D","#71AABE","#645D53","#D1417E"]}]}},e=>this.dialog.error(e))}loadMachineUsedByPurchases(){this.userService.getMachineUsedByPurchases(this.selectedWallet.accountId).subscribe(e=>{const t=[],a=[],r=e.pieChart;if(0===r.length)t.push("0"),t.push("0"),a.push(0),a.push(0);else for(let n=0;n<r.length;n++)t.push(r[n].name),a.push(r[n].percentage);this.machinesUsedByPurchasesData={labels:t,datasets:[{data:a,backgroundColor:["#3ab54b","#fcab11","#2c9fb4","#fa343d","#11d6b1","#ea4c87","#6B507D","#71AABE","#645D53","#D1417E"]}]}},e=>this.dialog.error(e))}loadMachineUsedByRecharges(){this.userService.getMachineUsedByRecharges(this.selectedWallet.accountId).subscribe(e=>{const t=[],a=[],r=e.pieChart;if(0===r.length)t.push("0"),t.push("0"),a.push(0),a.push(0);else for(let n=0;n<r.length;n++)t.push(r[n].name),a.push(r[n].percentage);this.machinesUsedByRechargesData={labels:t,datasets:[{data:a,backgroundColor:["#3ab54b","#fcab11","#2c9fb4","#fa343d","#11d6b1","#ea4c87","#6B507D","#71AABE","#645D53","#D1417E"]}]}},e=>this.dialog.error(e))}ngOnDestroy(){}static{this.ctorParameters=()=>[{type:re.g},{type:I.o},{type:M.j},{type:R.c$},{type:Ct.tp},{type:wt.up}]}static{this.propDecorators={cachedUser:[{type:o.pde}]}}};he=(0,h.Cg)([(0,o.uAl)({selector:"profile",template:'<div class="row" style="margin-top: 0.5rem">\r\n \x3c!-- Generalit\xe0 utente --\x3e\r\n <div class="col-md-6">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-2 icon">\r\n <mat-icon mat-list-icon svgIcon="user" class="icon-new"></mat-icon>\r\n </div>\r\n <div class="col-md-10 info">\r\n <div class="value">\r\n {{ cachedUser.firstName }} {{ cachedUser.lastName }}\r\n </div>\r\n\r\n <div *ngIf="cachedUser.birthDate != undefined" class="details">\r\n {{ cachedUser.birthDate | date : "dd/MM/yyyy" }}\r\n </div>\r\n <user-gender\r\n *ngIf="cachedUser.gender != undefined"\r\n class="details"\r\n [gender]="cachedUser.gender"\r\n ></user-gender>\r\n <div class="details">{{ cachedUser.email }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n \x3c!-- Selezione borsellino --\x3e\r\n <div class="col-md-6" *ngIf="isWalletLoaded; else spinnerPlaceHolderCol6">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-2 icon">\r\n <mat-icon mat-list-icon svgIcon="mean_new"></mat-icon>\r\n </div>\r\n <div class="col-md-10 info">\r\n <select\r\n name="wallet"\r\n id="wallet"\r\n class="form-control"\r\n style="margin-bottom: 10px"\r\n (change)="selectWallet($event)"\r\n >\r\n <option\r\n *ngFor="let wallet of wallets"\r\n [value]="wallet.accountId"\r\n [selected]="wallet.accountId === selectedWallet.accountId"\r\n >\r\n {{ wallet.accountId }}\r\n </option>\r\n </select>\r\n\r\n <div style="margin-top: 2rem">\r\n <div class="label">\r\n {{ "Users.Profiles.CreatedOn" | translate }}:\r\n <strong> {{ creationDate }}</strong>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n \x3c!-- Modello cellulare --\x3e\r\n <div class="col-md-6" *ngIf="isWalletLoaded; else spinnerPlaceHolderCol6">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-2 icon">\r\n <mat-icon mat-list-icon svgIcon="device"></mat-icon>\r\n </div>\r\n <div class="col-md-10 info">\r\n <div class="value">{{ selectedWallet.device.os }}</div>\r\n <div class="details">{{ selectedWallet.device.model }}</div>\r\n <div class="details">{{ selectedWallet.device.language }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n \x3c!-- Info distributore --\x3e\r\n <div class="col-md-6" *ngIf="isMachineLoaded; else spinnerPlaceHolderCol6">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-2 icon">\r\n <mat-icon mat-list-icon svgIcon="machine"></mat-icon>\r\n </div>\r\n <div class="col-md-10 info">\r\n <div class="row">\r\n <div class="col-md-12">\r\n <div class="label">\r\n {{ "Users.Profiles.MachineS/N" | translate }}:\r\n <strong> {{ machineInfo.serialNumber }}</strong>\r\n </div>\r\n </div>\r\n </div>\r\n <br />\r\n <div class="row">\r\n <div class="col-md-12">\r\n <div class="label">\r\n {{ "Common.MachinesGroup" | translate }}:\r\n <strong> {{ machineInfo.machineGroup }}</strong>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- Saldo borsellino e Saldo punti --\x3e\r\n<div class="row">\r\n <div class="col-md-6" *ngIf="isWalletLoaded; else spinnerPlaceHolderCol6">\r\n <mat-card>\r\n <mat-card-content style="padding-top: 0px">\r\n <div class="doughnut-label">\r\n {{ "Users.Profiles.Balance" | translate }}\r\n </div>\r\n <canvas\r\n baseChart\r\n type="doughnut"\r\n [data]="balanceData"\r\n [options]="doughnutOptions"\r\n class="doughnut"\r\n ></canvas>\r\n <div class="info center" style="margin-top: 10px">\r\n <div class="value no-padding">\r\n {{ selectedWallet.balance | decimal : merchant.decimalPlaces }}
1\r\n <span class="currency"> {{ merchant.formattedCurrency }}</span>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n <div class="col-md-6" *ngIf="isWalletLoaded; else spinnerPlaceHolderCol6">\r\n <mat-card>\r\n <mat-card-content style="padding-top: 0px">\r\n <div *ngIf="showPointsChart">\r\n <div class="doughnut-label">\r\n {{ "Users.Profiles.Points" | translate }}\r\n </div>\r\n <canvas\r\n baseChart\r\n type="doughnut"\r\n [data]="pointsData"\r\n [options]="doughnutOptions"\r\n class="doughnut"\r\n ></canvas>\r\n <div class="info center" style="margin-top: 10px">\r\n <div class="value no-padding">{{ selectedWallet.points }}</div>\r\n </div>\r\n </div>\r\n \x3c!-- Messaggio informativo se threshold == 0 --\x3e\r\n <div\r\n *ngIf="!showPointsChart"\r\n class="info center"\r\n style="margin-top: 10px"\r\n >\r\n {{ "Users.Profiles.PointsMessageThresholdNull" | translate }}\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- Spesa totale e Soldi inviati ad altri utenti --\x3e\r\n<div class="row">\r\n <div class="col-md-6" *ngIf="isUserWalletLoaded; else spinnerPlaceHolderCol6">\r\n <mat-card>\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div class="label">\r\n {{ "Users.Profiles.TotalSpending" | translate }}\r\n </div>\r\n <div class="value" style="margin-top: 1.5rem">\r\n {{ walletUser.consumption | decimal : merchant.decimalPlaces }}\r\n <span class="currency"> {{ merchant.formattedCurrency }}</span>\r\n </div>\r\n \x3c!--<div class="label"> {{\'Users.Profiles.NOfPurchases\' | translate}}</div>\r\n <div class="value no-padding">{{selectedWallet.numberOfConsumptions}}</div>--\x3e\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n <div class="col-md-6" *ngIf="isUserWalletLoaded; else spinnerPlaceHolderCol6">\r\n <mat-card>\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div class="label">\r\n {{ "Users.Profiles.SentMoney" | translate }}\r\n </div>\r\n <div class="value" style="margin-top: 1.5rem">\r\n {{ walletUser.sent | decimal : merchant.decimalPlaces }}\r\n <span class="currency"> {{ merchant.formattedCurrency }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- Dettagli per ogni tipo di ricarica: contanti, carte, qr, rimborsi --\x3e\r\n<div class="row">\r\n <div class="col-md-3" *ngIf="isUserWalletLoaded; else spinnerPlaceHolderCol3">\r\n <mat-card>\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div class="label">\r\n {{ "Users.Profiles.RechargeCash" | translate }}\r\n </div>\r\n <div class="value" style="margin-top: 1.5rem">\r\n {{ walletUser.cashRecharge | decimal : merchant.decimalPlaces }}\r\n <span class="currency"> {{ merchant.formattedCurrency }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n <div class="col-md-3" *ngIf="isUserWalletLoaded; else spinnerPlaceHolderCol3">\r\n <mat-card>\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div class="label">\r\n {{ "Users.Profiles.RechargeCard" | translate }}\r\n </div>\r\n <div class="value" style="margin-top: 1.5rem">\r\n {{ walletUser.cardRecharge | decimal : merchant.decimalPlaces }}
1\r\n <span class="currency"> {{ merchant.formattedCurrency }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n <div class="col-md-3" *ngIf="isUserWalletLoaded; else spinnerPlaceHolderCol3">\r\n <mat-card>\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div class="label">\r\n {{ "Users.Profiles.RechargeQr" | translate }}\r\n </div>\r\n <div class="value" style="margin-top: 1.5rem">\r\n {{ walletUser.qrRecharge | decimal : merchant.decimalPlaces }}\r\n <span class="currency"> {{ merchant.formattedCurrency }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n <div class="col-md-3" *ngIf="isUserWalletLoaded; else spinnerPlaceHolderCol3">\r\n <mat-card>\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div class="label">\r\n {{ "Users.Profiles.Reimbursements" | translate }}\r\n </div>\r\n <div class="value" style="margin-top: 1.5rem">\r\n {{ walletUser.refund | decimal : merchant.decimalPlaces }}\r\n <span class="currency"> {{ merchant.formattedCurrency }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- Credito omaggio e soldi ricevuti da altri utenti --\x3e\r\n<div class="row">\r\n <div class="col-md-6" *ngIf="isUserWalletLoaded; else spinnerPlaceHolderCol6">\r\n <mat-card>\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div class="label">\r\n {{ "Users.Profiles.FreeCredit" | translate }}\r\n </div>\r\n <div class="value" style="margin-top: 1.5rem">\r\n {{ walletUser.freeRecharge | decimal : merchant.decimalPlaces }}\r\n <span class="currency"> {{ merchant.formattedCurrency }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n <div class="col-md-6" *ngIf="isUserWalletLoaded; else spinnerPlaceHolderCol6">\r\n <mat-card>\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div class="label">\r\n {{ "Users.Profiles.ReceivedMoney" | translate }}\r\n </div>\r\n <div class="value" style="margin-top: 1.5rem">\r\n {{ walletUser.received | decimal : merchant.decimalPlaces }}\r\n <span class="currency"> {{ merchant.formattedCurrency }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col-md-7">\r\n <div class="row">\r\n <div class="col-md-12">\r\n <mat-card style="height: 25rem">\r\n <mat-card-title>{{\r\n "Users.Profiles.PurchasesByProductLine" | translate\r\n }}</mat-card-title>\r\n <mat-card-content>\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="purchasesByProductLineData"\r\n [options]="barChartOptions"\r\n style="height: 20rem"\r\n ></canvas>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="col-md-5">\r\n <div class="row">\r\n <div\r\n class="col-md-6"\r\n *ngIf="isAverageLoaded; else spinnerPlaceHolderCol6"\r\n >\r\n <mat-card style="height: 25rem">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/equal_to_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.dailyExpenseAvgSign == \'=\'"\r\n />\r\n </div>\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/lower_of_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.dailyExpenseAvgSign == \'-\'"\r\n />\r\n </div>\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/greater_of_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.dailyExpenseAvgSign == \'+\'"\r\n />\r\n </div>\r\n <div class="label" style="margin-top: 2rem">\r\n {{ "Users.Profiles.AverageDailySpending" | translate }}\r\n </div>\r\n <div class="value no-padding" style="margin-top: 2rem">\r\n {{\r\n averageInfo.dailyExpenseAvg\r\n | decimal : merchant.decimalPlaces\r\n }}
1\r\n <span class="currency">\r\n {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n <div\r\n class="col-md-6"\r\n *ngIf="isAverageLoaded; else spinnerPlaceHolderCol6"\r\n >\r\n <mat-card style="height: 25rem">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/equal_to_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.monthlyNumberOfRechargesSign == \'=\'"\r\n />\r\n </div>\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/lower_of_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.monthlyNumberOfRechargesSign == \'-\'"\r\n />\r\n </div>\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/greater_of_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.monthlyNumberOfRechargesSign == \'+\'"\r\n />\r\n </div>\r\n <div class="label" style="margin-top: 2rem">\r\n {{ "Users.Profiles.AverageMonthlyRecharge" | translate }}\r\n </div>\r\n <div class="value no-padding" style="margin-top: 2rem">\r\n {{\r\n averageInfo.monthlyTotalRecharge\r\n | decimal : merchant.decimalPlaces\r\n }}\r\n <span class="currency">\r\n {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col-md-7">\r\n <div class="row">\r\n <div class="col-md-12">\r\n <mat-card style="height: 25rem">\r\n <mat-card-title>{{\r\n "Users.Profiles.PurchasesByHour" | translate\r\n }}</mat-card-title>\r\n <mat-card-content>\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="purchasesByHourData"\r\n [options]="barChartOptions"\r\n style="height: 20rem"\r\n ></canvas>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="col-md-5">\r\n <div class="row">\r\n <div\r\n class="col-md-6"\r\n *ngIf="isAverageLoaded; else spinnerPlaceHolderCol6"\r\n >\r\n <mat-card style="height: 25rem">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/equal_to_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.dailyConsumptionsAvgSign == \'=\'"\r\n />\r\n </div>\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/lower_of_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.dailyConsumptionsAvgSign == \'-\'"\r\n />\r\n </div>\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/greater_of_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.dailyConsumptionsAvgSign == \'+\'"\r\n />\r\n </div>\r\n <div class="label" style="margin-top: 2rem">\r\n {{ "Users.Profiles.AverageDailyPurchases" | translate }}\r\n </div>\r\n <div class="value no-padding" style="margin-top: 2rem">\r\n {{\r\n averageInfo.dailyConsumptionsAvg\r\n | decimal : merchant.decimalPlaces\r\n }}\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n <div\r\n class="col-md-6"\r\n *ngIf="isAverageLoaded; else spinnerPlaceHolderCol6"\r\n >\r\n <mat-card style="height: 25rem">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 info center">\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/equal_to_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.monthlyTotalRechargeSign == \'=\'"\r\n />\r\n </div>\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/lower_of_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.monthlyTotalRechargeSign == \'-\'"\r\n />\r\n </div>\r\n <div style="margin-top: 1rem">\r\n <img\r\n src="assets/images/icons/profile/greater_of_mean.png"\r\n width="100%"\r\n class="comparison"\r\n *ngIf="averageInfo.monthlyTotalRechargeSign == \'+\'"\r\n />\r\n </div>\r\n <div class="label" style="margin-top: 2rem">\r\n {{ "Users.Profiles.MonthlyAverageRecharges" | translate }}\r\n </div>\r\n <div class="value no-padding" style="margin-top: 2rem">\r\n {{\r\n averageInfo.monthlyNumberOfRecharges\r\n | decimal : merchant.decimalPlaces\r\n }}\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col-md-6">\r\n <mat-card>\r\n <mat-card-title>{{\r\n "Users.Profiles.TypesOfRecharges" | translate\r\n }}</mat-card-title>\r\n <mat-card-content>\r\n <canvas\r\n baseChart\r\n type="pie"\r\n [data]="typesOfRechargesData"\r\n [options]="pieChartOptions"\r\n class="pie"\r\n ></canvas>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n <div class="col-md-6">\r\n <mat-card>\r\n <mat-card-title>{{\r\n "Users.Profiles.TypesOfPromotions" | translate\r\n }}</mat-card-title>\r\n <mat-card-content>\r\n <canvas\r\n baseChart\r\n type="pie"\r\n [data]="typesOfPromotionsData"\r\n [options]="pieChartOptions"\r\n class="pie"\r\n ></canvas>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col-md-12">\r\n <mat-card>\r\n <mat-card-title>{{\r\n "Users.Profiles.MachinesUsedPurchases" | translate\r\n }}</mat-card-title>\r\n <mat-card-content>\r\n <canvas\r\n baseChart\r\n type="pie"\r\n [data]="machinesUsedByPurchasesData"\r\n [options]="pieChartOptions"\r\n class="pie"\r\n >\r\n </canvas>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n<div class="row">\r\n <div class="col-md-12">\r\n <mat-card>\r\n <mat-card-title>{{\r\n "Users.Profiles.MachinesUsedRecharges" | translate\r\n }}</mat-card-title>\r\n <mat-card-content>\r\n <canvas\r\n baseChart\r\n type="pie"\r\n [data]="machinesUsedByRechargesData"\r\n [options]="pieChartOptions"\r\n class="pie"\r\n >\r\n </canvas>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n</div>\r\n\r\n<ng-template #spinnerPlaceHolderCol5>\r\n <div class="col-md-5">\r\n <mat-card\r\n [nbSpinner]="true"\r\n nbSpinnerStatus="primary"\r\n class="equal-height"\r\n ></mat-card>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #spinnerPlaceHolderCol7>\r\n <div class="col-md-7">\r\n <mat-card\r\n [nbSpinner]="true"\r\n nbSpinnerStatus="primary"\r\n class="equal-height"\r\n ></mat-card>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #spinnerPlaceHolderCol6>\r\n <div class="col-md-6">\r\n <mat-card\r\n [nbSpinner]="true"\r\n nbSpinnerStatus="primary"\r\n class="equal-height"\r\n ></mat-card>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #spinnerPlaceHolderCol3>\r\n <div class="col-md-3">\r\n <mat-card\r\n [nbSpinner]="true"\r\n nbSpinnerStatus="primary"\r\n class="equal-height"\r\n ></mat-card>\r\n </div>\r\n</ng-template>\r\n',providers:[re.g],styles:[ft()]})],he);var Mt=s(82850),Rt=s.n(Mt);let me=class{constructor(){}ngOnInit(){this.translateKey=this.gender==ue.MALE?"Common.Male":"Common.Female"}static{this.ctorParameters=()=>[]}static{this.propDecorators={gender:[{type:o.pde}]}}};var ue;me=(0,h.Cg)([(0,o.uAl)({selector:"user-gender",template:"{{translateKey | translate}}\r\n",styles:[Rt()]})],me),function(i){i[i.MALE=0]="MALE",i[i.FEMALE=1]="FEMALE"}(ue||(ue={}));var L,At=s(41114),Lt=s.n(At);!function(i){i[i.TOTAL_USERS=0]="TOTAL_USERS",i[i.NEW_USERS_TITLE=1]="NEW_USERS_TITLE",i[i.ACTIVE_USERS_TITLE=2]="ACTIVE_USERS_TITLE",i[i.CARDS_USERS=3]="CARDS_USERS",i[i.QRCODE_USERS=4]="QRCODE_USERS",i[i.P2P_SENDERS_USERS=5]="P2P_SENDERS_USERS",i[i.AVERAGE_NUMBER_OF_PURCHASES=6]="AVERAGE_NUMBER_OF_PURCHASES",i[i.AVERAGE_EARNINGS=7]="AVERAGE_EARNINGS",i[i.TOP_SPENDING_USERS_CHART=8]="TOP_SPENDING_USERS_CHART",i[i.TOP_SPENDING_USERS_DAILY_AVARAGE_CHART=9]="TOP_SPENDING_USERS_DAILY_AVARAGE_CHART"}(L||(L={}));class P{constructor(e,t,a,r,n,d){this.showInfoIcon=t,this.titleStringKey=`Stats.Users.Generals.${L[e]}`;const c=navigator.language,m=d&&d.currencyDecimalPlaces>n?d.currencyDecimalPlaces:n;
1this.value=a||0==a?a.toLocaleString(c,{style:"decimal",minimumFractionDigits:m,maximumFractionDigits:m}):void 0,this.value=r?`${this.value} %`:this.value,this.currency=d?` ${d.currencySymbol}`:null}}class xe{constructor(e,t,a,r,n,d,c){this.type="bar";let m=e.map(y=>{y.userExpenseValue=y.userExpenseValue/Math.pow(10,r);const x=Number(y.userExpenseValue).toLocaleString(navigator.language,{style:"decimal",minimumFractionDigits:r,maximumFractionDigits:r});return Object.assign(y,{x:y.userExpenseValue,formattedUserExpenseValue:`${x} ${a||""}`})});const l="yellow"==t?"#fcab11":"#3ab54b";let f=[],b=0;m.forEach(y=>{b+=1,f.push(b.toString())}),this.data={labels:f,datasets:[{data:m.map(y=>y.x),backgroundColor:l,borderColor:l}]};this.options={indexAxis:"y",responsive:!0,maintainAspectRatio:!1,onClick:function(y){let x=this;var D=x.getElementAtEvent(y)[0];if(D){var $=x.data.datasets[D._datasetIndex].data[D._index];c($)}},animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{position:"top",grid:{borderDash:[1,0]},title:{display:!0,text:a||""},ticks:{callback:y=>Number(y).toLocaleString(navigator.language,{style:"decimal",minimumFractionDigits:r,maximumFractionDigits:r})}},y:{grid:{display:!1}}},tooltips:{callbacks:{label:function(y,x){let D=x.datasets[0].data[y.index];return[`${D.firstName} ${D.lastName}`,`${D.email}`,`${D.formattedUserExpenseValue}`]},title:function(){}},displayColors:!1}}}}var Ae=s(18359);let pe=class{constructor(e,t,a,r){this.merchant=e,this.usersStatsService=t,this.dynamicComponentService=a,this.translate=r,this.dataSourcesSubscriptions=new Ae.yU,this.selectedUser=new o.bkB,this.dataSourcesState={summary:"loading",barChartsData:"loading"}}ngOnInit(){const e=this.usersStatsService.getUsersStatistics(this.merchant.id).subscribe({next:a=>{this.summaryDataSource=new _t(a,this.merchant),this.dataSourcesState.summary="loaded"},error:a=>{console.log(a),this.dataSourcesState.summary="error"}}),t=this.usersStatsService.getUsersStatisticsBarChartsData(this.merchant.id).subscribe({next:a=>{this.initBarChartsWithData(a),this.dataSourcesState.barChartsData="loaded"},error:a=>{console.log(a),this.dataSourcesState.barChartsData="error"}});this.dataSourcesSubscriptions.add(e),this.dataSourcesSubscriptions.add(t)}ngOnDestroy(){this.dataSourcesSubscriptions.unsubscribe()}initBarChartsWithData(e){function t(c){return 50+(0!=c.length?18*c.length:50)+"px"}e.topUsersByTotalExpense=e.topUsersByTotalExpense?e.topUsersByTotalExpense:[],e.topUsersByDailyExpense=e.topUsersByDailyExpense?e.topUsersByDailyExpense:[];let a=e.topUsersByTotalExpense.map(c=>new Le(c)),r=e.topUsersByDailyExpense.map(c=>new Le(c));function n(c,m){return m.userExpenseValue-c.userExpenseValue}a=a.sort(n),r=r.sort(n);let d=c=>this.selectedUser.emit(c);this.totalExpensesChartSource=Object.assign(new xe(a,"yellow",this.merchant.formattedCurrency,this.merchant.decimalPlaces,this.translate,this.dynamicComponentService,d),{chartHeight:t(a)}),this.avaragesExpensesChartSource=Object.assign(new xe(r,"green",this.merchant.formattedCurrency,this.merchant.decimalPlaces,this.translate,this.dynamicComponentService,d),{chartHeight:t(r)})}static{this.ctorParameters=()=>[{type:M.j},{type:k},{type:ae},{type:R.c$}]}static{this.propDecorators={selectedUser:[{type:o.k7i}]}}};pe=(0,h.Cg)([(0,o.uAl)({selector:"users-stats-summary",template:'\x3c!-- Casi di test --\x3e\r\n\x3c!-- <div class="row">\r\n <div class="col">\r\n <users-stats-detail [detail]="basicTest">\r\n </users-stats-detail>\r\n </div>\r\n <div class="col">\r\n <users-stats-detail [detail]="showPercentageSymbolTest">\r\n </users-stats-detail>\r\n </div>\r\n <div class="col">\r\n <users-stats-detail [detail]="showInfoSymbolTest" nbTooltip="{{\'Stats.Users.Generals.NEW_USERS_TIP\' | translate}}" nbTooltipStatus="primary">\r\n </users-stats-detail>\r\n </div>\r\n</div>\r\n<div class="row">\r\n <div class="col">\r\n <users-stats-detail [detail]="valueUndefinedTest">\r\n </users-stats-detail>\r\n </div>\r\n <div class="col">\r\n <users-stats-detail [detail]="showCurrencyTest">\r\n </users-stats-detail>\r\n </div>\r\n <div class="col">\r\n <users-stats-detail>\r\n </users-stats-detail>\r\n </div>\r\n</div> --\x3e\r\n\r\n<load-guard [dataSourceState]="dataSourcesState.summary">\r\n <div\r\n *ngIf="summaryDataSource"\r\n load-guarded-template\r\n style="margin-top: 0.5rem"\r\n >\r\n <div class="row">\r\n <div class="col">\r\n <users-stats-detail [detail]="summaryDataSource.totalUsers">\r\n </users-stats-detail>\r\n </div>\r\n <div class="col">\r\n <users-stats-detail\r\n [detail]="summaryDataSource.newUsers"\r\n ngbTooltip="{{ \'Stats.Users.Generals.NEW_USERS_TIP\' | translate }}"\r\n placement="bottom"\r\n tooltipClass="tooltip-class"\r\n >\r\n </users-stats-detail>\r\n </div>\r\n <div class="col">\r\n <users-stats-detail\r\n [detail]="summaryDataSource.activeUsers"\r\n ngbTooltip="{{ \'Stats.Users.Generals.ACTIVE_USERS_TIP\' | translate }}"\r\n placement="bottom"\r\n tooltipClass="tooltip-class"\r\n >\r\n </users-stats-detail>\r\n </div>\r\n </div>\r\n <div class="row">\r\n <div class="col">\r\n <users-stats-detail [detail]="summaryDataSource.cardUsers">\r\n </users-stats-detail>\r\n </div>\r\n <div class="col">\r\n <users-stats-detail [detail]="summaryDataSource.qrCodeUsers">\r\n </users-stats-detail>\r\n </div>\r\n <div class="col">\r\n <users-stats-detail [detail]="summaryDataSource.p2pSendersUsers">\r\n </users-stats-detail>\r\n </div>\r\n </div>\r\n <div class="row">\r\n <div class="col">\r\n <users-stats-detail\r\n [detail]="summaryDataSource.avarageNumberOfPurchases"\r\n ngbTooltip="{{ \'Stats.Common.AVERAGES_TOOLTIP\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n >\r\n </users-stats-detail>\r\n </div>\r\n <div class="col">\r\n <users-stats-detail\r\n [detail]="summaryDataSource.avarageEarnings"\r\n ngbTooltip="{{ \'Stats.Common.AVERAGES_TOOLTIP\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n >\r\n </users-stats-detail>\r\n </div>\r\n </div>\r\n </div>\r\n</load-guard>\r\n\r\n\x3c!-- Grafici --\x3e\r\n<div class="row">\r\n <div class="col-md-6">\r\n <load-guard-card-with-tooltip-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.Users.Generals.TOP_SPENDING_USERS_CHART\' | translate"\r\n [tooltipText]="\'Stats.Common.AVERAGES_TOOLTIP\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n *ngIf="totalExpensesChartSource"\r\n [style.height]="totalExpensesChartSource.chartHeight"\r\n [type]="totalExpensesChartSource.type"\r\n [data]="totalExpensesChartSource.data"\r\n [options]="totalExpensesChartSource.options"\r\n load-guarded-template\r\n ></canvas>\r\n </load-guard-card-with-tooltip-header>\r\n </div>\r\n\r\n <div class="col-md-6">\r\n <load-guard-card-with-tooltip-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\r\n \'Stats.Users.Generals.TOP_SPENDING_USERS_DAILY_AVARAGE_CHART\'\r\n | translate\r\n "\r\n [tooltipText]="\'Stats.Common.AVERAGES_TOOLTIP\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n *ngIf="avaragesExpensesChartSource"\r\n [style.height]="avaragesExpensesChartSource.chartHeight"\r\n [type]="avaragesExpensesChartSource.type"\r\n [data]="avaragesExpensesChartSource.data"\r\n [options]="avaragesExpensesChartSource.options"\r\n load-guarded-template\r\n ></canvas>\r\n </load-guard-card-with-tooltip-header>\r\n </div>\r\n</div>\r\n',styles:[Lt()]})],pe);class _t{constructor(e,t){this.totalUsers=new P(L.TOTAL_USERS,!1,e.merchantUsersStats.overallUsers,!1,0),this.newUsers=new P(L.NEW_USERS_TITLE,!0,e.merchantUsersStats.newUsers,!1,0),this.activeUsers=new P(L.ACTIVE_USERS_TITLE,!0,e.merchantUsersStats.activeUsers,!1,0),this.cardUsers=new P(L.CARDS_USERS,!1,e.merchantUsersStats.usersWithCards,!0,2),this.qrCodeUsers=new P(L.QRCODE_USERS,!1,e.merchantUsersStats.usersWithQrCode,!0,2),this.p2pSendersUsers=new P(L.P2P_SENDERS_USERS,!1,e.merchantUsersStats.usersWithP2P,!0,2),this.avarageNumberOfPurchases=new P(L.AVERAGE_NUMBER_OF_PURCHASES,!0,e.merchantUsersStats.dailyPurchasesPerUser,!1,2),this.avarageEarnings=new P(L.AVERAGE_EARNINGS,!0,e.merchantUsersStats.dailyExpensePerUser,!1,2,{currencySymbol:t.formattedCurrency,currencyDecimalPlaces:t.decimalPlaces})}}class Le{constructor(e){this.userId=e.userId,this.email=e.email,this.firstName=e.firstName,this.lastName=e.lastName,this.userExpenseValue=e.expenditure}}var Tt=s(892),Et=s.n(Tt);let ge=class{constructor(){}static{this.ctorParameters=()=>[]}static{this.propDecorators={detail:[{type:o.pde}]}}};ge=(0,h.Cg)([(0,o.uAl)({selector:"users-stats-detail",template:'<ng-container *ngIf="detail; else cardWithSpinner">\r\n <mat-card>\r\n <mat-card-content>\r\n <div class="detail-title">{{ detail.titleStringKey | translate }} \r\n <mat-icon *ngIf="detail.showInfoIcon" class="mat-icon-info">info_outline</mat-icon>\r\n </div>\r\n <br>\r\n <div *ngIf="detail.value || detail.value == 0" class="detail-value">{{ detail.value }} <span>{{ detail.currency }}</span> </div>\r\n </mat-card-content>\r\n </mat-card>\r\n</ng-container>\r\n\r\n<ng-template #cardWithSpinner>\r\n <mat-card [nbSpinner]="true" nbSpinnerStatus="primary" id="spinner-card"></mat-card>\r\n</ng-template>',styles:[Et()]})],ge);var Pt=s(63278),Ot=s.n(Pt);let O=class{constructor(e,t){this.http=e,this.merchant=t}getMachineInfo(e){return this.http.get(`wallet/v1/machine/stat/info/${e}/merchant/${this.merchant.id}`)}getMasterMachineInfo(e){return this.http.get(`wallet/v1/machine/stat/info/master/${e}/merchant/${this.merchant.id}`)}getMachineFullDetails(e){return this.http.get(`wallet/v1/machine/stat/detail/full/${e}/merchant/${this.merchant.id}`)}getMachineDetails(e,t=null,a=null){null===t&&(t=new Date).setDate(t.getDate()-30);const r=("0"+t.getDate()).slice(-2),n=("0"+(t.getMonth()+1)).slice(-2),c=t.getFullYear()+""+n+r;null===a&&(a=new Date);const m=("0"+a.getDate()).slice(-2),v=("0"+(a.getMonth()+1)).slice(-2),l=a.getFullYear()+""+v+m;return this.http.get(`wallet/v1/machine/stat/detail/${e}/merchant/${this.merchant.id}?from=${c}&to=${l}`)}getMachineActivities(e,t=null,a=null){null===t&&(t=new Date).setDate(t.getDate()-10);const r=("0"+t.getDate()).slice(-2),n=("0"+(t.getMonth()+1)).slice(-2),c=t.getFullYear()+""+n+r;null===a&&(a=new Date);const m=("0"+a.getDate()).slice(-2),v=("0"+(a.getMonth()+1)).slice(-2),l=a.getFullYear()+""+v+m;return this.http.get(`wallet/v1/machine/stat/activities/${e}/merchant/${this.merchant.id}?from=${c}&to=${l}`)}getMachineSaleProducts(e,t=null,a=null){null===t&&(t=new Date).setDate(t.getDate()-10);const r=("0"+t.getDate()).slice(-2),n=("0"+(t.getMonth()+1)).slice(-2),c=t.getFullYear()+""+n+r;null===a&&(a=new Date);const m=("0"+a.getDate()).slice(-2),v=("0"+(a.getMonth()+1)).slice(-2),l=a.getFullYear()+""+v+m;return this.http.get(`wallet/v1/machine/stat/sales/products/${e}/merchant/${this.merchant.id}?from=${c}&to=${l}`)}getMasterMachineSaleProducts(e,t=null,a=null){null===t&&(t=new Date).setDate(t.getDate()-10);const r=("0"+t.getDate()).slice(-2),n=("0"+(t.getMonth()+1)).slice(-2),c=t.getFullYear()+""+n+r;null===a&&(a=new Date);const m=("0"+a.getDate()).slice(-2),v=("0"+(a.getMonth()+1)).slice(-2),l=a.getFullYear()+""+v+m;return this.http.get(`wallet/v1/machine/stat/master/sales/products/${e}/merchant/${this.merchant.id}?from=${c}&to=${l}`)}getMachineSaleHours(e,t=null,a=null){null===t&&(t=new Date).setDate(t.getDate()-10);const r=("0"+t.getDate()).slice(-2),n=("0"+(t.getMonth()+1)).slice(-2),c=t.getFullYear()+""+n+r;null===a&&(a=new Date);const m=("0"+a.getDate()).slice(-2),v=("0"+(a.getMonth()+1)).slice(-2),l=a.getFullYear()+""+v+m;return this.http.get(`wallet/v1/machine/stat/sales/hour/${e}/merchant/${this.merchant.id}?from=${c}&to=${l}`)}getMachineStatsSummaryDetails(e){return this.http.get(`merchant/v1/merchants/${e}/machines/stats`)}getMachineStatsSummaryPiesData(e){return this.http.get(`merchant/v1/merchants/${e}/machines/stats/pieCharts`)}getMachineStatsSummaryTotalExpensesChartData(e){return this.http.get(`merchant/v1/merchants/${e}/machines/stats/barCharts/total`)}getMachineStatsSummaryAvaragesExpensesChartData(e){return this.http.get(`merchant/v1/merchants/${e}/machines/stats/barCharts/daily`)}static{this.ctorParameters=()=>[{type:N.k},{type:M.j}]}};O=(0,h.Cg)([(0,o._qm)({providedIn:"root"})],O);let ve=class{constructor(e,t,a,r,n){this.machineService=e,this.router=t,this.dialog=a,this.translate=r,this.merchant=n,this.selectedMachine=new o.bkB,this.dataSourceAvailable=!0,this.selectedMachineType="slave",this.settings={actions:{add:!1,edit:!1,delete:!1},pager:{display:!0,perPage:10}
1,hideSubHeader:!1,selectedRowIndex:-1,columns:{friendlyName:{title:this.translate.instant("Common.Name"),type:"string",sort:!1},locationCode:{title:this.translate.instant("Machines.Common.LocationCode"),type:"number",class:"location",width:"20px",sort:!1,filterFunction:m=>isNaN(m)?null:m},cashlessAddress:{title:this.translate.instant("Machines.Common.CashlessAddress"),type:"string",sort:!1,valuePrepareFunction:m=>"Cashless 1"!==m&&"Cashless 2"!==m?"":m,filterFunction:m=>{switch(m.toUpperCase()){case"CASHLESS 1":return"0X10h";case"CASHLESS 2":return"0X60h";default:return null}}},serialNumber:{title:this.translate.instant("Machines.Common.SerialNumber"),type:"number",sort:!1},locality:{title:this.translate.instant("Machines.Common.Place"),type:"string",sort:!1},city:{title:this.translate.instant("Machines.Common.City"),type:"string",sort:!1},address:{title:this.translate.instant("Machines.Common.Address"),type:"string",sort:!1},status:{title:this.translate.instant("Common.Status"),type:"html",sort:!1,valuePrepareFunction:m=>{let v="";return v="PENDING"===m?"assets/images/yellow.png":"OK"===m?"assets/images/green.png":"assets/images/red.gif",'<div align="center"><img src='+v+' width="20px"/></div>'}}}},this.columns=["friendlyName","locationCode","cashlessAddress","serialNumber","locality","city","address","status"],this.isLoading=!1,this.totalRows=0,this.pageSize=10,this.currentPage=0,this.pageSizeOptions=[10,25,100],this.filterfriendlyName="",this.filterlocationCode="",this.filtercashlessAddress="",this.filterserialNumber="",this.filterlocality="",this.filtercity="",this.filteraddress="",this.filterstatus="",this.columnsMaster=["friendlyName","locationCode","cashlessAddress","serialNumber","locality","city","address","status"],this.isLoadingMaster=!1,this.totalRowsMaster=0,this.pageSizeMaster=10,this.currentPageMaster=0,this.pageSizeOptionsMaster=[10,25,100],this.filterfriendlyNameMaster="",this.filterlocationCodeMaster="",this.filtercashlessAddressMaster="",this.filterserialNumberMaster="",this.filterlocalitymaster="",this.filtercitymaster="",this.filteraddressmaster="",this.filterstatusmaster="",this.formatResponse=m=>{const v=m.machines;for(let p=0;p<v.length;p++)"0X10h"===v[p].cashlessAddress?v[p].cashlessAddress="Cashless 1":"0X60h"===v[p].cashlessAddress?v[p].cashlessAddress="Cashless 2":v[p].cashlessAddress="Other Address";return v};this.dataSource=new E.I6([]);this.dataSourceMaster=new E.I6([])}ngOnInit(){this.getMachines(),this.getMasterMachines()}showStats(e,t){const a={machineId:e.machineId,friendlyName:e.friendlyName,type:this.selectedMachineType};this.selectedMachine.emit(a)}getMachines(){this.filters=""+this.filterfriendlyName+this.filterlocationCode+this.filtercashlessAddress+this.filterserialNumber+this.filterlocality+this.filtercity+this.filteraddress+this.filterstatus,this.filtercount="?"+this.filterfriendlyName+this.filterlocationCode+this.filtercashlessAddress+this.filterserialNumber+this.filterlocality+this.filtercity+this.filteraddress+this.filterstatus,this.isLoading=!0,this.machineService.getMachines(this.merchant.id,this.currentPage,this.pageSize,"",this.filters).subscribe(e=>{this.dataSource.data=e.machines,this.machineService.getMachinesCount(this.merchant.id,this.pageSize,this.filtercount).subscribe(t=>{this.paginator.pageIndex=this.currentPage,this.paginator.length=t,this.paginator.pageSize=this.pageSize,this.totalRows=t,this.isLoading=!1},t=>{console.log(t)})},e=>{console.log(e),this.dataSource.data=[],this.isLoading=!1})}pageChanged(e){this.pageSize=e.pageSize,this.currentPage=e.pageIndex,this.getMachines()}onTabChanged(e){console.log("Tab cambiato:",e.index),0===e.index?this.selectedMachineType="slave":1===e.index&&(this.selectedMachineType="master")}getMasterMachines(){this.filtersMaster=""+this.filterfriendlyNameMaster+this.filterlocationCodeMaster+this.filtercashlessAddressMaster+this.filterserialNumberMaster+this.filterlocalitymaster+this.filtercitymaster+this.filteraddressmaster+this.filterstatusmaster,this.filtercountmaster="?"+this.filterfriendlyNameMaster+this.filterlocationCodeMaster+this.filtercashlessAddressMaster+this.filterserialNumberMaster+this.filterlocalitymaster+this.filtercitymaster+this.filteraddressmaster+this.filterstatusmaster,this.isLoadingMaster=!0,this.machineService.getMasterMachines(this.merchant.id,this.currentPageMaster,this.pageSizeMaster,"",this.filtersMaster).subscribe(e=>{this.dataSourceMaster.data=e.machines,this.machineService.getMasterMachinesCount(this.merchant.id,this.pageSizeMaster,this.filtercountmaster).subscribe(t=>{this.paginatorMaster.pageIndex=this.currentPageMaster,this.paginatorMaster.length=t,this.paginatorMaster.pageSize=this.pageSizeMaster,this.totalRowsMaster=t,this.isLoadingMaster=!1},t=>{console.log(t)})},e=>{console.log(e),this.dataSourceMaster.data=[],this.isLoadingMaster=!1})}pageMasterChanged(e){this.pageSizeMaster=e.pageSize,this.currentPageMaster=e.pageIndex,this.getMasterMachines()}filterNameMaster(e){this.filterfriendlyNameMaster=e?"&friendlyName="+e:"",this.getMasterMachines()}filterLocationCodeMaster(e){this.filterlocationCodeMaster=e?"&locationCode="+e:"",this.getMasterMachines()}filterCashlessMaster(e){this.filtercashlessAddressMaster=e?"&cashlessAddress="+e:"",this.getMasterMachines()}filterSerialNumberMaster(e){this.filterserialNumberMaster=e?"&serialNumber="+e:"",this.getMasterMachines()}filterLocalityMaster(e){this.filterlocalitymaster=e?"&locality="+e:"",this.getMasterMachines()}filterCityMaster(e){this.filtercitymaster=e?"&city="+e:"",this.getMasterMachines()}filterAddressMaster(e){this.filteraddressmaster=e?"&address="+e:"",this.getMasterMachines()}filterStatusMaster(e){this.filterstatusmaster=e?"&status="+e:"",this.getMasterMachines()}filterName(e){this.filterfriendlyName=e?"&friendlyName="+e:"",this.getMachines()}filterLocationCode(e){this.filterlocationCode=e?"&locationCode="+e:"",this.getMachines()}filterCashless(e){this.filtercashlessAddress=e?"&cashlessAddress="+e:"",this.getMachines()}filterSerialNumber(e){this.filterserialNumber=e?"&serialNumber="+e:"",this.getMachines()}filterLocality(e){this.filterlocality=e?"&locality="+e:"",this.getMachines()}filterCity(e){this.filtercity=e?"&city="+e:"",this.getMachines()}filterAddress(e){this.filteraddress=e?"&address="+e:"",this.getMachines()}filterStatus(e){this.filterstatus=e?"&status="+e:"",this.getMachines()}static{this.ctorParameters=()=>[{type:U.W},{type:_.Ix},{type:I.o},{type:R.c$},{type:M.j}]}static{this.propDecorators={selectedMachine:[{type:o.k7i}],paginator:[{type:o.Uct,args:["paginator",{static:!0}]}],paginatorMaster:[{type:o.Uct,args:["paginatorMaster",{static:!0}]}]}}};ve=(0,h.Cg)([(0,o.uAl)({selector:"machines-list",template:'<mat-card>\r\n <mat-card-title>{{\r\n "Menu.Transactions.SelectMachine" | translate\r\n }}</mat-card-title>\r\n <mat-tab-group (selectedTabChange)="onTabChanged($event)">\r\n \x3c!-- TAB SLAVE --\x3e\r\n <mat-tab label="{{ \'Menu.Machines.Slave\' | translate }}" #slaveMachinesTab>\r\n <mat-card-content class="table-card">\r\n <mat-progress-bar\r\n mode="indeterminate"\r\n *ngIf="isLoading"\r\n ></mat-progress-bar>\r\n <mat-table [dataSource]="dataSource" matSort>\r\n \x3c!-- Column --\x3e\r\n <ng-container matColumnDef="friendlyName">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Common.Name" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.friendlyName }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="locationCode">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.LocationCode" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.locationCode }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="cashlessAddress">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.CashlessAddress" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{\r\n row.cashlessAddress == "0X10h"\r\n ? "Cashless 1"\r\n : "Cashless\r\n 2"\r\n }}\r\n </mat-cell>\r\n </ng-container>
1\r\n <ng-container matColumnDef="serialNumber">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.SerialNumber" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.serialNumber }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="locality">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.Place" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.locality }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="city">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.City" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.city }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="address">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.Address" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.address }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="status">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Common.Status" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n <img\r\n src="assets/images/not.svg"\r\n width="20px"\r\n *ngIf="row.status == \'PENDING\'"\r\n />\r\n <img\r\n src="assets/images/ok.svg"\r\n width="20px"\r\n *ngIf="row.status == \'OK\'"\r\n />\r\n </mat-cell>\r\n \x3c!-- {{row.status}} --\x3e\r\n </ng-container>\r\n\r\n \x3c!-- Filtri --\x3e\r\n <ng-container matColumnDef="header2">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Common.Name\' | translate }}"\r\n (keyup.enter)="filterName(friendlyName)"\r\n [(ngModel)]="friendlyName"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header3">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Machines.Common.LocationCode\' | translate }}"\r\n (keyup.enter)="filterLocationCode(locationCode)"\r\n [(ngModel)]="locationCode"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header4">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <select\r\n class="filter-input"\r\n type="text"\r\n (ngModelChange)="filterCashless($event)"\r\n [(ngModel)]="cashlessAddress"\r\n >\r\n \x3c!-- placeholder="{{\'Machines.Common.CashlessAddress\' | translate}}" --\x3e\r\n <option></option>\r\n <option value="0X10h">Cashless 1</option>\r\n <option value="0X60h">Cashless 2</option>\r\n </select>\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header5">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Machines.Common.SerialNumber\' | translate }}"\r\n (keyup.enter)="filterSerialNumber(serialNumber)"\r\n [(ngModel)]="serialNumber"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header6">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Machines.Common.Place\' | translate }}"\r\n (keyup.enter)="filterLocality(locality)"\r\n [(ngModel)]="locality"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header7">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Machines.Common.City\' | translate }}"\r\n (keyup.enter)="filterCity(city)"\r\n [(ngModel)]="city"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header71">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Machines.Common.Address\' | translate }}"\r\n (keyup.enter)="filterAddress(address)"\r\n [(ngModel)]="address"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header10">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <select\r\n class="filter-input"\r\n type="text"\r\n (ngModelChange)="filterStatus($event)"\r\n [(ngModel)]="status"\r\n >\r\n \x3c!-- placeholder="{{\'Common.Status\' | translate}}" --\x3e\r\n <option></option>\r\n <option value="PENDING">\r\n {{ "Machines.NoConfigurate" | translate }}\r\n </option>\r\n <option value="OK">\r\n {{ "Machines.Configurate" | translate }}\r\n </option>\r\n </select>\r\n </mat-header-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef="columns"></mat-header-row>\r\n <mat-header-row\r\n *matHeaderRowDef="[\r\n \'header2\',\r\n \'header3\',\r\n \'header4\',\r\n \'header5\',\r\n \'header6\',\r\n \'header7\',\r\n \'header71\',\r\n \'header10\'\r\n ]"\r\n ></mat-header-row>\r\n <mat-row\r\n *matRowDef="let row; columns: columns"\r\n style="cursor: pointer"\r\n (click)="showStats(row)"\r\n ></mat-row>\r\n </mat-table>\r\n\r\n <mat-paginator\r\n #paginator\r\n [length]="totalRows"\r\n [pageIndex]="currentPage"\r\n [pageSize]="pageSize"\r\n [pageSizeOptions]="pageSizeOptions"\r\n (page)="pageChanged($event)"\r\n aria-label="Select page"\r\n [showFirstLastButtons]="true"\r\n ></mat-paginator>\r\n </mat-card-content>\r\n </mat-tab>\r\n \x3c!-- TAB MASTER --\x3e\r\n <mat-tab\r\n label="{{ \'Menu.Machines.Master\' | translate }}"\r\n #masterMachinesTab\r\n >\r\n <mat-card-content class="table-card">\r\n <mat-progress-bar\r\n mode="indeterminate"\r\n *ngIf="isLoadingMaster"\r\n ></mat-progress-bar>\r\n <mat-table [dataSource]="dataSourceMaster" matSort>\r\n \x3c!-- Column --\x3e\r\n <ng-container matColumnDef="friendlyName">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Common.Name" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.friendlyName }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="locationCode">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.LocationCode" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.locationCode }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="cashlessAddress">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.CashlessAddress" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{\r\n row.cashlessAddress == "0X10h"\r\n ? "Cashless 1"\r\n : "Cashless\r\n 2"\r\n }}\r\n </mat-cell>\r\n </ng-container>
1\r\n <ng-container matColumnDef="serialNumber">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.SerialNumber" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.serialNumber }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="locality">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.Place" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.locality }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="city">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.City" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.city }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="address">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Machines.Common.Address" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n {{ row.address }}\r\n </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="status">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n {{ "Common.Status" | translate }}\r\n </mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="row-text">\r\n <img\r\n src="assets/images/not.svg"\r\n width="20px"\r\n *ngIf="row.status == \'PENDING\'"\r\n />\r\n <img\r\n src="assets/images/ok.svg"\r\n width="20px"\r\n *ngIf="row.status == \'OK\'"\r\n />\r\n </mat-cell>\r\n \x3c!-- {{row.status}} --\x3e\r\n </ng-container>\r\n\r\n \x3c!-- Filtri --\x3e\r\n <ng-container matColumnDef="header2">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Common.Name\' | translate }}"\r\n (keyup.enter)="filterNameMaster(friendlyNameMaster)"\r\n [(ngModel)]="friendlyNameMaster"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header3">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Machines.Common.LocationCode\' | translate }}"\r\n (keyup.enter)="filterLocationCodeMaster(locationCodeMaster)"\r\n [(ngModel)]="locationCodeMaster"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header4">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <select\r\n class="filter-input"\r\n type="text"\r\n (ngModelChange)="filterCashlessMaster($event)"\r\n [(ngModel)]="cashlessAddressMaster"\r\n >\r\n \x3c!-- placeholder="{{\'Machines.Common.CashlessAddress\' | translate}}" --\x3e\r\n <option></option>\r\n <option value="0X10h">Cashless 1</option>\r\n <option value="0X60h">Cashless 2</option>\r\n </select>\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header5">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Machines.Common.SerialNumber\' | translate }}"\r\n (keyup.enter)="filterSerialNumberMaster(serialNumberMaster)"\r\n [(ngModel)]="serialNumberMaster"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header6">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Machines.Common.Place\' | translate }}"\r\n (keyup.enter)="filterLocalityMaster(localitymaster)"\r\n [(ngModel)]="localitymaster"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header7">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Machines.Common.City\' | translate }}"\r\n (keyup.enter)="filterCityMaster(citymaster)"\r\n [(ngModel)]="citymaster"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header71">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <input\r\n class="filter-input"\r\n type="text"\r\n placeholder="{{ \'Machines.Common.Address\' | translate }}"\r\n (keyup.enter)="filterAddressMaster(addressmaster)"\r\n [(ngModel)]="addressmaster"\r\n ngbTooltip="{{ \'Common.FilterMessage\' | translate }}"\r\n placement="top"\r\n tooltipClass="tooltip-class"\r\n />\r\n </mat-header-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="header10">\r\n <mat-header-cell *matHeaderCellDef class="column-title">\r\n <select\r\n class="filter-input"\r\n type="text"\r\n (ngModelChange)="filterStatusMaster($event)"\r\n [(ngModel)]="statusmaster"\r\n >\r\n \x3c!-- placeholder="{{\'Common.Status\' | translate}}" --\x3e\r\n <option></option>\r\n <option value="PENDING">\r\n {{ "Machines.NoConfigurate" | translate }}\r\n </option>\r\n <option value="OK">\r\n {{ "Machines.Configurate" | translate }}\r\n </option>\r\n </select>\r\n </mat-header-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef="columnsMaster"></mat-header-row>\r\n <mat-header-row\r\n *matHeaderRowDef="[\r\n \'header2\',\r\n \'header3\',\r\n \'header4\',\r\n \'header5\',\r\n \'header6\',\r\n \'header7\',\r\n \'header71\',\r\n \'header10\'\r\n ]"\r\n ></mat-header-row>\r\n <mat-row\r\n *matRowDef="let row; columns: columnsMaster"\r\n style="cursor: pointer"\r\n (click)="showStats(row)"\r\n ></mat-row>\r\n </mat-table>\r\n\r\n <mat-paginator\r\n #paginatorMaster\r\n [length]="totalRowsMaster"\r\n [pageIndex]="currentPageMaster"\r\n [pageSize]="pageSizeMaster"\r\n [pageSizeOptions]="pageSizeOptionsMaster"\r\n (page)="pageMasterChanged($event)"\r\n aria-label="Select page"\r\n [showFirstLastButtons]="true"\r\n ></mat-paginator>\r\n </mat-card-content> </mat-tab\r\n ></mat-tab-group>\r\n</mat-card>\r\n',providers:[U.W,O],styles:[Ot()]})],ve);var Nt=s(52432),kt=s.n(Nt);let fe=class{constructor(e,t,a,r,n){this.machineStatsService=e,this.route=t,this.translate=a,this.merchant=r,this.dialog=n,this.dateFromMinDate=this.merchant.createdAt,this.dateFromMaxDate=new Date,this.dateToMinDate=new Date,this.dateToMaxDate=new Date,this.lineChartOptions={animation:!1,responsive:!0,maintainAspectRatio:!1,plugins:{legend:{dis
1play:!1}},scales:{x:{grid:{borderDash:[12,4]},ticks:{autoSkip:!0}},y:{grid:{borderDash:[12,4]},title:{display:!0,text:this.merchant.formattedCurrency},min:0,ticks:{callback:d=>(new T.V).transform(Number(d),2)}}}},this.barChartOptions={animation:!1,responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{x:{grid:{borderDash:[12,4]},ticks:{autoSkip:!0}},y:{grid:{borderDash:[12,4]},title:{display:!0,text:this.merchant.formattedCurrency},min:0,ticks:{callback:d=>(new T.V).transform(Number(d),0)}}}},this.dataSourcesState={summary:"loading",barChartsData:"loading",summaryDetails:"loading"}}ngOnInit(){this.dateFrom=new Date,this.dateFrom.setDate(this.dateFrom.getDate()-10),this.dateTo=new Date,this.dateToMinDate=this.merchant.createdAt,this.dateToMinDate.setDate(this.dateToMinDate.getDate()+10)}ngOnChanges(e){(e.machineId||e.type)&&this.loadMachineStats()}loadMachineStats(){console.log("Carico stats per macchina",this.machineId,"di tipo",this.type),"master"===this.type?this.loadStatsMaster(!0):this.loadStats(!0)}ngOnDestroy(){}loadStats(e=!1){this.dataSourcesState.summaryDetails="loading",e&&(this.isLoading=!0),(0,V.p)(this.machineStatsService.getMachineInfo(this.machineId),this.machineStatsService.getMachineDetails(this.machineId,this.dateFrom,this.dateTo),this.machineStatsService.getMachineFullDetails(this.machineId)).subscribe(([t,a,r])=>{this.setInfo(t),this.setDetails(a),this.setFullDetails(r),this.dataSourcesState.summary="loaded",this.dataSourcesState.summaryDetails="loaded"},t=>{this.dialog.error(t),this.isLoading=void 0,this.dataSourcesState.summary="error",this.dataSourcesState.summaryDetails="error"},()=>{e&&(this.isLoading=!1)}),this.machineStatsService.getMachineActivities(this.machineId,this.dateFrom,this.dateTo).subscribe(t=>this.setActivities(t)),this.machineStatsService.getMachineSaleHours(this.machineId,this.dateFrom,this.dateTo).subscribe(t=>this.setSaleHours(t)),this.machineStatsService.getMachineSaleProducts(this.machineId,this.dateFrom,this.dateTo).subscribe(t=>this.setSaleProducts(t))}loadStatsMaster(e=!1){this.dataSourcesState.summaryDetails="loading",e&&(this.isLoading=!0),(0,V.p)(this.machineStatsService.getMasterMachineInfo(this.machineId),this.machineStatsService.getMachineDetails(this.machineId,this.dateFrom,this.dateTo),this.machineStatsService.getMachineFullDetails(this.machineId)).subscribe(([t,a,r])=>{this.setInfo(t),this.setDetails(a),this.setFullDetails(r),this.dataSourcesState.summary="loaded",this.dataSourcesState.summaryDetails="loaded"},t=>{this.dialog.error(t),this.isLoading=void 0,this.dataSourcesState.summary="error",this.dataSourcesState.summaryDetails="error"},()=>{e&&(this.isLoading=!1)}),this.machineStatsService.getMachineActivities(this.machineId,this.dateFrom,this.dateTo).subscribe(t=>this.setActivities(t)),this.machineStatsService.getMachineSaleHours(this.machineId,this.dateFrom,this.dateTo).subscribe(t=>this.setSaleHours(t)),this.machineStatsService.getMasterMachineSaleProducts(this.machineId,this.dateFrom,this.dateTo).subscribe(t=>this.setSaleProducts(t))}loadStats_date(){this.dataSourcesState.summaryDetails="loading",this.dataSourcesState.barChartsData="loading",this.machineStatsService.getMachineDetails(this.machineId,this.dateFrom,this.dateTo).subscribe(e=>{this.setDetails(e),this.dataSourcesState.summaryDetails="loaded"},e=>{this.dialog.error(e),this.isLoading=void 0,this.dataSourcesState.summaryDetails="error"}),this.machineStatsService.getMachineActivities(this.machineId,this.dateFrom,this.dateTo).subscribe(e=>this.setActivities(e)),this.machineStatsService.getMachineSaleHours(this.machineId,this.dateFrom,this.dateTo).subscribe(e=>this.setSaleHours(e)),this.machineStatsService.getMachineSaleProducts(this.machineId,this.dateFrom,this.dateTo).subscribe(e=>this.setSaleProducts(e))}setInfo(e){this.machineInfo=e.machineInfo}setDetails(e){this.statsDetails=e.machineDetail,this.statsDetails.totalSales=this.statsDetails.totalSales/Math.pow(10,this.merchant.decimalPlaces),this.statsDetails.totalRevenues=this.statsDetails.totalRevenues/Math.pow(10,this.merchant.decimalPlaces)}setFullDetails(e){this.statsFullDetails=e.machineDetail,this.statsFullDetails.totalSales=this.statsFullDetails.totalSales/Math.pow(10,this.merchant.decimalPlaces),this.statsFullDetails.totalRevenues=this.statsFullDetails.totalRevenues/Math.pow(10,this.merchant.decimalPlaces)}setActivities(e){this.dataSourcesState.barChartsData="loading";const t=[],a=[],r=[],n=[],d=[],c=[],m=[],v=[],p=e.statistics;for(const l=new Date(this.dateFrom.getTime());l<=this.dateTo;l.setDate(l.getDate()+1))r.push(S(l).format("DD-MM-YYYY")),n.push(0),t.push(S(l).format("DD-MM-YYYY")),a.push(0),d.push(S(l).format("DD-MM-YYYY")),c.push(0),m.push(S(l).format("DD-MM-YYYY")),v.push(0);if(0!==p.length)for(let l=0;l<p.length;l++)for(let f=0;f<p[l].entries.length;f++)if(1===p[l].entries[f].entryType){const b=t.indexOf(S(p[l].date).format("DD-MM-YYYY"));a[b]=p[l].entries[f].amount/Math.pow(10,this.merchant.decimalPlaces),c[b]=p[l].entries[f].entryNumber}else if(2===p[l].entries[f].entryType){const b=r.indexOf(S(p[l].date).format("DD-MM-YYYY"));n[b]=p[l].entries[f].amount/Math.pow(10,this.merchant.decimalPlaces),v[b]=p[l].entries[f].entryNumber}this.numberOfSalesData={labels:d,datasets:[{data:c,backgroundColor:"#fcab11",borderColor:"#fcab11",showPoint:!1,radius:0}]},this.numberOfRechargesData={labels:m,datasets:[{data:v,backgroundColor:"#fcab11",borderColor:"#fcab11",showPoint:!1,radius:0}]},this.revenuesData={labels:r,datasets:[{data:n,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]},this.salesData={labels:t,datasets:[{data:a,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]},this.dataSourcesState.barChartsData="loaded"}setSaleHours(e){this.dataSourcesState.barChartsData="loading";const t=[],a=[],r=e.purchases;if(0===r.length)t.push("0"),t.push("0"),a.push(0),a.push(0);else for(let n=0;n<r.length;n++)t.push(r[n].hour.toString()),a.push(r[n].total);this.purchasesByHourData={labels:t,datasets:[{data:a,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]},this.dataSourcesState.barChartsData="loaded"}setSaleProducts(e){const t=[],a=[],r=e.productLineStats;if(0===r.length)t.push("0"),t.push("0"),a.push(0),a.push(0);else for(let n=0;n<r.length;n++)t.push(r[n].itemDescription?r[n].itemDescription:r[n].itemCode),a.push(r[n].total);this.purchasesByProductLineData={labels:t,datasets:[{data:a,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]}}static{this.ctorParameters=()=>[{type:O},{type:_.nX},{type:R.c$},{type:M.j},{type:I.o}]}static{this.propDecorators={machineId:[{type:o.pde}],type:[{type:o.pde}]}}};fe=(0,h.Cg)([(0,o.uAl)({selector:"machine-stats",template:'\x3c!-- <spinner *ngIf="isLoading === true" class="page-spinner"></spinner> --\x3e\r\n\r\n\x3c!-- Informazioni --\x3e\r\n<load-guard [dataSourceState]="dataSourcesState.summary">\r\n <div\r\n *ngIf="statsFullDetails || statsDetails || machineInfo"\r\n load-guarded-template\r\n style="margin-top: 0.5rem"\r\n >\r\n <div class="row" *ngIf="isLoading === false">\r\n <div class="col-md-6">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-1 icon">\r\n <i class="i-machine"></i>\r\n </div>\r\n <div class="col-md-11">\r\n <div class="row">\r\n <div class="col-md-12" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Machines.Common.Machine" | translate }} S/N:\r\n <strong> {{ machineInfo.serialNumber }}</strong>\r\n </div>\r\n </div>\r\n <div class="col-md-12">\r\n <div class="value">\r\n {{ "Machines.Common.Locality" | translate }}:\r\n <strong> {{ machineInfo.locality }}</strong>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">{{ "Stats.TotalSales" | translate }}</div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">\r\n {{ statsFullDetails.totalSales\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">{{ "Stats.TotalRevenues" | translate }}</div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">\r\n {{ statsFullDetails.totalRevenues\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n\r\n <div class="row" *ngIf="isLoading === false">\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Stats.RegisteredUsers" | translate }}\r\n </div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">{{ machineInfo.registeredUsers }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">{{ "Stats.ActiveUsers" | translate }}</div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">{{ machineInfo.activeUsers }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Stats.TotalNumberOfSales" | translate }}\r\n </div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">{{ statsFullDetails.countSales }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Stats.TotalNumberOfRecharges" | translate }}\r\n </div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">\r\n {{ statsFullDetails.countRecharges }}\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n </div>\r\n</load-guard>\r\n\r\n<load-guard [dataSourceState]="dataSourcesState.summaryDetails">\r\n <div\r\n *ngIf="statsFullDetails || statsDetails || machineInfo"\r\n load-guarded-template\r\n >\r\n <div class="row">\r\n <div class="col-md-6">\r\n <mat-card style="height: 80%">\r\n <mat-card-title>{{ "Stats.Filters" | translate }}</mat-card-title>\r\n <mat-card-content>\r\n <label>\r\n {{ "Stats.From" | translate }}\r\n </label>\r\n <div class="input-group date">\r\n <div class="input-group-prepend">
1\r\n <span class="input-group-text" (click)="dpFrom.toggle()">\r\n <i class="ion-android-calendar"></i>\r\n </span>\r\n </div>\r\n <input\r\n type="text"\r\n name="dateFrom"\r\n class="form-control m-input m-input--solid"\r\n [maxDate]="dateFromMaxDate"\r\n [minDate]="dateFromMinDate"\r\n #dpFrom="bsDatepicker"\r\n [bsConfig]="{ dateInputFormat: \'DD-MM-YYYY\' }"\r\n bsDatepicker\r\n [(ngModel)]="dateFrom"\r\n />\r\n </div>\r\n <br />\r\n <label>\r\n {{ "Stats.To" | translate }}\r\n </label>\r\n <div class="input-group date">\r\n <div class="input-group-prepend">\r\n <span class="input-group-text" (click)="dpTo.toggle()">\r\n <i class="ion-android-calendar"></i>\r\n </span>\r\n </div>\r\n <input\r\n type="text"\r\n name="dateTo"\r\n class="form-control m-input m-input--solid"\r\n [maxDate]="dateToMaxDate"\r\n [minDate]="dateToMinDate"\r\n #dpTo="bsDatepicker"\r\n [bsConfig]="{ dateInputFormat: \'DD-MM-YYYY\' }"\r\n bsDatepicker\r\n [(ngModel)]="dateTo"\r\n />\r\n </div>\r\n <br />\r\n <button class="btn" (click)="loadStats_date()">\r\n {{ "Stats.Filter" | translate }}\r\n </button>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" *ngIf="isLoading === false">\r\n <div class="row">\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">{{ "Stats.Sales" | translate }}</div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">\r\n {{ statsDetails.totalSales\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">{{ "Stats.Revenues" | translate }}</div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">\r\n {{ statsDetails.totalRevenues\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">\r\n {{ "Stats.NumberOfSales" | translate }}\r\n </div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">{{ statsDetails.countSales }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">\r\n {{ "Stats.NumberOfRecharges" | translate }}\r\n </div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">\r\n {{ statsDetails.countRecharges }}\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</load-guard>\r\n\r\n\x3c!-- Grafici --\x3e\r\n<div>\r\n <div class="row">\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <mat-card>\r\n <mat-card-title>{{ "Stats.Revenues" | translate }}</mat-card-title>\r\n <mat-card-content>\r\n <div>\r\n <canvas\r\n baseChart\r\n type="line"\r\n [data]="revenuesData"\r\n [options]="lineChartOptions"\r\n style="height: 300px"\r\n >\r\n </canvas>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <mat-card>\r\n <mat-card-title>{{ "Stats.Sales" | translate }}</mat-card-title>\r\n <mat-card-content>\r\n <div>\r\n <canvas\r\n baseChart\r\n type="line"\r\n [data]="salesData"\r\n [options]="lineChartOptions"\r\n style="height: 300px"\r\n >\r\n </canvas>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n\r\n <div class="row">\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.NumberOfRecharges\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="numberOfRechargesData"\r\n [options]="barChartOptions"\r\n style="height: 300px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.NumberOfSales\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="numberOfSalesData"\r\n [options]="barChartOptions"\r\n style="height: 300px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n </div>\r\n\r\n <div class="row">\r\n <div\r\n class="col-md-12"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol12\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.SalesByProductLine\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="purchasesByProductLineData"\r\n [options]="barChartOptions"\r\n style="height: 320px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n </div>\r\n\r\n <div class="row">\r\n <div\r\n class="col-md-12"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol12\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.SalesByHour\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="purchasesByHourData"\r\n [options]="barChartOptions"\r\n style="height: 320px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #spinnerPlaceHolderCol6>\r\n <div class="col-md-6">\r\n <mat-card\r\n [nbSpinner]="true"\r\n nbSpinnerStatus="primary"\r\n class="equal-height"\r\n ></mat-card>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #spinnerPlaceHolderCol12>\r\n <div class="col-md-12">\r\n <mat-card\r\n [nbSpinner]="true"\r\n nbSpinnerStatus="primary"\r\n class="equal-height"\r\n ></mat-card>\r\n </div>\r\n</ng-template>\r\n',providers:[U.W,O],styles:[kt()]})],fe);var F,Gt=s(55448),Yt=s.n(Gt);!function(i){i[i.TOTAL_MACHINES=0]="TOTAL_MACHINES",i[i.CONFIGURED_MACHINES=1]="CONFIGURED_MACHINES",i[i.ACTIVE_MACHINES_TITLE=2]="ACTIVE_MACHINES_TITLE",i[i.DELETED_MACHINES=3]="DELETED_MACHINES"}(F||(F={}));
1class ne{constructor(e,t,a){this.value=t,this.showInfoIcon=a,this.titleStringTranslateKey=`Stats.Machines.Summary.${F[e]}`}}class _e{constructor(e,t,a,r,n,d,c){this.type="bar";let m=e.map(y=>{y.machineExpenseValue=y.machineExpenseValue/Math.pow(10,r);const x=Number(y.machineExpenseValue).toLocaleString(navigator.language,{style:"decimal",minimumFractionDigits:r,maximumFractionDigits:r});return Object.assign(y,{y:y.machineExpenseValue,formattedMachineExpensesValue:`${x} ${a||""}`})});const l="yellow"==t?"#fcab11":"#3ab54b";let f=[],b=0;m.forEach(y=>{b+=1,f.push(b.toString())}),this.data={labels:f,datasets:[{data:m.map(y=>y.machineExpenseValue),backgroundColor:l,borderColor:l}]};this.options={responsive:!0,maintainAspectRatio:!1,onClick:function(y){let x=this;var D=x.getElementAtEvent(y)[0];if(D){var $=x.data.datasets[D._datasetIndex].data[D._index];c($)}},animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1}},y:{grid:{borderDash:[1,0]},title:{display:!0,text:a||""},min:0,ticks:{callback:y=>Number(y).toLocaleString(navigator.language,{style:"decimal",minimumFractionDigits:r,maximumFractionDigits:r})}}},tooltips:{callbacks:{label:function(y,x){let D=x.datasets[0].data[y.index],$=n.instant("Machines.Common.FriendlyName"),qt=n.instant("Machines.Common.Type"),ea=n.instant("Machines.Common.Place"),ta=n.instant("Machines.Common.Address"),aa=n.instant("Machines.Common.City"),ra=n.instant("Machines.Common.MachineGroup");return[`${$}: ${D.friendlyName}`,`S/N: ${D.serialNumber}`,`${qt}: ${D.machineType.name}`,`${ea}: ${D.locality}`,`${ta}: ${D.address}`,`${aa}: ${D.city}`,`${ra}: ${D.friendlyName?D.machineGroup.name:""} `]},title:function(){}},displayColors:!1}}}}var jt=s(66063);let Se=class{constructor(e,t,a){this.injector=e,this.appRef=t,this.componentFactoryResolver=a}getAppendableTooltipDomElementWithData(e){const t=document.createElement("machines-stats-bar-chart-tooltip"),r=this.componentFactoryResolver.resolveComponentFactory(jt.z).create(this.injector,[],t);return r.instance.model=e,this.appRef.attachView(r.hostView),r.changeDetectorRef.detectChanges(),{domElement:t,componentReference:r}}appendDomElementToBody(e){document.body.appendChild(e)}removeComponentFromBody(e){document.body.removeChild(e.domElement),this.appRef.detachView(e.componentReference.hostView),e.componentReference.destroy()}static{this.ctorParameters=()=>[{type:o.zZn},{type:o.o8S},{type:o.OM3}]}};Se=(0,h.Cg)([(0,o._qm)({providedIn:"root"})],Se);let be=class{constructor(e,t,a,r){this.translate=e,this.merchant=t,this.dynamicTooltipService=a,this.machinesStatsService=r,this.dataSourcesSubscriptions=new Ae.yU,this.sourceState={details:"loading",pieCharts:"loading",totalExpenses:"loading",avaragesExpenses:"loading"},this.selectedMachine=new o.bkB}ngOnInit(){this.initDetailsSource(),this.initPieChartsSources(),this.initBarChartsSources()}ngOnDestroy(){this.dataSourcesSubscriptions.unsubscribe()}initDetailsSource(){const e=this.machinesStatsService.getMachineStatsSummaryDetails(this.merchant.id).subscribe({next:t=>{this.detailsDataSource=new $t(t),this.sourceState.details="loaded"},error:t=>{console.log(t),this.sourceState.details="error"}});this.dataSourcesSubscriptions.add(e)}initPieChartsSources(){const e=this.machinesStatsService.getMachineStatsSummaryPiesData(this.merchant.id).subscribe({next:t=>{const a={value:t.cashlessPieChartDTO.cashless1,valueLabel:"Cashless 1"},r={value:t.cashlessPieChartDTO.cashless2,valueLabel:"Cashless 2"},n={value:t.userGroupPieChartDTO.groupAll,valueLabel:this.translate.instant("Common.AccessPolicy.ALL")},d={value:t.userGroupPieChartDTO.group1,valueLabel:this.translate.instant("Common.AccessPolicy.GROUP_1")},c={value:t.userGroupPieChartDTO.group2,valueLabel:this.translate.instant("Common.AccessPolicy.GROUP_2")},m={value:t.userGroupPieChartDTO.group3,valueLabel:this.translate.instant("Common.AccessPolicy.GROUP_3")},v={value:t.nfcPieChartDTO.nfcYes,valueLabel:this.translate.instant("Common.Yes")},p={value:t.nfcPieChartDTO.nfcNo,valueLabel:this.translate.instant("Common.No")};this.cashlessAddressesSource=new ye([a,r]),this.accessPoliciesSource=new ye([n,d,c,m]),this.nfcUseSource=new ye([p,v]),this.sourceState.pieCharts="loaded"},error:t=>{console.log(t),this.sourceState.pieCharts="error"}});this.dataSourcesSubscriptions.add(e)}initBarChartsSources(){function e(n,d){return d.machineExpenseValue-n.machineExpenseValue}let t=n=>this.selectedMachine.emit(n);const a=this.machinesStatsService.getMachineStatsSummaryTotalExpensesChartData(this.merchant.id).subscribe({next:n=>{let d=n.machines.map(c=>new Ie(c));this.totalExpensesChartSource=new _e(d.sort(e),"yellow",this.merchant.formattedCurrency,this.merchant.decimalPlaces,this.translate,this.dynamicTooltipService,t),this.sourceState.totalExpenses="loaded"},error:n=>{console.log(n),this.sourceState.totalExpenses="error"}});this.dataSourcesSubscriptions.add(a);const r=this.machinesStatsService.getMachineStatsSummaryAvaragesExpensesChartData(this.merchant.id).subscribe({next:n=>{let d=n.machines.map(c=>new Ie(c));this.avaragesExpensesChartSource=new _e(d.sort(e),"green",this.merchant.formattedCurrency,this.merchant.decimalPlaces,this.translate,this.dynamicTooltipService,t),this.sourceState.avaragesExpenses="loaded"},error:n=>{console.log(n),this.sourceState.avaragesExpenses="error"}});this.dataSourcesSubscriptions.add(r)}static{this.ctorParameters=()=>[{type:R.c$},{type:M.j},{type:Se},{type:O}]}static{this.propDecorators={selectedMachine:[{type:o.k7i}]}}};be=(0,h.Cg)([(0,o.uAl)({selector:"machines-stats-summary",template:'\x3c!-- Dettagli delle statistiche macchine --\x3e\r\n<load-guard [dataSourceState]="sourceState.details">\r\n <div\r\n *ngIf="detailsDataSource"\r\n class="row"\r\n load-guarded-template\r\n style="margin-top: 0.5rem"\r\n >\r\n <div class="col">\r\n <machines-stats-detail\r\n [detail]="detailsDataSource.totalMachines"\r\n ></machines-stats-detail>\r\n </div>\r\n <div class="col">\r\n <machines-stats-detail\r\n [detail]="detailsDataSource.configuredMachines"\r\n ></machines-stats-detail>\r\n </div>\r\n <div class="col">\r\n <machines-stats-detail\r\n [detail]="detailsDataSource.activeMachines"\r\n ></machines-stats-detail>\r\n </div>\r\n <div class="col">\r\n <machines-stats-detail\r\n [detail]="detailsDataSource.deletedMachines"\r\n ></machines-stats-detail>\r\n </div>\r\n </div>\r\n</load-guard>\r\n\r\n\x3c!-- Diagrammi a torta --\x3e\r\n<div class="row">\r\n <div class="col-md-4">\r\n <load-guard-card-with-header\r\n [dataSourceState]="sourceState.pieCharts"\r\n [headerText]="\'Stats.Machines.Summary.CASHLESS_ADDRESSES\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n *ngIf="cashlessAddressesSource"\r\n class="pie-chart"\r\n [type]="cashlessAddressesSource.type"\r\n [data]="cashlessAddressesSource.data"\r\n [options]="cashlessAddressesSource.options"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n\r\n <div class="col-md-4">\r\n <load-guard-card-with-header\r\n [dataSourceState]="sourceState.pieCharts"\r\n [headerText]="\'Common.Acce
1ssPolicyTitle\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n *ngIf="accessPoliciesSource"\r\n class="pie-chart"\r\n [type]="accessPoliciesSource.type"\r\n [data]="accessPoliciesSource.data"\r\n [options]="accessPoliciesSource.options"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n\r\n <div class="col-md-4">\r\n <load-guard-card-with-header\r\n [dataSourceState]="sourceState.pieCharts"\r\n [headerText]="\'NFC\'"\r\n >\r\n <canvas\r\n baseChart\r\n *ngIf="nfcUseSource"\r\n class="pie-chart"\r\n [type]="nfcUseSource.type"\r\n [data]="nfcUseSource.data"\r\n [options]="nfcUseSource.options"\r\n load-guarded-template\r\n ></canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- Istogramma vendite totali --\x3e\r\n<div class="row">\r\n <div class="col">\r\n <load-guard-card-with-header\r\n [dataSourceState]="sourceState.totalExpenses"\r\n [headerText]="\r\n \'Stats.Machines.Summary.TOP_SPENDING_MACHINES_CHART\' | translate\r\n "\r\n >\r\n <canvas\r\n baseChart\r\n *ngIf="totalExpensesChartSource"\r\n [type]="totalExpensesChartSource.type"\r\n [data]="totalExpensesChartSource.data"\r\n [options]="totalExpensesChartSource.options"\r\n class="bar-chart"\r\n load-guarded-template\r\n ></canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- Istogramma vendite medie giornaliere --\x3e\r\n<div class="row">\r\n <div class="col">\r\n <load-guard-card-with-tooltip-header\r\n [dataSourceState]="sourceState.avaragesExpenses"\r\n [headerText]="\r\n \'Stats.Machines.Summary.TOP_SPENDING_MACHINES_DAILY_AVARAGE_CHART\'\r\n | translate\r\n "\r\n [tooltipText]="\'Stats.Common.AVERAGES_TOOLTIP\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n *ngIf="avaragesExpensesChartSource"\r\n [type]="avaragesExpensesChartSource.type"\r\n [data]="avaragesExpensesChartSource.data"\r\n [options]="avaragesExpensesChartSource.options"\r\n class="bar-chart"\r\n load-guarded-template\r\n ></canvas>\r\n </load-guard-card-with-tooltip-header>\r\n </div>\r\n</div>\r\n',styles:[Yt()]})],be);class $t{constructor(e){this.totalMachines=new ne(F.TOTAL_MACHINES,e.allMachines,!1),this.configuredMachines=new ne(F.CONFIGURED_MACHINES,e.configuredMachines,!1),this.activeMachines=new ne(F.ACTIVE_MACHINES_TITLE,e.activeMachines,!0),this.deletedMachines=new ne(F.DELETED_MACHINES,e.deletedMachines,!1)}}class ye{constructor(e){this.type="pie",this.options={responsive:!0,maintainAspectRatio:!1,showArea:!0,animation:!1,plugins:{legend:{display:!1}},tooltips:{callbacks:{label:function(r,n){const d=n.labels[r.index];let c=n.datasets[r.datasetIndex].data[r.index];return c=isNaN(c)?c:c.toFixed(2),d&&c?` ${d}: ${c} %`:d?` ${d}: ?? %`:c?` ??: ${c} %`:" ??: ?? %"}}}};const t=[],a=[];e.forEach(r=>{t.push(r.valueLabel),a.push(r.value)}),this.data={labels:t,datasets:[{data:a,backgroundColor:["#3ab54b","#fcab11","#2c9fb4","#fa343d"]}]}}}class Ie{constructor(e){this.machineId=e.machineId,this.machineExpenseValue=e.amount,this.friendlyName=e.friendlyName,this.serialNumber=e.serialNumber,this.machineType={name:e.machineTypeName},this.locality=e.locality,this.address=e.address,this.city=e.city,this.machineGroup={name:e.machineGroupName}}}var zt=s(17852),Vt=s.n(zt);let Ce=class{constructor(){}static{this.ctorParameters=()=>[]}static{this.propDecorators={detail:[{type:o.pde}]}}};Ce=(0,h.Cg)([(0,o.uAl)({selector:"machines-stats-detail",template:'<ng-container *ngIf="detail; else cardWithSpinner">\r\n <mat-card>\r\n <mat-card-content>\r\n <div class="detail-title">{{ detail.titleStringTranslateKey | translate }} \r\n <mat-icon *ngIf="detail.showInfoIcon" placement="bottom" tooltipClass="tooltip-class" class="mat-icon-info"\r\n ngbTooltip="{{\'Stats.Machines.Summary.ACTIVE_MACHINES_TOOLTIP\' | translate}}">info_outline</mat-icon></div>\r\n <br>\r\n <div *ngIf="detail.value || detail.value == 0" class="detail-value">{{ detail.value }}</div>\r\n </mat-card-content>\r\n </mat-card>\r\n</ng-container>\r\n\r\n<ng-template #cardWithSpinner>\r\n <mat-card [nbSpinner]="true" nbSpinnerStatus="primary" id="spinner-card"></mat-card>\r\n</ng-template>',styles:[Vt()]})],Ce);var Wt=s(96695),Xt=s(67575),Kt=s(99622),Qt=s.n(Kt);let we=class{constructor(e,t,a,r,n){this.machineStatsService=e,this.route=t,this.translate=a,this.merchant=r,this.dialog=n,this.dateFromMinDate=this.merchant.createdAt,this.dateFromMaxDate=new Date,this.dateToMinDate=new Date,this.dateToMaxDate=new Date,this.lineChartOptions={animation:!1,responsive:!0,maintainAspectRatio:!1,plugins:{legend:{dis
1play:!1}},scales:{x:{grid:{borderDash:[12,4]},ticks:{autoSkip:!0}},y:{grid:{borderDash:[12,4]},title:{display:!0,text:this.merchant.formattedCurrency},min:0,ticks:{callback:d=>(new T.V).transform(Number(d),2)}}}},this.barChartOptions={animation:!1,responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{x:{grid:{borderDash:[12,4]},ticks:{autoSkip:!0}},y:{grid:{borderDash:[12,4]},title:{display:!0,text:this.merchant.formattedCurrency},min:0,ticks:{callback:d=>(new T.V).transform(Number(d),0)}}}},this.dataSourcesState={summary:"loading",barChartsData:"loading",summaryDetails:"loading"}}ngOnInit(){this.dateFrom=new Date,this.dateFrom.setDate(this.dateFrom.getDate()-10),this.dateTo=new Date,this.dateToMinDate=this.merchant.createdAt,this.dateToMinDate.setDate(this.dateToMinDate.getDate()+10),this.loadStatsMaster(!0)}ngOnDestroy(){}loadStatsMaster(e=!1){this.dataSourcesState.summaryDetails="loading",e&&(this.isLoading=!0),(0,V.p)(this.machineStatsService.getMasterMachineInfo(this.machineId),this.machineStatsService.getMachineDetails(this.machineId,this.dateFrom,this.dateTo),this.machineStatsService.getMachineFullDetails(this.machineId)).subscribe(([t,a,r])=>{this.setInfo(t),this.setDetails(a),this.setFullDetails(r),this.dataSourcesState.summary="loaded",this.dataSourcesState.summaryDetails="loaded"},t=>{this.dialog.error(t),this.isLoading=void 0,this.dataSourcesState.summary="error",this.dataSourcesState.summaryDetails="error"},()=>{e&&(this.isLoading=!1)}),this.machineStatsService.getMachineActivities(this.machineId,this.dateFrom,this.dateTo).subscribe(t=>this.setActivities(t)),this.machineStatsService.getMachineSaleHours(this.machineId,this.dateFrom,this.dateTo).subscribe(t=>this.setSaleHours(t)),this.machineStatsService.getMasterMachineSaleProducts(this.machineId,this.dateFrom,this.dateTo).subscribe(t=>this.setSaleProducts(t))}loadStats_date(){this.dataSourcesState.summaryDetails="loading",this.dataSourcesState.barChartsData="loading",this.machineStatsService.getMachineDetails(this.machineId,this.dateFrom,this.dateTo).subscribe(e=>{this.setDetails(e),this.dataSourcesState.summaryDetails="loaded"},e=>{this.dialog.error(e),this.isLoading=void 0,this.dataSourcesState.summaryDetails="error"}),this.machineStatsService.getMachineActivities(this.machineId,this.dateFrom,this.dateTo).subscribe(e=>this.setActivities(e)),this.machineStatsService.getMachineSaleHours(this.machineId,this.dateFrom,this.dateTo).subscribe(e=>this.setSaleHours(e)),this.machineStatsService.getMachineSaleProducts(this.machineId,this.dateFrom,this.dateTo).subscribe(e=>this.setSaleProducts(e))}setInfo(e){this.machineInfo=e.machineInfo}setDetails(e){this.statsDetails=e.machineDetail,this.statsDetails.totalSales=this.statsDetails.totalSales/Math.pow(10,this.merchant.decimalPlaces),this.statsDetails.totalRevenues=this.statsDetails.totalRevenues/Math.pow(10,this.merchant.decimalPlaces)}setFullDetails(e){this.statsFullDetails=e.machineDetail,this.statsFullDetails.totalSales=this.statsFullDetails.totalSales/Math.pow(10,this.merchant.decimalPlaces),this.statsFullDetails.totalRevenues=this.statsFullDetails.totalRevenues/Math.pow(10,this.merchant.decimalPlaces)}setActivities(e){this.dataSourcesState.barChartsData="loading";const t=[],a=[],r=[],n=[],d=[],c=[],m=[],v=[],p=e.statistics;for(const l=new Date(this.dateFrom.getTime());l<=this.dateTo;l.setDate(l.getDate()+1))r.push(S(l).format("DD-MM-YYYY")),n.push(0),t.push(S(l).format("DD-MM-YYYY")),a.push(0),d.push(S(l).format("DD-MM-YYYY")),c.push(0),m.push(S(l).format("DD-MM-YYYY")),v.push(0);if(0!==p.length)for(let l=0;l<p.length;l++)for(let f=0;f<p[l].entries.length;f++)if(1===p[l].entries[f].entryType){const b=t.indexOf(S(p[l].date).format("DD-MM-YYYY"));a[b]=p[l].entries[f].amount/Math.pow(10,this.merchant.decimalPlaces),c[b]=p[l].entries[f].entryNumber}else if(2===p[l].entries[f].entryType){const b=r.indexOf(S(p[l].date).format("DD-MM-YYYY"));n[b]=p[l].entries[f].amount/Math.pow(10,this.merchant.decimalPlaces),v[b]=p[l].entries[f].entryNumber}this.numberOfSalesData={labels:d,datasets:[{data:c,backgroundColor:"#fcab11",borderColor:"#fcab11",showPoint:!1,radius:0}]},this.numberOfRechargesData={labels:m,datasets:[{data:v,backgroundColor:"#fcab11",borderColor:"#fcab11",showPoint:!1,radius:0}]},this.revenuesData={labels:r,datasets:[{data:n,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]},this.salesData={labels:t,datasets:[{data:a,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]},this.dataSourcesState.barChartsData="loaded"}setSaleHours(e){this.dataSourcesState.barChartsData="loading";const t=[],a=[],r=e.purchases;if(0===r.length)t.push("0"),t.push("0"),a.push(0),a.push(0);else for(let n=0;n<r.length;n++)t.push(r[n].hour.toString()),a.push(r[n].total);this.purchasesByHourData={labels:t,datasets:[{data:a,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]},this.dataSourcesState.barChartsData="loaded"}setSaleProducts(e){const t=[],a=[],r=e.productLineStats;if(0===r.length)t.push("0"),t.push("0"),a.push(0),a.push(0);else for(let n=0;n<r.length;n++)t.push(r[n].itemDescription?r[n].itemDescription:r[n].itemCode),a.push(r[n].total);this.purchasesByProductLineData={labels:t,datasets:[{data:a,backgroundColor:"#3ab54b",borderColor:"#3ab54b",showPoint:!1,radius:0}]}}static{this.ctorParameters=()=>[{type:O},{type:_.nX},{type:R.c$},{type:M.j},{type:I.o}]}static{this.propDecorators={machineId:[{type:o.pde}]}}};we=(0,h.Cg)([(0,o.uAl)({selector:"master-machine-stats",template:'\x3c!-- <spinner *ngIf="isLoading === true" class="page-spinner"></spinner> --\x3e\r\n\r\n\x3c!-- Informazioni --\x3e\r\n<load-guard [dataSourceState]="dataSourcesState.summary">\r\n <div\r\n *ngIf="statsFullDetails || statsDetails || machineInfo"\r\n load-guarded-template\r\n style="margin-top: 0.5rem"\r\n >\r\n <div class="row" *ngIf="isLoading === false">\r\n <div class="col-md-6">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-1 icon">\r\n <i class="i-machine"></i>\r\n </div>\r\n <div class="col-md-11">\r\n <div class="row">\r\n <div class="col-md-12" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Machines.Common.Machine" | translate }} S/N:\r\n <strong> {{ machineInfo.serialNumber }}</strong>\r\n </div>\r\n </div>\r\n <div class="col-md-12">\r\n <div class="value">\r\n {{ "Machines.Common.Locality" | translate }}:\r\n <strong> {{ machineInfo.locality }}</strong>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">{{ "Stats.TotalSales" | translate }}</div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">\r\n {{ statsFullDetails.totalSales\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">{{ "Stats.TotalRevenues" | translate }}</div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">\r\n {{ statsFullDetails.totalRevenues\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n\r\n <div class="row" *ngIf="isLoading === false">\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Stats.RegisteredUsers" | translate }}\r\n </div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">{{ machineInfo.registeredUsers }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">{{ "Stats.ActiveUsers" | translate }}</div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">{{ machineInfo.activeUsers }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Stats.TotalNumberOfSales" | translate }}\r\n </div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">{{ statsFullDetails.countSales }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-3">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="value">\r\n {{ "Stats.TotalNumberOfRecharges" | translate }}\r\n </div>\r\n </div>\r\n <div class="col-md-12 text-center" style="margin-bottom: 15px">\r\n <div class="big-value">\r\n {{ statsFullDetails.countRecharges }}\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n </div>\r\n</load-guard>\r\n\r\n<load-guard [dataSourceState]="dataSourcesState.summaryDetails">\r\n <div\r\n *ngIf="statsFullDetails || statsDetails || machineInfo"\r\n load-guarded-template\r\n >\r\n <div class="row">\r\n <div class="col-md-6">\r\n <mat-card style="height: 80%">\r\n <mat-card-title>{{ "Stats.Filters" | translate }}</mat-card-title>\r\n <mat-card-content>\r\n <label>\r\n {{ "Stats.From" | translate }}\r\n </label>\r\n <div class="input-group date">\r\n <div class="input-group-prepend">
1\r\n <span class="input-group-text" (click)="dpFrom.toggle()">\r\n <i class="ion-android-calendar"></i>\r\n </span>\r\n </div>\r\n <input\r\n type="text"\r\n name="dateFrom"\r\n class="form-control m-input m-input--solid"\r\n [maxDate]="dateFromMaxDate"\r\n [minDate]="dateFromMinDate"\r\n #dpFrom="bsDatepicker"\r\n [bsConfig]="{ dateInputFormat: \'DD-MM-YYYY\' }"\r\n bsDatepicker\r\n [(ngModel)]="dateFrom"\r\n />\r\n </div>\r\n <br />\r\n <label>\r\n {{ "Stats.To" | translate }}\r\n </label>\r\n <div class="input-group date">\r\n <div class="input-group-prepend">\r\n <span class="input-group-text" (click)="dpTo.toggle()">\r\n <i class="ion-android-calendar"></i>\r\n </span>\r\n </div>\r\n <input\r\n type="text"\r\n name="dateTo"\r\n class="form-control m-input m-input--solid"\r\n [maxDate]="dateToMaxDate"\r\n [minDate]="dateToMinDate"\r\n #dpTo="bsDatepicker"\r\n [bsConfig]="{ dateInputFormat: \'DD-MM-YYYY\' }"\r\n bsDatepicker\r\n [(ngModel)]="dateTo"\r\n />\r\n </div>\r\n <br />\r\n <button class="btn" (click)="loadStats_date()">\r\n {{ "Stats.Filter" | translate }}\r\n </button>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" *ngIf="isLoading === false">\r\n <div class="row">\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">{{ "Stats.Sales" | translate }}</div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">\r\n {{ statsDetails.totalSales\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">{{ "Stats.Revenues" | translate }}</div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">\r\n {{ statsDetails.totalRevenues\r\n }}<span class="currency"\r\n > {{ merchant.formattedCurrency }}</span\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">\r\n {{ "Stats.NumberOfSales" | translate }}\r\n </div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">{{ statsDetails.countSales }}</div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div class="col-md-6" style="display: inline-block">\r\n <mat-card class="equal-height">\r\n <mat-card-content>\r\n <div class="row">\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="value">\r\n {{ "Stats.NumberOfRecharges" | translate }}\r\n </div>\r\n </div>\r\n <div\r\n class="col-md-12 text-center"\r\n style="margin-bottom: 15px"\r\n >\r\n <div class="big-value">\r\n {{ statsDetails.countRecharges }}\r\n </div>\r\n </div>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</load-guard>\r\n\r\n\x3c!-- Grafici --\x3e\r\n<div>\r\n <div class="row">\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <mat-card>\r\n <mat-card-title>{{ "Stats.Revenues" | translate }}</mat-card-title>\r\n <mat-card-content>\r\n <div>\r\n <canvas\r\n baseChart\r\n type="line"\r\n [data]="revenuesData"\r\n [options]="lineChartOptions"\r\n style="height: 300px"\r\n >\r\n </canvas>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <mat-card>\r\n <mat-card-title>{{ "Stats.Sales" | translate }}</mat-card-title>\r\n <mat-card-content>\r\n <div>\r\n <canvas\r\n baseChart\r\n type="line"\r\n [data]="salesData"\r\n [options]="lineChartOptions"\r\n style="height: 300px"\r\n >\r\n </canvas>\r\n </div>\r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n </div>\r\n\r\n <div class="row">\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.NumberOfRecharges\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="numberOfRechargesData"\r\n [options]="barChartOptions"\r\n style="height: 300px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n\r\n <div\r\n class="col-md-6"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol6\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.NumberOfSales\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="numberOfSalesData"\r\n [options]="barChartOptions"\r\n style="height: 300px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n </div>\r\n\r\n <div class="row">\r\n <div\r\n class="col-md-12"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol12\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.SalesByProductLine\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="purchasesByProductLineData"\r\n [options]="barChartOptions"\r\n style="height: 320px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n </div>\r\n\r\n <div class="row">\r\n <div\r\n class="col-md-12"\r\n *ngIf="\r\n dataSourcesState.barChartsData == \'loaded\';\r\n else spinnerPlaceHolderCol12\r\n "\r\n >\r\n <load-guard-card-with-header\r\n [dataSourceState]="dataSourcesState.barChartsData"\r\n [headerText]="\'Stats.SalesByHour\' | translate"\r\n >\r\n <canvas\r\n baseChart\r\n type="bar"\r\n [data]="purchasesByHourData"\r\n [options]="barChartOptions"\r\n style="height: 320px"\r\n load-guarded-template\r\n >\r\n </canvas>\r\n </load-guard-card-with-header>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #spinnerPlaceHolderCol6>\r\n <div class="col-md-6">\r\n <mat-card\r\n [nbSpinner]="true"\r\n nbSpinnerStatus="primary"\r\n class="equal-height"\r\n ></mat-card>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #spinnerPlaceHolderCol12>\r\n <div class="col-md-12">\r\n <mat-card\r\n [nbSpinner]="true"\r\n nbSpinnerStatus="primary"\r\n class="equal-height"\r\n ></mat-card>\r\n </div>\r\n</ng-template>\r\n',providers:[U.W,O],styles:[Qt()]})],we);let De=class{};De=(0,h.Cg)([(0,o.UQu)({imports:[Me.O,oe,u.FR,H.G,B.YN.forRoot(),E.tP,Wt.Ou,Xt.PO],declarations:[...rt,le,ce,de,he,me,pe,ge,ve,fe,we,be,Ce]})],De)},23217:(g,C,s)=>{var h=s(8564),u=s(98557)(h);
1u.push([g.id,"",""]),g.exports=u.toString()},78422:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"@import url(https://fonts.googleapis.com/css?family=Roboto);"]),u.push([g.id,'div.detail-title, div.detail-value span {\n font-size: 1.1rem;\n}\n\ndiv.detail-value {\n font-size: 1.6rem;\n}\n\ndiv.detail-value, div.detail-title {\n color: black;\n text-align: center;\n font-family: "Roboto";\n}',""]),g.exports=u.toString()},53392:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"",""]),g.exports=u.toString()},32037:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,".input-group-text {\n display: flex;\n align-items: center;\n height: 100%;\n}",""]),g.exports=u.toString()},80113:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"",""]),g.exports=u.toString()},53502:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"/*\n Declare variables before making them global.\n dart-sass doesn't allow to declare variable with !global.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * This mixin generates keyfames.\n * Because of all keyframes can't be scoped,\n * we need to puts unique name in each btn-pulse call.\n */\n/*\n\nAccording to the specification (https://www.w3.org/TR/css-scoping-1/#host-selector)\n:host and :host-context are pseudo-classes. So we assume they could be combined,\nlike other pseudo-classes, even same ones.\nFor example: ':nth-of-type(2n):nth-of-type(even)'.\n\nIdeal solution would be to prepend any selector with :host-context([dir=rtl]).\nThen nebular components will behave as an html element and respond to [dir] attribute on any level,\nso direction could be overridden on any component level.\n\nImplementation code:\n\n@mixin nb-rtl() {\n // add # to scss interpolation statement.\n // it works in comments and we can't use it here\n @at-root {selector-append(':host-context([dir=rtl])', &)} {\n @content;\n }\n}\n\nAnd when we call it somewhere:\n\n:host {\n .some-class {\n @include nb-rtl() {\n ...\n }\n }\n}\n:host-context(...) {\n .some-class {\n @include nb-rtl() {\n ...\n }\n }\n}\n\nResult will look like:\n\n:host-context([dir=rtl]):host .some-class {\n ...\n}\n:host-context([dir=rtl]):host-context(...) .some-class {\n ...\n}\n\n*\n Side note:\n :host-context():host selector are valid. https://lists.w3.org/Archives/Public/www-style/2015Feb/0305.html\n\n :host-context([dir=rtl]):host-context(...) should match any permutation,\n so order is not important.\n*\n\n\nCurrently, there're two problems with this approach:\n\nFirst, is that we can't combine :host, :host-context. Angular bugs #14349, #19199.\nFor the moment of writing, the only possible way is:\n:host {\n :host-context(...) {\n ...\n }\n}\nIt doesn't work for us because mixin could be called somewhere deeper, like:\n:host {\n p {\n @include nb-rtl() { ... }\n }\n}\nWe are not able to go up to :host level to place content passed to mixin.\n\nThe second problem is that we only can be sure that we appending :host-context([dir=rtl]) to another\n:host/:host-context pseudo-class when called
1in theme files (*.theme.scss).\n *\n Side note:\n Currently, nb-install-component uses another approach where :host prepended with the theme name\n (https://github.com/angular/angular/blob/5b96078624b0a4760f2dbcf6fdf0bd62791be5bb/packages/compiler/src/shadow_css.ts#L441),\n but it was made to be able to use current realization of rtl and it can be rewritten back to\n :host-context($theme) once we will be able to use multiple shadow selectors.\n *\nBut when it's called in *.component.scss we can't be sure, that selector starts with :host/:host-context,\nbecause angular allows omitting pseudo-classes if we don't need to style :host component itself.\nWe can break such selectors, by just appending :host-context([dir=rtl]) to them.\n ***\n Possible solution\n check if we in theme by some theme variables and if so append, otherwise nest like\n @at-root :host-context([dir=rtl]) {\n // add # to scss interpolation statement.\n // it works in comments and we can't use it here\n {&} {\n @content;\n }\n }\n What if :host specified? Can we add space in :host-context(...) :host?\n Or maybe add :host selector anyway? If multiple :host selectors are allowed\n ***\n\n\nProblems with the current approach.\n\n1. Direction can be applied only on document level, because mixin prepends theme class,\nwhich placed on the body.\n2. *.component.scss styles should be in :host selector. Otherwise angular will add host\nattribute to [dir=rtl] attribute as well.\n\n\nGeneral problems.\n\nLtr is default document direction, but for proper work of nb-ltr (means ltr only),\n[dir=ltr] should be specified at least somewhere. ':not([dir=rtl]' not applicable here,\nbecause it's satisfy any parent, that don't have [dir=rtl] attribute.\nPrevious approach was to use single rtl mixin and reset ltr properties to initial value.\nBut sometimes it's hard to find, what the previous value should be. And such mixin call looks too verbose.\n*/\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/*\n Declare variables before making them global.\n dart-sass doesn't allow to declare variable with !global.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * Sass map contains a list of all Theme variables and also their mappings into Component variables\n * A theme consists of a list of colors, backgrounds, borders, text styles and supporting variables.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/*!\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\nmat-card {\n width: 100%;\n}\nmat-card .icon {\n text-align: left;\n}\nmat-card .icon i {\n display: inline-block;\n vertical-align: top;\n background-size: contain;\n height: 40px;\n width: 100%;\n background-position-x: left;\n background-position-y: top;\n background-repeat: no-repeat;\n}\nmat-card .i-machine {\n background: url('03_machines.e0c78f87b308b9b5.svg');\n}\nmat-card .comparison {\n padding-left: 1rem;\n padding-right: 1rem;\n margin-bottom: 20px;\n max-width: 170px;\n}\nmat-card .pie-chart {\n padding: 50px;\n}\nmat-card .pie-chart.center {\n text-align: center;\n}\nmat-card .doughnut {\n height: 150px;\n}\nmat-card .doughnut-label {\n position: relative;\n top: 85px;\n width: 100%;\n text-align: center;\n}\nmat-card .label {\n font-size: 1.1rem;\n color: black !important;\n}\nmat-card .value {\n font-size: 1.1rem;\n color: black !important;\n}
1\nmat-card .big-value {\n font-size: 1.6rem;\n color: black !important;\n}\nmat-card .currency {\n font-size: 1.1rem;\n font-weight: 500;\n}\n\n.equal-height {\n height: 143px !important;\n}\n\n@media only screen and (max-width: 1367px) {\n .details {\n font-size: 0.7rem;\n }\n .label {\n font-size: 0.7rem;\n }\n .value {\n font-size: 1rem;\n }\n}\n.input-group-text {\n display: flex;\n align-items: center;\n height: 100%;\n}",""]),g.exports=u.toString()},57451:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"",""]),g.exports=u.toString()},52432:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"/*\n Declare variables before making them global.\n dart-sass doesn't allow to declare variable with !global.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * This mixin generates keyfames.\n * Because of all keyframes can't be scoped,\n * we need to puts unique name in each btn-pulse call.\n */\n/*\n\nAccording to the specification (https://www.w3.org/TR/css-scoping-1/#host-selector)\n:host and :host-context are pseudo-classes. So we assume they could be combined,\nlike other pseudo-classes, even same ones.\nFor example: ':nth-of-type(2n):nth-of-type(even)'.\n\nIdeal solution would be to prepend any selector with :host-context([dir=rtl]).\nThen nebular components will behave as an html element and respond to [dir] attribute on any level,\nso direction could be overridden on any component level.\n\nImplementation code:\n\n@mixin nb-rtl() {\n // add # to scss interpolation statement.\n // it works in comments and we can't use it here\n @at-root {selector-append(':host-context([dir=rtl])', &)} {\n @content;\n }\n}\n\nAnd when we call it somewhere:\n\n:host {\n .some-class {\n @include nb-rtl() {\n ...\n }\n }\n}\n:host-context(...) {\n .some-class {\n @include nb-rtl() {\n ...\n }\n }\n}\n\nResult will look like:\n\n:host-context([dir=rtl]):host .some-class {\n ...\n}\n:host-context([dir=rtl]):host-context(...) .some-class {\n ...\n}\n\n*\n Side note:\n :host-context():host selector are valid. https://lists.w3.org/Archives/Public/www-style/2015Feb/0305.html\n\n :host-context([dir=rtl]):host-context(...) should match any permutation,\n so order is not important.\n*\n\n\nCurrently, there're two problems with this approach:\n\nFirst, is that we can't combine :host, :host-context. Angular bugs #14349, #19199.\nFor the moment of writing, the only possible way is:\n:host {\n :host-context(...) {\n ...\n }\n}\nIt doesn't work for us because mixin could be called somewhere deeper, like:\n:host {\n p {\n @include nb-rtl() { ... }\n }\n}\nWe are not able to go up to :host level to place content passed to mixin.\n\nThe second problem is that we only can be sure that we appending :host-context([dir=rtl]) to another\n:host/:host-context pseudo-class when called
1in theme files (*.theme.scss).\n *\n Side note:\n Currently, nb-install-component uses another approach where :host prepended with the theme name\n (https://github.com/angular/angular/blob/5b96078624b0a4760f2dbcf6fdf0bd62791be5bb/packages/compiler/src/shadow_css.ts#L441),\n but it was made to be able to use current realization of rtl and it can be rewritten back to\n :host-context($theme) once we will be able to use multiple shadow selectors.\n *\nBut when it's called in *.component.scss we can't be sure, that selector starts with :host/:host-context,\nbecause angular allows omitting pseudo-classes if we don't need to style :host component itself.\nWe can break such selectors, by just appending :host-context([dir=rtl]) to them.\n ***\n Possible solution\n check if we in theme by some theme variables and if so append, otherwise nest like\n @at-root :host-context([dir=rtl]) {\n // add # to scss interpolation statement.\n // it works in comments and we can't use it here\n {&} {\n @content;\n }\n }\n What if :host specified? Can we add space in :host-context(...) :host?\n Or maybe add :host selector anyway? If multiple :host selectors are allowed\n ***\n\n\nProblems with the current approach.\n\n1. Direction can be applied only on document level, because mixin prepends theme class,\nwhich placed on the body.\n2. *.component.scss styles should be in :host selector. Otherwise angular will add host\nattribute to [dir=rtl] attribute as well.\n\n\nGeneral problems.\n\nLtr is default document direction, but for proper work of nb-ltr (means ltr only),\n[dir=ltr] should be specified at least somewhere. ':not([dir=rtl]' not applicable here,\nbecause it's satisfy any parent, that don't have [dir=rtl] attribute.\nPrevious approach was to use single rtl mixin and reset ltr properties to initial value.\nBut sometimes it's hard to find, what the previous value should be. And such mixin call looks too verbose.\n*/\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/*\n Declare variables before making them global.\n dart-sass doesn't allow to declare variable with !global.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * Sass map contains a list of all Theme variables and also their mappings into Component variables\n * A theme consists of a list of colors, backgrounds, borders, text styles and supporting variables.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/*!\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\nmat-card {\n width: 100%;\n}\nmat-card .icon {\n text-align: left;\n}\nmat-card .icon i {\n display: inline-block;\n vertical-align: top;\n background-size: contain;\n height: 40px;\n width: 100%;\n background-position-x: left;\n background-position-y: top;\n background-repeat: no-repeat;\n}\nmat-card .i-machine {\n background: url('03_machines.e0c78f87b308b9b5.svg');\n}\nmat-card .comparison {\n padding-left: 1rem;\n padding-right: 1rem;\n margin-bottom: 20px;\n max-width: 170px;\n}\nmat-card .pie-chart {\n padding: 50px;\n}\nmat-card .pie-chart.center {\n text-align: center;\n}\nmat-card .doughnut {\n height: 150px;\n}\nmat-card .doughnut-label {\n position: relative;\n top: 85px;\n width: 100%;\n text-align: center;\n}\nmat-card .label {\n font-size: 1.1rem;\n color: black !important;\n}\nmat-card .value {\n font-size: 1.1rem;\n color: black !important;\n}
1\nmat-card .big-value {\n font-size: 1.6rem;\n color: black !important;\n}\nmat-card .currency {\n font-size: 1.6rem;\n color: black !important;\n}\n\n.equal-height {\n height: 143px !important;\n}\n\n@media only screen and (max-width: 1367px) {\n .details {\n font-size: 0.7rem;\n }\n .label {\n font-size: 0.7rem;\n }\n .value {\n font-size: 1rem;\n }\n}\n.input-group-text {\n display: flex;\n align-items: center;\n height: 100%;\n}",""]),g.exports=u.toString()},9463:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,".first-tab {\n background-color: rgb(237, 241, 247);\n}",""]),g.exports=u.toString()},17852:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"div.detail-title {\n font-size: 1.1rem;\n color: black !important;\n}\n\ndiv.detail-value {\n font-size: 1.6rem;\n color: black !important;\n}\n\ndiv.detail-value, div.detail-title {\n text-align: center;\n}\n\nnb-card#spinner-card {\n height: 50px;\n}",""]),g.exports=u.toString()},55448:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,".bar-chart {\n height: 400px;\n}
1\n\n.pie-chart {\n width: 150px;\n height: 150px;\n}",""]),g.exports=u.toString()},63278:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"",""]),g.exports=u.toString()},99622:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"/*\n Declare variables before making them global.\n dart-sass doesn't allow to declare variable with !global.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * This mixin generates keyfames.\n * Because of all keyframes can't be scoped,\n * we need to puts unique name in each btn-pulse call.\n */\n/*\n\nAccording to the specification (https://www.w3.org/TR/css-scoping-1/#host-selector)\n:host and :host-context are pseudo-classes. So we assume they could be combined,\nlike other pseudo-classes, even same ones.\nFor example: ':nth-of-type(2n):nth-of-type(even)'.\n\nIdeal solution would be to prepend any selector with :host-context([dir=rtl]).\nThen nebular components will behave as an html element and respond to [dir] attribute on any level,\nso direction could be overridden on any component level.\n\nImplementation code:\n\n@mixin nb-rtl() {\n // add # to scss interpolation statement.\n // it works in comments and we can't use it here\n @at-root {selector-append(':host-context([dir=rtl])', &)} {\n @content;\n }\n}\n\nAnd when we call it somewhere:\n\n:host {\n .some-class {\n @include nb-rtl() {\n ...\n }\n }\n}\n:host-context(...) {\n .some-class {\n @include nb-rtl() {\n ...\n }\n }\n}\n\nResult will look like:\n\n:host-context([dir=rtl]):host .some-class {\n ...\n}\n:host-context([dir=rtl]):host-context(...) .some-class {\n ...\n}\n\n*\n Side note:\n :host-context():host selector are valid. https://lists.w3.org/Archives/Public/www-style/2015Feb/0305.html\n\n :host-context([dir=rtl]):host-context(...) should match any permutation,\n so order is not important.\n*\n\n\nCurrently, there're two problems with this approach:\n\nFirst, is that we can't combine :host, :host-context. Angular bugs #14349, #19199.\nFor the moment of writing, the only possible way is:\n:host {\n :host-context(...) {\n ...\n }\n}\nIt doesn't work for us because mixin could be called somewhere deeper, like:\n:host {\n p {\n @include nb-rtl() { ... }\n }\n}\nWe are not able to go up to :host level to place content passed to mixin.\n\nThe second problem is that we only can be sure that we appending :host-context([dir=rtl]) to another\n:host/:host-context pseudo-class when called in theme files (*.theme.scss).\n *\n Side note:\n Currently, nb-install-component uses another approach where :host prepended with the theme name\n (https://github.com/angular/angular/blob/5b96078624b0a4760f2dbcf6fdf0bd62791be5bb/packages/compiler/src/shadow_css.ts#L441),\n but it was made to be able to use current realization of rtl and it can be rewritten back to\n :host-context($theme) once we will be able to use multiple shadow selectors.\n *\nBut when it's called
1in *.component.scss we can't be sure, that selector starts with :host/:host-context,\nbecause angular allows omitting pseudo-classes if we don't need to style :host component itself.\nWe can break such selectors, by just appending :host-context([dir=rtl]) to them.\n ***\n Possible solution\n check if we in theme by some theme variables and if so append, otherwise nest like\n @at-root :host-context([dir=rtl]) {\n // add # to scss interpolation statement.\n // it works in comments and we can't use it here\n {&} {\n @content;\n }\n }\n What if :host specified? Can we add space in :host-context(...) :host?\n Or maybe add :host selector anyway? If multiple :host selectors are allowed\n ***\n\n\nProblems with the current approach.\n\n1. Direction can be applied only on document level, because mixin prepends theme class,\nwhich placed on the body.\n2. *.component.scss styles should be in :host selector. Otherwise angular will add host\nattribute to [dir=rtl] attribute as well.\n\n\nGeneral problems.\n\nLtr is default document direction, but for proper work of nb-ltr (means ltr only),\n[dir=ltr] should be specified at least somewhere. ':not([dir=rtl]' not applicable here,\nbecause it's satisfy any parent, that don't have [dir=rtl] attribute.\nPrevious approach was to use single rtl mixin and reset ltr properties to initial value.\nBut sometimes it's hard to find, what the previous value should be. And such mixin call looks too verbose.\n*/\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/*\n Declare variables before making them global.\n dart-sass doesn't allow to declare variable with !global.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * Sass map contains a list of all Theme variables and also their mappings into Component variables\n * A theme consists of a list of colors, backgrounds, borders, text styles and supporting variables.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/*!\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\nmat-card {\n width: 100%;\n}\nmat-card .icon {\n text-align: left;\n}\nmat-card .icon i {\n display: inline-block;\n vertical-align: top;\n background-size: contain;\n height: 40px;\n width: 100%;\n background-position-x: left;\n background-position-y: top;\n background-repeat: no-repeat;\n}\nmat-card .i-machine {\n background: url('03_machines.e0c78f87b308b9b5.svg');\n}\nmat-card .comparison {\n padding-left: 1rem;\n padding-right: 1rem;\n margin-bottom: 20px;\n max-width: 170px;\n}\nmat-card .pie-chart {\n padding: 50px;\n}\nmat-card .pie-chart.center {\n text-align: center;\n}\nmat-card .doughnut {\n height: 150px;\n}\nmat-card .doughnut-label {\n position: relative;\n top: 85px;\n width: 100%;\n text-align: center;\n}\nmat-card .label {\n font-size: 1.1rem;\n color: black !important;\n}\nmat-card .value {\n font-size: 1.1rem;\n color: black !important;\n}
1\nmat-card .big-value {\n font-size: 1.6rem;\n color: black !important;\n}\nmat-card .currency {\n font-size: 1.6rem;\n color: black !important;\n}\n\n.equal-height {\n height: 143px !important;\n}\n\n@media only screen and (max-width: 1367px) {\n .details {\n font-size: 0.7rem;\n }\n .label {\n font-size: 0.7rem;\n }\n .value {\n font-size: 1rem;\n }\n}\n.input-group-text {\n display: flex;\n align-items: center;\n height: 100%;\n}",""]),g.exports=u.toString()},94211:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,'@charset "UTF-8";\n.deleted-row {\n color: #2196f3;\n /* Cambia il colore in blu */\n}\n\n/* Spinner per ordinamento dati */\n.sort-btn {\n border: 1px solid #000;\n background: #fff;\n cursor: pointer;\n margin-left: 6px;\n padding: 0;\n width: 18px;\n height: 18px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.sort-btn mat-icon {\n font-size: 12px;\n width: 12px;\n height: 12px;\n line-height: 12px;\n}\n\n/* Commento informativo che \xe8 nascosto di default */\n.InfoCellComment {\n font-size: x-small;\n font-weight: normal;\n font-family: "Open Sans";\n display: none;\n position: absolute;\n z-index: 100;\n border: 1px;\n background-color: #ff5000;\n border-radius: 3px 3px 3px 3px;\n padding: 3px;\n color: white;\n width: 100px;\n}\n\n/* Quando si passa il mouse sopra la cella, mostra il commento */\n.mat-column-machineGroupName:hover span.InfoCellComment {\n display: block;\n}\n\n.mat-header-cell,\n.mat-cell {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 150px;\n}\n\n.mat-datepicker-toggle-default-icon {\n width: 16px !important;\n height: 16px !important;\n}\n\n.mat-datepicker-toggle {\n font-size: 16px !important;\n}\n\n.mat-header-cell {\n white-space: normal !important;\n word-break: break-word;\n line-height: 1.2em;\n padding: 4px 8px;\n}\n\n.table-card {\n overflow-x: auto;\n width: 100%;\n}\n\nmat-card-title {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 10px;\n}\n\n.filter-input {\n width: 100%;\n max-width: 120px;\n font-size: 12px;\n padding: 2px 6px;\n}',""]),g.exports=u.toString()},44318:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"/*\n Declare variables before making them global.\n dart-sass doesn't allow to declare variable with !global.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * This mixin generates keyfames.\n * Because of all keyframes can't be scoped,\n * we need to puts unique name in each btn-pulse call.\n */\n/*\n\nAccording to the specification (https://www.w3.org/TR/css-scoping-1/#host-selector)\n:host and :host-context are pseudo-classe
1s. So we assume they could be combined,\nlike other pseudo-classes, even same ones.\nFor example: ':nth-of-type(2n):nth-of-type(even)'.\n\nIdeal solution would be to prepend any selector with :host-context([dir=rtl]).\nThen nebular components will behave as an html element and respond to [dir] attribute on any level,\nso direction could be overridden on any component level.\n\nImplementation code:\n\n@mixin nb-rtl() {\n // add # to scss interpolation statement.\n // it works in comments and we can't use it here\n @at-root {selector-append(':host-context([dir=rtl])', &)} {\n @content;\n }\n}\n\nAnd when we call it somewhere:\n\n:host {\n .some-class {\n @include nb-rtl() {\n ...\n }\n }\n}\n:host-context(...) {\n .some-class {\n @include nb-rtl() {\n ...\n }\n }\n}\n\nResult will look like:\n\n:host-context([dir=rtl]):host .some-class {\n ...\n}\n:host-context([dir=rtl]):host-context(...) .some-class {\n ...\n}\n\n*\n Side note:\n :host-context():host selector are valid. https://lists.w3.org/Archives/Public/www-style/2015Feb/0305.html\n\n :host-context([dir=rtl]):host-context(...) should match any permutation,\n so order is not important.\n*\n\n\nCurrently, there're two problems with this approach:\n\nFirst, is that we can't combine :host, :host-context. Angular bugs #14349, #19199.\nFor the moment of writing, the only possible way is:\n:host {\n :host-context(...) {\n ...\n }\n}\nIt doesn't work for us because mixin could be called somewhere deeper, like:\n:host {\n p {\n @include nb-rtl() { ... }\n }\n}\nWe are not able to go up to :host level to place content passed to mixin.\n\nThe second problem is that we only can be sure that we appending :host-context([dir=rtl]) to another\n:host/:host-context pseudo-class when called in theme files (*.theme.scss).\n *\n Side note:\n Currently, nb-install-component uses another approach where :host prepended with the theme name\n (https://github.com/angular/angular/blob/5b96078624b0a4760f2dbcf6fdf0bd62791be5bb/packages/compiler/src/shadow_css.ts#L441),\n but it was made to be able to use current realization of rtl and it can be rewritten back to\n :host-context($theme) once we will be able to use multiple shadow selectors.\n *\nBut when it's called in *.component.scss we can't be sure, that selector starts with :host/:host-context,\nbecause angular allows omitting pseudo-classes if we don't need to style :host component itself.\nWe can break such selectors, by just appending :host-context([dir=rtl]) to them.\n ***\n Possible solution\n check if we in theme by some theme variables and if so append, otherwise nest like\n @at-root :host-context([dir=rtl]) {\n // add # to scss interpolation statement.\n // it works in comments and we can't use it here\n {&} {\n @content;\n }\n }\n What if :host specified? Can we add space in :host-context(...) :host?\n Or maybe add :host selector anyway? If multiple :host selectors are allowed\n ***\n\n\nProblems with the current approach.\n\n1. Direction can be applied only on document level, because mixin prepends theme class,\nwhich placed on the body.\n2. *.component.scss styles should be in :host selector. Otherwise angular will add host\nattribute to [dir=rtl] attribute as well.\n\n\nGeneral problems.\n\nLtr is default document direction, but for proper work of nb-ltr (means ltr only),\n[dir=ltr] should be specified at least somewhere. ':not([dir=rtl]' not applicable here,\nbecause it's satisfy any parent, that don't have [dir=rtl] attribute.\nPrevious approach was to use single rtl mixin and reset ltr properties to initial value.\nBut sometimes it's hard to find, what the previous value should be. And such mixin call looks too verbose.\n*/\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/*\n Declare variables before making them global.\n dart-sass doesn't allow to declare variable with !global.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * Sass map contains a list of all Theme variables and also their mappings into Component variables\n * A theme consists of a list of colors, backgrounds, borders, text styles and supporting variables.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/**\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\n/*!\n * @license\n * Copyright Akveo. All Rights Reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n */\nmat-card {\n width: 100%;\n text-align: left;\n}\nmat-card .icon {\n text-align: left;\n}\nmat-card .icon i {\n display: inline-block;\n vertical-align: top;\n background-size: contain;\n height: 40px;\n width: 100%;\n background-position-x: left;\n background-position-y: top;\n background-repeat: no-repeat;\n}\nmat-card .i-user {\n background: url('04_users.ef34a7c32f9b11f7.svg');\n stroke-width: 20 !important;\n}\nmat-card .i-wallet {\n background: url('08_recharges.4d4d431e81e00625.svg');\n}\nmat-card .i-machine {\n background: url('03_machines.e0c78f87b308b9b5.svg');\n}\nmat-card .i-device {\n background: url('phone.e7f62332f21c8eba.svg');\n}\nmat-card mat-icon {\n background-size: contain;\n vertical-align: middle;\n height: 48px;\n width: 48px;\n background-position-y: top;\n background-repeat: no-repeat;\n float: left;\n transform: scale(0.5);\n}\nmat-card .comparison {\n padding-left: 1rem;\n padding-right: 1rem;\n margin-bottom: 20px;\n max-width: 170px;\n}\nmat-card .pie-chart {\n padding: 50px;\n}\nmat-card .pie {\n height: 300px;\n}\nmat-card .pie-chart.center {\n text-align: center;\n}\nmat-card .doughnut {\n display: block;\n width: 180px !important;\n height: 120px !important;\n max-width: none !important;\n margin: 0 auto 3rem auto;\n transform: scaleY(1.3);\n}\nmat-card .doughnut-label {\n position: relative;\n top: 85px;\n width: 100%;\n text-align: center;\n}\nmat-card .label {\n font-size: 1.1rem;\n color: black !important;\n}\nmat-card .value {\n font-size: 1.6rem;\n color: black !important;\n}\nmat-card .currency {\n font-size: 1.6rem;\n color: black !important;\n}\n\n.equal-height {\n height: 150px !important;\n}\n\ncanvas {\n display: block;\n height: 300px !important;\n width: 100% !important;\n}\n\n@media only screen and (max-width: 1367px) {\n .details {\n font-size: 0.7rem;\n }\n .label {\n font-size: 0.7rem;\n }\n .value {\n font-size: 1rem;\n }\n}
1",""]),g.exports=u.toString()},35796:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"",""]),g.exports=u.toString()},82850:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"",""]),g.exports=u.toString()},8075:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,".first-tab {\n background-color: rgb(237, 241, 247);\n}",""]),g.exports=u.toString()},892:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,'div.detail-title, div.detail-value span {\n font-size: 1.1rem;\n}\n\ndiv.detail-value {\n font-size: 1.6rem;\n}\n\ndiv.detail-value, div.detail-title {\n color: black;\n text-align: center;\n font-family: "Roboto";\n}\n\nnb-card#spinner-card {\n height: 50%;\n}',""]),g.exports=u.toString()},41114:(g,C,s)=>{var h=s(8564),u=s(98557)(h);u.push([g.id,"chart.small-chart {\n height: 220px;\n}\n\nchart.medium-chart {\n height: 440px;\n}\n\nchart.large-chart {\n height: 600px;\n}",""]),g.exports=u.toString()}}]);
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.