tango-app-ui-shared 3.5.0-alpha.1 → 3.5.0-alpha.3

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.
@@ -5226,12 +5226,15 @@ class SingleStoredateComponent {
5226
5226
  ngOnInit() {
5227
5227
  this.activatedRoute?.queryParams.subscribe(params => {
5228
5228
  this.dataUser = params;
5229
- console.log("Query Params:", this.dataUser);
5229
+ // Re-check date after params load
5230
+ this.initializeFilters();
5230
5231
  });
5231
5232
  if ("user-info" in localStorage) {
5232
5233
  const userData = JSON.parse(localStorage.getItem("user-info") || "{}");
5233
5234
  this.users = userData;
5234
5235
  }
5236
+ }
5237
+ initializeFilters() {
5235
5238
  const clientFromRoute = this.dataUser?.client;
5236
5239
  const clientFromHeader = localStorage.getItem("header-filters")
5237
5240
  ? JSON.parse(localStorage.getItem("header-filters") || "{}").client
@@ -5243,14 +5246,29 @@ class SingleStoredateComponent {
5243
5246
  this.headerFilters = headerFilters;
5244
5247
  // Determine final client ID
5245
5248
  const finalClient = clientFromRoute ?? clientFromHeader ?? clientFromUser;
5246
- // Safely assign all filters
5247
5249
  this.selectedFilters.client = finalClient;
5248
5250
  this.selectedFilters.clients = finalClient ? [finalClient] : [];
5249
5251
  this.selectedFilters.clientName = headerFilters.clientName || "";
5250
5252
  this.selectedFilters.store = this.dataUser?.storeId ?? headerFilters.store ?? "";
5251
5253
  this.selectedFilters.storeName = headerFilters.storeName || "";
5252
- // Handle date
5253
- if (headerFilters?.date?.startDate && headerFilters?.date?.endDate) {
5254
+ this.selectedFilters.group = headerFilters.group;
5255
+ this.selectedFilters.location = headerFilters.location;
5256
+ this.selectedFilters.country = headerFilters.country;
5257
+ this.selectedFilters.stores = headerFilters.stores ?? "";
5258
+ this.selectedFilters.zoneName = headerFilters.zoneName ?? "";
5259
+ // ✅ Handle query param date if present
5260
+ if (this.dataUser?.date) {
5261
+ const date = this.dataUser.date;
5262
+ this.selectedFilters.date = {
5263
+ startDate: date,
5264
+ endDate: date,
5265
+ };
5266
+ this.selectedDateRange = {
5267
+ startDate: this.dayjs(date, "YYYY-MM-DD").format("DD-MM-YYYY"),
5268
+ endDate: this.dayjs(date, "YYYY-MM-DD").format("DD-MM-YYYY"),
5269
+ };
5270
+ }
5271
+ else if (headerFilters?.date?.startDate && headerFilters?.date?.endDate) {
5254
5272
  this.selectedFilters.date = headerFilters.date;
5255
5273
  this.selectedDateRange = {
5256
5274
  startDate: this.dayjs(headerFilters.date.startDate, "YYYY-MM-DD").format("DD-MM-YYYY"),
@@ -5258,7 +5276,7 @@ class SingleStoredateComponent {
5258
5276
  };
5259
5277
  }
5260
5278
  else {
5261
- // Default to yesterday if no valid date is found
5279
+ // Default to yesterday
5262
5280
  const yesterday = this.dayjs().subtract(1, "days");
5263
5281
  const formattedDate = {
5264
5282
  startDate: yesterday.format("YYYY-MM-DD"),
@@ -5270,7 +5288,7 @@ class SingleStoredateComponent {
5270
5288
  endDate: yesterday.format("DD-MM-YYYY"),
5271
5289
  };
5272
5290
  }
5273
- // Save back only if valid
5291
+ // Save only if valid
5274
5292
  if (finalClient && this.selectedFilters.date?.startDate && this.selectedFilters.store) {
5275
5293
  localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
5276
5294
  }
@@ -5304,12 +5322,14 @@ class SingleStoredateComponent {
5304
5322
  const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
5305
5323
  this.selectedFilters.date = headerFilters.date;
5306
5324
  }
5307
- this.selectedFilters.client = this.users.clientId;
5308
- this.selectedFilters.clients = [this.users.clientId];
5325
+ const clientId = this.users?.clientId ?? this.dataUser?.client ?? this.selectedFilters.client;
5326
+ this.selectedFilters.client = clientId;
5327
+ this.selectedFilters.clients = clientId ? [clientId] : [this.selectedFilters.client];
5309
5328
  this.selectedFilters.date = this.selectedFilters.date;
5310
- this.selectedFilters.storeName = this.selectedFilters.storeName;
5329
+ this.selectedFilters.storeName = this.selectedFilters.storeName || '';
5311
5330
  this.gs.dataRangeValue.next(this.selectedFilters);
5312
5331
  localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
5332
+ this.cd.detectChanges();
5313
5333
  }
5314
5334
  Apply() {
5315
5335
  const headerFilters = JSON.parse(localStorage.getItem("header-filters") || "{}");
@@ -6840,8 +6860,10 @@ class MetricsHeaderComponent {
6840
6860
  const isValidDate = m > this.dayjs();
6841
6861
  return isValidDate ? "invalid-date" : false;
6842
6862
  };
6843
- selectedDateRange = { startDate: dayjs().subtract(30, 'days'),
6844
- endDate: dayjs().subtract(1, "days"), };
6863
+ selectedDateRange = {
6864
+ startDate: dayjs().subtract(30, "days"),
6865
+ endDate: dayjs().subtract(1, "days"),
6866
+ };
6845
6867
  selectedFilters = {
6846
6868
  client: null,
6847
6869
  clientName: null,
@@ -6852,7 +6874,7 @@ class MetricsHeaderComponent {
6852
6874
  group: [],
6853
6875
  location: [],
6854
6876
  country: [],
6855
- zoneName: []
6877
+ zoneName: [],
6856
6878
  };
6857
6879
  Opendropdown = false;
6858
6880
  dropdownOpen = null; // 'location' or 'group'
@@ -6866,8 +6888,8 @@ class MetricsHeaderComponent {
6866
6888
  filteredZones = [];
6867
6889
  stores = [];
6868
6890
  zones = [];
6869
- searchStoreText = '';
6870
- searchZoneText = '';
6891
+ searchStoreText = "";
6892
+ searchZoneText = "";
6871
6893
  clientList = [];
6872
6894
  selectedClient;
6873
6895
  locationLabel = [];
@@ -6886,7 +6908,7 @@ class MetricsHeaderComponent {
6886
6908
  }
6887
6909
  onClick(event) {
6888
6910
  const target = event.target;
6889
- if (!target.closest('.dropdown2')) {
6911
+ if (!target.closest(".dropdown2")) {
6890
6912
  this.Opendropdown = false;
6891
6913
  }
6892
6914
  }
@@ -6901,12 +6923,12 @@ class MetricsHeaderComponent {
6901
6923
  // this.setRangesBasedOnRoute();
6902
6924
  // }
6903
6925
  // });
6904
- this.url = this.router.url.split("?")[0].split('/');
6905
- const user = JSON.parse(localStorage.getItem('user-info'));
6926
+ this.url = this.router.url.split("?")[0].split("/");
6927
+ const user = JSON.parse(localStorage.getItem("user-info"));
6906
6928
  this.users = user;
6907
6929
  this.gs?.manageRefreshTrigger?.subscribe((e) => {
6908
6930
  if (e) {
6909
- if (user.userType === 'tango') {
6931
+ if (user.userType === "tango") {
6910
6932
  this.getClient();
6911
6933
  }
6912
6934
  else {
@@ -6915,18 +6937,18 @@ class MetricsHeaderComponent {
6915
6937
  const headerFilters = JSON.parse(storedFilters);
6916
6938
  this.filteredStores = headerFilters?.stores.map((store) => ({
6917
6939
  ...store,
6918
- checked: store.checked
6940
+ checked: store.checked,
6919
6941
  }));
6920
6942
  this.filteredZones = headerFilters?.zoneName.map((store) => ({
6921
6943
  ...store,
6922
- checked: store.checked
6944
+ checked: store.checked,
6923
6945
  }));
6924
6946
  }
6925
6947
  }
6926
6948
  }
6927
6949
  });
6928
6950
  // Fetch client data if the user is of type 'tango'
6929
- if (user.userType === 'tango') {
6951
+ if (user.userType === "tango") {
6930
6952
  this.getClient();
6931
6953
  }
6932
6954
  else {
@@ -6938,7 +6960,7 @@ class MetricsHeaderComponent {
6938
6960
  if (clientFilters) {
6939
6961
  const headerclientFilters = JSON.parse(clientFilters);
6940
6962
  this.selectedClient = {
6941
- trafficDateRange: headerclientFilters.trafficDateRange
6963
+ trafficDateRange: headerclientFilters.trafficDateRange,
6942
6964
  };
6943
6965
  }
6944
6966
  }
@@ -6949,7 +6971,7 @@ class MetricsHeaderComponent {
6949
6971
  // Initialize selectedFilters with defaults or existing values
6950
6972
  this.selectedFilters = {
6951
6973
  client: headerFilters.client || this.users.client,
6952
- clientName: headerFilters.clientName || '',
6974
+ clientName: headerFilters.clientName || "",
6953
6975
  clients: headerFilters.clients || [],
6954
6976
  store: headerFilters.store || null,
6955
6977
  date: headerFilters.date || {},
@@ -6992,7 +7014,7 @@ class MetricsHeaderComponent {
6992
7014
  return items
6993
7015
  ? items.map((item) => ({
6994
7016
  ...item,
6995
- checked: item.checked === true
7017
+ checked: item.checked === true,
6996
7018
  }))
6997
7019
  : [];
6998
7020
  }
@@ -7007,7 +7029,7 @@ class MetricsHeaderComponent {
7007
7029
  resetFilters() {
7008
7030
  this.selectedFilters = {
7009
7031
  client: null,
7010
- clientName: '',
7032
+ clientName: "",
7011
7033
  clients: [],
7012
7034
  store: null,
7013
7035
  date: {},
@@ -7015,7 +7037,7 @@ class MetricsHeaderComponent {
7015
7037
  group: [],
7016
7038
  location: [],
7017
7039
  country: [],
7018
- zoneName: []
7040
+ zoneName: [],
7019
7041
  };
7020
7042
  this.filteredLocations = [];
7021
7043
  this.filteredGroups = [];
@@ -7114,13 +7136,13 @@ class MetricsHeaderComponent {
7114
7136
  }
7115
7137
  getUserInfo(client) {
7116
7138
  let obj = {
7117
- clientId: client ? client : ''
7139
+ clientId: client ? client : "",
7118
7140
  };
7119
7141
  if (client) {
7120
7142
  this.auth.getHeaderUsers(obj).subscribe({
7121
7143
  next: (e) => {
7122
7144
  localStorage.setItem("usersEmail-info", JSON.stringify(e?.data?.userEmailData || []));
7123
- }
7145
+ },
7124
7146
  });
7125
7147
  }
7126
7148
  }
@@ -7153,7 +7175,7 @@ class MetricsHeaderComponent {
7153
7175
  this.getStore();
7154
7176
  this.getGroups();
7155
7177
  // Update localStorage with the new client selection and empty filter data
7156
- localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
7178
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
7157
7179
  window.location.reload();
7158
7180
  // Emit data to the global service
7159
7181
  // this.gs.dataRangeValue.next(this.selectedFilters);
@@ -7162,16 +7184,16 @@ class MetricsHeaderComponent {
7162
7184
  }
7163
7185
  ranges = {
7164
7186
  Today: [dayjs(), dayjs()],
7165
- Yesterday: [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')],
7166
- 'This Week': [dayjs().subtract(7, 'days'), dayjs().subtract(1, 'days')],
7167
- 'Last Week': [
7168
- dayjs().subtract(14, 'days').startOf('day'),
7169
- dayjs().subtract(8, 'days').endOf('day'),
7187
+ Yesterday: [dayjs().subtract(1, "days"), dayjs().subtract(1, "days")],
7188
+ "This Week": [dayjs().subtract(7, "days"), dayjs().subtract(1, "days")],
7189
+ "Last Week": [
7190
+ dayjs().subtract(14, "days").startOf("day"),
7191
+ dayjs().subtract(8, "days").endOf("day"),
7170
7192
  ],
7171
- 'This Month': [dayjs().subtract(30, 'days'), dayjs().subtract(1, 'days')],
7172
- 'Last Month': [
7173
- dayjs().subtract(1, 'month').startOf('month'),
7174
- dayjs().subtract(1, 'month').endOf('month'),
7193
+ "This Month": [dayjs().subtract(30, "days"), dayjs().subtract(1, "days")],
7194
+ "Last Month": [
7195
+ dayjs().subtract(1, "month").startOf("month"),
7196
+ dayjs().subtract(1, "month").endOf("month"),
7175
7197
  ],
7176
7198
  };
7177
7199
  onStartDateChange(event) {
@@ -7184,7 +7206,8 @@ class MetricsHeaderComponent {
7184
7206
  }
7185
7207
  else {
7186
7208
  this.isCustomDate = (m) => {
7187
- const isValidDate = m > this.dayjs() || m > this.dayjs(event.startDate.add(180, "days"));
7209
+ const isValidDate = m > this.dayjs() ||
7210
+ m > this.dayjs(event.startDate.add(180, "days"));
7188
7211
  return isValidDate ? "invalid-date" : false;
7189
7212
  };
7190
7213
  }
@@ -7213,18 +7236,22 @@ class MetricsHeaderComponent {
7213
7236
  }
7214
7237
  getLocations() {
7215
7238
  const country = this.countries
7216
- .filter(country => country.checked)
7217
- .map(country => country.country);
7239
+ .filter((country) => country.checked)
7240
+ .map((country) => country.country);
7218
7241
  // const headerFilters: any = JSON.parse(localStorage.getItem("header-filters") || "{}");
7219
7242
  let obj = {
7220
- clientId: this.selectedFilters.client ? this.selectedFilters.client : this.users.clientId,
7243
+ clientId: this.selectedFilters.client
7244
+ ? this.selectedFilters.client
7245
+ : this.users.clientId,
7221
7246
  country,
7222
7247
  city: [],
7223
7248
  group: [],
7224
7249
  };
7225
7250
  this.auth.getLocation(obj).subscribe({
7226
7251
  next: (res) => {
7227
- let cityList = this.selectedFilters?.location?.filter((location) => location.checked).map((loc) => loc.city);
7252
+ let cityList = this.selectedFilters?.location
7253
+ ?.filter((location) => location.checked)
7254
+ .map((loc) => loc.city);
7228
7255
  // Map the fetched locations with default unchecked state
7229
7256
  this.locations = res?.data?.locationData.map((city) => ({
7230
7257
  city: city.city,
@@ -7232,19 +7259,26 @@ class MetricsHeaderComponent {
7232
7259
  checked: cityList?.includes(city.city) ? true : false,
7233
7260
  }));
7234
7261
  // Sync the fetched locations with any stored checked values in localStorage
7235
- if (this.selectedFilters.location && Array.isArray(this.selectedFilters.location)) {
7236
- this.filteredLocations = this.locations.map(location => {
7262
+ if (this.selectedFilters.location &&
7263
+ Array.isArray(this.selectedFilters.location)) {
7264
+ this.filteredLocations = this.locations.map((location) => {
7237
7265
  const matchedLocation = this.selectedFilters.location.find((loc) => loc.city === location.city);
7238
- return matchedLocation ? { ...location, checked: matchedLocation.checked } : location;
7266
+ return matchedLocation
7267
+ ? { ...location, checked: matchedLocation.checked }
7268
+ : location;
7239
7269
  });
7240
7270
  }
7241
7271
  else {
7242
7272
  this.filteredLocations = this.locations;
7243
7273
  }
7244
7274
  if (this.searchLocationText) {
7245
- this.filteredLocations = this.locations.filter((location) => location.city.toLowerCase().includes(this.searchLocationText.toLowerCase()));
7275
+ this.filteredLocations = this.locations.filter((location) => location.city
7276
+ .toLowerCase()
7277
+ .includes(this.searchLocationText.toLowerCase()));
7246
7278
  }
7247
- const selectedLocations = this.locations.filter((location) => location.checked).map((location) => location.city);
7279
+ const selectedLocations = this.locations
7280
+ .filter((location) => location.checked)
7281
+ .map((location) => location.city);
7248
7282
  if (selectedLocations.length > 0) {
7249
7283
  setTimeout(() => {
7250
7284
  this.getGroups();
@@ -7261,36 +7295,50 @@ class MetricsHeaderComponent {
7261
7295
  });
7262
7296
  }
7263
7297
  isAllLocationsSelected() {
7264
- return this.filteredLocations.every(location => location.checked);
7298
+ return this.filteredLocations.every((location) => location.checked);
7265
7299
  }
7266
7300
  selectedLocationsLabel() {
7267
- const selectedLocations = this.locationLabel = this.searchLocationText.length ? this.locations
7268
- .filter(location => location.checked).map(location => location.city) : this.filteredLocations
7269
- .filter(location => location.checked).map(location => location.city);
7301
+ const selectedLocations = (this.locationLabel = this.searchLocationText
7302
+ .length
7303
+ ? this.locations
7304
+ .filter((location) => location.checked)
7305
+ .map((location) => location.city)
7306
+ : this.filteredLocations
7307
+ .filter((location) => location.checked)
7308
+ .map((location) => location.city));
7270
7309
  return selectedLocations.length === 0
7271
- ? ''
7310
+ ? ""
7272
7311
  : selectedLocations.length === 1
7273
7312
  ? selectedLocations[0]
7274
- : `${selectedLocations.length} locations`;
7313
+ : `${selectedLocations.length} Region`;
7275
7314
  }
7276
7315
  removeLocation() {
7277
7316
  this.Reset();
7278
7317
  }
7279
7318
  getGroups() {
7280
7319
  const country = this.countries
7281
- .filter(country => country.checked)
7282
- .map(country => country.country);
7320
+ .filter((country) => country.checked)
7321
+ .map((country) => country.country);
7283
7322
  let city;
7284
7323
  city = this.locations
7285
- .filter(location => location.checked)
7286
- .map(location => location.city);
7324
+ .filter((location) => location.checked)
7325
+ .map((location) => location.city);
7287
7326
  if (!city.length && country.length) {
7288
7327
  city = this.locations.map((loc) => loc.city);
7289
7328
  }
7290
- const obj = { country, city, clientId: this.selectedFilters.client ? this.selectedFilters.client : this.users.clientId, group: [] };
7329
+ const obj = {
7330
+ country,
7331
+ city,
7332
+ clientId: this.selectedFilters.client
7333
+ ? this.selectedFilters.client
7334
+ : this.users.clientId,
7335
+ group: [],
7336
+ };
7291
7337
  this.auth.getGroups(obj).subscribe({
7292
7338
  next: (res) => {
7293
- let checkedGroup = this.selectedFilters?.group?.filter((group) => group.checked).map((group) => group.groupName);
7339
+ let checkedGroup = this.selectedFilters?.group
7340
+ ?.filter((group) => group.checked)
7341
+ .map((group) => group.groupName);
7294
7342
  const combinedGroups = res?.data?.groupData?.map((groupName) => ({
7295
7343
  groupName: groupName.groupName,
7296
7344
  checked: checkedGroup?.includes(groupName.groupName) ? true : false,
@@ -7304,7 +7352,9 @@ class MetricsHeaderComponent {
7304
7352
  this.filteredGroups = combinedGroups;
7305
7353
  }
7306
7354
  // Auto-fetch stores when groups are selected
7307
- const selectedGroups = this.groupsData.filter((group) => group.checked).map((group) => group.groupName);
7355
+ const selectedGroups = this.groupsData
7356
+ .filter((group) => group.checked)
7357
+ .map((group) => group.groupName);
7308
7358
  if (selectedGroups.length > 0) {
7309
7359
  setTimeout(() => {
7310
7360
  this.getStore(); // Fetch stores based on selected groups
@@ -7324,51 +7374,57 @@ class MetricsHeaderComponent {
7324
7374
  else {
7325
7375
  // Open the specific dropdown and handle data fetching only if necessary
7326
7376
  this.dropdownOpen = type;
7327
- if (type === 'country') {
7377
+ if (type === "country") {
7328
7378
  // Fetch countries only if not already fetched and no search text exists
7329
- if ((!this.filteredCountries || this.filteredCountries.length === 0) && !this.searchCountryText.trim()) {
7379
+ if ((!this.filteredCountries || this.filteredCountries.length === 0) &&
7380
+ !this.searchCountryText.trim()) {
7330
7381
  this.getCountry();
7331
7382
  }
7332
7383
  }
7333
- if (type === 'group') {
7384
+ if (type === "group") {
7334
7385
  // Fetch groups only if there are selected cities and no active search text
7335
7386
  const selectedCities = this.locations
7336
7387
  .filter((location) => location.checked)
7337
7388
  .map((location) => location.city);
7338
7389
  // Fetch groups only if locations are selected, no search text exists, and dropdown is opened
7339
- if (this.filteredLocations.length > 0 || (selectedCities.length > 0 && !this.searchGroupText.trim())) {
7390
+ if (this.filteredLocations.length > 0 ||
7391
+ (selectedCities.length > 0 && !this.searchGroupText.trim())) {
7340
7392
  this.getGroups();
7341
7393
  }
7342
7394
  else {
7343
7395
  this.filteredGroups = []; // Clear groups if no locations are selected
7344
7396
  }
7345
7397
  }
7346
- if (type === 'store') {
7398
+ if (type === "store") {
7347
7399
  // Fetch stores only if not already fetched and no search text is active
7348
- if ((!this.filteredStores || this.filteredStores.length === 0) && !this.searchStoreText.trim()) {
7400
+ if ((!this.filteredStores || this.filteredStores.length === 0) &&
7401
+ !this.searchStoreText.trim()) {
7349
7402
  this.getStore();
7350
7403
  }
7351
7404
  }
7352
- if (type === 'zone') {
7405
+ if (type === "zone") {
7353
7406
  // Fetch stores only if not already fetched and no search text is active
7354
- if ((!this.filteredZones || this.filteredZones.length === 0) && !this.searchZoneText.trim()) {
7407
+ if ((!this.filteredZones || this.filteredZones.length === 0) &&
7408
+ !this.searchZoneText.trim()) {
7355
7409
  this.getZone();
7356
7410
  }
7357
7411
  }
7358
7412
  }
7359
7413
  }
7360
7414
  handleGroupDropdownClick() {
7361
- if (this.dropdownOpen === 'group') {
7415
+ if (this.dropdownOpen === "group") {
7362
7416
  this.resetSelectedGroups();
7363
7417
  }
7364
- this.toggleDropdown('group');
7418
+ this.toggleDropdown("group");
7365
7419
  }
7366
7420
  resetSelectedGroups() {
7367
7421
  this.filteredGroups.forEach((group) => (group.checked = false));
7368
7422
  this.searchGroupText = "";
7369
7423
  }
7370
7424
  selectedGroupsLabel() {
7371
- const selectedGroups = this.groupLabel = this.searchGroupText.length ? this.groupsData.filter((group) => group.checked) : this.filteredGroups.filter((group) => group.checked);
7425
+ const selectedGroups = (this.groupLabel = this.searchGroupText.length
7426
+ ? this.groupsData.filter((group) => group.checked)
7427
+ : this.filteredGroups.filter((group) => group.checked));
7372
7428
  return selectedGroups.length === 0
7373
7429
  ? ""
7374
7430
  : selectedGroups.length === 1
@@ -7379,23 +7435,25 @@ class MetricsHeaderComponent {
7379
7435
  this.Reset();
7380
7436
  }
7381
7437
  isAllGroupsSelected() {
7382
- return this.filteredGroups.length ? this.filteredGroups.every((group) => group.checked) : false;
7438
+ return this.filteredGroups.length
7439
+ ? this.filteredGroups.every((group) => group.checked)
7440
+ : false;
7383
7441
  }
7384
7442
  getStore() {
7385
7443
  const country = this.countries
7386
- .filter(country => country.checked)
7387
- .map(country => country.country);
7444
+ .filter((country) => country.checked)
7445
+ .map((country) => country.country);
7388
7446
  const city = this.locations
7389
- .filter(location => location.checked)
7390
- .map(location => location.city);
7447
+ .filter((location) => location.checked)
7448
+ .map((location) => location.city);
7391
7449
  const group = this.groupsData
7392
- .filter(group => group.checked)
7393
- .map(group => group.groupName);
7450
+ .filter((group) => group.checked)
7451
+ .map((group) => group.groupName);
7394
7452
  const data = {
7395
7453
  country,
7396
7454
  city,
7397
7455
  clusters: group,
7398
- clientId: this.users.clientId || this.selectedFilters.client
7456
+ clientId: this.users.clientId || this.selectedFilters.client,
7399
7457
  };
7400
7458
  this.auth.getHeaderStores(data).subscribe({
7401
7459
  next: (res) => {
@@ -7404,30 +7462,34 @@ class MetricsHeaderComponent {
7404
7462
  this.stores = res.data.storesData;
7405
7463
  // Check if there are previously selected stores
7406
7464
  const checkedStoreIds = this.selectedFilters?.stores
7407
- ? this.selectedFilters.stores.filter((store) => store.checked).map((store) => store.storeId)
7465
+ ? this.selectedFilters.stores
7466
+ .filter((store) => store.checked)
7467
+ .map((store) => store.storeId)
7408
7468
  : [];
7409
7469
  // Sync the `checked` state
7410
- this.stores.forEach(store => {
7470
+ this.stores.forEach((store) => {
7411
7471
  store.checked = checkedStoreIds.length
7412
7472
  ? checkedStoreIds.includes(store.storeId) // Use previous selection
7413
7473
  : true; // Default to true if no previous selection
7414
7474
  });
7415
7475
  // Apply search filter if search text is present
7416
7476
  if (this.searchStoreText.length) {
7417
- this.filteredStores = this.stores.filter(store => store.storeName.toLowerCase().includes(this.searchStoreText.toLowerCase()));
7477
+ this.filteredStores = this.stores.filter((store) => store.storeName
7478
+ .toLowerCase()
7479
+ .includes(this.searchStoreText.toLowerCase()));
7418
7480
  }
7419
7481
  else {
7420
7482
  this.filteredStores = [...this.stores];
7421
7483
  }
7422
7484
  // Update `selectedFilters.stores` to reflect the current state
7423
- this.selectedFilters.stores = this.filteredStores.map(store => ({
7485
+ this.selectedFilters.stores = this.filteredStores.map((store) => ({
7424
7486
  storeId: store.storeId,
7425
7487
  storeName: store.storeName,
7426
- checked: store.checked
7488
+ checked: store.checked,
7427
7489
  }));
7428
7490
  // this.selectedFilters.country = country;
7429
7491
  // Save updated filters to localStorage
7430
- localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
7492
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
7431
7493
  this.getZone();
7432
7494
  // Trigger UI change detection
7433
7495
  this.cd.detectChanges();
@@ -7440,93 +7502,108 @@ class MetricsHeaderComponent {
7440
7502
  error: (err) => {
7441
7503
  console.error("Failed to fetch stores", err);
7442
7504
  this.clearStoresState();
7443
- }
7505
+ },
7444
7506
  });
7445
7507
  }
7446
7508
  getZone() {
7447
7509
  const country = this.countries
7448
- .filter(country => country.checked)
7449
- .map(country => country.country);
7510
+ .filter((country) => country.checked)
7511
+ .map((country) => country.country);
7450
7512
  const city = this.locations
7451
- .filter(location => location.checked)
7452
- .map(location => location.city);
7513
+ .filter((location) => location.checked)
7514
+ .map((location) => location.city);
7453
7515
  const group = this.groupsData
7454
- .filter(group => group.checked)
7455
- .map(group => group.groupName);
7516
+ .filter((group) => group.checked)
7517
+ .map((group) => group.groupName);
7456
7518
  const storeId = this.filteredStores
7457
- .filter(group => group.checked)
7458
- .map(group => group.storeId);
7519
+ .filter((group) => group.checked)
7520
+ .map((group) => group.storeId);
7459
7521
  const data = {
7460
7522
  country,
7461
7523
  city,
7462
7524
  clusters: group,
7463
7525
  clientId: this.users.clientId || this.selectedFilters.client,
7464
- storeId: storeId
7526
+ storeId: storeId,
7465
7527
  };
7466
7528
  this.auth.getHeaderZone(data).subscribe({
7467
7529
  next: (res) => {
7468
7530
  if (res && res.code === 200) {
7469
- // Initialize stores from API response
7470
- this.zones = res?.data?.zoneData;
7471
- // Check if there are previously selected stores
7531
+ // Initialize zones with Overall Store first, unchecked by default
7532
+ this.zones = [
7533
+ { _id: "overall", tagName: "Overall Store", checked: false },
7534
+ ...(res?.data?.zoneData?.map((zone) => ({
7535
+ _id: zone._id,
7536
+ tagName: zone.tagName,
7537
+ checked: false, // initialize unchecked; will update below
7538
+ })) || []),
7539
+ ];
7540
+ // Get previously selected zone IDs (checked ones)
7472
7541
  const checkedStoreIds = this.selectedFilters?.zoneName
7473
- ? this.selectedFilters?.zoneName.filter((Zone) => Zone.checked).map((zone) => zone._id)
7542
+ ? this.selectedFilters.zoneName
7543
+ .filter((zone) => zone.checked)
7544
+ .map((zone) => zone._id)
7474
7545
  : [];
7475
- // Sync the `checked` state,
7476
- this.zones.forEach(zone => {
7477
- zone.checked = checkedStoreIds.length
7478
- ? checkedStoreIds.includes(zone._id) // Use previous selection
7479
- : true; // Default to true if no previous selection
7546
+ // Sync checked state with previous selections or default:
7547
+ // If no previous selection, Overall Store unchecked, others checked
7548
+ this.zones.forEach((zone) => {
7549
+ if (checkedStoreIds.length) {
7550
+ zone.checked = checkedStoreIds.includes(zone._id);
7551
+ }
7552
+ else {
7553
+ zone.checked = zone._id !== "overall";
7554
+ }
7480
7555
  });
7481
- // Apply search filter if search text is present
7556
+ // Apply search filter if any
7482
7557
  if (this.searchZoneText.length) {
7483
- this.filteredZones = this.zones.filter(zone => zone.tagName.toLowerCase().includes(this.searchZoneText.toLowerCase()));
7558
+ this.filteredZones = this.zones.filter((zone) => zone.tagName
7559
+ .toLowerCase()
7560
+ .includes(this.searchZoneText.toLowerCase()));
7484
7561
  }
7485
7562
  else {
7486
7563
  this.filteredZones = [...this.zones];
7487
7564
  }
7488
- // Update `selectedFilters.stores` to reflect the current state
7489
- this.selectedFilters.zoneName = this.filteredZones.map(zone => ({
7565
+ // Update selectedFilters.zoneName with current checked states
7566
+ this.selectedFilters.zoneName = this.filteredZones.map((zone) => ({
7490
7567
  _id: zone._id,
7491
7568
  tagName: zone.tagName,
7492
- checked: zone.checked
7569
+ checked: zone.checked,
7493
7570
  }));
7494
- // this.selectedFilters.country = couthis.filteredZonesntry;
7495
7571
  // Save updated filters to localStorage
7496
- localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
7497
- // Trigger UI change detection
7572
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
7573
+ // Trigger change detection if needed
7498
7574
  this.cd.detectChanges();
7499
7575
  }
7500
7576
  else {
7501
- // Handle empty or error response
7502
7577
  this.clearZoneState();
7503
7578
  }
7504
7579
  },
7505
7580
  error: (err) => {
7506
- console.error("Failed to fetch stores", err);
7581
+ console.error("Failed to fetch zones", err);
7507
7582
  this.clearZoneState();
7508
- }
7583
+ },
7509
7584
  });
7510
7585
  }
7511
7586
  clearZoneState() {
7512
7587
  this.zones = [];
7513
7588
  this.filteredZones = [];
7514
7589
  this.selectedFilters.zonename = [];
7515
- localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
7590
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
7516
7591
  }
7517
7592
  // Clear stores state and reset filters
7518
7593
  clearStoresState() {
7519
7594
  this.stores = [];
7520
7595
  this.filteredStores = [];
7521
7596
  this.selectedFilters.stores = [];
7522
- localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
7597
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
7523
7598
  }
7524
7599
  resetSelectedStores() {
7525
7600
  this.filteredStores.forEach((store) => (store.checked = false));
7526
7601
  this.searchStoreText = "";
7527
7602
  }
7528
7603
  selectedStoresLabel() {
7529
- const selectedStores = this.searchStoreText.length ? this.stores.filter((store) => store.checked) : this.filteredStores.filter((store) => store.checked);
7604
+ const selectedStores = this.searchStoreText.length
7605
+ ? this.stores.filter((store) => store.checked)
7606
+ : this.filteredStores.filter((store) => store.checked);
7530
7607
  return selectedStores.length === 0
7531
7608
  ? "0 Stores"
7532
7609
  : selectedStores.length === 1
@@ -7534,7 +7611,9 @@ class MetricsHeaderComponent {
7534
7611
  : `${selectedStores.length} Stores`;
7535
7612
  }
7536
7613
  selectedZonesLabel() {
7537
- const selectedStores = this.searchZoneText.length ? this.zones.filter((zone) => zone.checked) : this.filteredZones.filter((zone) => zone.checked);
7614
+ const selectedStores = this.searchZoneText.length
7615
+ ? this.zones.filter((zone) => zone.checked)
7616
+ : this.filteredZones.filter((zone) => zone.checked);
7538
7617
  return selectedStores.length === 0
7539
7618
  ? "0 Zones"
7540
7619
  : selectedStores.length === 1
@@ -7542,23 +7621,26 @@ class MetricsHeaderComponent {
7542
7621
  : `${selectedStores.length} Zones`;
7543
7622
  }
7544
7623
  isAllStoresSelected() {
7545
- return this.filteredStores.length > 0 && this.filteredStores.every(store => store.checked);
7624
+ return (this.filteredStores.length > 0 &&
7625
+ this.filteredStores.every((store) => store.checked));
7546
7626
  }
7547
7627
  isAllZonesSelected() {
7548
- return this.filteredZones.length > 0 && this.filteredZones.every(zone => zone.checked);
7628
+ return this.filteredZones
7629
+ .filter((zone) => zone._id !== "overall")
7630
+ .every((zone) => zone.checked);
7549
7631
  }
7550
7632
  // Method to handle dropdown item selection
7551
7633
  updateSelectedStores() {
7552
- this.filteredStores.forEach(store => {
7553
- const filteredStore = this.stores.findIndex(fStore => fStore.storeId === store.storeId);
7634
+ this.filteredStores.forEach((store) => {
7635
+ const filteredStore = this.stores.findIndex((fStore) => fStore.storeId === store.storeId);
7554
7636
  if (filteredStore != -1) {
7555
7637
  this.stores[filteredStore].checked = store.checked; // Sync the checked state with full store list
7556
7638
  }
7557
7639
  });
7558
7640
  // Update selectedFilters based on the current store selection
7559
- this.selectedFilters.stores = this.stores.filter(store => store.checked);
7641
+ this.selectedFilters.stores = this.stores.filter((store) => store.checked);
7560
7642
  // Update localStorage with the latest selection
7561
- localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
7643
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
7562
7644
  // Emit updated filters via service
7563
7645
  // this.gs.dataRangeValue.next(this.selectedFilters);
7564
7646
  // Trigger change detection if necessary
@@ -7570,20 +7652,30 @@ class MetricsHeaderComponent {
7570
7652
  this.selectedFilters.zoneName = [];
7571
7653
  this.cd.detectChanges();
7572
7654
  }
7573
- updateSelectedZones() {
7574
- this.filteredZones.forEach(zone => {
7575
- const filteredZone = this.zones.findIndex(fStore => fStore._id === zone._id);
7576
- if (filteredZone != -1) {
7577
- this.zones[filteredZone].checked = zone.checked; // Sync the checked state with full store list
7655
+ updateSelectedZones(clickedZoneId) {
7656
+ this.filteredZones.forEach((zone) => {
7657
+ const index = this.zones.findIndex((z) => z._id === zone._id);
7658
+ if (index !== -1) {
7659
+ this.zones[index].checked = zone.checked;
7578
7660
  }
7579
7661
  });
7580
- // Update selectedFilters based on the current store selection
7581
- this.selectedFilters.zoneName = this.zones.filter(zone => zone.checked);
7582
- // Update localStorage with the latest selection
7583
- localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
7584
- // Emit updated filters via service
7585
- // this.gs.dataRangeValue.next(this.selectedFilters);
7586
- // Trigger change detection if necessary
7662
+ const overallZone = this.zones.find((z) => z._id === "overall");
7663
+ const overallChecked = overallZone?.checked ?? false;
7664
+ const othersSelected = this.zones.some((z) => z._id !== "overall" && z.checked);
7665
+ if (clickedZoneId === "overall" && overallChecked) {
7666
+ this.zones = this.zones.map((z) => ({
7667
+ ...z,
7668
+ checked: z._id === "overall",
7669
+ }));
7670
+ }
7671
+ if (clickedZoneId !== "overall" && overallChecked) {
7672
+ if (overallZone) {
7673
+ overallZone.checked = false;
7674
+ }
7675
+ }
7676
+ this.filteredZones = [...this.zones];
7677
+ this.selectedFilters.zoneName = this.zones.filter((z) => z.checked);
7678
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
7587
7679
  this.cd.detectChanges();
7588
7680
  }
7589
7681
  toggleSelectAllLocations(event) {
@@ -7594,9 +7686,9 @@ class MetricsHeaderComponent {
7594
7686
  toggleSelectAllStores(event) {
7595
7687
  const checked = event.target.checked;
7596
7688
  // Apply the selection to both filtered and full list of stores
7597
- this.filteredStores.forEach(store => store.checked = checked);
7598
- this.stores.forEach(store => {
7599
- const filteredStore = this.filteredStores.find(fStore => fStore.storeId === store.storeId);
7689
+ this.filteredStores.forEach((store) => (store.checked = checked));
7690
+ this.stores.forEach((store) => {
7691
+ const filteredStore = this.filteredStores.find((fStore) => fStore.storeId === store.storeId);
7600
7692
  if (filteredStore) {
7601
7693
  store.checked = checked; // Sync the checked state with full store list
7602
7694
  }
@@ -7606,16 +7698,24 @@ class MetricsHeaderComponent {
7606
7698
  }
7607
7699
  toggleSelectAllZones(event) {
7608
7700
  const checked = event.target.checked;
7609
- // Apply the selection to both filtered and full list of stores
7610
- this.filteredZones.forEach(zone => zone.checked = checked);
7611
- this.zones.forEach(zone => {
7612
- const filteredStore = this.filteredZones.find(fStore => fStore._id === zone._id);
7613
- if (filteredStore) {
7614
- zone.checked = checked; // Sync the checked state with full store list
7701
+ this.filteredZones.forEach((zone) => {
7702
+ if (zone._id !== "overall") {
7703
+ zone.checked = checked;
7704
+ }
7705
+ else {
7706
+ zone.checked = false;
7615
7707
  }
7616
7708
  });
7617
- // Update the selected stores and persist the selection
7618
- this.updateSelectedZones();
7709
+ this.zones.forEach((zone) => {
7710
+ const match = this.filteredZones.find((fz) => fz._id === zone._id);
7711
+ if (match) {
7712
+ zone.checked = match.checked;
7713
+ }
7714
+ });
7715
+ // Since this is bulk, pass a dummy value — any non-overall zone is fine
7716
+ const anySelectedZone = this.filteredZones.find((z) => z._id !== "overall");
7717
+ const clickedId = anySelectedZone ? anySelectedZone._id : "";
7718
+ this.updateSelectedZones(clickedId);
7619
7719
  }
7620
7720
  updateSelectedLocations() {
7621
7721
  // When locations are selected, fetch the related groups
@@ -7642,8 +7742,8 @@ class MetricsHeaderComponent {
7642
7742
  }
7643
7743
  this.selectedFilters.group = [];
7644
7744
  this.filteredStores = []; // Reset stores as well
7645
- this.searchGroupText = '';
7646
- this.searchStoreText = '';
7745
+ this.searchGroupText = "";
7746
+ this.searchStoreText = "";
7647
7747
  // this.Opendropdown = false;
7648
7748
  }
7649
7749
  toggleSelectAllGroups(event) {
@@ -7673,26 +7773,25 @@ class MetricsHeaderComponent {
7673
7773
  this.filteredStores = [];
7674
7774
  // Also, update localStorage to reflect the cleared store selection
7675
7775
  this.selectedFilters.stores = [];
7676
- localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
7776
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
7677
7777
  // Emit data via service
7678
7778
  // this.gs.dataRangeValue.next(this.selectedFilters);
7679
7779
  }
7680
7780
  // Clear the search store text when groups are updated
7681
- this.searchStoreText = '';
7781
+ this.searchStoreText = "";
7682
7782
  }
7683
7783
  Reset() {
7684
7784
  setTimeout(() => {
7685
- // Clear selected groups, stores, and locations
7686
7785
  this.filteredCountries = [];
7687
7786
  this.filteredGroups = [];
7688
7787
  this.filteredStores = [];
7689
- this.filteredLocations = []; // Reset locations as well
7788
+ this.filteredLocations = [];
7690
7789
  this.locations = [];
7691
7790
  this.groupsData = [];
7692
7791
  this.stores = [];
7693
7792
  this.filteredZones = [];
7694
7793
  this.zones = [];
7695
- // Clear search input fields
7794
+ this.countries = [];
7696
7795
  this.searchLocationText = "";
7697
7796
  this.searchGroupText = "";
7698
7797
  this.searchStoreText = "";
@@ -7701,32 +7800,14 @@ class MetricsHeaderComponent {
7701
7800
  this.selectedFilters.location = [];
7702
7801
  this.selectedFilters.country = [];
7703
7802
  this.selectedFilters.zoneName = [];
7704
- // Fetch locations, groups, and stores again
7705
7803
  this.getCountry();
7706
7804
  this.getLocations();
7707
7805
  this.getStore();
7708
7806
  this.getGroups();
7709
- // Reset the filters in selectedFilters
7710
- // // Once stores are fetched, mark all as checked
7711
- // setTimeout(() => {
7712
- // this.filteredStores = this.stores.map(store => ({
7713
- // ...store,
7714
- // checked: true // Mark all stores as checked
7715
- // }));
7716
- // // Sync selectedFilters with the updated store state
7717
- // this.selectedFilters.stores = this.filteredStores.map(store => ({
7718
- // ...store,
7719
- // checked: true
7720
- // }));
7721
- // Update localStorage with the latest selectedFilters
7722
- localStorage.setItem('header-filters', JSON.stringify(this.selectedFilters));
7807
+ localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
7723
7808
  window.location.reload();
7724
- // Emit the reset filters to update other components if needed
7725
7809
  // this.gs.dataRangeValue.next(this.selectedFilters);
7726
- // Trigger change detection
7727
7810
  this.cd.detectChanges();
7728
- // Adding a slight delay to ensure stores are fetched first
7729
- // Close dropdown after reset if necessary
7730
7811
  this.Opendropdown = false;
7731
7812
  }, 100);
7732
7813
  }
@@ -7735,17 +7816,18 @@ class MetricsHeaderComponent {
7735
7816
  if (searchText) {
7736
7817
  // Preserve the checked state during filtering
7737
7818
  this.filteredLocations = this.locations
7738
- .map(location => ({
7819
+ .map((location) => ({
7739
7820
  ...location,
7740
- checked: this.filteredLocations.find(l => l.city === location.city)?.checked || false
7821
+ checked: this.filteredLocations.find((l) => l.city === location.city)
7822
+ ?.checked || false,
7741
7823
  }))
7742
- .filter(location => location?.city?.toLowerCase().includes(searchText));
7824
+ .filter((location) => location?.city?.toLowerCase().includes(searchText));
7743
7825
  }
7744
7826
  else {
7745
7827
  // Restore the original checked state when search text is cleared
7746
- this.filteredLocations = this.locations.map(location => ({
7828
+ this.filteredLocations = this.locations.map((location) => ({
7747
7829
  ...location,
7748
- checked: this.selectedFilters.location.find((l) => l.city === location.city)?.checked || false
7830
+ checked: this.selectedFilters.location.find((l) => l.city === location.city)?.checked || false,
7749
7831
  }));
7750
7832
  }
7751
7833
  }
@@ -7754,17 +7836,18 @@ class MetricsHeaderComponent {
7754
7836
  if (searchText) {
7755
7837
  // Preserve the checked state during filtering
7756
7838
  this.filteredGroups = this.groupsData
7757
- .map(group => ({
7839
+ .map((group) => ({
7758
7840
  ...group,
7759
- checked: this.filteredGroups.find(g => g.groupName === group.groupName)?.checked || false
7841
+ checked: this.filteredGroups.find((g) => g.groupName === group.groupName)
7842
+ ?.checked || false,
7760
7843
  }))
7761
- .filter(group => group?.groupName?.toLowerCase().includes(searchText));
7844
+ .filter((group) => group?.groupName?.toLowerCase().includes(searchText));
7762
7845
  }
7763
7846
  else {
7764
7847
  // Restore the original checked state when search text is cleared
7765
- this.filteredGroups = this.groupsData.map(group => ({
7848
+ this.filteredGroups = this.groupsData.map((group) => ({
7766
7849
  ...group,
7767
- checked: this.selectedFilters.group.find((g) => g.groupName === group.groupName)?.checked || false
7850
+ checked: this.selectedFilters.group.find((g) => g.groupName === group.groupName)?.checked || false,
7768
7851
  }));
7769
7852
  }
7770
7853
  }
@@ -7774,19 +7857,23 @@ class MetricsHeaderComponent {
7774
7857
  if (searchText) {
7775
7858
  // Filter based on search text while preserving checked state
7776
7859
  this.filteredStores = this.stores
7777
- .map(store => ({
7860
+ .map((store) => ({
7778
7861
  ...store,
7779
7862
  // Check if the store is already checked in filteredStores, fallback to original stores' checked state
7780
- checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked || store.checked || false
7863
+ checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked ||
7864
+ store.checked ||
7865
+ false,
7781
7866
  }))
7782
- .filter(store => store.storeName.toLowerCase().includes(searchText));
7867
+ .filter((store) => store.storeName.toLowerCase().includes(searchText));
7783
7868
  }
7784
7869
  else {
7785
7870
  // When the search text is cleared, restore the original list with preserved checked states
7786
- this.filteredStores = this.stores.map(store => ({
7871
+ this.filteredStores = this.stores.map((store) => ({
7787
7872
  ...store,
7788
7873
  // Preserve the checked state based on the selected filters
7789
- checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked || store.checked || false
7874
+ checked: this.selectedFilters.stores.find((s) => s.storeId === store.storeId)?.checked ||
7875
+ store.checked ||
7876
+ false,
7790
7877
  }));
7791
7878
  }
7792
7879
  }
@@ -7796,19 +7883,25 @@ class MetricsHeaderComponent {
7796
7883
  if (searchText) {
7797
7884
  // Filter based on search text while preserving checked state
7798
7885
  this.filteredZones = this.zones
7799
- .map(zone => ({
7886
+ .map((zone) => ({
7800
7887
  ...zone,
7801
7888
  // Check if the store is already checked in filteredStores, fallback to original stores' checked state
7802
- checked: this.selectedFilters.zoneName.find((s) => s._id === zone._id)?.checked || zone.checked || false
7889
+ checked: this.selectedFilters.zoneName.find((s) => s._id === zone._id)
7890
+ ?.checked ||
7891
+ zone.checked ||
7892
+ false,
7803
7893
  }))
7804
- .filter(zone => zone.tagName.toLowerCase().includes(searchText));
7894
+ .filter((zone) => zone.tagName.toLowerCase().includes(searchText));
7805
7895
  }
7806
7896
  else {
7807
7897
  // When the search text is cleared, restore the original list with preserved checked states
7808
- this.filteredZones = this.zones.map(zone => ({
7898
+ this.filteredZones = this.zones.map((zone) => ({
7809
7899
  ...zone,
7810
7900
  // Preserve the checked state based on the selected filters
7811
- checked: this.selectedFilters.zoneName.find((s) => s._id === zone._id)?.checked || zone.checked || false
7901
+ checked: this.selectedFilters.zoneName.find((s) => s._id === zone._id)
7902
+ ?.checked ||
7903
+ zone.checked ||
7904
+ false,
7812
7905
  }));
7813
7906
  }
7814
7907
  }
@@ -7875,7 +7968,7 @@ class MetricsHeaderComponent {
7875
7968
  // isAllCountriesSelected(): boolean {
7876
7969
  // return this.filteredCountries.every(country => country.checked);
7877
7970
  // }
7878
- // filterCountries(): void {
7971
+ // filterCountries(): void {
7879
7972
  // const searchText = this.searchCountryText.toLowerCase();
7880
7973
  // if (searchText) {
7881
7974
  // // Preserve the checked state during filtering
@@ -7897,12 +7990,16 @@ class MetricsHeaderComponent {
7897
7990
  // }
7898
7991
  getCountry() {
7899
7992
  let obj = {
7900
- clientId: this.selectedFilters.client ? this.selectedFilters.client : this.users.clientId,
7993
+ clientId: this.selectedFilters.client
7994
+ ? this.selectedFilters.client
7995
+ : this.users.clientId,
7901
7996
  };
7902
7997
  this.auth.getCountry(obj).subscribe({
7903
7998
  next: (res) => {
7904
7999
  // Extract selected countries from existing filters (if any)
7905
- let countryList = this.selectedFilters?.country?.filter((country) => country.checked).map((loc) => loc.country);
8000
+ let countryList = this.selectedFilters?.country
8001
+ ?.filter((country) => country.checked)
8002
+ .map((loc) => loc.country);
7906
8003
  // Map API response to frontend model
7907
8004
  this.countries = res?.data?.countryData.map((item) => ({
7908
8005
  country: item.country,
@@ -7910,10 +8007,13 @@ class MetricsHeaderComponent {
7910
8007
  // checked: cityList?.length ? cityList.includes(city.city) : true,
7911
8008
  checked: countryList?.includes(item.country) ? true : false,
7912
8009
  }));
7913
- if (this.selectedFilters.country && Array.isArray(this.selectedFilters.country)) {
7914
- this.filteredCountries = this.countries.map(location => {
8010
+ if (this.selectedFilters.country &&
8011
+ Array.isArray(this.selectedFilters.country)) {
8012
+ this.filteredCountries = this.countries.map((location) => {
7915
8013
  const matchedLocation = this.selectedFilters.country.find((loc) => loc.country === location.country);
7916
- return matchedLocation ? { ...location, checked: matchedLocation.checked } : location;
8014
+ return matchedLocation
8015
+ ? { ...location, checked: matchedLocation.checked }
8016
+ : location;
7917
8017
  });
7918
8018
  }
7919
8019
  else {
@@ -7941,10 +8041,14 @@ class MetricsHeaderComponent {
7941
8041
  }
7942
8042
  selectedCountriesLabel() {
7943
8043
  const selectedCountries = this.searchCountryText.length
7944
- ? this.filteredCountries.filter(country => country.checked).map(country => country.country)
7945
- : this.countries.filter(country => country.checked).map(country => country.country);
8044
+ ? this.filteredCountries
8045
+ .filter((country) => country.checked)
8046
+ .map((country) => country.country)
8047
+ : this.countries
8048
+ .filter((country) => country.checked)
8049
+ .map((country) => country.country);
7946
8050
  return selectedCountries.length === 0
7947
- ? ''
8051
+ ? ""
7948
8052
  : selectedCountries.length === 1
7949
8053
  ? selectedCountries[0]
7950
8054
  : `${selectedCountries.length} countries`;
@@ -7954,22 +8058,24 @@ class MetricsHeaderComponent {
7954
8058
  if (searchText) {
7955
8059
  // Filter and preserve checked state
7956
8060
  this.filteredCountries = this.countries
7957
- .map(country => ({
8061
+ .map((country) => ({
7958
8062
  ...country,
7959
- checked: this.filteredCountries.find(c => c.country === country.country)?.checked || false
8063
+ checked: this.filteredCountries.find((c) => c.country === country.country)
8064
+ ?.checked || false,
7960
8065
  }))
7961
- .filter(country => country.country.toLowerCase().includes(searchText));
8066
+ .filter((country) => country.country.toLowerCase().includes(searchText));
7962
8067
  }
7963
8068
  else {
7964
8069
  // Reset to full list
7965
8070
  this.filteredCountries = this.countries.map((country) => ({
7966
8071
  ...country,
7967
- checked: this.selectedFilters.country?.find((c) => c.country === country.country)?.checked || false
8072
+ checked: this.selectedFilters.country?.find((c) => c.country === country.country)?.checked || false,
7968
8073
  }));
7969
8074
  }
7970
8075
  }
7971
8076
  isAllCountriesSelected() {
7972
- return this.filteredCountries.length > 0 && this.filteredCountries.every(country => country.checked);
8077
+ return (this.filteredCountries.length > 0 &&
8078
+ this.filteredCountries.every((country) => country.checked));
7973
8079
  }
7974
8080
  toggleSelectAllCountries(event) {
7975
8081
  const isChecked = event.target.checked;
@@ -8006,8 +8112,8 @@ class MetricsHeaderComponent {
8006
8112
  this.selectedFilters.group = [];
8007
8113
  this.filteredStores = []; // Reset stores as well
8008
8114
  this.filteredZones = [];
8009
- this.searchGroupText = '';
8010
- this.searchStoreText = '';
8115
+ this.searchGroupText = "";
8116
+ this.searchStoreText = "";
8011
8117
  // this.Opendropdown = false;
8012
8118
  }
8013
8119
  removeCountry() {
@@ -8023,8 +8129,12 @@ class MetricsHeaderComponent {
8023
8129
  this.selectedFilters.country = this.filteredCountries;
8024
8130
  this.selectedFilters.location = this.locations;
8025
8131
  this.selectedFilters.group = this.groupsData;
8026
- this.selectedFilters.stores = headerFilters.stores ? headerFilters.stores : this.stores;
8027
- this.selectedFilters.zoneName = headerFilters.zoneName ? headerFilters.zoneName : this.zones;
8132
+ this.selectedFilters.stores = headerFilters.stores
8133
+ ? headerFilters.stores
8134
+ : this.stores;
8135
+ this.selectedFilters.zoneName = headerFilters.zoneName
8136
+ ? headerFilters.zoneName
8137
+ : this.zones;
8028
8138
  // this.selectedFilters.zoneName = this.filteredZones;
8029
8139
  // Store updated filters back in localStorage
8030
8140
  localStorage.setItem("header-filters", JSON.stringify(this.selectedFilters));
@@ -8037,14 +8147,14 @@ class MetricsHeaderComponent {
8037
8147
  this.cd.detectChanges();
8038
8148
  }
8039
8149
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MetricsHeaderComponent, deps: [{ token: AuthService }, { token: i2.Router }, { token: i1.GlobalStateService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
8040
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MetricsHeaderComponent, selector: "lib-metrics-header", host: { listeners: { "document:click": "clickOutside($event)" } }, ngImport: i0, template: "<div class=\"me-3\">\r\n <label *ngIf=\"selectedCountriesLabel()\" class=\"badge badge-light-default mx-2\">{{selectedCountriesLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeCountry()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n <label class=\"badge badge-light-default mx-2\">{{selectedZonesLabel()}} \r\n <!-- <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span> -->\r\n </label>\r\n</div>\r\n\r\n\r\n<div class=\"wrapper me-3\" *ngIf=\"(gs.userAccess | async)?.userType === 'tango'\">\r\n<lib-select [items]=\"clientList\" [multi]=\"false\" [searchField]=\"'clientName'\" [disabled]=\"false\" [idField]=\"'clientId'\"\r\n(selected)=\"onClientSelect($event)\" [selectedValues]=\"[selectedClient]\"></lib-select>\r\n</div>\r\n<div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div>\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown2 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Country Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('country')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedCountriesLabel()\"\r\n readonly\r\n placeholder=\"Select country\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'country'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search country\" \r\n [(ngModel)]=\"searchCountryText\" \r\n (ngModelChange)=\"filterCountries()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllCountries\" \r\n [checked]=\"isAllCountriesSelected()\" \r\n (change)=\"toggleSelectAllCountries($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllCountries\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let country of filteredCountries\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"country.country\" \r\n [(ngModel)]=\"country.checked\"\r\n (change)=\"updateSelectedCountries()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"country.country\">\r\n {{ country.country }}\r\n </label>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('location')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n readonly\r\n placeholder=\"Select Region\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search Region\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Zone Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('zone')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedZonesLabel()\"\r\n readonly\r\n placeholder=\"Select zones\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'zone'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search zones\" \r\n [(ngModel)]=\"searchZoneText\" \r\n (ngModelChange)=\"filterZones()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllZones\" \r\n [checked]=\"isAllZonesSelected()\" \r\n (change)=\"toggleSelectAllZones($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllZones\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let zone of filteredZones\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"zone._id\"\r\n [(ngModel)]=\"zone.checked\"\r\n (change)=\"updateSelectedZones()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"zone._id\">\r\n {{ zone.tagName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}:host::ng-deep .md-drppicker td.available.today:not(.invalid-date){text-decoration:unset;pointer-events:unset;color:unset}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown2{position:absolute;top:70px;min-width:270px!important}.dropdown2 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown2 .dropdown{position:relative;display:inline-block}.dropdown2 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CustomSelectComponent, selector: "lib-select", inputs: ["items", "searchField", "multi", "idField", "selectedValues", "disabled", "label"], outputs: ["selected"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i7.DaterangepickerDirective, selector: "input[ngxDaterangepickerMd]", inputs: ["minDate", "maxDate", "autoApply", "alwaysShowCalendars", "showCustomRangeLabel", "linkedCalendars", "dateLimit", "singleDatePicker", "showWeekNumbers", "showISOWeekNumbers", "showDropdowns", "isInvalidDate", "isCustomDate", "isTooltipDate", "showClearButton", "customRangeDirection", "ranges", "opens", "drops", "firstMonthDayClass", "lastMonthDayClass", "emptyWeekRowClass", "emptyWeekColumnClass", "firstDayOfNextMonthClass", "lastDayOfPreviousMonthClass", "keepCalendarOpeningWithRange", "showRangeLabelOnInput", "showCancel", "lockStartDate", "timePicker", "timePicker24Hour", "timePickerIncrement", "timePickerSeconds", "closeOnAutoApply", "endKeyHolder", "startKey", "locale", "endKey"], outputs: ["change", "rangeClicked", "datesUpdated", "startDateChanged", "endDateChanged", "clearClicked"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
8150
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MetricsHeaderComponent, selector: "lib-metrics-header", host: { listeners: { "document:click": "clickOutside($event)" } }, ngImport: i0, template: "<div class=\"me-3\">\r\n <label *ngIf=\"selectedCountriesLabel()\" class=\"badge badge-light-default mx-2\">{{selectedCountriesLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeCountry()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n <label class=\"badge badge-light-default mx-2\">{{selectedZonesLabel()}} \r\n <!-- <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span> -->\r\n </label>\r\n</div>\r\n\r\n\r\n<div class=\"wrapper me-3\" *ngIf=\"(gs.userAccess | async)?.userType === 'tango'\">\r\n<lib-select [items]=\"clientList\" [multi]=\"false\" [searchField]=\"'clientName'\" [disabled]=\"false\" [idField]=\"'clientId'\"\r\n(selected)=\"onClientSelect($event)\" [selectedValues]=\"[selectedClient]\"></lib-select>\r\n</div>\r\n<div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div>\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown2 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Country Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('country')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedCountriesLabel()\"\r\n readonly\r\n placeholder=\"Select country\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'country'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search country\" \r\n [(ngModel)]=\"searchCountryText\" \r\n (ngModelChange)=\"filterCountries()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllCountries\" \r\n [checked]=\"isAllCountriesSelected()\" \r\n (change)=\"toggleSelectAllCountries($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllCountries\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let country of filteredCountries\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"country.country\" \r\n [(ngModel)]=\"country.checked\"\r\n (change)=\"updateSelectedCountries()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"country.country\">\r\n {{ country.country }}\r\n </label>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('location')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n readonly\r\n placeholder=\"Select Region\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search Region\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Zone Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('zone')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedZonesLabel()\"\r\n readonly\r\n placeholder=\"Select zones\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'zone'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search zones\" \r\n [(ngModel)]=\"searchZoneText\" \r\n (ngModelChange)=\"filterZones()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllZones\" \r\n [checked]=\"isAllZonesSelected()\" \r\n (change)=\"toggleSelectAllZones($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllZones\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let zone of filteredZones\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"zone._id\"\r\n [(ngModel)]=\"zone.checked\"\r\n (change)=\"updateSelectedZones(zone._id)\"\r\n />\r\n <label class=\"form-check-label\" [for]=\"zone._id\">\r\n {{ zone.tagName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}:host::ng-deep .md-drppicker td.available.today:not(.invalid-date){text-decoration:unset;pointer-events:unset;color:unset}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown2{position:absolute;top:70px;min-width:270px!important}.dropdown2 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown2 .dropdown{position:relative;display:inline-block}.dropdown2 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CustomSelectComponent, selector: "lib-select", inputs: ["items", "searchField", "multi", "idField", "selectedValues", "disabled", "label"], outputs: ["selected"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i7.DaterangepickerDirective, selector: "input[ngxDaterangepickerMd]", inputs: ["minDate", "maxDate", "autoApply", "alwaysShowCalendars", "showCustomRangeLabel", "linkedCalendars", "dateLimit", "singleDatePicker", "showWeekNumbers", "showISOWeekNumbers", "showDropdowns", "isInvalidDate", "isCustomDate", "isTooltipDate", "showClearButton", "customRangeDirection", "ranges", "opens", "drops", "firstMonthDayClass", "lastMonthDayClass", "emptyWeekRowClass", "emptyWeekColumnClass", "firstDayOfNextMonthClass", "lastDayOfPreviousMonthClass", "keepCalendarOpeningWithRange", "showRangeLabelOnInput", "showCancel", "lockStartDate", "timePicker", "timePicker24Hour", "timePickerIncrement", "timePickerSeconds", "closeOnAutoApply", "endKeyHolder", "startKey", "locale", "endKey"], outputs: ["change", "rangeClicked", "datesUpdated", "startDateChanged", "endDateChanged", "clearClicked"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] });
8041
8151
  }
8042
8152
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MetricsHeaderComponent, decorators: [{
8043
8153
  type: Component,
8044
- args: [{ selector: 'lib-metrics-header', template: "<div class=\"me-3\">\r\n <label *ngIf=\"selectedCountriesLabel()\" class=\"badge badge-light-default mx-2\">{{selectedCountriesLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeCountry()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n <label class=\"badge badge-light-default mx-2\">{{selectedZonesLabel()}} \r\n <!-- <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span> -->\r\n </label>\r\n</div>\r\n\r\n\r\n<div class=\"wrapper me-3\" *ngIf=\"(gs.userAccess | async)?.userType === 'tango'\">\r\n<lib-select [items]=\"clientList\" [multi]=\"false\" [searchField]=\"'clientName'\" [disabled]=\"false\" [idField]=\"'clientId'\"\r\n(selected)=\"onClientSelect($event)\" [selectedValues]=\"[selectedClient]\"></lib-select>\r\n</div>\r\n<div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div>\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown2 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Country Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('country')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedCountriesLabel()\"\r\n readonly\r\n placeholder=\"Select country\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'country'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search country\" \r\n [(ngModel)]=\"searchCountryText\" \r\n (ngModelChange)=\"filterCountries()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllCountries\" \r\n [checked]=\"isAllCountriesSelected()\" \r\n (change)=\"toggleSelectAllCountries($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllCountries\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let country of filteredCountries\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"country.country\" \r\n [(ngModel)]=\"country.checked\"\r\n (change)=\"updateSelectedCountries()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"country.country\">\r\n {{ country.country }}\r\n </label>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('location')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n readonly\r\n placeholder=\"Select Region\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search Region\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Zone Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('zone')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedZonesLabel()\"\r\n readonly\r\n placeholder=\"Select zones\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'zone'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search zones\" \r\n [(ngModel)]=\"searchZoneText\" \r\n (ngModelChange)=\"filterZones()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllZones\" \r\n [checked]=\"isAllZonesSelected()\" \r\n (change)=\"toggleSelectAllZones($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllZones\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let zone of filteredZones\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"zone._id\"\r\n [(ngModel)]=\"zone.checked\"\r\n (change)=\"updateSelectedZones()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"zone._id\">\r\n {{ zone.tagName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}:host::ng-deep .md-drppicker td.available.today:not(.invalid-date){text-decoration:unset;pointer-events:unset;color:unset}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown2{position:absolute;top:70px;min-width:270px!important}.dropdown2 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown2 .dropdown{position:relative;display:inline-block}.dropdown2 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"] }]
8154
+ args: [{ selector: "lib-metrics-header", template: "<div class=\"me-3\">\r\n <label *ngIf=\"selectedCountriesLabel()\" class=\"badge badge-light-default mx-2\">{{selectedCountriesLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeCountry()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedLocationsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedLocationsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeLocation()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label *ngIf=\"selectedGroupsLabel()\" class=\"badge badge-light-default mx-2\">{{selectedGroupsLabel()}} \r\n <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span>\r\n </label>\r\n <label class=\"badge badge-light-default\">{{selectedStoresLabel()}}</label>\r\n <label class=\"badge badge-light-default mx-2\">{{selectedZonesLabel()}} \r\n <!-- <span class=\"cursor-pointer\" (click)=\"removeGroup()\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\">\r\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"#667085\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg></span> -->\r\n </label>\r\n</div>\r\n\r\n\r\n<div class=\"wrapper me-3\" *ngIf=\"(gs.userAccess | async)?.userType === 'tango'\">\r\n<lib-select [items]=\"clientList\" [multi]=\"false\" [searchField]=\"'clientName'\" [disabled]=\"false\" [idField]=\"'clientId'\"\r\n(selected)=\"onClientSelect($event)\" [selectedValues]=\"[selectedClient]\"></lib-select>\r\n</div>\r\n<div class=\"d-flex align-items-center position-relative my-1\">\r\n <span class=\"svg-icon svg-icon-1 position-absolute ms-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M13.3333 1.66663V4.99996M6.66667 1.66663V4.99996M2.5 8.33329H17.5M4.16667 3.33329H15.8333C16.7538 3.33329 17.5 4.07948 17.5 4.99996V16.6666C17.5 17.5871 16.7538 18.3333 15.8333 18.3333H4.16667C3.24619 18.3333 2.5 17.5871 2.5 16.6666V4.99996C2.5 4.07948 3.24619 3.33329 4.16667 3.33329Z\"\r\n stroke=\"#344054\" stroke-width=\"1.67\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n </span>\r\n <input class=\"fx-date-range form-control ps-14\" style=\"min-width: 260px !important;\" type=\"text\" matInput\r\n ngxDaterangepickerMd [drops]=\"'down'\" [opens]=\"'right'\" [ranges]=\"ranges\" [showCustomRangeLabel]=\"true\" [autoApply]=\"true\"\r\n [alwaysShowCalendars]=\"false\" [keepCalendarOpeningWithRange]=\"true\" [showCancel]=\"true\" autocomplete=\"off\"\r\n [(ngModel)]=\"selectedDateRange\" (startDateChanged)=\"onStartDateChange($event)\" [isCustomDate]=\"isCustomDate\"\r\n [locale]=\"{ format: 'DD-MM-YYYY', firstDay: 1, monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }\"\r\n (datesUpdated)=\"datechange($event)\" name=\"daterange\" [readonly]=\"true\" />\r\n</div>\r\n<div class=\"position-relative\">\r\n <button type=\"button\" (click)=\"opendropdown($event)\" class=\"btn btn-default mx-2 rounded-3 text-nowrap border-val\">\r\n <!-- <span class=\"me-2\">Filter</span> -->\r\n <svg class=\"pl-3\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path d=\"M5 10H15M2.5 5H17.5M7.5 15H12.5\" stroke=\"#344054\" stroke-width=\"2\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n\r\n <div *ngIf=\"Opendropdown\" class=\"card p-5 dropdown2 position-absolute z-1 end-0\" style=\"z-index: 1 !important;\" (clickOutside)=\"closeDropdown1()\">\r\n <div class=\"dropdown-title d-flex justify-content-between mb-2\">Filter Options\r\n <button class=\"btn btn-outline w-25 ms-3 btn-resize\" (click)=\"Reset()\"> Reset </button>\r\n <button class=\"btn btn-primary w-25 btn-resize\" (click)=\"Apply()\">Apply</button>\r\n </div>\r\n\r\n <!-- Country Dropdown -->\r\n<div class=\"dropdown-container\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('country')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedCountriesLabel()\"\r\n readonly\r\n placeholder=\"Select country\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'country'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search country\" \r\n [(ngModel)]=\"searchCountryText\" \r\n (ngModelChange)=\"filterCountries()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllCountries\" \r\n [checked]=\"isAllCountriesSelected()\" \r\n (change)=\"toggleSelectAllCountries($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllCountries\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let country of filteredCountries\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"country.country\" \r\n [(ngModel)]=\"country.checked\"\r\n (change)=\"updateSelectedCountries()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"country.country\">\r\n {{ country.country }}\r\n </label>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n\r\n <!-- Location Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('location')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedLocationsLabel()\"\r\n readonly\r\n placeholder=\"Select Region\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'location'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search Region\" \r\n [(ngModel)]=\"searchLocationText\" \r\n (ngModelChange)=\"filterLocations()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllLocations\" \r\n [checked]=\"isAllLocationsSelected()\" \r\n (change)=\"toggleSelectAllLocations($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllLocations\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let location of filteredLocations\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"location.city\" \r\n [(ngModel)]=\"location.checked\"\r\n (change)=\"updateSelectedLocations()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"location.city\">\r\n {{ location.city }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Group Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('group')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\" \r\n [value]=\"selectedGroupsLabel()\" readonly\r\n placeholder=\"Select clusters\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'group'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search\" \r\n placeholder=\"Search clusters\" \r\n [(ngModel)]=\"searchGroupText\" \r\n (ngModelChange)=\"filterGroups()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllGroups\" \r\n [checked]=\"isAllGroupsSelected()\" \r\n (change)=\"toggleSelectAllGroups($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllGroups\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let group of filteredGroups\"\r\n >\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n [id]=\"group.groupName\"\r\n [(ngModel)]=\"group.checked\"\r\n (change)=\"updateSelectedGroups()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"group.groupName\">\r\n {{ group.groupName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<!-- Store Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('store')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedStoresLabel()\"\r\n readonly\r\n placeholder=\"Select stores\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'store'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search stores\" \r\n [(ngModel)]=\"searchStoreText\" \r\n (ngModelChange)=\"filterStores()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllStores\" \r\n [checked]=\"isAllStoresSelected()\" \r\n (change)=\"toggleSelectAllStores($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllStores\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let store of filteredStores\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"store.storeId\"\r\n [(ngModel)]=\"store.checked\"\r\n (change)=\"updateSelectedStores()\" \r\n />\r\n <label class=\"form-check-label\" [for]=\"store.storeId\">\r\n {{ store.storeName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Zone Dropdown -->\r\n<div class=\"dropdown-container mt-3\" (clickOutside)=\"closeDropdown()\">\r\n <div class=\"dropdown-header\" (click)=\"toggleDropdown('zone')\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control dropdown-input cursor-pointer\"\r\n [value]=\"selectedZonesLabel()\"\r\n readonly\r\n placeholder=\"Select zones\"\r\n />\r\n </div>\r\n <div class=\"dropdown-menu custom-dropdown-menu\" *ngIf=\"dropdownOpen === 'zone'\">\r\n <input \r\n type=\"text\" \r\n class=\"form-control mb-2 dropdown-search \" \r\n placeholder=\"Search zones\" \r\n [(ngModel)]=\"searchZoneText\" \r\n (ngModelChange)=\"filterZones()\" \r\n />\r\n <div class=\"form-check mb-2 dropdown-item custom-dropdown-item\">\r\n <input \r\n class=\"form-check-input cursor-pointer\" \r\n type=\"checkbox\" \r\n id=\"selectAllZones\" \r\n [checked]=\"isAllZonesSelected()\" \r\n (change)=\"toggleSelectAllZones($event)\" \r\n />\r\n <label class=\"form-check-label\" for=\"selectAllZones\">\r\n Select All\r\n </label>\r\n </div>\r\n <div \r\n class=\"dropdown-item form-check custom-dropdown-item\" \r\n *ngFor=\"let zone of filteredZones\"\r\n >\r\n <input \r\n class=\"form-check-input\" \r\n type=\"checkbox\" \r\n [id]=\"zone._id\"\r\n [(ngModel)]=\"zone.checked\"\r\n (change)=\"updateSelectedZones(zone._id)\"\r\n />\r\n <label class=\"form-check-label\" [for]=\"zone._id\">\r\n {{ zone.tagName }}\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n</div>", styles: [".daterangepicker{display:block!important;top:153.85px!important;left:900px!important;right:0}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize}::ng-deep .applyBtn{display:none!important}:host::ng-deep .md-drppicker .btn{line-height:10px!important}:host::ng-deep .daterangepicker-input+.ngx-daterangepicker-material .applyBtn{display:none}:host::ng-deep .md-drppicker.drops-down-right.ltr.double.show-ranges.shown{top:65px!important;left:-470px!important;height:365px!important}:host::ng-deep .md-drppicker .btn{border-radius:8px!important;border:1px solid var(--Primary-600, #00A3FF)!important;background:var(--Primary-600, #00A3FF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--White, #FFF)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize}:host::ng-deep .md-drppicker .ranges ul li button{padding:12px 16px;width:160px;color:var(--Gray-700, #344054);font-size:14px;font-weight:400;line-height:20px;background:none;border:none;text-align:left;cursor:pointer}:host::ng-deep .md-drppicker td.active,:host::ng-deep .md-drppicker td.active:hover{background-color:#029cf4!important;border-radius:20px!important;color:var(--White, #FFF)!important;text-align:center!important;font-size:14px!important;font-weight:500!important;line-height:20px}:host::ng-deep .md-drppicker.ltr .ranges{float:left;margin-top:10px!important}:host::ng-deep .md-drppicker td.in-range{background:var(--Primary-50, #EAF8FF)}:host::ng-deep .md-drppicker .ranges ul li button.active{background:var(--Primary-50, #EAF8FF)!important;border-radius:8px!important;color:var(--Primary-700, #009BF3);font-size:14px!important;font-weight:500!important;line-height:20px!important}:host::ng-deep table th,:host::ng-deep table td{width:40px!important;height:40px!important;padding:10px 8px!important}:host::ng-deep .md-drppicker td.available.prev,:host::ng-deep .md-drppicker th.available.prev{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep .md-drppicker td.available.next,:host::ng-deep .md-drppicker th.available.next{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)!important;background-repeat:no-repeat!important;background-size:.5em!important;background-position:center!important}:host::ng-deep table th{border-bottom:0px solid var(--Gray-200, #EAECF0)!important;background:transparent!important;color:var(--Gray-700, #344054)!important;text-align:center;font-size:16px!important;font-weight:500!important;line-height:24px}:host::ng-deep .md-drppicker .btn.btn-default{border-radius:8px!important;border:1px solid var(--Gray-300, #D0D5DD)!important;background:var(--White, #FFF)!important;box-shadow:0 1px 2px #1018280d!important;color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600!important;line-height:20px;text-transform:capitalize;margin-right:10px!important}:host::ng-deep .md-drppicker td.available.invalid-date{text-decoration:line-through;pointer-events:none;color:#a9a9a9}:host::ng-deep .md-drppicker td.available.today:not(.invalid-date){text-decoration:unset;pointer-events:unset;color:unset}.wrapper{min-width:200px}.btn-primary{line-height:18px!important}.filter-label{color:var(--Gray-500, #667085)!important;font-size:14px;font-style:normal;font-weight:600;line-height:20px;text-transform:capitalize}.position-relative{position:relative}.filter-icon{cursor:pointer}.dropdown-container{position:relative;display:inline-block;width:100%}.dropdown-header{cursor:pointer;width:100%}.form-control{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:600;line-height:20px;text-transform:capitalize;width:100%;box-sizing:border-box}.dropdown-menu{position:absolute;top:100%;left:0;right:0;border:1px solid #ccc;background-color:#fff;z-index:1000;max-height:230px;overflow-y:auto;display:block;box-sizing:border-box;padding:10px 5px}.dropdown-item{padding:6px 0}.dropdown-item:hover{background-color:#f1f1f1}.dropdown-item input[type=checkbox]{margin-right:10px}.custom-dropdown-menu{border-radius:4px;box-shadow:0 1px 2px #1018280d}.custom-dropdown-item{display:flex;align-items:center}.custom-dropdown-item input{margin-left:10px}.btn-resize{font-size:13px!important;height:29px!important;line-height:11px!important;padding:3px!important}.dropdown2{position:absolute;top:70px;min-width:270px!important}.dropdown2 .dropdown-title{color:var(--Gray-900, #101828);font-size:14px;font-weight:600;line-height:24px}.dropdown2 .dropdown{position:relative;display:inline-block}.dropdown2 .dropdown span{color:var(--Gray-700, #344054);font-size:14px;font-weight:600;line-height:20px}.form-check-label{color:var(--Gray-700, #344054)!important;font-size:14px;font-style:normal;font-weight:500;line-height:20px}input[type=checkbox]{width:16px!important;height:16px!important;margin:0 5px;border-radius:4px!important;-webkit-appearance:none;-moz-appearance:none;-o-appearance:none;appearance:none;outline:1px solid var(--gray-300, #D0D5DD);box-shadow:none;font-size:.8em;text-align:center;line-height:1em;background:#fff}input[type=checkbox]:checked{outline:1px solid var(--primary-600, #00A3FF);background-color:var(--primary-50, #EAF8FF)}input[type=checkbox]:checked:after{content:\"\";transform:rotate(45deg);border-bottom:2px solid #00A3FF;border-right:2px solid #00A3FF;display:inline-block;width:.2em;padding-left:0;padding-top:9px;padding-right:4px}\n"] }]
8045
8155
  }], ctorParameters: () => [{ type: AuthService }, { type: i2.Router }, { type: i1.GlobalStateService }, { type: i0.ChangeDetectorRef }], propDecorators: { onClick: [{
8046
8156
  type: HostListener,
8047
- args: ['document:click', ['$event']]
8157
+ args: ["document:click", ["$event"]]
8048
8158
  }], clickOutside: [{
8049
8159
  type: HostListener,
8050
8160
  args: ["document:click", ["$event"]]
@@ -8178,7 +8288,6 @@ class ToolbarComponent {
8178
8288
  const url = URL.split("?")[0].split('/');
8179
8289
  this.urlString = URL;
8180
8290
  this.urlString1 = URL.split('/');
8181
- console.log(url);
8182
8291
  if (this.users?.userType === "tango") {
8183
8292
  if (url[2] == "settings" || URL == "/manage/users/client" ||
8184
8293
  URL == "/manage/stores" || URL === "/manage/stores?type=stores" || URL === "/manage/stores?type=clusters" ||