@tuki-io/tuki-widgets 0.0.63 → 0.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/di2mt/README.md +42 -0
  2. package/di2mt/api/api.endpoints.d.ts +20 -0
  3. package/di2mt/index.d.ts +5 -0
  4. package/di2mt/public-api.d.ts +15 -0
  5. package/di2mt/shared/components/card/card.component.d.ts +6 -0
  6. package/di2mt/shared/components/chart-card/chart-card.component.d.ts +22 -0
  7. package/di2mt/shared/components/index.d.ts +6 -0
  8. package/di2mt/shared/components/stat-card/stat-card.component.d.ts +14 -0
  9. package/di2mt/shared/components/status-list-card/status-list-card.component.d.ts +7 -0
  10. package/di2mt/shared/components/summary-card/summary-card.component.d.ts +9 -0
  11. package/di2mt/shared/components/table-filters/table-filters.component.d.ts +14 -0
  12. package/di2mt/shared/material.module.d.ts +15 -0
  13. package/di2mt/shared/services/api.service.d.ts +20 -0
  14. package/di2mt/shared/shared.module.d.ts +16 -0
  15. package/di2mt/shared/types/constants.d.ts +7 -0
  16. package/di2mt/shared/types/data-table.d.ts +5 -0
  17. package/di2mt/shared/types/table/filter.d.ts +16 -0
  18. package/di2mt/widgets/site-upgrade/site-upgrade-data-table/site-upgrade-data-table.component.d.ts +47 -0
  19. package/di2mt/widgets/site-upgrade/site-upgrade.module.d.ts +12 -0
  20. package/di2mt/widgets/site-upgrade/site-upgrade.service.d.ts +12 -0
  21. package/di2mt/widgets/site-upgrade/types/user-upgrade.d.ts +14 -0
  22. package/di2mt/widgets/upgrade-overview/cards/already-upgraded-sites/already-upgraded-sites-card.component.d.ts +18 -0
  23. package/di2mt/widgets/upgrade-overview/cards/already-upgraded-users/already-upgraded-users-card.component.d.ts +18 -0
  24. package/di2mt/widgets/upgrade-overview/cards/preconditions-status-list/preconditions-status-list-card.component.d.ts +17 -0
  25. package/di2mt/widgets/upgrade-overview/cards/ready-to-upgrade-sites/ready-to-upgrade-sites-card.component.d.ts +18 -0
  26. package/di2mt/widgets/upgrade-overview/cards/ready-to-upgrade-users/ready-to-upgrade-users-card.component.d.ts +18 -0
  27. package/di2mt/widgets/upgrade-overview/cards/site-infrastructure-status-list/site-infrastructure-status-list-card.component.d.ts +14 -0
  28. package/di2mt/widgets/upgrade-overview/cards/upgrade-state-comparison-chart/upgrade-state-comparison-chart-card.component.d.ts +17 -0
  29. package/di2mt/widgets/upgrade-overview/types/upgrade-overview.d.ts +56 -0
  30. package/di2mt/widgets/upgrade-overview/upgrade-overview.module.d.ts +15 -0
  31. package/di2mt/widgets/upgrade-overview/upgrade-overview.service.d.ts +17 -0
  32. package/di2mt/widgets/user-upgrade/types/user-upgrade.d.ts +16 -0
  33. package/di2mt/widgets/user-upgrade/user-upgrade-data-table/user-upgrade-data-table.component.d.ts +48 -0
  34. package/di2mt/widgets/user-upgrade/user-upgrade.module.d.ts +12 -0
  35. package/di2mt/widgets/user-upgrade/user-upgrade.service.d.ts +14 -0
  36. package/esm2020/di2mt/api/api.endpoints.mjs +21 -0
  37. package/esm2020/di2mt/public-api.mjs +23 -0
  38. package/esm2020/di2mt/shared/components/card/card.component.mjs +13 -0
  39. package/esm2020/di2mt/shared/components/chart-card/chart-card.component.mjs +62 -0
  40. package/esm2020/di2mt/shared/components/index.mjs +7 -0
  41. package/esm2020/di2mt/shared/components/stat-card/stat-card.component.mjs +47 -0
  42. package/esm2020/di2mt/shared/components/status-list-card/status-list-card.component.mjs +17 -0
  43. package/esm2020/di2mt/shared/components/summary-card/summary-card.component.mjs +36 -0
  44. package/esm2020/di2mt/shared/components/table-filters/table-filters.component.mjs +37 -0
  45. package/esm2020/di2mt/shared/material.module.mjs +76 -0
  46. package/esm2020/di2mt/shared/services/api.service.mjs +86 -0
  47. package/esm2020/di2mt/shared/shared.module.mjs +61 -0
  48. package/esm2020/di2mt/shared/types/constants.mjs +12 -0
  49. package/esm2020/di2mt/shared/types/data-table.mjs +2 -0
  50. package/esm2020/di2mt/shared/types/table/filter.mjs +2 -0
  51. package/esm2020/di2mt/tuki-io-tuki-widgets-di2mt.mjs +5 -0
  52. package/esm2020/di2mt/widgets/site-upgrade/site-upgrade-data-table/site-upgrade-data-table.component.mjs +179 -0
  53. package/esm2020/di2mt/widgets/site-upgrade/site-upgrade.module.mjs +40 -0
  54. package/esm2020/di2mt/widgets/site-upgrade/site-upgrade.service.mjs +43 -0
  55. package/esm2020/di2mt/widgets/site-upgrade/types/user-upgrade.mjs +3 -0
  56. package/esm2020/di2mt/widgets/upgrade-overview/cards/already-upgraded-sites/already-upgraded-sites-card.component.mjs +61 -0
  57. package/esm2020/di2mt/widgets/upgrade-overview/cards/already-upgraded-users/already-upgraded-users-card.component.mjs +61 -0
  58. package/esm2020/di2mt/widgets/upgrade-overview/cards/preconditions-status-list/preconditions-status-list-card.component.mjs +65 -0
  59. package/esm2020/di2mt/widgets/upgrade-overview/cards/ready-to-upgrade-sites/ready-to-upgrade-sites-card.component.mjs +42 -0
  60. package/esm2020/di2mt/widgets/upgrade-overview/cards/ready-to-upgrade-users/ready-to-upgrade-users-card.component.mjs +42 -0
  61. package/esm2020/di2mt/widgets/upgrade-overview/cards/site-infrastructure-status-list/site-infrastructure-status-list-card.component.mjs +61 -0
  62. package/esm2020/di2mt/widgets/upgrade-overview/cards/upgrade-state-comparison-chart/upgrade-state-comparison-chart-card.component.mjs +71 -0
  63. package/esm2020/di2mt/widgets/upgrade-overview/types/upgrade-overview.mjs +2 -0
  64. package/esm2020/di2mt/widgets/upgrade-overview/upgrade-overview.module.mjs +59 -0
  65. package/esm2020/di2mt/widgets/upgrade-overview/upgrade-overview.service.mjs +82 -0
  66. package/esm2020/di2mt/widgets/user-upgrade/types/user-upgrade.mjs +3 -0
  67. package/esm2020/di2mt/widgets/user-upgrade/user-upgrade-data-table/user-upgrade-data-table.component.mjs +194 -0
  68. package/esm2020/di2mt/widgets/user-upgrade/user-upgrade.module.mjs +40 -0
  69. package/esm2020/di2mt/widgets/user-upgrade/user-upgrade.service.mjs +58 -0
  70. package/fesm2015/tuki-io-tuki-widgets-di2mt.mjs +1438 -0
  71. package/fesm2015/tuki-io-tuki-widgets-di2mt.mjs.map +1 -0
  72. package/fesm2020/tuki-io-tuki-widgets-di2mt.mjs +1429 -0
  73. package/fesm2020/tuki-io-tuki-widgets-di2mt.mjs.map +1 -0
  74. package/package.json +9 -1
@@ -0,0 +1,1438 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, Input, NgModule, EventEmitter, Output, Injectable, inject } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
6
+ import * as i4$1 from '@angular/material/table';
7
+ import { MatTableModule, MatTableDataSource } from '@angular/material/table';
8
+ import { MatTooltipModule } from '@angular/material/tooltip';
9
+ import * as i6$1 from '@angular/material/checkbox';
10
+ import { MatCheckboxModule } from '@angular/material/checkbox';
11
+ import * as i5$1 from '@angular/material/button';
12
+ import { MatButtonModule } from '@angular/material/button';
13
+ import * as i2 from '@angular/material/icon';
14
+ import { MatIconModule } from '@angular/material/icon';
15
+ import * as i3 from '@angular/material/form-field';
16
+ import { MatFormFieldModule } from '@angular/material/form-field';
17
+ import * as i4 from '@angular/material/input';
18
+ import { MatInputModule } from '@angular/material/input';
19
+ import * as i5 from '@angular/material/select';
20
+ import { MatSelectModule } from '@angular/material/select';
21
+ import * as i1$1 from 'ng-apexcharts';
22
+ import { NgApexchartsModule } from 'ng-apexcharts';
23
+ import * as i6 from '@angular/material/core';
24
+ import * as i1$2 from '@angular/common/http';
25
+ import { HttpClientModule, HttpHeaders } from '@angular/common/http';
26
+ import { SelectionModel } from '@angular/cdk/collections';
27
+ import { catchError, of, map, Subject, takeUntil } from 'rxjs';
28
+
29
+ class CardComponent {
30
+ }
31
+ CardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
32
+ CardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CardComponent, selector: "tk-card", inputs: { title: "title" }, ngImport: i0, template: "<article class=\"card\">\r\n <header class=\"card__header\">\r\n <h2>{{ title }}</h2>\r\n <div class=\"card__menu-button\">\r\n <img width=\"18\" src=\"/assets/icons/menu_icon.png\" alt=\"Menu Icon\">\r\n </div>\r\n </header>\r\n <div class=\"card__content\">\r\n <ng-content select=\"card-content\"></ng-content>\r\n </div>\r\n</article>", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";:host{display:block;height:100%;box-sizing:border-box}.card{font-family:Inter,Inter,sans-serif;background-color:#fff;border-radius:1rem;padding:2rem;border:1px solid hsl(0,0%,50%);min-width:300px;max-width:100%;height:100%;display:flex;flex-direction:column;box-sizing:border-box;gap:2.5rem}.card__header{position:relative;display:flex;align-items:center;justify-content:space-between}.card__header h2{font-size:16px;margin:0}.card__header .card__menu-button{position:relative;display:flex;align-items:center}.card__content{display:flex;flex-direction:column;gap:2.5rem;flex-grow:1}\n"] });
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CardComponent, decorators: [{
34
+ type: Component,
35
+ args: [{ selector: 'tk-card', template: "<article class=\"card\">\r\n <header class=\"card__header\">\r\n <h2>{{ title }}</h2>\r\n <div class=\"card__menu-button\">\r\n <img width=\"18\" src=\"/assets/icons/menu_icon.png\" alt=\"Menu Icon\">\r\n </div>\r\n </header>\r\n <div class=\"card__content\">\r\n <ng-content select=\"card-content\"></ng-content>\r\n </div>\r\n</article>", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";:host{display:block;height:100%;box-sizing:border-box}.card{font-family:Inter,Inter,sans-serif;background-color:#fff;border-radius:1rem;padding:2rem;border:1px solid hsl(0,0%,50%);min-width:300px;max-width:100%;height:100%;display:flex;flex-direction:column;box-sizing:border-box;gap:2.5rem}.card__header{position:relative;display:flex;align-items:center;justify-content:space-between}.card__header h2{font-size:16px;margin:0}.card__header .card__menu-button{position:relative;display:flex;align-items:center}.card__content{display:flex;flex-direction:column;gap:2.5rem;flex-grow:1}\n"] }]
36
+ }], propDecorators: { title: [{
37
+ type: Input
38
+ }] } });
39
+
40
+ class MaterialModule {
41
+ }
42
+ MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
43
+ MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [MatProgressBarModule,
44
+ MatTooltipModule,
45
+ MatTableModule,
46
+ MatCheckboxModule,
47
+ MatButtonModule,
48
+ MatIconModule,
49
+ MatFormFieldModule,
50
+ MatInputModule,
51
+ MatSelectModule], exports: [MatProgressBarModule,
52
+ MatTooltipModule,
53
+ MatTableModule,
54
+ MatCheckboxModule,
55
+ MatButtonModule,
56
+ MatIconModule,
57
+ MatFormFieldModule,
58
+ MatInputModule,
59
+ MatSelectModule] });
60
+ MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, imports: [MatProgressBarModule,
61
+ MatTooltipModule,
62
+ MatTableModule,
63
+ MatCheckboxModule,
64
+ MatButtonModule,
65
+ MatIconModule,
66
+ MatFormFieldModule,
67
+ MatInputModule,
68
+ MatSelectModule, MatProgressBarModule,
69
+ MatTooltipModule,
70
+ MatTableModule,
71
+ MatCheckboxModule,
72
+ MatButtonModule,
73
+ MatIconModule,
74
+ MatFormFieldModule,
75
+ MatInputModule,
76
+ MatSelectModule] });
77
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MaterialModule, decorators: [{
78
+ type: NgModule,
79
+ args: [{
80
+ imports: [
81
+ MatProgressBarModule,
82
+ MatTooltipModule,
83
+ MatTableModule,
84
+ MatCheckboxModule,
85
+ MatButtonModule,
86
+ MatIconModule,
87
+ MatFormFieldModule,
88
+ MatInputModule,
89
+ MatSelectModule
90
+ ],
91
+ exports: [
92
+ MatProgressBarModule,
93
+ MatTooltipModule,
94
+ MatTableModule,
95
+ MatCheckboxModule,
96
+ MatButtonModule,
97
+ MatIconModule,
98
+ MatFormFieldModule,
99
+ MatInputModule,
100
+ MatSelectModule
101
+ ]
102
+ }]
103
+ }] });
104
+
105
+ class StatCardComponent {
106
+ ngOnInit() {
107
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
108
+ if (this.type === 'user') {
109
+ this.stats = {
110
+ id: (_a = this.readinessStats) === null || _a === void 0 ? void 0 : _a.id,
111
+ customerId: (_b = this.readinessStats) === null || _b === void 0 ? void 0 : _b.customerId,
112
+ total: (_c = this.readinessStats) === null || _c === void 0 ? void 0 : _c['totalUsers'],
113
+ totalReady: (_d = this.readinessStats) === null || _d === void 0 ? void 0 : _d['totalReadyUsers'],
114
+ totalUpgraded: (_e = this.readinessStats) === null || _e === void 0 ? void 0 : _e['totalUpgradedUsers'],
115
+ };
116
+ }
117
+ else {
118
+ this.stats = {
119
+ id: (_f = this.readinessStats) === null || _f === void 0 ? void 0 : _f.id,
120
+ customerId: (_g = this.readinessStats) === null || _g === void 0 ? void 0 : _g.customerId,
121
+ total: (_h = this.readinessStats) === null || _h === void 0 ? void 0 : _h['totalSites'],
122
+ totalReady: (_j = this.readinessStats) === null || _j === void 0 ? void 0 : _j['totalReadySites'],
123
+ totalUpgraded: (_k = this.readinessStats) === null || _k === void 0 ? void 0 : _k['totalUpgradedSites'],
124
+ };
125
+ }
126
+ }
127
+ get readyPercentage() {
128
+ var _a, _b;
129
+ return (((_a = this.stats) === null || _a === void 0 ? void 0 : _a.totalReady) / ((_b = this.stats) === null || _b === void 0 ? void 0 : _b.total) * 100) >> 0;
130
+ }
131
+ get upgradedPercentage() {
132
+ var _a, _b;
133
+ return (((_a = this.stats) === null || _a === void 0 ? void 0 : _a.totalUpgraded) / ((_b = this.stats) === null || _b === void 0 ? void 0 : _b.total) * 100) >> 0;
134
+ }
135
+ }
136
+ StatCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: StatCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
137
+ StatCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: StatCardComponent, selector: "tk-stat-card", inputs: { title: "title", type: "type", readinessStats: "readinessStats", upgradeStatus: "upgradeStatus" }, ngImport: i0, template: "<tk-card [title]=\"title\">\r\n <ng-container ngProjectAs=\"card-content\">\r\n <div class=\"card__content-info\">\r\n <div class=\"card__content-wrapper\">\r\n <img width=\"42\" [src]=\"'/assets/icons/' + type + '.png'\" alt=\"\" />\r\n <div class=\"card__content-text\">\r\n <div class=\"card__content-label\">\r\n {{ upgradeStatus === 'ready' ? stats?.totalReady : stats?.totalUpgraded }} \r\n {{ type === 'user' ? 'Users' : 'Sites' }}</div>\r\n <div class=\"card__content-description\">{{ upgradeStatus === 'ready' ? 'Ready to Upgrade' : 'Already Upgraded' }}</div>\r\n </div>\r\n </div>\r\n <div class=\"card__content-wrapper\">\r\n <img\r\n *ngIf=\"upgradeStatus === 'ready'\"\r\n height=\"48\"\r\n src=\"/assets/icons/ready_to_upgrade.png\"\r\n alt=\"\"\r\n />\r\n <img\r\n *ngIf=\"upgradeStatus === 'already'\"\r\n height=\"48\"\r\n src=\"/assets/icons/already_upgraded.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"card__content-progress-wrapper\">\r\n <div class=\"card__content-progress\">\r\n <div class=\"card__content-progress-label\">\r\n <span>{{ readyPercentage }}%</span>\r\n <span>From all {{ stats?.total }} {{ type === 'user' ? 'users' : 'sites' }}</span>\r\n </div>\r\n <div class=\"card__content-progress-bar\">\r\n <div\r\n class=\"card__content-progress-bar-fill ready\"\r\n [class.already]=\"upgradeStatus === 'already'\"\r\n [style.width.%]=\"readyPercentage\"\r\n ></div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"upgradeStatus === 'already'\" class=\"card__content-progress\">\r\n <div class=\"card__content-progress-label\">\r\n <span>{{ upgradedPercentage }}%</span>\r\n <span>From all {{ stats?.totalReady }} ready {{ type === 'user' ? 'users' : 'sites' }}</span>\r\n </div>\r\n <div class=\"card__content-progress-bar\">\r\n <div\r\n class=\"card__content-progress-bar-fill ready\"\r\n [class.already]=\"upgradeStatus === 'already'\"\r\n [style.width.%]=\"upgradedPercentage\"\r\n ></div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n</tk-card>\r\n", styles: [":host{display:block;height:100%;box-sizing:border-box}.card__content-info{display:flex;align-items:center;justify-content:space-between}.card__content-text{display:flex;flex-direction:column;gap:.25rem}.card__content-text .card__content-label{font-size:20px}.card__content-text .card__content-description{font-size:12px}.card__content-wrapper{display:flex;align-items:center;justify-content:center;gap:1rem}.card__content-wrapper:first-child{display:flex;gap:.5rem}.card__content-progress-wrapper{display:flex;flex-direction:column;gap:1rem}.card__content-progress{display:flex;flex-direction:column;gap:.25rem;font-size:14px}.card__content-progress .card__content-progress-label{display:flex;align-items:center;justify-content:space-between;padding:.05rem}.card__content-progress .card__content-progress-bar{background-color:#ededed;border-radius:10rem}.card__content-progress .card__content-progress-bar .card__content-progress-bar-fill{height:10px;border-radius:inherit}.ready{background-color:#1170cf}.already{background-color:#1d805f}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CardComponent, selector: "tk-card", inputs: ["title"] }] });
138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: StatCardComponent, decorators: [{
139
+ type: Component,
140
+ args: [{ selector: 'tk-stat-card', template: "<tk-card [title]=\"title\">\r\n <ng-container ngProjectAs=\"card-content\">\r\n <div class=\"card__content-info\">\r\n <div class=\"card__content-wrapper\">\r\n <img width=\"42\" [src]=\"'/assets/icons/' + type + '.png'\" alt=\"\" />\r\n <div class=\"card__content-text\">\r\n <div class=\"card__content-label\">\r\n {{ upgradeStatus === 'ready' ? stats?.totalReady : stats?.totalUpgraded }} \r\n {{ type === 'user' ? 'Users' : 'Sites' }}</div>\r\n <div class=\"card__content-description\">{{ upgradeStatus === 'ready' ? 'Ready to Upgrade' : 'Already Upgraded' }}</div>\r\n </div>\r\n </div>\r\n <div class=\"card__content-wrapper\">\r\n <img\r\n *ngIf=\"upgradeStatus === 'ready'\"\r\n height=\"48\"\r\n src=\"/assets/icons/ready_to_upgrade.png\"\r\n alt=\"\"\r\n />\r\n <img\r\n *ngIf=\"upgradeStatus === 'already'\"\r\n height=\"48\"\r\n src=\"/assets/icons/already_upgraded.png\"\r\n alt=\"\"\r\n />\r\n </div>\r\n </div>\r\n <div class=\"card__content-progress-wrapper\">\r\n <div class=\"card__content-progress\">\r\n <div class=\"card__content-progress-label\">\r\n <span>{{ readyPercentage }}%</span>\r\n <span>From all {{ stats?.total }} {{ type === 'user' ? 'users' : 'sites' }}</span>\r\n </div>\r\n <div class=\"card__content-progress-bar\">\r\n <div\r\n class=\"card__content-progress-bar-fill ready\"\r\n [class.already]=\"upgradeStatus === 'already'\"\r\n [style.width.%]=\"readyPercentage\"\r\n ></div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"upgradeStatus === 'already'\" class=\"card__content-progress\">\r\n <div class=\"card__content-progress-label\">\r\n <span>{{ upgradedPercentage }}%</span>\r\n <span>From all {{ stats?.totalReady }} ready {{ type === 'user' ? 'users' : 'sites' }}</span>\r\n </div>\r\n <div class=\"card__content-progress-bar\">\r\n <div\r\n class=\"card__content-progress-bar-fill ready\"\r\n [class.already]=\"upgradeStatus === 'already'\"\r\n [style.width.%]=\"upgradedPercentage\"\r\n ></div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n</tk-card>\r\n", styles: [":host{display:block;height:100%;box-sizing:border-box}.card__content-info{display:flex;align-items:center;justify-content:space-between}.card__content-text{display:flex;flex-direction:column;gap:.25rem}.card__content-text .card__content-label{font-size:20px}.card__content-text .card__content-description{font-size:12px}.card__content-wrapper{display:flex;align-items:center;justify-content:center;gap:1rem}.card__content-wrapper:first-child{display:flex;gap:.5rem}.card__content-progress-wrapper{display:flex;flex-direction:column;gap:1rem}.card__content-progress{display:flex;flex-direction:column;gap:.25rem;font-size:14px}.card__content-progress .card__content-progress-label{display:flex;align-items:center;justify-content:space-between;padding:.05rem}.card__content-progress .card__content-progress-bar{background-color:#ededed;border-radius:10rem}.card__content-progress .card__content-progress-bar .card__content-progress-bar-fill{height:10px;border-radius:inherit}.ready{background-color:#1170cf}.already{background-color:#1d805f}\n"] }]
141
+ }], propDecorators: { title: [{
142
+ type: Input
143
+ }], type: [{
144
+ type: Input
145
+ }], readinessStats: [{
146
+ type: Input
147
+ }], upgradeStatus: [{
148
+ type: Input
149
+ }] } });
150
+
151
+ class StatusListCardComponent {
152
+ }
153
+ StatusListCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: StatusListCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
154
+ StatusListCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: StatusListCardComponent, selector: "tk-status-list-card", inputs: { title: "title", items: "items" }, ngImport: i0, template: "<tk-card [title]=\"title\">\r\n <ng-container ngProjectAs=\"card-content\">\r\n <div class=\"card__list-wrapper\">\r\n <div class=\"card__list-item\" *ngFor=\"let item of items\">\r\n <img *ngIf=\"item.status\" src=\"{{ 'assets/icons/check_icon.png' }}\" alt=\"\">\r\n <img *ngIf=\"!item.status\" src=\"{{ 'assets/icons/warning_icon.png' }}\" alt=\"\">\r\n <div class=\"card__item-info\">\r\n <div class=\"card__item-text\">\r\n <div class=\"card__item-label\">\r\n {{ item.label }}\r\n </div>\r\n <div class=\"card__item-description\">\r\n {{ item.description }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"title.includes('Site')\" class=\"card__item-stats\">\r\n <div class=\"card__item-numbers\">\r\n {{ item.value }}/{{ item.totalSites }}\r\n </div>\r\n <div class=\"card__item-numbers-description\">\r\n Ready/All\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n</tk-card>", styles: [":host{color:#333;display:block;height:100%;box-sizing:border-box}.card__list-wrapper{display:flex;flex-direction:column;gap:1rem}.card__list-item{display:flex;align-items:center;gap:1rem}.card__item-info{position:relative;display:flex;align-items:center;justify-content:space-between;gap:1rem;width:100%}.card__item-text{display:flex;flex-direction:column;gap:.05rem}.card__item-text .card__item-label{font-size:18px}.card__item-text .card__item-description{font-size:14px}.card__item-stats{right:0;position:absolute;text-align:right}.card__item-stats .card__item-numbers{font-size:28px}.card__item-stats .card__item-numbers-description{font-size:14px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CardComponent, selector: "tk-card", inputs: ["title"] }] });
155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: StatusListCardComponent, decorators: [{
156
+ type: Component,
157
+ args: [{ selector: "tk-status-list-card", template: "<tk-card [title]=\"title\">\r\n <ng-container ngProjectAs=\"card-content\">\r\n <div class=\"card__list-wrapper\">\r\n <div class=\"card__list-item\" *ngFor=\"let item of items\">\r\n <img *ngIf=\"item.status\" src=\"{{ 'assets/icons/check_icon.png' }}\" alt=\"\">\r\n <img *ngIf=\"!item.status\" src=\"{{ 'assets/icons/warning_icon.png' }}\" alt=\"\">\r\n <div class=\"card__item-info\">\r\n <div class=\"card__item-text\">\r\n <div class=\"card__item-label\">\r\n {{ item.label }}\r\n </div>\r\n <div class=\"card__item-description\">\r\n {{ item.description }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"title.includes('Site')\" class=\"card__item-stats\">\r\n <div class=\"card__item-numbers\">\r\n {{ item.value }}/{{ item.totalSites }}\r\n </div>\r\n <div class=\"card__item-numbers-description\">\r\n Ready/All\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n</tk-card>", styles: [":host{color:#333;display:block;height:100%;box-sizing:border-box}.card__list-wrapper{display:flex;flex-direction:column;gap:1rem}.card__list-item{display:flex;align-items:center;gap:1rem}.card__item-info{position:relative;display:flex;align-items:center;justify-content:space-between;gap:1rem;width:100%}.card__item-text{display:flex;flex-direction:column;gap:.05rem}.card__item-text .card__item-label{font-size:18px}.card__item-text .card__item-description{font-size:14px}.card__item-stats{right:0;position:absolute;text-align:right}.card__item-stats .card__item-numbers{font-size:28px}.card__item-stats .card__item-numbers-description{font-size:14px}\n"] }]
158
+ }], propDecorators: { title: [{
159
+ type: Input
160
+ }], items: [{
161
+ type: Input
162
+ }] } });
163
+
164
+ class ChartCardComponent {
165
+ ngOnInit() {
166
+ this.initChartOptions();
167
+ }
168
+ initChartOptions() {
169
+ if (this.totalUpgraded === 0)
170
+ this.totalNotUpgraded = 100;
171
+ this.chartOptions = {
172
+ series: [this.totalUpgraded, this.totalNotUpgraded],
173
+ chart: {
174
+ type: "donut",
175
+ height: 250
176
+ },
177
+ labels: ["MT", "DI"],
178
+ colors: ["#808080", "#2E8B57"],
179
+ legend: {
180
+ position: "right",
181
+ offsetY: 0,
182
+ fontSize: "14px",
183
+ markers: {
184
+ width: 16,
185
+ height: 16,
186
+ radius: 2
187
+ },
188
+ itemMargin: {
189
+ horizontal: 20,
190
+ vertical: 2
191
+ },
192
+ formatter: function (seriesName, opts) {
193
+ return seriesName + " " + ((opts.w.globals.series[opts.seriesIndex] / (opts.w.globals.series[0] + opts.w.globals.series[1]) * 100) >> 0) + "%";
194
+ }
195
+ },
196
+ plotOptions: {
197
+ pie: {
198
+ donut: {
199
+ size: "75%"
200
+ }
201
+ }
202
+ },
203
+ dataLabels: {
204
+ enabled: false
205
+ }
206
+ };
207
+ }
208
+ }
209
+ ChartCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ChartCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
210
+ ChartCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ChartCardComponent, selector: "tk-chart-card", inputs: { title: "title", totalUpgraded: "totalUpgraded", totalNotUpgraded: "totalNotUpgraded" }, ngImport: i0, template: "<tk-card [title]=\"title\">\r\n <ng-container ngProjectAs=\"card-content\">\r\n <div class=\"chart-container\">\r\n <apx-chart\r\n [series]=\"chartOptions.series\"\r\n [chart]=\"chartOptions.chart\"\r\n [labels]=\"chartOptions.labels\"\r\n [colors]=\"chartOptions.colors\"\r\n [legend]=\"chartOptions.legend\"\r\n [plotOptions]=\"chartOptions.plotOptions\"\r\n [dataLabels]=\"chartOptions.dataLabels\">\r\n </apx-chart>\r\n </div>\r\n </ng-container>\r\n</tk-card>", styles: [":host{width:100%;display:block;height:100%;box-sizing:border-box}.chart-container{width:100%;height:220px;display:flex;justify-content:flex-start;align-items:center;padding:0}.chart-container apx-chart{width:100%;max-width:400px}:host ::ng-deep .apexcharts-legend{display:flex!important;flex-direction:column!important;justify-content:center!important}:host ::ng-deep .apexcharts-legend .apexcharts-legend-marker{border-radius:2px!important}:host ::ng-deep .apexcharts-legend .apexcharts-legend-text{font-weight:500!important;color:#333!important}\n"], dependencies: [{ kind: "component", type: i1$1.ChartComponent, selector: "apx-chart", inputs: ["chart", "annotations", "colors", "dataLabels", "series", "stroke", "labels", "legend", "markers", "noData", "fill", "tooltip", "plotOptions", "responsive", "xaxis", "yaxis", "forecastDataPoints", "grid", "states", "title", "subtitle", "theme", "autoUpdateSeries"] }, { kind: "component", type: CardComponent, selector: "tk-card", inputs: ["title"] }] });
211
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ChartCardComponent, decorators: [{
212
+ type: Component,
213
+ args: [{ selector: 'tk-chart-card', template: "<tk-card [title]=\"title\">\r\n <ng-container ngProjectAs=\"card-content\">\r\n <div class=\"chart-container\">\r\n <apx-chart\r\n [series]=\"chartOptions.series\"\r\n [chart]=\"chartOptions.chart\"\r\n [labels]=\"chartOptions.labels\"\r\n [colors]=\"chartOptions.colors\"\r\n [legend]=\"chartOptions.legend\"\r\n [plotOptions]=\"chartOptions.plotOptions\"\r\n [dataLabels]=\"chartOptions.dataLabels\">\r\n </apx-chart>\r\n </div>\r\n </ng-container>\r\n</tk-card>", styles: [":host{width:100%;display:block;height:100%;box-sizing:border-box}.chart-container{width:100%;height:220px;display:flex;justify-content:flex-start;align-items:center;padding:0}.chart-container apx-chart{width:100%;max-width:400px}:host ::ng-deep .apexcharts-legend{display:flex!important;flex-direction:column!important;justify-content:center!important}:host ::ng-deep .apexcharts-legend .apexcharts-legend-marker{border-radius:2px!important}:host ::ng-deep .apexcharts-legend .apexcharts-legend-text{font-weight:500!important;color:#333!important}\n"] }]
214
+ }], propDecorators: { title: [{
215
+ type: Input
216
+ }], totalUpgraded: [{
217
+ type: Input
218
+ }], totalNotUpgraded: [{
219
+ type: Input
220
+ }] } });
221
+
222
+ class TableFiltersComponent {
223
+ constructor() {
224
+ this.filter = new EventEmitter();
225
+ }
226
+ ngOnInit() {
227
+ if (this.filters) {
228
+ this.filters.forEach(filter => {
229
+ if (filter.type === 'select' && !filter.options.some(opt => opt.value === 'all')) {
230
+ filter.options.unshift({ label: 'All', value: 'all' });
231
+ }
232
+ });
233
+ }
234
+ }
235
+ onFilter(key, value) {
236
+ const val = { key, value };
237
+ this.filter.emit(val);
238
+ }
239
+ }
240
+ TableFiltersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableFiltersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
241
+ TableFiltersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TableFiltersComponent, selector: "tk-table-filters", inputs: { filters: "filters" }, outputs: { filter: "filter" }, ngImport: i0, template: "<div class=\"filters-wrapper\">\r\n <ng-container *ngFor=\"let filter of filters\">\r\n <div class=\"filter\">\r\n <ng-container [ngSwitch]=\"filter.type\">\r\n <!-- Search Input with Material Design -->\r\n <mat-form-field *ngSwitchCase=\"'search'\" appearance=\"outline\" class=\"search-field\">\r\n <mat-label>{{ filter.placeholder }}</mat-label>\r\n <input matInput \r\n [placeholder]=\"filter.placeholder\"\r\n (input)=\"onFilter(filter.columnKey, $event)\">\r\n <mat-icon matPrefix class=\"search-icon\">\r\n <img src=\"/assets/icons/search_icon.png\" alt=\"Search\" />\r\n </mat-icon>\r\n </mat-form-field>\r\n\r\n <!-- Select Dropdown with Material Design -->\r\n <mat-form-field *ngSwitchCase=\"'select'\" appearance=\"outline\" class=\"select-field\">\r\n <mat-label>{{ filter.placeholder }}</mat-label>\r\n <mat-select (selectionChange)=\"onFilter(filter.columnKey, $event)\">\r\n <mat-option *ngFor=\"let option of filter.options\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n</div>", styles: [":host .filters-wrapper{display:flex;gap:1rem;flex-wrap:wrap;align-items:center;padding:0}:host .filters-wrapper .filter .search-field,:host .filters-wrapper .filter .select-field{width:100%}:host .filters-wrapper .filter .search-field .search-icon,:host .filters-wrapper .filter .select-field .search-icon{display:flex;align-items:center;justify-content:center;margin-right:.25rem;padding:0}:host .filters-wrapper .filter .search-field .search-icon img,:host .filters-wrapper .filter .select-field .search-icon img{width:24px;height:24px;object-fit:contain;opacity:.6;vertical-align:middle}:host .filters-wrapper .filter ::ng-deep .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0!important;padding:0!important}:host .filters-wrapper .filter ::ng-deep .mat-form-field-infix{padding:.5rem 1rem!important}:host .filters-wrapper .filter ::ng-deep .mat-form-field-label-wrapper{top:-1.1rem!important}:host .filters-wrapper .filter ::ng-deep .mat-form-field-infix .mat-input-element{transform:translate(-16px) translateY(-4px)!important}:host .filters-wrapper .filter ::ng-deep .mat-select-value{transform:translateY(-4px)!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", exportAs: ["matOption"] }] });
242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableFiltersComponent, decorators: [{
243
+ type: Component,
244
+ args: [{ selector: 'tk-table-filters', template: "<div class=\"filters-wrapper\">\r\n <ng-container *ngFor=\"let filter of filters\">\r\n <div class=\"filter\">\r\n <ng-container [ngSwitch]=\"filter.type\">\r\n <!-- Search Input with Material Design -->\r\n <mat-form-field *ngSwitchCase=\"'search'\" appearance=\"outline\" class=\"search-field\">\r\n <mat-label>{{ filter.placeholder }}</mat-label>\r\n <input matInput \r\n [placeholder]=\"filter.placeholder\"\r\n (input)=\"onFilter(filter.columnKey, $event)\">\r\n <mat-icon matPrefix class=\"search-icon\">\r\n <img src=\"/assets/icons/search_icon.png\" alt=\"Search\" />\r\n </mat-icon>\r\n </mat-form-field>\r\n\r\n <!-- Select Dropdown with Material Design -->\r\n <mat-form-field *ngSwitchCase=\"'select'\" appearance=\"outline\" class=\"select-field\">\r\n <mat-label>{{ filter.placeholder }}</mat-label>\r\n <mat-select (selectionChange)=\"onFilter(filter.columnKey, $event)\">\r\n <mat-option *ngFor=\"let option of filter.options\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n</div>", styles: [":host .filters-wrapper{display:flex;gap:1rem;flex-wrap:wrap;align-items:center;padding:0}:host .filters-wrapper .filter .search-field,:host .filters-wrapper .filter .select-field{width:100%}:host .filters-wrapper .filter .search-field .search-icon,:host .filters-wrapper .filter .select-field .search-icon{display:flex;align-items:center;justify-content:center;margin-right:.25rem;padding:0}:host .filters-wrapper .filter .search-field .search-icon img,:host .filters-wrapper .filter .select-field .search-icon img{width:24px;height:24px;object-fit:contain;opacity:.6;vertical-align:middle}:host .filters-wrapper .filter ::ng-deep .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:0!important;padding:0!important}:host .filters-wrapper .filter ::ng-deep .mat-form-field-infix{padding:.5rem 1rem!important}:host .filters-wrapper .filter ::ng-deep .mat-form-field-label-wrapper{top:-1.1rem!important}:host .filters-wrapper .filter ::ng-deep .mat-form-field-infix .mat-input-element{transform:translate(-16px) translateY(-4px)!important}:host .filters-wrapper .filter ::ng-deep .mat-select-value{transform:translateY(-4px)!important}\n"] }]
245
+ }], propDecorators: { filters: [{
246
+ type: Input
247
+ }], filter: [{
248
+ type: Output
249
+ }] } });
250
+
251
+ class SummaryCardComponent {
252
+ constructor() {
253
+ this.value = 41;
254
+ this.status = 'Ready';
255
+ }
256
+ getStatusClass(status) {
257
+ switch (status === null || status === void 0 ? void 0 : status.toLowerCase()) {
258
+ case 'ready':
259
+ return 'ready';
260
+ case 'not ready':
261
+ return 'not-ready';
262
+ case 'failed':
263
+ return 'failed';
264
+ case 'completed':
265
+ return 'completed';
266
+ default:
267
+ return 'not-ready';
268
+ }
269
+ }
270
+ }
271
+ SummaryCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SummaryCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
272
+ SummaryCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SummaryCardComponent, selector: "tk-summary-card", inputs: { value: "value", status: "status", description: "description" }, ngImport: i0, template: "<article class=\"summary-card\">\r\n <header class=\"summary-card__header\">\r\n <h2>{{ value }}</h2>\r\n </header>\r\n <div class=\"summary__card-description\">\r\n <span>{{ description }}</span>\r\n <div class=\"summary__card-status-wrapper\">\r\n <span class=\"summary__card-status-indicator\" [ngClass]=\"getStatusClass(status)\"></span>\r\n <span>{{ status }}</span>\r\n </div>\r\n </div>\r\n</article>", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";:host{display:block;height:100%;box-sizing:border-box;flex:1}.summary-card{font-family:Inter,Inter,sans-serif;background-color:#fff;border-radius:1rem;padding:1rem;border:1px solid hsl(0,0%,50%);max-width:100%;height:100%;display:flex;box-sizing:border-box;flex-direction:column;gap:.25rem}.summary-card__header{position:relative;display:flex;align-items:center;justify-content:space-between}.summary-card__header h2{font-size:28px;font-weight:500;margin:0}.summary__card-status-wrapper{display:flex;align-items:center;font-size:14px;gap:.5rem}.summary__card-status-wrapper .summary__card-status-indicator{width:8px;height:8px;border-radius:50%}.summary__card-status-wrapper .summary__card-status-indicator.ready{background-color:#1c3893}.summary__card-status-wrapper .summary__card-status-indicator.partial-ready{background-color:#f8cd00}.summary__card-status-wrapper .summary__card-status-indicator.not-ready{background-color:#9e9e9e}.summary__card-status-wrapper .summary__card-status-indicator.completed{background-color:#1d805f}.summary__card-status-wrapper .summary__card-status-indicator.failed{background-color:#f23933}.summary__card-description{font-size:14px;color:#333;display:flex;align-items:center;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
273
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SummaryCardComponent, decorators: [{
274
+ type: Component,
275
+ args: [{ selector: 'tk-summary-card', template: "<article class=\"summary-card\">\r\n <header class=\"summary-card__header\">\r\n <h2>{{ value }}</h2>\r\n </header>\r\n <div class=\"summary__card-description\">\r\n <span>{{ description }}</span>\r\n <div class=\"summary__card-status-wrapper\">\r\n <span class=\"summary__card-status-indicator\" [ngClass]=\"getStatusClass(status)\"></span>\r\n <span>{{ status }}</span>\r\n </div>\r\n </div>\r\n</article>", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";:host{display:block;height:100%;box-sizing:border-box;flex:1}.summary-card{font-family:Inter,Inter,sans-serif;background-color:#fff;border-radius:1rem;padding:1rem;border:1px solid hsl(0,0%,50%);max-width:100%;height:100%;display:flex;box-sizing:border-box;flex-direction:column;gap:.25rem}.summary-card__header{position:relative;display:flex;align-items:center;justify-content:space-between}.summary-card__header h2{font-size:28px;font-weight:500;margin:0}.summary__card-status-wrapper{display:flex;align-items:center;font-size:14px;gap:.5rem}.summary__card-status-wrapper .summary__card-status-indicator{width:8px;height:8px;border-radius:50%}.summary__card-status-wrapper .summary__card-status-indicator.ready{background-color:#1c3893}.summary__card-status-wrapper .summary__card-status-indicator.partial-ready{background-color:#f8cd00}.summary__card-status-wrapper .summary__card-status-indicator.not-ready{background-color:#9e9e9e}.summary__card-status-wrapper .summary__card-status-indicator.completed{background-color:#1d805f}.summary__card-status-wrapper .summary__card-status-indicator.failed{background-color:#f23933}.summary__card-description{font-size:14px;color:#333;display:flex;align-items:center;justify-content:space-between}\n"] }]
276
+ }], propDecorators: { value: [{
277
+ type: Input
278
+ }], status: [{
279
+ type: Input
280
+ }], description: [{
281
+ type: Input
282
+ }] } });
283
+
284
+ class SharedModule {
285
+ }
286
+ SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
287
+ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, declarations: [CardComponent,
288
+ StatCardComponent,
289
+ StatusListCardComponent,
290
+ ChartCardComponent,
291
+ SummaryCardComponent,
292
+ TableFiltersComponent], imports: [CommonModule,
293
+ MaterialModule,
294
+ NgApexchartsModule,
295
+ HttpClientModule], exports: [CardComponent,
296
+ StatCardComponent,
297
+ StatusListCardComponent,
298
+ ChartCardComponent,
299
+ SummaryCardComponent,
300
+ TableFiltersComponent] });
301
+ SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, imports: [CommonModule,
302
+ MaterialModule,
303
+ NgApexchartsModule,
304
+ HttpClientModule] });
305
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SharedModule, decorators: [{
306
+ type: NgModule,
307
+ args: [{
308
+ declarations: [
309
+ CardComponent,
310
+ StatCardComponent,
311
+ StatusListCardComponent,
312
+ ChartCardComponent,
313
+ SummaryCardComponent,
314
+ TableFiltersComponent
315
+ ],
316
+ imports: [
317
+ CommonModule,
318
+ MaterialModule,
319
+ NgApexchartsModule,
320
+ HttpClientModule
321
+ ],
322
+ exports: [
323
+ CardComponent,
324
+ StatCardComponent,
325
+ StatusListCardComponent,
326
+ ChartCardComponent,
327
+ SummaryCardComponent,
328
+ TableFiltersComponent
329
+ ]
330
+ }]
331
+ }] });
332
+
333
+ const API = {
334
+ OVERVIEW: {
335
+ GET_UPGRADE_PRECONDITIONS: '/api/webex-upgrade/customers/1477/preconditions/fetch',
336
+ GET_SITE_INFRASTRUCTURE: '/api/webex-upgrade/customers/1477/infra/fetch',
337
+ GET_USERS_UPGRADE_SUMMARY: '/api/webex-upgrade/customers/1477/users/upgrade/fetch',
338
+ GET_SITES_UPGRADE_SUMMARY: '/api/webex-upgrade/customers/1477/sites/upgrade/fetch',
339
+ GET_USERS_UPGRADE_READINESS: '/api/webex-upgrade/customers/1477/users/readiness/fetch',
340
+ GET_SITES_UPGRADE_READINESS: '/api/webex-upgrade/customers/1477/sites/readiness/fetch'
341
+ },
342
+ USER_UPGRADE: {
343
+ GET_USERS_UPGRADE_DATA: '/api/webex-upgrade/customers/1477/user-upgrade',
344
+ GET_USERS_UPGRADE_STATUS_COUNTS: '/api/webex-upgrade/customers/1477/user-upgrades/status-counts',
345
+ UPGRADE_USER: '/api/migration/webex/sites/:siteId/users/:userId'
346
+ },
347
+ SITE_UPGRADE: {
348
+ GET_SITES_UPGRADE_DATA: '/api/webex-upgrade/customers/1477/site-upgrades',
349
+ GET_SITES_UPGRADE_STATUS_COUNTS: '/api/webex-upgrade/customers/1477/site-upgrades/status-counts',
350
+ UPGRADE_SITE: '/api/migration/webex/sites/:siteId'
351
+ }
352
+ };
353
+
354
+ class APIService {
355
+ constructor(httpClient) {
356
+ this.httpClient = httpClient;
357
+ this.apiUrl = window.location.protocol + '//' + window.location.hostname + '/dcp';
358
+ this.token = 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbkBjb3JyZW5ldC5jb20iLCJyb2xlcyI6IlNVUEVSX1VTRVIiLCJpYXQiOjE3NTUwODUyMzgsImV4cCI6MTc1NTEwMzIzOH0.X1CKx-OBZvSs7Bzr_4SWW2ulBgHNkYZrmVuv6V7FZyo';
359
+ // this.apiUrl = window.location.protocol + '//' + window.location.host + '/dcp';
360
+ this.apiUrl = 'https://dev.tuki.io/webex';
361
+ // this.apiUrl = 'http://localhost:8088/dcp';
362
+ }
363
+ fetch(url, params, cache) {
364
+ const headers = this.getHeaders(cache);
365
+ params = params || {};
366
+ return this.httpClient.get(this.apiUrl + url, { params: this.prepareEncodedParams(params), headers });
367
+ }
368
+ post(url, body, params = {}) {
369
+ body = body || null;
370
+ const headers = this.getHeaders();
371
+ return this.httpClient.post(this.apiUrl + url, body, { params: this.prepareEncodedParams(params), headers });
372
+ }
373
+ // use when response extended data is necessary:
374
+ postExtended(url, body = null, params = {}, headers = {}) {
375
+ headers = headers || this.getHeaders();
376
+ return this.httpClient.post(this.apiUrl + url, body, {
377
+ headers,
378
+ observe: 'response',
379
+ params: this.prepareEncodedParams(params)
380
+ });
381
+ }
382
+ put(url, body = null, params = {}) {
383
+ const headers = this.getHeaders();
384
+ return this.httpClient.put(this.apiUrl + url, body, { headers, params: this.prepareEncodedParams(params) });
385
+ }
386
+ delete(url, params = {}) {
387
+ const headers = this.getHeaders();
388
+ return this.httpClient.delete(this.apiUrl + url, { headers, params: this.prepareEncodedParams(params) });
389
+ }
390
+ fetchPagination(url, pageSize, pageNumber, additionalParams = {}, cache) {
391
+ const copyAdditionalParams = JSON.parse(JSON.stringify(additionalParams));
392
+ const params = Object.assign(copyAdditionalParams, { size: pageSize.toString(), page: pageNumber.toString() });
393
+ return this.fetch(url, params, cache);
394
+ }
395
+ prepareEncodedParams(params) {
396
+ const result = {};
397
+ if (!params) {
398
+ return {};
399
+ }
400
+ for (const key of Object.keys(params)) {
401
+ if (params[key]) {
402
+ const stringParam = params[key].toString();
403
+ result[key] = stringParam.includes('+') ? encodeURIComponent(stringParam) : stringParam;
404
+ }
405
+ }
406
+ return result;
407
+ }
408
+ getHeaders(cache) {
409
+ let headers = new HttpHeaders();
410
+ if (cache) {
411
+ headers = headers.append('_Cache', 'true ');
412
+ }
413
+ const token = this.token || this.getParameterByName('token');
414
+ headers = headers.append('Authorization', 'Bearer ' + token);
415
+ return headers;
416
+ }
417
+ getParameterByName(name, url = window.location.href) {
418
+ name = name.replace(/[\[\]]/g, '\\$&');
419
+ var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url);
420
+ if (!results)
421
+ return null;
422
+ if (!results[2])
423
+ return '';
424
+ return decodeURIComponent(results[2].replace(/\+/g, ' '));
425
+ }
426
+ }
427
+ APIService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
428
+ APIService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, providedIn: 'root' });
429
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: APIService, decorators: [{
430
+ type: Injectable,
431
+ args: [{
432
+ providedIn: 'root'
433
+ }]
434
+ }], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
435
+
436
+ class UserUpgradeService {
437
+ constructor() {
438
+ this.apiService = inject(APIService);
439
+ }
440
+ // TODO: Impl the user upgrade logic here
441
+ bulkUpgrade(users) {
442
+ const entities = users.map(record => ({ cucmId: record.cucmId, entityId: record.userId }));
443
+ const customerId = users[0].customerId;
444
+ const siteId = users[0].siteId;
445
+ const body = {
446
+ customerId,
447
+ siteId,
448
+ entities: {
449
+ 'PERSON': entities
450
+ }
451
+ };
452
+ console.log(body);
453
+ // This is not done yet...
454
+ return this.apiService.post(API.USER_UPGRADE.UPGRADE_USER.replace(':siteId', siteId).replace(':userId', users[0].userId), body, {}).pipe(catchError((err) => of(err)));
455
+ }
456
+ getUserUpgradeStatusCounts() {
457
+ return this.apiService.fetch(API.USER_UPGRADE.GET_USERS_UPGRADE_STATUS_COUNTS.replace(':customerId', this.customerId));
458
+ }
459
+ getUserUpgradeRecords() {
460
+ return this.apiService.fetch(API.USER_UPGRADE.GET_USERS_UPGRADE_DATA.replace(':customerId', this.customerId)).pipe(map((resp) => {
461
+ return resp.content;
462
+ // This was added because of mapping issues with BE resp;
463
+ // return resp.content.map((record: UserUpgradeRecord) => ({
464
+ // userId: record.userId,
465
+ // userName: record.userName,
466
+ // customerId: record.customerId,
467
+ // siteId: record.siteId,
468
+ // siteName: record.siteName,
469
+ // devices: record.devices,
470
+ // cucmId: record.cucmId,
471
+ // primaryExtension: record.primaryExtension,
472
+ // deviceStatus: record.deviceStatus,
473
+ // dialPlanStatus: record.dialPlanStatus,
474
+ // dependenciesStatus: record.dependenciesStatus,
475
+ // upgradeStatus: record.upgradeStatus
476
+ // } as UserUpgradeRecord));
477
+ }));
478
+ }
479
+ }
480
+ UserUpgradeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserUpgradeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
481
+ UserUpgradeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserUpgradeService, providedIn: 'root' });
482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserUpgradeService, decorators: [{
483
+ type: Injectable,
484
+ args: [{
485
+ providedIn: 'root'
486
+ }]
487
+ }] });
488
+
489
+ const STATUS_ENTRIES = {
490
+ READY: 'Ready',
491
+ NOT_READY: 'Not Ready',
492
+ PARTIAL_READY: 'Partial Ready',
493
+ FAILED: 'Failed',
494
+ COMPLETED: 'Completed'
495
+ };
496
+ const DEPENDENCIES_STATUS = {
497
+ DEPENDENCIES_FOUND: 'Dependencies found',
498
+ NO_DEPENDENCIES: 'No dependencies',
499
+ };
500
+
501
+ class UserUpgradeDataTableComponent {
502
+ constructor() {
503
+ this.destroy$ = new Subject();
504
+ this.userUpgradeService = inject(UserUpgradeService);
505
+ this.apiService = inject(APIService);
506
+ this.STATUS_ENTRIES = STATUS_ENTRIES;
507
+ this.DEPENDENCIES_STATUS = DEPENDENCIES_STATUS;
508
+ this.displayedColumns = ['select', 'user', 'site', 'device', 'dialPlanStatus', 'dependencies', 'userUpgradeStatus'];
509
+ this.selection = new SelectionModel(true, []);
510
+ this.filters = [];
511
+ this.statusCounts = {};
512
+ this.activeFilters = {};
513
+ }
514
+ ngOnInit() {
515
+ this.apiService.token = this.token;
516
+ this.userUpgradeService.getUserUpgradeRecords()
517
+ .pipe(takeUntil(this.destroy$))
518
+ .subscribe((records) => {
519
+ this.data = new MatTableDataSource(records);
520
+ this.setupCustomFilter();
521
+ this.initializeFilters(records);
522
+ });
523
+ this.userUpgradeService.getUserUpgradeStatusCounts()
524
+ .pipe(takeUntil(this.destroy$))
525
+ .subscribe((statusCounts) => {
526
+ this.statusCounts['Ready'] = statusCounts['READY'] || 0;
527
+ this.statusCounts['Not Ready'] = statusCounts['NOT_READY'] || 0;
528
+ this.statusCounts['Completed'] = statusCounts['COMPLETED'] || 0;
529
+ this.statusCounts['Failed'] = statusCounts['FAILED'] || 0;
530
+ });
531
+ }
532
+ ngOnDestroy() {
533
+ this.destroy$.next();
534
+ this.destroy$.complete();
535
+ }
536
+ initializeFilters(records) {
537
+ // Extract unique sites from actual data
538
+ const uniqueSites = [...new Set(records.map(record => record.siteName))];
539
+ const siteOptions = uniqueSites.map(site => ({
540
+ label: site,
541
+ value: site.toLowerCase().replace(/\s+/g, '-')
542
+ }));
543
+ // Extract unique statuses from actual data
544
+ const uniqueStatuses = [...new Set(records.map(record => record.upgradeStatus))];
545
+ const statusOptions = uniqueStatuses.map(status => ({
546
+ label: STATUS_ENTRIES[status],
547
+ value: status.toLowerCase().replace(/\s+/g, '-')
548
+ }));
549
+ this.filters = [
550
+ {
551
+ id: 'userName',
552
+ type: 'search',
553
+ columnKey: 'User',
554
+ placeholder: 'Search users...',
555
+ options: []
556
+ },
557
+ {
558
+ id: 'sites',
559
+ type: 'select',
560
+ columnKey: 'Site',
561
+ placeholder: 'Sites',
562
+ options: siteOptions
563
+ },
564
+ {
565
+ id: 'status',
566
+ type: 'select',
567
+ columnKey: 'User Upgrade Status',
568
+ placeholder: 'Upgrade Status',
569
+ options: statusOptions
570
+ }
571
+ ];
572
+ }
573
+ /** Whether the number of selected elements matches the total number of rows. */
574
+ isAllSelected() {
575
+ var _a, _b;
576
+ const numSelected = this.selection.selected.length;
577
+ const numRows = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.data.length) !== null && _b !== void 0 ? _b : 0;
578
+ return numSelected === numRows;
579
+ }
580
+ /** Selects all rows if they are not all selected; otherwise clear selection. */
581
+ masterToggle() {
582
+ var _a;
583
+ this.isAllSelected() ?
584
+ this.selection.clear() :
585
+ (_a = this.data) === null || _a === void 0 ? void 0 : _a.data.forEach(row => this.selection.select(row));
586
+ }
587
+ upgradeUser(user) {
588
+ this.userUpgradeService.bulkUpgrade([user]);
589
+ }
590
+ upgradeSelectedUsers() {
591
+ this.userUpgradeService.bulkUpgrade(this.selection.selected);
592
+ }
593
+ onFilter(filterEvent) {
594
+ const { key, value } = filterEvent;
595
+ let filterValue;
596
+ if (value && value.value !== undefined) {
597
+ filterValue = value.value;
598
+ }
599
+ else if (value && value.target) {
600
+ filterValue = value.target.value;
601
+ }
602
+ else {
603
+ filterValue = value;
604
+ }
605
+ // Handle "All" option or empty values - remove the filter
606
+ if (filterValue === 'all' || !filterValue || filterValue === '') {
607
+ delete this.activeFilters[key];
608
+ }
609
+ else {
610
+ this.activeFilters[key] = filterValue;
611
+ }
612
+ this.applyFilters();
613
+ }
614
+ setupCustomFilter() {
615
+ this.data.filterPredicate = (data, filter) => {
616
+ const filters = JSON.parse(filter || '{}');
617
+ for (const [key, value] of Object.entries(filters)) {
618
+ if (!value)
619
+ continue;
620
+ switch (key) {
621
+ case 'User':
622
+ const searchTerm = value.toLowerCase();
623
+ if (!data.userName.toLowerCase().includes(searchTerm)) {
624
+ return false;
625
+ }
626
+ break;
627
+ case 'Site':
628
+ if (data.siteName !== this.getSiteNameFromValue(value)) {
629
+ return false;
630
+ }
631
+ break;
632
+ case 'User Upgrade Status':
633
+ if (!this.matchesUpgradeStatus(data.upgradeStatus, value)) {
634
+ return false;
635
+ }
636
+ break;
637
+ }
638
+ }
639
+ return true;
640
+ };
641
+ }
642
+ applyFilters() {
643
+ this.data.filter = JSON.stringify(this.activeFilters);
644
+ }
645
+ get filteredDataCount() {
646
+ var _a, _b;
647
+ return ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.filteredData) === null || _b === void 0 ? void 0 : _b.length) || 0;
648
+ }
649
+ getSiteNameFromValue(value) {
650
+ // Since we're now using actual site names, just convert back from slug format
651
+ return value.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
652
+ }
653
+ matchesUpgradeStatus(status, filterValue) {
654
+ // Handle direct status matching for cleaner implementation
655
+ return status.toLowerCase().replace(/\s+/g, '-') === filterValue.toLowerCase();
656
+ }
657
+ getStatusClass(status) {
658
+ switch (status.toLowerCase()) {
659
+ case 'ready':
660
+ return 'ready';
661
+ case 'not ready':
662
+ return 'not-ready';
663
+ case 'partial ready':
664
+ return 'partial-ready';
665
+ case 'completed':
666
+ return 'completed';
667
+ case 'failed':
668
+ return 'failed';
669
+ default:
670
+ return 'not-ready';
671
+ }
672
+ }
673
+ }
674
+ UserUpgradeDataTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserUpgradeDataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
675
+ UserUpgradeDataTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UserUpgradeDataTableComponent, selector: "tk-user-upgrade-data-table", inputs: { token: "token" }, ngImport: i0, template: "<div class=\"wrapper\">\r\n <div class=\"user-upgrade-status-wrapper\">\r\n <tk-summary-card [description]=\"'Users are ready to upgrade'\" [value]=\"statusCounts['Ready']\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Users are not ready'\" [value]=\"statusCounts['Not Ready']\" [status]=\"'Not Ready'\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Users failed to upgrade'\" [value]=\"statusCounts['Failed']\" [status]=\"'Failed'\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Successfully upgraded'\" [value]=\"statusCounts['Completed']\" [status]=\"'Completed'\"></tk-summary-card>\r\n </div>\r\n <div class=\"table-action-panel\">\r\n <tk-table-filters *ngIf=\"filters.length > 0\" [filters]=\"filters\" (filter)=\"onFilter($event)\"></tk-table-filters>\r\n <div class=\"action-wrapper\">\r\n <span>{{filteredDataCount}} Users</span>\r\n <button \r\n mat-button \r\n class=\"upgrade-bulk-button\" \r\n color=\"primary\" \r\n [disabled]=\"selection.selected.length === 0\" \r\n (click)=\"upgradeSelectedUsers()\">\r\n Upgrade {{ selection.selected.length === 0 ? '' : '(' + selection.selected.length + ')' }}\r\n </button>\r\n </div>\r\n </div>\r\n <table mat-table [dataSource]=\"data\" class=\"user-upgrade-table\">\r\n\r\n <!-- Checkbox Column -->\r\n <ng-container matColumnDef=\"select\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <mat-checkbox \r\n (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"selection.hasValue() && isAllSelected()\"\r\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\"\r\n class=\"custom-checkbox\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-checkbox \r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"\r\n [checked]=\"selection.isSelected(row)\"\r\n [disabled]=\"STATUS_ENTRIES[row.upgradeStatus] !== 'Ready'\"\r\n class=\"custom-checkbox\">\r\n </mat-checkbox>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- User Column -->\r\n <ng-container matColumnDef=\"user\">\r\n <th mat-header-cell *matHeaderCellDef>User</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"user-info\">\r\n <div class=\"user-name\">{{element.userName}}</div>\r\n <div class=\"user-email\">{{element.userName}}</div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Site Column -->\r\n <ng-container matColumnDef=\"site\">\r\n <th mat-header-cell *matHeaderCellDef>Site</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"site-info\">\r\n <span class=\"site-indicator\"></span>\r\n {{element.siteName}}\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Device Column -->\r\n <ng-container matColumnDef=\"device\">\r\n <th mat-header-cell *matHeaderCellDef>Device</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"device-info\">\r\n <div *ngIf=\"element.devices.length > 1\">\r\n <div class=\"device-name-wrapper\">\r\n <span class=\"device-indicator\"></span>\r\n <span class=\"device-name\">Multiple devices</span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"element.devices.length === 1\">\r\n <div class=\"device-name-wrapper\">\r\n <span class=\"device-indicator\"></span>\r\n <span class=\"device-name\">{{element.devices[0]}}</span>\r\n </div>\r\n <span class=\"device-model\">{{ element.primaryExtension || 'No Extension' }}</span>\r\n </div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Dial Plan Status Column -->\r\n <ng-container matColumnDef=\"dialPlanStatus\">\r\n <th mat-header-cell *matHeaderCellDef>Dial Plan Status</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"status-info\">\r\n <span class=\"status-indicator\" [ngClass]=\"getStatusClass(element.dialPlanStatus)\"></span>\r\n <span>{{STATUS_ENTRIES[element.dialPlanStatus]}}</span>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Dependencies Column -->\r\n <ng-container matColumnDef=\"dependencies\">\r\n <th mat-header-cell *matHeaderCellDef>Dependencies</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <span *ngIf=\"DEPENDENCIES_STATUS[element.dependenciesStatus] === 'Dependencies found'\" class=\"dependencies-text\">{{DEPENDENCIES_STATUS[element.dependenciesStatus]}}</span>\r\n <span *ngIf=\"DEPENDENCIES_STATUS[element.dependenciesStatus] === 'No dependencies'\">\u2014</span>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- User Upgrade Status Column -->\r\n <ng-container matColumnDef=\"userUpgradeStatus\">\r\n <th mat-header-cell *matHeaderCellDef>User Upgrade Status</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"upgrade-status-cell\">\r\n <ng-container *ngIf=\"STATUS_ENTRIES[element.upgradeStatus] === 'Ready'; else statusBlock\">\r\n <button mat-button color=\"primary\" class=\"upgrade-button\" (click)=\"upgradeUser(element)\">Upgrade</button>\r\n </ng-container>\r\n <ng-template #statusBlock>\r\n <div class=\"status-info\">\r\n <span class=\"status-indicator\" [ngClass]=\"getStatusClass(element.upgradeStatus)\"></span>\r\n <span>{{STATUS_ENTRIES[element.upgradeStatus]}}</span>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\" \r\n [class.selected-row]=\"selection.isSelected(row)\"></tr>\r\n </table>\r\n</div>", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";.wrapper{display:flex;flex-direction:column;gap:1rem}.user-upgrade-status-wrapper{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}.user-upgrade-table{font-family:Inter,Inter,sans-serif;width:100%;background:white;border-radius:8px;overflow:hidden;font-size:14px}.user-upgrade-table .mat-header-row{font-size:12px;height:35px}.user-upgrade-table .mat-cell{border-bottom:1px solid #d6d6d6}.user-upgrade-table .mat-header-cell{border-bottom:1px solid #afafaf}.user-upgrade-table .mat-row{transition:background-color .2s ease}.user-upgrade-table .mat-row:hover{background-color:#f8f9fa}.user-upgrade-table .mat-row.selected-row{background-color:#08599c1a}.user-upgrade-table .user-info .user-name{font-weight:500;color:#212121}.user-upgrade-table .user-info .user-email{font-size:12px;color:#757575}.user-upgrade-table .site-info{display:flex;align-items:center;gap:8px}.user-upgrade-table .site-info .site-indicator{width:8px;height:8px;border-radius:50%;background-color:#1170cf}.user-upgrade-table .device-info{display:flex;align-items:center;gap:12px}.user-upgrade-table .device-info .device-name-wrapper{display:flex;align-items:center;gap:8px}.user-upgrade-table .device-info .device-name-wrapper .device-name{font-weight:500;color:#212121}.user-upgrade-table .device-info .device-name-wrapper .device-indicator{width:8px;height:8px;border-radius:50%;background-color:#f8cd00}.user-upgrade-table .device-info .device-model{font-size:12px;color:#757575}.user-upgrade-table .status-info{display:flex;align-items:center;gap:8px}.user-upgrade-table .status-info .status-indicator{width:8px;height:8px;border-radius:50%}.user-upgrade-table .status-info .status-indicator.ready{background-color:#1d805f}.user-upgrade-table .status-info .status-indicator.partial-ready{background-color:#f8cd00}.user-upgrade-table .status-info .status-indicator.not-ready{background-color:#9e9e9e}.user-upgrade-table .status-info .status-indicator.completed{background-color:#1d805f}.user-upgrade-table .status-info .status-indicator.failed{background-color:#f23933}.user-upgrade-table .dependencies-text{font-size:12px;background-color:#ffe9e9;padding:.25rem .5rem;border-radius:3px;color:#000}.user-upgrade-table .upgrade-status-cell{display:flex;align-items:center;justify-content:flex-start}.user-upgrade-table .upgrade-button{border:1px solid #08599c!important;color:#08599c!important;background:white!important;border-radius:20px!important;font-size:14px!important;font-style:normal!important;font-weight:500!important;height:32px!important;display:flex!important;align-items:center!important;justify-content:center!important}.user-upgrade-table .upgrade-button:hover{background-color:#e3f2fd!important}.user-upgrade-table .custom-checkbox .mdc-checkbox{padding:8px}.table-action-panel{width:100%;display:flex;justify-content:flex-start;gap:1rem}.action-wrapper{display:flex;flex:1;align-items:center;justify-content:space-between;gap:1rem}.upgrade-bulk-button{border:1px solid #000!important;color:#fff!important;background:#000!important;border-radius:20px!important;padding:0 1rem!important;font-size:14px!important;font-style:normal!important;font-weight:400!important;height:36px!important;display:flex!important;align-items:center!important;justify-content:center!important}.upgrade-bulk-button:hover{background-color:#212121!important}.upgrade-bulk-button:disabled{background-color:#888!important;color:#fff!important;cursor:not-allowed!important;border-color:#888!important;opacity:.25!important}:host ::ng-deep .user-upgrade-table .mat-checkbox-checked.mat-accent .mat-checkbox-background{background-color:#08599c!important;border-color:#08599c!important}:host ::ng-deep .user-upgrade-table .mat-checkbox-indeterminate.mat-accent .mat-checkbox-background{background-color:#08599c!important;border-color:#08599c!important}:host ::ng-deep .user-upgrade-table .mat-checkbox.mat-accent .mat-checkbox-background{border-color:#08599c99!important}:host ::ng-deep .user-upgrade-table .mat-checkbox.mat-accent .mat-ripple-element{background-color:#08599c1a!important}:host ::ng-deep .user-upgrade-table .mat-checkbox.mat-accent:focus .mat-checkbox-background{background-color:#08599c1a!important}:host ::ng-deep .user-upgrade-table .mat-checkbox.mat-accent .mat-checkbox-frame{border-color:#08599c99!important}:host ::ng-deep .user-upgrade-table .mat-checkbox-checkmark{color:#fff!important}:host ::ng-deep .user-upgrade-table .mat-checkbox-checkmark-path{stroke:#fff!important}:host ::ng-deep .user-upgrade-table .mat-checkbox-mixedmark{border-color:#fff!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SummaryCardComponent, selector: "tk-summary-card", inputs: ["value", "status", "description"] }, { kind: "component", type: TableFiltersComponent, selector: "tk-table-filters", inputs: ["filters"], outputs: ["filter"] }, { kind: "component", type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i4$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i5$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }] });
676
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserUpgradeDataTableComponent, decorators: [{
677
+ type: Component,
678
+ args: [{ selector: 'tk-user-upgrade-data-table', template: "<div class=\"wrapper\">\r\n <div class=\"user-upgrade-status-wrapper\">\r\n <tk-summary-card [description]=\"'Users are ready to upgrade'\" [value]=\"statusCounts['Ready']\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Users are not ready'\" [value]=\"statusCounts['Not Ready']\" [status]=\"'Not Ready'\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Users failed to upgrade'\" [value]=\"statusCounts['Failed']\" [status]=\"'Failed'\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Successfully upgraded'\" [value]=\"statusCounts['Completed']\" [status]=\"'Completed'\"></tk-summary-card>\r\n </div>\r\n <div class=\"table-action-panel\">\r\n <tk-table-filters *ngIf=\"filters.length > 0\" [filters]=\"filters\" (filter)=\"onFilter($event)\"></tk-table-filters>\r\n <div class=\"action-wrapper\">\r\n <span>{{filteredDataCount}} Users</span>\r\n <button \r\n mat-button \r\n class=\"upgrade-bulk-button\" \r\n color=\"primary\" \r\n [disabled]=\"selection.selected.length === 0\" \r\n (click)=\"upgradeSelectedUsers()\">\r\n Upgrade {{ selection.selected.length === 0 ? '' : '(' + selection.selected.length + ')' }}\r\n </button>\r\n </div>\r\n </div>\r\n <table mat-table [dataSource]=\"data\" class=\"user-upgrade-table\">\r\n\r\n <!-- Checkbox Column -->\r\n <ng-container matColumnDef=\"select\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <mat-checkbox \r\n (change)=\"$event ? masterToggle() : null\"\r\n [checked]=\"selection.hasValue() && isAllSelected()\"\r\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\"\r\n class=\"custom-checkbox\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <mat-checkbox \r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"\r\n [checked]=\"selection.isSelected(row)\"\r\n [disabled]=\"STATUS_ENTRIES[row.upgradeStatus] !== 'Ready'\"\r\n class=\"custom-checkbox\">\r\n </mat-checkbox>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- User Column -->\r\n <ng-container matColumnDef=\"user\">\r\n <th mat-header-cell *matHeaderCellDef>User</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"user-info\">\r\n <div class=\"user-name\">{{element.userName}}</div>\r\n <div class=\"user-email\">{{element.userName}}</div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Site Column -->\r\n <ng-container matColumnDef=\"site\">\r\n <th mat-header-cell *matHeaderCellDef>Site</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"site-info\">\r\n <span class=\"site-indicator\"></span>\r\n {{element.siteName}}\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Device Column -->\r\n <ng-container matColumnDef=\"device\">\r\n <th mat-header-cell *matHeaderCellDef>Device</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"device-info\">\r\n <div *ngIf=\"element.devices.length > 1\">\r\n <div class=\"device-name-wrapper\">\r\n <span class=\"device-indicator\"></span>\r\n <span class=\"device-name\">Multiple devices</span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"element.devices.length === 1\">\r\n <div class=\"device-name-wrapper\">\r\n <span class=\"device-indicator\"></span>\r\n <span class=\"device-name\">{{element.devices[0]}}</span>\r\n </div>\r\n <span class=\"device-model\">{{ element.primaryExtension || 'No Extension' }}</span>\r\n </div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Dial Plan Status Column -->\r\n <ng-container matColumnDef=\"dialPlanStatus\">\r\n <th mat-header-cell *matHeaderCellDef>Dial Plan Status</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"status-info\">\r\n <span class=\"status-indicator\" [ngClass]=\"getStatusClass(element.dialPlanStatus)\"></span>\r\n <span>{{STATUS_ENTRIES[element.dialPlanStatus]}}</span>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Dependencies Column -->\r\n <ng-container matColumnDef=\"dependencies\">\r\n <th mat-header-cell *matHeaderCellDef>Dependencies</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <span *ngIf=\"DEPENDENCIES_STATUS[element.dependenciesStatus] === 'Dependencies found'\" class=\"dependencies-text\">{{DEPENDENCIES_STATUS[element.dependenciesStatus]}}</span>\r\n <span *ngIf=\"DEPENDENCIES_STATUS[element.dependenciesStatus] === 'No dependencies'\">\u2014</span>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- User Upgrade Status Column -->\r\n <ng-container matColumnDef=\"userUpgradeStatus\">\r\n <th mat-header-cell *matHeaderCellDef>User Upgrade Status</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"upgrade-status-cell\">\r\n <ng-container *ngIf=\"STATUS_ENTRIES[element.upgradeStatus] === 'Ready'; else statusBlock\">\r\n <button mat-button color=\"primary\" class=\"upgrade-button\" (click)=\"upgradeUser(element)\">Upgrade</button>\r\n </ng-container>\r\n <ng-template #statusBlock>\r\n <div class=\"status-info\">\r\n <span class=\"status-indicator\" [ngClass]=\"getStatusClass(element.upgradeStatus)\"></span>\r\n <span>{{STATUS_ENTRIES[element.upgradeStatus]}}</span>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\" \r\n [class.selected-row]=\"selection.isSelected(row)\"></tr>\r\n </table>\r\n</div>", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";.wrapper{display:flex;flex-direction:column;gap:1rem}.user-upgrade-status-wrapper{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}.user-upgrade-table{font-family:Inter,Inter,sans-serif;width:100%;background:white;border-radius:8px;overflow:hidden;font-size:14px}.user-upgrade-table .mat-header-row{font-size:12px;height:35px}.user-upgrade-table .mat-cell{border-bottom:1px solid #d6d6d6}.user-upgrade-table .mat-header-cell{border-bottom:1px solid #afafaf}.user-upgrade-table .mat-row{transition:background-color .2s ease}.user-upgrade-table .mat-row:hover{background-color:#f8f9fa}.user-upgrade-table .mat-row.selected-row{background-color:#08599c1a}.user-upgrade-table .user-info .user-name{font-weight:500;color:#212121}.user-upgrade-table .user-info .user-email{font-size:12px;color:#757575}.user-upgrade-table .site-info{display:flex;align-items:center;gap:8px}.user-upgrade-table .site-info .site-indicator{width:8px;height:8px;border-radius:50%;background-color:#1170cf}.user-upgrade-table .device-info{display:flex;align-items:center;gap:12px}.user-upgrade-table .device-info .device-name-wrapper{display:flex;align-items:center;gap:8px}.user-upgrade-table .device-info .device-name-wrapper .device-name{font-weight:500;color:#212121}.user-upgrade-table .device-info .device-name-wrapper .device-indicator{width:8px;height:8px;border-radius:50%;background-color:#f8cd00}.user-upgrade-table .device-info .device-model{font-size:12px;color:#757575}.user-upgrade-table .status-info{display:flex;align-items:center;gap:8px}.user-upgrade-table .status-info .status-indicator{width:8px;height:8px;border-radius:50%}.user-upgrade-table .status-info .status-indicator.ready{background-color:#1d805f}.user-upgrade-table .status-info .status-indicator.partial-ready{background-color:#f8cd00}.user-upgrade-table .status-info .status-indicator.not-ready{background-color:#9e9e9e}.user-upgrade-table .status-info .status-indicator.completed{background-color:#1d805f}.user-upgrade-table .status-info .status-indicator.failed{background-color:#f23933}.user-upgrade-table .dependencies-text{font-size:12px;background-color:#ffe9e9;padding:.25rem .5rem;border-radius:3px;color:#000}.user-upgrade-table .upgrade-status-cell{display:flex;align-items:center;justify-content:flex-start}.user-upgrade-table .upgrade-button{border:1px solid #08599c!important;color:#08599c!important;background:white!important;border-radius:20px!important;font-size:14px!important;font-style:normal!important;font-weight:500!important;height:32px!important;display:flex!important;align-items:center!important;justify-content:center!important}.user-upgrade-table .upgrade-button:hover{background-color:#e3f2fd!important}.user-upgrade-table .custom-checkbox .mdc-checkbox{padding:8px}.table-action-panel{width:100%;display:flex;justify-content:flex-start;gap:1rem}.action-wrapper{display:flex;flex:1;align-items:center;justify-content:space-between;gap:1rem}.upgrade-bulk-button{border:1px solid #000!important;color:#fff!important;background:#000!important;border-radius:20px!important;padding:0 1rem!important;font-size:14px!important;font-style:normal!important;font-weight:400!important;height:36px!important;display:flex!important;align-items:center!important;justify-content:center!important}.upgrade-bulk-button:hover{background-color:#212121!important}.upgrade-bulk-button:disabled{background-color:#888!important;color:#fff!important;cursor:not-allowed!important;border-color:#888!important;opacity:.25!important}:host ::ng-deep .user-upgrade-table .mat-checkbox-checked.mat-accent .mat-checkbox-background{background-color:#08599c!important;border-color:#08599c!important}:host ::ng-deep .user-upgrade-table .mat-checkbox-indeterminate.mat-accent .mat-checkbox-background{background-color:#08599c!important;border-color:#08599c!important}:host ::ng-deep .user-upgrade-table .mat-checkbox.mat-accent .mat-checkbox-background{border-color:#08599c99!important}:host ::ng-deep .user-upgrade-table .mat-checkbox.mat-accent .mat-ripple-element{background-color:#08599c1a!important}:host ::ng-deep .user-upgrade-table .mat-checkbox.mat-accent:focus .mat-checkbox-background{background-color:#08599c1a!important}:host ::ng-deep .user-upgrade-table .mat-checkbox.mat-accent .mat-checkbox-frame{border-color:#08599c99!important}:host ::ng-deep .user-upgrade-table .mat-checkbox-checkmark{color:#fff!important}:host ::ng-deep .user-upgrade-table .mat-checkbox-checkmark-path{stroke:#fff!important}:host ::ng-deep .user-upgrade-table .mat-checkbox-mixedmark{border-color:#fff!important}\n"] }]
679
+ }], propDecorators: { token: [{
680
+ type: Input
681
+ }] } });
682
+
683
+ class UserUpgradeModule {
684
+ }
685
+ UserUpgradeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserUpgradeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
686
+ UserUpgradeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UserUpgradeModule, declarations: [UserUpgradeDataTableComponent], imports: [CommonModule,
687
+ SharedModule,
688
+ MatTableModule,
689
+ MatButtonModule,
690
+ MatCheckboxModule], exports: [UserUpgradeDataTableComponent] });
691
+ UserUpgradeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserUpgradeModule, imports: [CommonModule,
692
+ SharedModule,
693
+ MatTableModule,
694
+ MatButtonModule,
695
+ MatCheckboxModule] });
696
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserUpgradeModule, decorators: [{
697
+ type: NgModule,
698
+ args: [{
699
+ declarations: [
700
+ UserUpgradeDataTableComponent
701
+ ],
702
+ imports: [
703
+ CommonModule,
704
+ SharedModule,
705
+ MatTableModule,
706
+ MatButtonModule,
707
+ MatCheckboxModule
708
+ ],
709
+ exports: [
710
+ UserUpgradeDataTableComponent
711
+ ]
712
+ }]
713
+ }] });
714
+
715
+ class SiteUpgradeService {
716
+ constructor() {
717
+ this.apiService = inject(APIService);
718
+ }
719
+ getSiteUpgradeStatusCounts() {
720
+ return this.apiService.fetch(API.SITE_UPGRADE.GET_SITES_UPGRADE_STATUS_COUNTS.replace(':customerId', this.customerId));
721
+ }
722
+ getSiteUpgradeRecords() {
723
+ return this.apiService.fetch(API.SITE_UPGRADE.GET_SITES_UPGRADE_DATA.replace(':customerId', this.customerId)).pipe(map((resp) => {
724
+ return resp.content.map((record) => ({
725
+ siteId: record.siteId,
726
+ siteName: record.siteName,
727
+ totalUsers: record.totalUsers,
728
+ totalReadyUsers: record.readyUsers,
729
+ totalNotReadyUsers: record.notReadyUsers,
730
+ totalUpgradedUsers: record.totalUpgradedUsers,
731
+ totalFailedUsers: record.totalFailedToUpgradeUsers,
732
+ locationMapping: record.locationMappingStatus,
733
+ PSTNTrunk: record.pstnTrunkStatus,
734
+ upgradeStatus: record.siteUpgradeStatus
735
+ }));
736
+ }));
737
+ }
738
+ // TODO: Impl the site upgrade logic here
739
+ upgradeSite(site) {
740
+ const customerId = site.customerId;
741
+ const siteId = site.siteId;
742
+ }
743
+ }
744
+ SiteUpgradeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SiteUpgradeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
745
+ SiteUpgradeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SiteUpgradeService, providedIn: 'root' });
746
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SiteUpgradeService, decorators: [{
747
+ type: Injectable,
748
+ args: [{
749
+ providedIn: 'root'
750
+ }]
751
+ }] });
752
+
753
+ class SiteUpgradeDataTableComponent {
754
+ constructor() {
755
+ this.siteUpgradeService = inject(SiteUpgradeService);
756
+ this.apiService = inject(APIService);
757
+ this.destroy$ = new Subject();
758
+ this.STATUS_ENTRIES = STATUS_ENTRIES;
759
+ this.displayedColumns = ['site', 'ready users', 'upgraded users', 'location mapping', 'pstn trunk', 'site upgrade status'];
760
+ this.selection = new SelectionModel(true, []);
761
+ this.filters = [];
762
+ this.activeFilters = {};
763
+ this.statusCounts = {};
764
+ }
765
+ ngOnInit() {
766
+ this.apiService.token = this.token;
767
+ this.siteUpgradeService.getSiteUpgradeRecords()
768
+ .pipe(takeUntil(this.destroy$))
769
+ .subscribe((records) => {
770
+ this.data = new MatTableDataSource(records);
771
+ this.setupCustomFilter();
772
+ this.initializeFilters(records);
773
+ });
774
+ this.siteUpgradeService.getSiteUpgradeStatusCounts()
775
+ .pipe(takeUntil(this.destroy$))
776
+ .subscribe((statusCounts) => {
777
+ this.statusCounts['Ready'] = statusCounts['READY'] || 0;
778
+ this.statusCounts['Not Ready'] = statusCounts['NOT_READY'] || 0;
779
+ this.statusCounts['Completed'] = statusCounts['COMPLETED'] || 0;
780
+ this.statusCounts['Failed'] = statusCounts['FAILED'] || 0;
781
+ });
782
+ }
783
+ initializeFilters(records) {
784
+ // Extract unique sites from actual data
785
+ const uniqueSites = [...new Set(records.map(record => record.siteName))];
786
+ const siteOptions = uniqueSites.map(site => ({
787
+ label: site,
788
+ value: site.toLowerCase().replace(/\s+/g, '-')
789
+ }));
790
+ // Extract unique statuses from actual data
791
+ const uniqueStatuses = [...new Set(records.map(record => record.upgradeStatus))];
792
+ const statusOptions = uniqueStatuses.map(status => ({
793
+ label: STATUS_ENTRIES[status],
794
+ value: status.toLowerCase().replace(/\s+/g, '-')
795
+ }));
796
+ this.filters = [
797
+ {
798
+ id: 'sites',
799
+ type: 'select',
800
+ columnKey: 'Site',
801
+ placeholder: 'Sites',
802
+ options: siteOptions
803
+ },
804
+ {
805
+ id: 'status',
806
+ type: 'select',
807
+ columnKey: 'Site Upgrade Status',
808
+ placeholder: 'Upgrade Status',
809
+ options: statusOptions
810
+ }
811
+ ];
812
+ }
813
+ onFilter(filterEvent) {
814
+ const { key, value } = filterEvent;
815
+ let filterValue;
816
+ if (value && value.value !== undefined) {
817
+ filterValue = value.value;
818
+ }
819
+ else if (value && value.target) {
820
+ filterValue = value.target.value;
821
+ }
822
+ else {
823
+ filterValue = value;
824
+ }
825
+ // Handle "All" option or empty values - remove the filter
826
+ if (filterValue === 'all' || !filterValue || filterValue === '') {
827
+ delete this.activeFilters[key];
828
+ }
829
+ else {
830
+ this.activeFilters[key] = filterValue;
831
+ }
832
+ this.applyFilters();
833
+ }
834
+ setupCustomFilter() {
835
+ this.data.filterPredicate = (data, filter) => {
836
+ const filters = JSON.parse(filter || '{}');
837
+ for (const [key, value] of Object.entries(filters)) {
838
+ if (!value)
839
+ continue;
840
+ switch (key) {
841
+ case 'Site':
842
+ if (data.siteName !== this.getSiteNameFromValue(value)) {
843
+ return false;
844
+ }
845
+ break;
846
+ case 'Site Upgrade Status':
847
+ if (!this.matchesUpgradeStatus(data.upgradeStatus, value)) {
848
+ return false;
849
+ }
850
+ break;
851
+ }
852
+ }
853
+ return true;
854
+ };
855
+ }
856
+ applyFilters() {
857
+ this.data.filter = JSON.stringify(this.activeFilters);
858
+ }
859
+ getSiteNameFromValue(value) {
860
+ // Since we're now using actual site names, just convert back from slug format
861
+ return value.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
862
+ }
863
+ matchesUpgradeStatus(status, filterValue) {
864
+ // Handle direct status matching for cleaner implementation
865
+ return status.toLowerCase().replace(/\s+/g, '-') === filterValue.toLowerCase();
866
+ }
867
+ get filteredDataCount() {
868
+ var _a, _b;
869
+ return ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.filteredData) === null || _b === void 0 ? void 0 : _b.length) || 0;
870
+ }
871
+ /** Whether the number of selected elements matches the total number of rows. */
872
+ isAllSelected() {
873
+ var _a;
874
+ const numSelected = this.selection.selected.length;
875
+ const numRows = ((_a = this.data) === null || _a === void 0 ? void 0 : _a.data.length) || 0;
876
+ return numSelected === numRows;
877
+ }
878
+ /** Selects all rows if they are not all selected; otherwise clear selection. */
879
+ masterToggle() {
880
+ var _a;
881
+ this.isAllSelected() ?
882
+ this.selection.clear() :
883
+ (_a = this.data) === null || _a === void 0 ? void 0 : _a.data.forEach(row => this.selection.select(row));
884
+ }
885
+ getLocationMappingClass(locationMapping) {
886
+ return locationMapping ? 'success' : 'error';
887
+ }
888
+ getSiteUpgradeStatusClass(status) {
889
+ switch (status.toLowerCase()) {
890
+ case 'ready':
891
+ return 'ready';
892
+ case 'partial ready':
893
+ return 'partial-ready';
894
+ case 'completed':
895
+ return 'completed';
896
+ case 'failed':
897
+ return 'failed';
898
+ case 'not ready':
899
+ return 'not-ready';
900
+ default:
901
+ return 'not-ready';
902
+ }
903
+ }
904
+ upgradeSite(site) {
905
+ this.siteUpgradeService.upgradeSite(site);
906
+ }
907
+ ngOnDestroy() {
908
+ this.destroy$.next();
909
+ this.destroy$.complete();
910
+ }
911
+ }
912
+ SiteUpgradeDataTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SiteUpgradeDataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
913
+ SiteUpgradeDataTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SiteUpgradeDataTableComponent, selector: "tk-site-upgrade-data-table", inputs: { token: "token" }, ngImport: i0, template: "<div class=\"wrapper\">\r\n <div class=\"site-upgrade-status-wrapper\">\r\n <tk-summary-card [description]=\"'Sites are ready to upgrade'\" [value]=\"statusCounts['Ready']\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Sites are not ready'\" [value]=\"statusCounts['Not Ready']\" [status]=\"'Not Ready'\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Sites failed to upgrade'\" [value]=\"statusCounts['Failed']\" [status]=\"'Failed'\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Successfully upgraded'\" [value]=\"statusCounts['Completed']\" [status]=\"'Completed'\"></tk-summary-card>\r\n </div>\r\n <div class=\"table-action-panel\">\r\n <tk-table-filters *ngIf=\"filters.length > 0\" [filters]=\"filters\" (filter)=\"onFilter($event)\"></tk-table-filters>\r\n <div class=\"action-wrapper\">\r\n <span>{{filteredDataCount}} Sites</span>\r\n </div>\r\n </div>\r\n <table mat-table [dataSource]=\"data\" class=\"site-upgrade-table\">\r\n\r\n <!-- Site Column -->\r\n <ng-container matColumnDef=\"site\">\r\n <th mat-header-cell *matHeaderCellDef>Site</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"site-info\">\r\n <span class=\"site-indicator\"></span>\r\n {{element.siteName}}\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Ready Users Column -->\r\n <ng-container matColumnDef=\"ready users\">\r\n <th mat-header-cell *matHeaderCellDef>Ready Users</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"user-count-info\">\r\n <div class=\"user-count\">{{element.totalReadyUsers}}/{{element.totalUsers}}</div>\r\n <div class=\"user-label\">Ready/Total</div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Upgraded Users Column --> \r\n <ng-container matColumnDef=\"upgraded users\">\r\n <th mat-header-cell *matHeaderCellDef>Upgraded Users</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"user-count-info\">\r\n <div class=\"user-count\">{{element.totalUpgradedUsers}}/{{element.totalUsers}}</div>\r\n <div class=\"user-label\">Upgraded/Total</div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Location Mapping Column -->\r\n <ng-container matColumnDef=\"location mapping\">\r\n <th mat-header-cell *matHeaderCellDef>Location Mapping</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"status-icon-cell\">\r\n <img *ngIf=\"element.locationMapping\" src=\"/assets/icons/check2_icon.png\" alt=\"Location Mapping Enabled\"/>\r\n <img *ngIf=\"!element.locationMapping\" src=\"/assets/icons/issue_icon.png\" alt=\"Location Mapping Disabled\"/>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- PSTN Trunk Column -->\r\n <ng-container matColumnDef=\"pstn trunk\">\r\n <th mat-header-cell *matHeaderCellDef>PSTN Trunk</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"status-icon-cell\">\r\n <img *ngIf=\"element.PSTNTrunk\" src=\"/assets/icons/check2_icon.png\" alt=\"PSTN Trunk Enabled\"/>\r\n <img *ngIf=\"!element.PSTNTrunk\" src=\"/assets/icons/issue_icon.png\" alt=\"PSTN Trunk Disabled\"/>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Site Upgrade Status Column -->\r\n <ng-container matColumnDef=\"site upgrade status\">\r\n <th mat-header-cell *matHeaderCellDef>Site Upgrade Status</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"upgrade-status-cell\">\r\n <ng-container *ngIf=\"STATUS_ENTRIES[element.upgradeStatus] === 'Ready'; else statusBlock\">\r\n <button mat-button color=\"primary\" class=\"upgrade-button\" (click)=\"upgradeSite(element)\">Upgrade</button>\r\n </ng-container>\r\n <ng-template #statusBlock>\r\n <div class=\"status-info\">\r\n <span class=\"status-indicator\" [ngClass]=\"getSiteUpgradeStatusClass(element.upgradeStatus)\"></span>\r\n <span>{{ STATUS_ENTRIES[element.upgradeStatus] }}</span>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n</table>\r\n</div>", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";.wrapper{display:flex;flex-direction:column;gap:1rem}.site-upgrade-status-wrapper{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}.site-upgrade-table{font-family:Inter,Inter,sans-serif;width:100%;background:white;border-radius:8px;overflow:hidden;font-size:14px}.site-upgrade-table .mat-header-row{font-size:12px;height:35px}.site-upgrade-table .mat-cell{border-bottom:1px solid #d6d6d6}.site-upgrade-table .mat-header-cell{border-bottom:1px solid #afafaf}.site-upgrade-table .site-info{display:flex;align-items:center;gap:8px}.site-upgrade-table .site-info .site-indicator{width:8px;height:8px;border-radius:50%;background-color:#1170cf}.site-upgrade-table .device-info{display:flex;align-items:center;gap:12px}.site-upgrade-table .device-info .device-name-wrapper{display:flex;align-items:center;gap:4px}.site-upgrade-table .device-info .device-name-wrapper .device-name{font-weight:500;color:#212121}.site-upgrade-table .device-info .device-name-wrapper .device-indicator{width:8px;height:8px;border-radius:50%;background-color:#f8cd00}.site-upgrade-table .device-info .device-model{font-size:12px;color:#757575}.site-upgrade-table .status-info{display:flex;align-items:center;gap:8px}.site-upgrade-table .status-info .status-indicator{width:8px;height:8px;border-radius:50%}.site-upgrade-table .status-info .status-indicator.ready{background-color:#1d805f}.site-upgrade-table .status-info .status-indicator.partial-ready{background-color:#f8cd00}.site-upgrade-table .status-info .status-indicator.not-ready{background-color:#9e9e9e}.site-upgrade-table .status-info .status-indicator.completed{background-color:#1d805f}.site-upgrade-table .status-info .status-indicator.failed{background-color:#f23933}.site-upgrade-table .dependencies-text{font-size:12px;background-color:#ffe9e9;padding:.25rem .5rem;border-radius:3px;color:#000}.site-upgrade-table .upgrade-status-cell{display:flex;align-items:center;justify-content:flex-start}.site-upgrade-table .upgrade-button{border:1px solid #08599c;color:#08599c;background:white;border-radius:20px;font-size:14px;font-style:normal;font-weight:500;height:32px;display:flex;align-items:center;justify-content:center}.site-upgrade-table .upgrade-button:hover{background-color:#e3f2fd}.site-upgrade-table .user-count-info .user-count{font-weight:500;color:#212121}.site-upgrade-table .user-count-info .user-label{font-size:12px;color:#757575}.site-upgrade-table .status-icon-cell{display:flex;align-items:center}.action-wrapper{display:flex;align-items:center;flex:1;justify-content:space-between;gap:1rem}.table-action-panel{width:100%;display:flex;justify-content:flex-start;align-items:center;gap:1rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SummaryCardComponent, selector: "tk-summary-card", inputs: ["value", "status", "description"] }, { kind: "component", type: TableFiltersComponent, selector: "tk-table-filters", inputs: ["filters"], outputs: ["filter"] }, { kind: "component", type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i4$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i5$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
914
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SiteUpgradeDataTableComponent, decorators: [{
915
+ type: Component,
916
+ args: [{ selector: 'tk-site-upgrade-data-table', template: "<div class=\"wrapper\">\r\n <div class=\"site-upgrade-status-wrapper\">\r\n <tk-summary-card [description]=\"'Sites are ready to upgrade'\" [value]=\"statusCounts['Ready']\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Sites are not ready'\" [value]=\"statusCounts['Not Ready']\" [status]=\"'Not Ready'\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Sites failed to upgrade'\" [value]=\"statusCounts['Failed']\" [status]=\"'Failed'\"></tk-summary-card>\r\n <tk-summary-card [description]=\"'Successfully upgraded'\" [value]=\"statusCounts['Completed']\" [status]=\"'Completed'\"></tk-summary-card>\r\n </div>\r\n <div class=\"table-action-panel\">\r\n <tk-table-filters *ngIf=\"filters.length > 0\" [filters]=\"filters\" (filter)=\"onFilter($event)\"></tk-table-filters>\r\n <div class=\"action-wrapper\">\r\n <span>{{filteredDataCount}} Sites</span>\r\n </div>\r\n </div>\r\n <table mat-table [dataSource]=\"data\" class=\"site-upgrade-table\">\r\n\r\n <!-- Site Column -->\r\n <ng-container matColumnDef=\"site\">\r\n <th mat-header-cell *matHeaderCellDef>Site</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"site-info\">\r\n <span class=\"site-indicator\"></span>\r\n {{element.siteName}}\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Ready Users Column -->\r\n <ng-container matColumnDef=\"ready users\">\r\n <th mat-header-cell *matHeaderCellDef>Ready Users</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"user-count-info\">\r\n <div class=\"user-count\">{{element.totalReadyUsers}}/{{element.totalUsers}}</div>\r\n <div class=\"user-label\">Ready/Total</div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Upgraded Users Column --> \r\n <ng-container matColumnDef=\"upgraded users\">\r\n <th mat-header-cell *matHeaderCellDef>Upgraded Users</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"user-count-info\">\r\n <div class=\"user-count\">{{element.totalUpgradedUsers}}/{{element.totalUsers}}</div>\r\n <div class=\"user-label\">Upgraded/Total</div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Location Mapping Column -->\r\n <ng-container matColumnDef=\"location mapping\">\r\n <th mat-header-cell *matHeaderCellDef>Location Mapping</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"status-icon-cell\">\r\n <img *ngIf=\"element.locationMapping\" src=\"/assets/icons/check2_icon.png\" alt=\"Location Mapping Enabled\"/>\r\n <img *ngIf=\"!element.locationMapping\" src=\"/assets/icons/issue_icon.png\" alt=\"Location Mapping Disabled\"/>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- PSTN Trunk Column -->\r\n <ng-container matColumnDef=\"pstn trunk\">\r\n <th mat-header-cell *matHeaderCellDef>PSTN Trunk</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"status-icon-cell\">\r\n <img *ngIf=\"element.PSTNTrunk\" src=\"/assets/icons/check2_icon.png\" alt=\"PSTN Trunk Enabled\"/>\r\n <img *ngIf=\"!element.PSTNTrunk\" src=\"/assets/icons/issue_icon.png\" alt=\"PSTN Trunk Disabled\"/>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <!-- Site Upgrade Status Column -->\r\n <ng-container matColumnDef=\"site upgrade status\">\r\n <th mat-header-cell *matHeaderCellDef>Site Upgrade Status</th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <div class=\"upgrade-status-cell\">\r\n <ng-container *ngIf=\"STATUS_ENTRIES[element.upgradeStatus] === 'Ready'; else statusBlock\">\r\n <button mat-button color=\"primary\" class=\"upgrade-button\" (click)=\"upgradeSite(element)\">Upgrade</button>\r\n </ng-container>\r\n <ng-template #statusBlock>\r\n <div class=\"status-info\">\r\n <span class=\"status-indicator\" [ngClass]=\"getSiteUpgradeStatusClass(element.upgradeStatus)\"></span>\r\n <span>{{ STATUS_ENTRIES[element.upgradeStatus] }}</span>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n</table>\r\n</div>", styles: ["@import\"https://fonts.googleapis.com/css?family=Poppins:400,100,200,300,500,600,800,700,900\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap\";.wrapper{display:flex;flex-direction:column;gap:1rem}.site-upgrade-status-wrapper{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}.site-upgrade-table{font-family:Inter,Inter,sans-serif;width:100%;background:white;border-radius:8px;overflow:hidden;font-size:14px}.site-upgrade-table .mat-header-row{font-size:12px;height:35px}.site-upgrade-table .mat-cell{border-bottom:1px solid #d6d6d6}.site-upgrade-table .mat-header-cell{border-bottom:1px solid #afafaf}.site-upgrade-table .site-info{display:flex;align-items:center;gap:8px}.site-upgrade-table .site-info .site-indicator{width:8px;height:8px;border-radius:50%;background-color:#1170cf}.site-upgrade-table .device-info{display:flex;align-items:center;gap:12px}.site-upgrade-table .device-info .device-name-wrapper{display:flex;align-items:center;gap:4px}.site-upgrade-table .device-info .device-name-wrapper .device-name{font-weight:500;color:#212121}.site-upgrade-table .device-info .device-name-wrapper .device-indicator{width:8px;height:8px;border-radius:50%;background-color:#f8cd00}.site-upgrade-table .device-info .device-model{font-size:12px;color:#757575}.site-upgrade-table .status-info{display:flex;align-items:center;gap:8px}.site-upgrade-table .status-info .status-indicator{width:8px;height:8px;border-radius:50%}.site-upgrade-table .status-info .status-indicator.ready{background-color:#1d805f}.site-upgrade-table .status-info .status-indicator.partial-ready{background-color:#f8cd00}.site-upgrade-table .status-info .status-indicator.not-ready{background-color:#9e9e9e}.site-upgrade-table .status-info .status-indicator.completed{background-color:#1d805f}.site-upgrade-table .status-info .status-indicator.failed{background-color:#f23933}.site-upgrade-table .dependencies-text{font-size:12px;background-color:#ffe9e9;padding:.25rem .5rem;border-radius:3px;color:#000}.site-upgrade-table .upgrade-status-cell{display:flex;align-items:center;justify-content:flex-start}.site-upgrade-table .upgrade-button{border:1px solid #08599c;color:#08599c;background:white;border-radius:20px;font-size:14px;font-style:normal;font-weight:500;height:32px;display:flex;align-items:center;justify-content:center}.site-upgrade-table .upgrade-button:hover{background-color:#e3f2fd}.site-upgrade-table .user-count-info .user-count{font-weight:500;color:#212121}.site-upgrade-table .user-count-info .user-label{font-size:12px;color:#757575}.site-upgrade-table .status-icon-cell{display:flex;align-items:center}.action-wrapper{display:flex;align-items:center;flex:1;justify-content:space-between;gap:1rem}.table-action-panel{width:100%;display:flex;justify-content:flex-start;align-items:center;gap:1rem}\n"] }]
917
+ }], ctorParameters: function () { return []; }, propDecorators: { token: [{
918
+ type: Input
919
+ }] } });
920
+
921
+ class SiteUpgradeModule {
922
+ }
923
+ SiteUpgradeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SiteUpgradeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
924
+ SiteUpgradeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SiteUpgradeModule, declarations: [SiteUpgradeDataTableComponent], imports: [CommonModule,
925
+ SharedModule,
926
+ MatTableModule,
927
+ MatIconModule,
928
+ MatButtonModule], exports: [SiteUpgradeDataTableComponent] });
929
+ SiteUpgradeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SiteUpgradeModule, imports: [CommonModule,
930
+ SharedModule,
931
+ MatTableModule,
932
+ MatIconModule,
933
+ MatButtonModule] });
934
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SiteUpgradeModule, decorators: [{
935
+ type: NgModule,
936
+ args: [{
937
+ declarations: [
938
+ SiteUpgradeDataTableComponent
939
+ ],
940
+ imports: [
941
+ CommonModule,
942
+ SharedModule,
943
+ MatTableModule,
944
+ MatIconModule,
945
+ MatButtonModule
946
+ ],
947
+ exports: [
948
+ SiteUpgradeDataTableComponent
949
+ ]
950
+ }]
951
+ }] });
952
+
953
+ class UpgradeOverviewService {
954
+ constructor(apiService) {
955
+ this.apiService = apiService;
956
+ }
957
+ getUpgradePreconditions() {
958
+ return this.apiService.fetch(API.OVERVIEW.GET_UPGRADE_PRECONDITIONS.replace(':customerId', this.customerId)).pipe(map((resp) => {
959
+ return {
960
+ id: resp.id,
961
+ customerId: resp.customerId,
962
+ controlHubIntegration: resp.controlHubIntegration,
963
+ numberOfAvailableLicences: resp.availableLicences
964
+ };
965
+ }));
966
+ }
967
+ getSiteInfrastructureSummary() {
968
+ return this.apiService.fetch(API.OVERVIEW.GET_SITE_INFRASTRUCTURE.replace(':customerId', this.customerId)).pipe(map((resp) => {
969
+ return {
970
+ id: resp.id,
971
+ customerId: resp.customerId,
972
+ totalSites: resp.totalSites,
973
+ totalLocations: resp.totalLocations,
974
+ totalPSTNs: resp.totalPSTNS
975
+ };
976
+ }));
977
+ }
978
+ getUsersUpgradeSummary() {
979
+ return this.apiService.fetch(API.OVERVIEW.GET_USERS_UPGRADE_SUMMARY.replace(':customerId', this.customerId)).pipe(map((resp) => {
980
+ return {
981
+ id: resp.id,
982
+ customerId: resp.customerId,
983
+ totalUsers: resp.totalUsers,
984
+ totalReadyUsers: resp.totalUsersReady,
985
+ totalUpgradedUsers: resp.totalUsersUpgraded
986
+ };
987
+ }));
988
+ }
989
+ getSitesUpgradeSummary() {
990
+ return this.apiService.fetch(API.OVERVIEW.GET_SITES_UPGRADE_SUMMARY.replace(':customerId', this.customerId)).pipe(map((resp) => {
991
+ return {
992
+ id: resp.id,
993
+ customerId: resp.customerId,
994
+ totalSites: resp.totalSites,
995
+ totalReadySites: resp.totalSitesReady,
996
+ totalUpgradedSites: resp.totalSitesUpgraded
997
+ };
998
+ }));
999
+ }
1000
+ getUsersUpgradeReadiness() {
1001
+ return this.apiService.fetch(API.OVERVIEW.GET_USERS_UPGRADE_READINESS.replace(':customerId', this.customerId)).pipe(map((resp) => {
1002
+ return {
1003
+ id: resp.id,
1004
+ customerId: resp.customerId,
1005
+ totalUsers: resp.totalUsers,
1006
+ totalReadyUsers: resp.totalUsersReady
1007
+ };
1008
+ }));
1009
+ }
1010
+ getSitesUpgradeReadiness() {
1011
+ return this.apiService.fetch(API.OVERVIEW.GET_SITES_UPGRADE_READINESS.replace(':customerId', this.customerId)).pipe(map((resp) => {
1012
+ return {
1013
+ id: resp.id,
1014
+ customerId: resp.customerId,
1015
+ totalSites: resp.totalSites,
1016
+ totalReadySites: resp.totalSitesReady
1017
+ };
1018
+ }));
1019
+ }
1020
+ }
1021
+ UpgradeOverviewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UpgradeOverviewService, deps: [{ token: APIService }], target: i0.ɵɵFactoryTarget.Injectable });
1022
+ UpgradeOverviewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UpgradeOverviewService, providedIn: 'root' });
1023
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UpgradeOverviewService, decorators: [{
1024
+ type: Injectable,
1025
+ args: [{
1026
+ providedIn: 'root'
1027
+ }]
1028
+ }], ctorParameters: function () { return [{ type: APIService }]; } });
1029
+
1030
+ class ReadyToUpgradeUsersCardComponent {
1031
+ constructor() {
1032
+ this.apiService = inject(APIService);
1033
+ this.upgradeOverviewService = inject(UpgradeOverviewService);
1034
+ this.destroy$ = new Subject();
1035
+ this.title = 'Ready Users';
1036
+ this.type = 'user';
1037
+ this.upgradeStatus = 'ready';
1038
+ this.loading = false;
1039
+ }
1040
+ ngOnInit() {
1041
+ this.apiService.token = this.token;
1042
+ this.loading = true;
1043
+ this.upgradeOverviewService.getUsersUpgradeReadiness()
1044
+ .pipe(takeUntil(this.destroy$))
1045
+ .subscribe((stats) => {
1046
+ this.readinessStats = stats;
1047
+ this.loading = false;
1048
+ });
1049
+ }
1050
+ ngOnDestroy() {
1051
+ this.destroy$.next();
1052
+ this.destroy$.complete();
1053
+ }
1054
+ }
1055
+ ReadyToUpgradeUsersCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ReadyToUpgradeUsersCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1056
+ ReadyToUpgradeUsersCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ReadyToUpgradeUsersCardComponent, selector: "tk-ready-to-upgrade-users-card", inputs: { token: "token" }, ngImport: i0, template: " <tk-stat-card\r\n *ngIf=\"!loading\"\r\n [title]=\"title\"\r\n [type]=\"type\"\r\n [readinessStats]=\"readinessStats\"\r\n [upgradeStatus]=\"upgradeStatus\">\r\n </tk-stat-card>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: StatCardComponent, selector: "tk-stat-card", inputs: ["title", "type", "readinessStats", "upgradeStatus"] }] });
1057
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ReadyToUpgradeUsersCardComponent, decorators: [{
1058
+ type: Component,
1059
+ args: [{ selector: 'tk-ready-to-upgrade-users-card', template: " <tk-stat-card\r\n *ngIf=\"!loading\"\r\n [title]=\"title\"\r\n [type]=\"type\"\r\n [readinessStats]=\"readinessStats\"\r\n [upgradeStatus]=\"upgradeStatus\">\r\n </tk-stat-card>" }]
1060
+ }], propDecorators: { token: [{
1061
+ type: Input
1062
+ }] } });
1063
+
1064
+ class ReadyToUpgradeSitesCardComponent {
1065
+ constructor() {
1066
+ this.apiService = inject(APIService);
1067
+ this.upgradeOverviewService = inject(UpgradeOverviewService);
1068
+ this.destroy$ = new Subject();
1069
+ this.title = 'Ready Sites';
1070
+ this.type = 'site';
1071
+ this.upgradeStatus = 'ready';
1072
+ this.loading = false;
1073
+ }
1074
+ ngOnInit() {
1075
+ this.apiService.token = this.token;
1076
+ this.loading = true;
1077
+ this.upgradeOverviewService.getSitesUpgradeReadiness()
1078
+ .pipe(takeUntil(this.destroy$))
1079
+ .subscribe((stats) => {
1080
+ this.readinessStats = stats;
1081
+ this.loading = false;
1082
+ });
1083
+ }
1084
+ ngOnDestroy() {
1085
+ this.destroy$.next();
1086
+ this.destroy$.complete();
1087
+ }
1088
+ }
1089
+ ReadyToUpgradeSitesCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ReadyToUpgradeSitesCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1090
+ ReadyToUpgradeSitesCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ReadyToUpgradeSitesCardComponent, selector: "tk-ready-to-upgrade-sites-card", inputs: { token: "token" }, ngImport: i0, template: " <tk-stat-card\r\n *ngIf=\"!loading\"\r\n [title]=\"title\"\r\n [type]=\"type\"\r\n [readinessStats]=\"readinessStats\"\r\n [upgradeStatus]=\"upgradeStatus\">\r\n </tk-stat-card>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: StatCardComponent, selector: "tk-stat-card", inputs: ["title", "type", "readinessStats", "upgradeStatus"] }] });
1091
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ReadyToUpgradeSitesCardComponent, decorators: [{
1092
+ type: Component,
1093
+ args: [{ selector: 'tk-ready-to-upgrade-sites-card', template: " <tk-stat-card\r\n *ngIf=\"!loading\"\r\n [title]=\"title\"\r\n [type]=\"type\"\r\n [readinessStats]=\"readinessStats\"\r\n [upgradeStatus]=\"upgradeStatus\">\r\n </tk-stat-card>" }]
1094
+ }], propDecorators: { token: [{
1095
+ type: Input
1096
+ }] } });
1097
+
1098
+ class AlreadyUpgradedUsersCardComponent {
1099
+ constructor() {
1100
+ this.apiService = inject(APIService);
1101
+ this.upgradeOverviewService = inject(UpgradeOverviewService);
1102
+ this.destroy$ = new Subject();
1103
+ this.title = 'Upgraded Users';
1104
+ this.type = 'user';
1105
+ this.upgradeStatus = 'already';
1106
+ this.loading = false;
1107
+ }
1108
+ ngOnInit() {
1109
+ this.apiService.token = this.token;
1110
+ this.loading = true;
1111
+ this.upgradeOverviewService.getUsersUpgradeSummary()
1112
+ .pipe(takeUntil(this.destroy$))
1113
+ .subscribe((stats) => {
1114
+ this.readinessStats = stats;
1115
+ this.loading = false;
1116
+ });
1117
+ }
1118
+ ngOnDestroy() {
1119
+ this.destroy$.next();
1120
+ this.destroy$.complete();
1121
+ }
1122
+ }
1123
+ AlreadyUpgradedUsersCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AlreadyUpgradedUsersCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1124
+ AlreadyUpgradedUsersCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AlreadyUpgradedUsersCardComponent, selector: "tk-already-upgraded-users-card", inputs: { token: "token" }, ngImport: i0, template: `
1125
+ <tk-stat-card
1126
+ *ngIf="!loading"
1127
+ [title]="title"
1128
+ [type]="type"
1129
+ [readinessStats]="readinessStats"
1130
+ [upgradeStatus]="upgradeStatus"
1131
+ ></tk-stat-card>
1132
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: StatCardComponent, selector: "tk-stat-card", inputs: ["title", "type", "readinessStats", "upgradeStatus"] }] });
1133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AlreadyUpgradedUsersCardComponent, decorators: [{
1134
+ type: Component,
1135
+ args: [{
1136
+ selector: 'tk-already-upgraded-users-card',
1137
+ template: `
1138
+ <tk-stat-card
1139
+ *ngIf="!loading"
1140
+ [title]="title"
1141
+ [type]="type"
1142
+ [readinessStats]="readinessStats"
1143
+ [upgradeStatus]="upgradeStatus"
1144
+ ></tk-stat-card>
1145
+ `
1146
+ }]
1147
+ }], propDecorators: { token: [{
1148
+ type: Input
1149
+ }] } });
1150
+
1151
+ class AlreadyUpgradedSitesCardComponent {
1152
+ constructor() {
1153
+ this.apiService = inject(APIService);
1154
+ this.upgradeOverviewService = inject(UpgradeOverviewService);
1155
+ this.destroy$ = new Subject();
1156
+ this.title = 'Upgraded Sites';
1157
+ this.type = 'site';
1158
+ this.upgradeStatus = 'already';
1159
+ this.loading = false;
1160
+ }
1161
+ ngOnInit() {
1162
+ this.apiService.token = this.token;
1163
+ this.loading = true;
1164
+ this.upgradeOverviewService.getSitesUpgradeSummary()
1165
+ .pipe(takeUntil(this.destroy$))
1166
+ .subscribe((stats) => {
1167
+ this.readinessStats = stats;
1168
+ this.loading = false;
1169
+ });
1170
+ }
1171
+ ngOnDestroy() {
1172
+ this.destroy$.next();
1173
+ this.destroy$.complete();
1174
+ }
1175
+ }
1176
+ AlreadyUpgradedSitesCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AlreadyUpgradedSitesCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1177
+ AlreadyUpgradedSitesCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AlreadyUpgradedSitesCardComponent, selector: "tk-already-upgraded-sites-card", inputs: { token: "token" }, ngImport: i0, template: `
1178
+ <tk-stat-card
1179
+ *ngIf="!loading"
1180
+ [title]="title"
1181
+ [type]="type"
1182
+ [readinessStats]="readinessStats"
1183
+ [upgradeStatus]="upgradeStatus"
1184
+ ></tk-stat-card>
1185
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: StatCardComponent, selector: "tk-stat-card", inputs: ["title", "type", "readinessStats", "upgradeStatus"] }] });
1186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AlreadyUpgradedSitesCardComponent, decorators: [{
1187
+ type: Component,
1188
+ args: [{
1189
+ selector: 'tk-already-upgraded-sites-card',
1190
+ template: `
1191
+ <tk-stat-card
1192
+ *ngIf="!loading"
1193
+ [title]="title"
1194
+ [type]="type"
1195
+ [readinessStats]="readinessStats"
1196
+ [upgradeStatus]="upgradeStatus"
1197
+ ></tk-stat-card>
1198
+ `
1199
+ }]
1200
+ }], propDecorators: { token: [{
1201
+ type: Input
1202
+ }] } });
1203
+
1204
+ class PreconditionsStatusListCardComponent {
1205
+ constructor() {
1206
+ this.apiService = inject(APIService);
1207
+ this.destroy$ = new Subject();
1208
+ this.upgradeOverviewService = inject(UpgradeOverviewService);
1209
+ this.title = 'Preconditions';
1210
+ }
1211
+ ngOnInit() {
1212
+ this.apiService.token = this.token;
1213
+ this.upgradeOverviewService.getUpgradePreconditions()
1214
+ .pipe(takeUntil(this.destroy$))
1215
+ .subscribe((resp) => {
1216
+ this.preconditions = resp;
1217
+ this.init();
1218
+ });
1219
+ }
1220
+ ngOnDestroy() {
1221
+ this.destroy$.next();
1222
+ this.destroy$.complete();
1223
+ }
1224
+ init() {
1225
+ this.items = [
1226
+ {
1227
+ label: 'Control Hub Integration',
1228
+ description: 'Control Hub Connectivity',
1229
+ status: this.preconditions.controlHubIntegration === 'CONNECTED'
1230
+ },
1231
+ {
1232
+ label: 'SIP Trunk (Local Gateway)',
1233
+ description: 'CUCM trunk connectivity estabilished',
1234
+ status: false
1235
+ },
1236
+ {
1237
+ label: `${this.preconditions.numberOfAvailableLicences} Available User Licences`,
1238
+ description: 'Webex calling licences provisioned and assgined',
1239
+ status: this.preconditions.numberOfAvailableLicences > 0
1240
+ }
1241
+ ];
1242
+ }
1243
+ }
1244
+ PreconditionsStatusListCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PreconditionsStatusListCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1245
+ PreconditionsStatusListCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PreconditionsStatusListCardComponent, selector: "tk-preconditions-status-list-card", inputs: { token: "token" }, ngImport: i0, template: `
1246
+ <tk-status-list-card
1247
+ [title]="title"
1248
+ [items]="items"
1249
+ ></tk-status-list-card>
1250
+ `, isInline: true, styles: [":host{width:100%}\n"], dependencies: [{ kind: "component", type: StatusListCardComponent, selector: "tk-status-list-card", inputs: ["title", "items"] }] });
1251
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PreconditionsStatusListCardComponent, decorators: [{
1252
+ type: Component,
1253
+ args: [{ selector: 'tk-preconditions-status-list-card', template: `
1254
+ <tk-status-list-card
1255
+ [title]="title"
1256
+ [items]="items"
1257
+ ></tk-status-list-card>
1258
+ `, styles: [":host{width:100%}\n"] }]
1259
+ }], propDecorators: { token: [{
1260
+ type: Input
1261
+ }] } });
1262
+
1263
+ class SiteInfrastructureStatusListCardComponent {
1264
+ constructor() {
1265
+ this.title = 'Site Infrastructure';
1266
+ this.apiService = inject(APIService);
1267
+ this.upgradeOverviewService = inject(UpgradeOverviewService);
1268
+ this.destroy$ = new Subject();
1269
+ }
1270
+ ngOnInit() {
1271
+ this.apiService.token = this.token;
1272
+ this.upgradeOverviewService.getSiteInfrastructureSummary()
1273
+ .pipe(takeUntil(this.destroy$))
1274
+ .subscribe((siteInfrastructure) => {
1275
+ this.items = [
1276
+ {
1277
+ label: 'PSTN Trunk',
1278
+ description: 'Public network connectivity',
1279
+ status: false,
1280
+ totalSites: siteInfrastructure.totalSites,
1281
+ value: siteInfrastructure.totalPSTNs
1282
+ },
1283
+ {
1284
+ label: 'Location Mapping',
1285
+ description: 'Sites defined in Control Hub with proper configuration',
1286
+ status: false,
1287
+ totalSites: siteInfrastructure.totalSites,
1288
+ value: siteInfrastructure.totalLocations
1289
+ }
1290
+ ];
1291
+ });
1292
+ }
1293
+ ngOnDestroy() {
1294
+ this.destroy$.next();
1295
+ this.destroy$.complete();
1296
+ }
1297
+ }
1298
+ SiteInfrastructureStatusListCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SiteInfrastructureStatusListCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1299
+ SiteInfrastructureStatusListCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SiteInfrastructureStatusListCardComponent, selector: "tk-site-infrastructure-status-list-card", inputs: { token: "token" }, ngImport: i0, template: `
1300
+ <tk-status-list-card
1301
+ [title]="title"
1302
+ [items]="items"
1303
+ ></tk-status-list-card>
1304
+ `, isInline: true, styles: [":host{width:100%}\n"], dependencies: [{ kind: "component", type: StatusListCardComponent, selector: "tk-status-list-card", inputs: ["title", "items"] }] });
1305
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SiteInfrastructureStatusListCardComponent, decorators: [{
1306
+ type: Component,
1307
+ args: [{ selector: 'tk-site-infrastructure-status-list-card', template: `
1308
+ <tk-status-list-card
1309
+ [title]="title"
1310
+ [items]="items"
1311
+ ></tk-status-list-card>
1312
+ `, styles: [":host{width:100%}\n"] }]
1313
+ }], propDecorators: { token: [{
1314
+ type: Input
1315
+ }] } });
1316
+
1317
+ class UpgradeStateComparisonChartCardComponent {
1318
+ constructor() {
1319
+ this.apiService = inject(APIService);
1320
+ this.upgradeOverviewService = inject(UpgradeOverviewService);
1321
+ this.destroy$ = new Subject();
1322
+ this.type = 'Users';
1323
+ this.loading = false;
1324
+ }
1325
+ ngOnInit() {
1326
+ this.apiService.token = this.token;
1327
+ this.totalUpgraded = 0;
1328
+ this.totalNotUpgraded = 0;
1329
+ this.loading = true;
1330
+ this.title = `Upgraded vs. Not Upgraded ${this.type}`;
1331
+ if (this.type === 'Sites') {
1332
+ this.upgradeOverviewService.getSitesUpgradeSummary()
1333
+ .pipe(takeUntil(this.destroy$))
1334
+ .subscribe((stats) => {
1335
+ this.totalUpgraded = parseInt(stats.totalUpgradedSites);
1336
+ this.totalNotUpgraded = parseInt(stats.totalReadySites);
1337
+ this.loading = false;
1338
+ });
1339
+ }
1340
+ else {
1341
+ this.upgradeOverviewService.getUsersUpgradeSummary()
1342
+ .pipe(takeUntil(this.destroy$))
1343
+ .subscribe((stats) => {
1344
+ this.totalUpgraded = parseInt(stats.totalUpgradedUsers);
1345
+ this.totalNotUpgraded = parseInt(stats.totalReadyUsers);
1346
+ this.loading = false;
1347
+ });
1348
+ }
1349
+ }
1350
+ ngOnDestroy() {
1351
+ this.destroy$.next();
1352
+ this.destroy$.complete();
1353
+ }
1354
+ }
1355
+ UpgradeStateComparisonChartCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UpgradeStateComparisonChartCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1356
+ UpgradeStateComparisonChartCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UpgradeStateComparisonChartCardComponent, selector: "tk-upgrade-state-comparison-chart-card", inputs: { type: "type", token: "token" }, ngImport: i0, template: `
1357
+ <tk-chart-card
1358
+ *ngIf="!loading"
1359
+ [title]="title"
1360
+ [totalUpgraded]="totalUpgraded"
1361
+ [totalNotUpgraded]="totalNotUpgraded"
1362
+ ></tk-chart-card>
1363
+ `, isInline: true, styles: [":host{width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ChartCardComponent, selector: "tk-chart-card", inputs: ["title", "totalUpgraded", "totalNotUpgraded"] }] });
1364
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UpgradeStateComparisonChartCardComponent, decorators: [{
1365
+ type: Component,
1366
+ args: [{ selector: "tk-upgrade-state-comparison-chart-card", template: `
1367
+ <tk-chart-card
1368
+ *ngIf="!loading"
1369
+ [title]="title"
1370
+ [totalUpgraded]="totalUpgraded"
1371
+ [totalNotUpgraded]="totalNotUpgraded"
1372
+ ></tk-chart-card>
1373
+ `, styles: [":host{width:100%}\n"] }]
1374
+ }], propDecorators: { type: [{
1375
+ type: Input
1376
+ }], token: [{
1377
+ type: Input
1378
+ }] } });
1379
+
1380
+ class UpgradeOverviewModule {
1381
+ }
1382
+ UpgradeOverviewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UpgradeOverviewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1383
+ UpgradeOverviewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UpgradeOverviewModule, declarations: [ReadyToUpgradeUsersCardComponent,
1384
+ ReadyToUpgradeSitesCardComponent,
1385
+ AlreadyUpgradedUsersCardComponent,
1386
+ AlreadyUpgradedSitesCardComponent,
1387
+ PreconditionsStatusListCardComponent,
1388
+ SiteInfrastructureStatusListCardComponent,
1389
+ UpgradeStateComparisonChartCardComponent], imports: [CommonModule,
1390
+ SharedModule], exports: [ReadyToUpgradeUsersCardComponent,
1391
+ ReadyToUpgradeSitesCardComponent,
1392
+ AlreadyUpgradedUsersCardComponent,
1393
+ AlreadyUpgradedSitesCardComponent,
1394
+ PreconditionsStatusListCardComponent,
1395
+ SiteInfrastructureStatusListCardComponent,
1396
+ UpgradeStateComparisonChartCardComponent] });
1397
+ UpgradeOverviewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UpgradeOverviewModule, imports: [CommonModule,
1398
+ SharedModule] });
1399
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UpgradeOverviewModule, decorators: [{
1400
+ type: NgModule,
1401
+ args: [{
1402
+ declarations: [
1403
+ ReadyToUpgradeUsersCardComponent,
1404
+ ReadyToUpgradeSitesCardComponent,
1405
+ AlreadyUpgradedUsersCardComponent,
1406
+ AlreadyUpgradedSitesCardComponent,
1407
+ PreconditionsStatusListCardComponent,
1408
+ SiteInfrastructureStatusListCardComponent,
1409
+ UpgradeStateComparisonChartCardComponent
1410
+ ],
1411
+ imports: [
1412
+ CommonModule,
1413
+ SharedModule
1414
+ ],
1415
+ exports: [
1416
+ ReadyToUpgradeUsersCardComponent,
1417
+ ReadyToUpgradeSitesCardComponent,
1418
+ AlreadyUpgradedUsersCardComponent,
1419
+ AlreadyUpgradedSitesCardComponent,
1420
+ PreconditionsStatusListCardComponent,
1421
+ SiteInfrastructureStatusListCardComponent,
1422
+ UpgradeStateComparisonChartCardComponent
1423
+ ],
1424
+ providers: []
1425
+ }]
1426
+ }] });
1427
+
1428
+ /*
1429
+ * Public API Surface of @tuki-io/tuki-widgets
1430
+ */
1431
+ // Shared Components
1432
+
1433
+ /**
1434
+ * Generated bundle index. Do not edit.
1435
+ */
1436
+
1437
+ export { AlreadyUpgradedSitesCardComponent, AlreadyUpgradedUsersCardComponent, CardComponent, ChartCardComponent, PreconditionsStatusListCardComponent, ReadyToUpgradeSitesCardComponent, ReadyToUpgradeUsersCardComponent, SharedModule, SiteInfrastructureStatusListCardComponent, SiteUpgradeDataTableComponent, SiteUpgradeModule, StatCardComponent, StatusListCardComponent, SummaryCardComponent, TableFiltersComponent, UpgradeOverviewModule, UpgradeStateComparisonChartCardComponent, UserUpgradeDataTableComponent, UserUpgradeModule };
1438
+ //# sourceMappingURL=tuki-io-tuki-widgets-di2mt.mjs.map