kwikid-agent-dashboard 0.0.21 → 0.0.23

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.
@@ -1,201 +1,39 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, ViewChildren, EventEmitter, Component, Input, Output, HostListener, ViewChild, Pipe, Inject, NgModule } from '@angular/core';
3
- import * as i5 from '@angular/google-maps';
2
+ import { Injectable, ViewChildren, EventEmitter, Component, Input, Output, HostListener, Pipe, Inject, ViewChild, NgModule } from '@angular/core';
4
3
  import { MapInfoWindow, GoogleMapsModule } from '@angular/google-maps';
5
- import * as i11 from '@taiga-ui/core';
4
+ import * as i10 from '@taiga-ui/core';
6
5
  import { TuiDialogService, TuiRootModule, TuiDialogModule, TuiDropdownModule, TuiGroupModule, TuiSvgModule } from '@taiga-ui/core';
7
- import { of } from 'rxjs';
8
- import { map, catchError } from 'rxjs/operators';
9
6
  import { __awaiter } from 'tslib';
7
+ import * as L from 'leaflet';
8
+ import 'leaflet-routing-machine';
9
+ import { checkObjectPathExists, getObjectValueFromPath, isEmptyValue } from 'kwikid-toolkit';
10
10
  import * as i3$1 from '@angular/common/http';
11
11
  import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
12
12
  import * as i2 from 'kwikui';
13
13
  import { KwikUIButtonModule, KwikUIInputModule, KwikUIInputDateModule, KwikUIInputDateRangeModule, KwikUIInputSelectModule, KwikUITableModule, KwikUITablePaginationModule } from 'kwikui';
14
- import { getObjectValueFromPath, isEmptyValue } from 'kwikid-toolkit';
15
- import * as i6 from '@angular/common';
14
+ import * as i5 from '@angular/common';
16
15
  import { CommonModule } from '@angular/common';
17
16
  import * as i5$1 from '@angular/forms';
18
17
  import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
19
- import * as i10 from '@taiga-ui/cdk';
18
+ import * as i9 from '@taiga-ui/cdk';
20
19
  import { TuiDayRange, TuiDay, TuiActiveZoneModule } from '@taiga-ui/cdk';
21
20
  import * as i3 from '@angular/cdk/scrolling';
22
21
  import { ScrollingModule } from '@angular/cdk/scrolling';
23
- import * as i8 from 'kwikid-forms';
22
+ import * as i7 from 'kwikid-forms';
24
23
  import { KwikIDFormViewModule } from 'kwikid-forms';
25
24
  import { TuiSidebarModule } from '@taiga-ui/addon-mobile';
26
25
 
27
- class MapService {
28
- constructor(mapDirectionsService) {
29
- this.mapDirectionsService = mapDirectionsService;
30
- this.markers = [];
31
- this.directionsRenderOption = {};
32
- }
33
- getMarkers() {
34
- return this.markers;
35
- }
36
- setMarkers(markers) {
37
- this.markers = markers;
38
- }
39
- initMap() {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- this.myPosition = yield this.getPosition();
42
- this.map = {
43
- zoom: 10,
44
- center: this.myPosition,
45
- streetViewControl: false,
46
- mapTypeControl: false,
47
- fullscreenControl: false,
48
- zoomControl: false
49
- };
50
- });
51
- }
52
- plotMarkers(customers) {
53
- this.markers = [];
54
- let path = [];
55
- this.markers.push(this.myPosition);
56
- const request = {
57
- origin: this.myPosition,
58
- destination: this.myPosition,
59
- waypoints: path,
60
- optimizeWaypoints: true,
61
- travelMode: google.maps.TravelMode.DRIVING
62
- };
63
- this.directionsRenderOption = {
64
- suppressMarkers: true
65
- };
66
- this.directionsResults$ = this.mapDirectionsService
67
- .route(request)
68
- .pipe(map((response) => response.result));
69
- this.directionsResults$.subscribe((val) => {
70
- customers = this.sortList(val.routes[0].waypoint_order, customers);
71
- customers.map((customer) => {
72
- path.push({
73
- location: this.getLatLng(customer.task_details.customer_details.location),
74
- stopover: true
75
- });
76
- this.markers.push(this.getLatLng(customer.task_details.customer_details.location));
77
- });
78
- });
79
- return this.directionsResults$;
80
- }
81
- getPosition() {
82
- return new Promise((resolve, reject) => {
83
- navigator.geolocation.watchPosition((resp) => {
84
- resolve({
85
- lng: resp.coords.longitude,
86
- lat: resp.coords.latitude
87
- });
88
- }, (err) => {
89
- reject(err);
90
- });
91
- });
92
- }
93
- getLatLng(data) {
94
- let url = data.split('@');
95
- let lat_long_match = url[1].split(',');
96
- let lat = Number(lat_long_match[0]);
97
- let long = Number(lat_long_match[1]);
98
- return { lat: lat, lng: long };
99
- }
100
- sortList(order, customersData) {
101
- let c = [];
102
- for (let i = 0; i < customersData.length; i++) {
103
- let customer = customersData[order[i]];
104
- c.push(customer);
105
- }
106
- return c;
107
- }
108
- }
109
- /** @nocollapse */ MapService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, deps: [{ token: i5.MapDirectionsService }], target: i0.ɵɵFactoryTarget.Injectable });
110
- /** @nocollapse */ MapService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, providedIn: 'root' });
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, decorators: [{
112
- type: Injectable,
113
- args: [{
114
- providedIn: 'root'
115
- }]
116
- }], ctorParameters: function () { return [{ type: i5.MapDirectionsService }]; }, propDecorators: { directionsRenders: [{
117
- type: ViewChildren,
118
- args: ['directionsRender']
119
- }] } });
120
-
121
- class UserService {
26
+ class AgentService {
122
27
  constructor() {
123
28
  this.isListOpen = true;
124
29
  this.showMapview = false;
125
- this.addTaskFormConfig = {
30
+ this.addTaskForm = {
126
31
  key: 'ADD_TASK',
127
32
  title: 'Add Task',
128
33
  fields: [
129
34
  {
130
35
  key: 'name',
131
36
  label: 'Customer Name',
132
- disabled: false,
133
- messages: [],
134
- default: {
135
- value: {
136
- is_found: false,
137
- value: '',
138
- sources: [
139
- {
140
- key: 'OBJECT',
141
- props: {
142
- object: {
143
- key: 'ALL_FORMS_DATA',
144
- path: '$.ADD_TASK.name'
145
- }
146
- },
147
- value: '',
148
- validation: {
149
- is_valid: false,
150
- triggers: ['ON_INIT'],
151
- rules: [
152
- {
153
- id: '1',
154
- key: 'VALUE_CHECK',
155
- props: {
156
- value: {
157
- source: {
158
- key: 'OBJECT',
159
- props: {
160
- object: {
161
- key: 'ALL_FORMS_DATA',
162
- path: '$.ADD_TASK.name'
163
- }
164
- }
165
- }
166
- },
167
- pattern: {
168
- key: 'IS_NOT_EMPTY'
169
- }
170
- }
171
- }
172
- ],
173
- actions: [
174
- {
175
- id: '1',
176
- key: 'SET_FIELD_DEFAULT_VALUE',
177
- condition: '1',
178
- props: {
179
- fieldKey: 'name',
180
- value: {
181
- source: {
182
- key: 'OBJECT',
183
- props: {
184
- object: {
185
- key: 'ALL_FORMS_DATA',
186
- path: '$.ADD_TASK.name'
187
- }
188
- }
189
- }
190
- }
191
- }
192
- }
193
- ]
194
- }
195
- }
196
- ]
197
- }
198
- },
199
37
  validators: {
200
38
  required: true
201
39
  },
@@ -209,73 +47,6 @@ class UserService {
209
47
  {
210
48
  key: 'phone',
211
49
  label: 'Phone Number',
212
- disabled: false,
213
- messages: [],
214
- default: {
215
- value: {
216
- is_found: false,
217
- value: '',
218
- sources: [
219
- {
220
- key: 'OBJECT',
221
- props: {
222
- object: {
223
- key: 'ALL_FORMS_DATA',
224
- path: '$.ADD_TASK.phone'
225
- }
226
- },
227
- value: '',
228
- validation: {
229
- is_valid: false,
230
- triggers: ['ON_INIT'],
231
- rules: [
232
- {
233
- id: '1',
234
- key: 'VALUE_CHECK',
235
- props: {
236
- value: {
237
- source: {
238
- key: 'OBJECT',
239
- props: {
240
- object: {
241
- key: 'ALL_FORMS_DATA',
242
- path: '$.ADD_TASK.phone'
243
- }
244
- }
245
- }
246
- },
247
- pattern: {
248
- key: 'IS_NOT_EMPTY'
249
- }
250
- }
251
- }
252
- ],
253
- actions: [
254
- {
255
- id: '1',
256
- key: 'SET_FIELD_DEFAULT_VALUE',
257
- condition: '1',
258
- props: {
259
- fieldKey: 'phone',
260
- value: {
261
- source: {
262
- key: 'OBJECT',
263
- props: {
264
- object: {
265
- key: 'ALL_FORMS_DATA',
266
- path: '$.ADD_TASK.phone'
267
- }
268
- }
269
- }
270
- }
271
- }
272
- }
273
- ]
274
- }
275
- }
276
- ]
277
- }
278
- },
279
50
  validators: {
280
51
  required: true
281
52
  },
@@ -291,73 +62,6 @@ class UserService {
291
62
  {
292
63
  key: 'address',
293
64
  label: 'Address',
294
- disabled: false,
295
- messages: [],
296
- default: {
297
- value: {
298
- is_found: false,
299
- value: '',
300
- sources: [
301
- {
302
- key: 'OBJECT',
303
- props: {
304
- object: {
305
- key: 'ALL_FORMS_DATA',
306
- path: '$.ADD_TASK.address'
307
- }
308
- },
309
- value: '',
310
- validation: {
311
- is_valid: false,
312
- triggers: ['ON_INIT'],
313
- rules: [
314
- {
315
- id: '1',
316
- key: 'VALUE_CHECK',
317
- props: {
318
- value: {
319
- source: {
320
- key: 'OBJECT',
321
- props: {
322
- object: {
323
- key: 'ALL_FORMS_DATA',
324
- path: '$.ADD_TASK.address'
325
- }
326
- }
327
- }
328
- },
329
- pattern: {
330
- key: 'IS_NOT_EMPTY'
331
- }
332
- }
333
- }
334
- ],
335
- actions: [
336
- {
337
- id: '1',
338
- key: 'SET_FIELD_DEFAULT_VALUE',
339
- condition: '1',
340
- props: {
341
- fieldKey: 'address',
342
- value: {
343
- source: {
344
- key: 'OBJECT',
345
- props: {
346
- object: {
347
- key: 'ALL_FORMS_DATA',
348
- path: '$.ADD_TASK.address'
349
- }
350
- }
351
- }
352
- }
353
- }
354
- }
355
- ]
356
- }
357
- }
358
- ]
359
- }
360
- },
361
65
  validators: {
362
66
  required: true
363
67
  },
@@ -371,73 +75,6 @@ class UserService {
371
75
  {
372
76
  key: 'city',
373
77
  label: 'City',
374
- disabled: false,
375
- messages: [],
376
- default: {
377
- value: {
378
- is_found: false,
379
- value: '',
380
- sources: [
381
- {
382
- key: 'OBJECT',
383
- props: {
384
- object: {
385
- key: 'ALL_FORMS_DATA',
386
- path: '$.ADD_TASK.city'
387
- }
388
- },
389
- value: '',
390
- validation: {
391
- is_valid: false,
392
- triggers: ['ON_INIT'],
393
- rules: [
394
- {
395
- id: '1',
396
- key: 'VALUE_CHECK',
397
- props: {
398
- value: {
399
- source: {
400
- key: 'OBJECT',
401
- props: {
402
- object: {
403
- key: 'ALL_FORMS_DATA',
404
- path: '$.ADD_TASK.city'
405
- }
406
- }
407
- }
408
- },
409
- pattern: {
410
- key: 'IS_NOT_EMPTY'
411
- }
412
- }
413
- }
414
- ],
415
- actions: [
416
- {
417
- id: '1',
418
- key: 'SET_FIELD_DEFAULT_VALUE',
419
- condition: '1',
420
- props: {
421
- fieldKey: 'city',
422
- value: {
423
- source: {
424
- key: 'OBJECT',
425
- props: {
426
- object: {
427
- key: 'ALL_FORMS_DATA',
428
- path: '$.ADD_TASK.city'
429
- }
430
- }
431
- }
432
- }
433
- }
434
- }
435
- ]
436
- }
437
- }
438
- ]
439
- }
440
- },
441
78
  validators: {
442
79
  required: true
443
80
  },
@@ -451,73 +88,6 @@ class UserService {
451
88
  {
452
89
  key: 'location',
453
90
  label: 'Location URL',
454
- disabled: false,
455
- messages: [],
456
- default: {
457
- value: {
458
- is_found: false,
459
- value: '',
460
- sources: [
461
- {
462
- key: 'OBJECT',
463
- props: {
464
- object: {
465
- key: 'ALL_FORMS_DATA',
466
- path: '$.ADD_TASK.location'
467
- }
468
- },
469
- value: '',
470
- validation: {
471
- is_valid: false,
472
- triggers: ['ON_INIT'],
473
- rules: [
474
- {
475
- id: '1',
476
- key: 'VALUE_CHECK',
477
- props: {
478
- value: {
479
- source: {
480
- key: 'OBJECT',
481
- props: {
482
- object: {
483
- key: 'ALL_FORMS_DATA',
484
- path: '$.ADD_TASK.location'
485
- }
486
- }
487
- }
488
- },
489
- pattern: {
490
- key: 'IS_NOT_EMPTY'
491
- }
492
- }
493
- }
494
- ],
495
- actions: [
496
- {
497
- id: '1',
498
- key: 'SET_FIELD_DEFAULT_VALUE',
499
- condition: '1',
500
- props: {
501
- fieldKey: 'location',
502
- value: {
503
- source: {
504
- key: 'OBJECT',
505
- props: {
506
- object: {
507
- key: 'ALL_FORMS_DATA',
508
- path: '$.ADD_TASK.location'
509
- }
510
- }
511
- }
512
- }
513
- }
514
- }
515
- ]
516
- }
517
- }
518
- ]
519
- }
520
- },
521
91
  validators: {
522
92
  required: true
523
93
  },
@@ -537,6 +107,9 @@ class UserService {
537
107
  },
538
108
  steps: {
539
109
  hidden: true
110
+ },
111
+ logo: {
112
+ hidden: true
540
113
  }
541
114
  },
542
115
  footer: {
@@ -553,25 +126,273 @@ class UserService {
553
126
  };
554
127
  }
555
128
  ngOnInit() { }
556
- setAgentConfig(agentConfig) {
557
- this.agentConfig = agentConfig;
129
+ setAgentConfig(config) {
130
+ this.config = config;
558
131
  }
559
132
  toggleMapview() {
560
133
  this.showMapview = !this.showMapview;
561
134
  }
562
135
  }
563
- /** @nocollapse */ UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
564
- /** @nocollapse */ UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UserService, providedIn: 'root' });
565
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UserService, decorators: [{
136
+ /** @nocollapse */ AgentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
137
+ /** @nocollapse */ AgentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, providedIn: 'root' });
138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, decorators: [{
566
139
  type: Injectable,
567
140
  args: [{
568
141
  providedIn: 'root'
569
142
  }]
570
143
  }], ctorParameters: function () { return []; } });
571
144
 
145
+ class MapService {
146
+ constructor(agentService) {
147
+ this.agentService = agentService;
148
+ this.allMarkers = [];
149
+ }
150
+ // To Initialize Map
151
+ initMap() {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ this.myPosition = yield this.getPosition();
154
+ this.map = L.map('map', {
155
+ center: [this.myPosition.lat, this.myPosition.lng],
156
+ zoom: 13
157
+ });
158
+ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(this.map);
159
+ });
160
+ }
161
+ // To Add Marker in Map
162
+ addMarker({ lat, lng, title, color }) {
163
+ L.marker([lat, lng], {
164
+ icon: L.icon({
165
+ iconUrl: color == 'red'
166
+ ? 'https://kwikid.s3.ap-south-1.amazonaws.com/CONFIG/USER/assets/map-marker-0.png'
167
+ : 'https://kwikid.s3.ap-south-1.amazonaws.com/CONFIG/USER/assets/map-marker-1.png'
168
+ })
169
+ })
170
+ .addTo(this.map)
171
+ .bindPopup(title);
172
+ }
173
+ // To Plot Directions for All Tasks
174
+ plotDirectionsForAllTasks(tasks) {
175
+ if (this.map) {
176
+ this.allMarkers = [];
177
+ // Create Agent Marker & Plot It.
178
+ const myMarker = {
179
+ lat: this.myPosition.lat,
180
+ lng: this.myPosition.lng,
181
+ title: 0,
182
+ color: 'red'
183
+ };
184
+ this.addMarker(myMarker);
185
+ this.allMarkers.push(myMarker);
186
+ // Create Markers for all Tasks
187
+ tasks.map((task, index) => {
188
+ const marker = this.getLatLng(this.getLocation(task), index);
189
+ this.allMarkers.push(marker);
190
+ });
191
+ // Run Algorithm to get optimized Routes
192
+ const startingPoint = this.allMarkers[0];
193
+ const unvisitedWaypoints = this.allMarkers.slice(1);
194
+ const optimizedRoute = this.nearestNeighborAlgorithm(startingPoint, unvisitedWaypoints);
195
+ // Sort All Markers as per optimized routes
196
+ this.allMarkers = this.sortTasksAsPerDistance(optimizedRoute, this.allMarkers, true);
197
+ // Sort All Tasks as per optimized routes
198
+ tasks = this.sortTasksAsPerDistance(optimizedRoute.slice(1), tasks, false);
199
+ // Plot Markers for All Tasks
200
+ tasks.map((task, index) => {
201
+ const marker = this.getLatLng(this.getLocation(task), index);
202
+ this.addMarker(marker);
203
+ });
204
+ // Set Styles for all Task Routes
205
+ const styles = [
206
+ { color: 'blue', opacity: 1, weight: 8 },
207
+ { color: 'white', opacity: 0.6, weight: 12 }
208
+ ];
209
+ // Set Routes for all Tasks
210
+ this.allTasksRoutes = this.setRoutes(this.allMarkers, styles);
211
+ this.fitMapBounds();
212
+ }
213
+ return tasks;
214
+ }
215
+ // To plot Direction for selected Task
216
+ plotDirectionsForSelectedTask(index) {
217
+ if (index !== null) {
218
+ // Remove Previously Selected Task Route
219
+ if (this.selectedTaskRoutes) {
220
+ this.map.removeControl(this.selectedTaskRoutes);
221
+ }
222
+ // Remove All Tasks Routes
223
+ if (this.allTasksRoutes) {
224
+ this.map.removeControl(this.allTasksRoutes);
225
+ }
226
+ const taskMarker = this.allMarkers[index + 1];
227
+ // If Location is Available in Task Details
228
+ if (taskMarker.color != 'red') {
229
+ const markers = [this.allMarkers[0], taskMarker];
230
+ const styles = [
231
+ { color: 'green', opacity: 1, weight: 8 },
232
+ { color: 'white', opacity: 0.4, weight: 12 }
233
+ ];
234
+ this.selectedTaskRoutes = this.setRoutes(markers, styles);
235
+ this.setSelectedTaskDistanceAndTime();
236
+ }
237
+ else {
238
+ alert('No Location Available');
239
+ }
240
+ }
241
+ // Set All Tasks Routes Again & Remove Selected Tasks route
242
+ else {
243
+ if (this.selectedTaskRoutes) {
244
+ this.map.removeControl(this.selectedTaskRoutes);
245
+ }
246
+ this.map.addControl(this.allTasksRoutes);
247
+ this.selectedTaskRoutes = undefined;
248
+ }
249
+ this.fitMapBounds();
250
+ }
251
+ // Get Distance & Time of Selected Task
252
+ getSelectedTaskDistanceAndTime() {
253
+ return this.selectedTaskDistanceAndTime;
254
+ }
255
+ // Set Distance & Time of Selected Task
256
+ setSelectedTaskDistanceAndTime() {
257
+ this.selectedTaskRoutes.on('routesfound', function (e) {
258
+ let routes = e.routes;
259
+ let summary = routes[0].summary;
260
+ const distance = summary.totalDistance / 1000;
261
+ const time = Math.round((summary.totalTime % 3600) / 60);
262
+ this.selectedTaskDistanceAndTime = {
263
+ distance: distance,
264
+ time: time
265
+ };
266
+ });
267
+ }
268
+ // To sort Task as per nearest distance
269
+ sortTasksAsPerDistance(order, tasks, isMarker) {
270
+ let sortedTasks = [];
271
+ for (let i = 0; i < tasks.length; i++) {
272
+ const title = isMarker ? order[i].title : order[i].title - 1;
273
+ let task = tasks[title];
274
+ sortedTasks.push(task);
275
+ }
276
+ return sortedTasks;
277
+ }
278
+ // To set routes in the maps
279
+ setRoutes(markers, styles) {
280
+ return L.Routing.control({
281
+ waypoints: markers,
282
+ lineOptions: {
283
+ styles: styles
284
+ },
285
+ createMarker: function () {
286
+ return null;
287
+ },
288
+ routeWhileDragging: true
289
+ }).addTo(this.map);
290
+ }
291
+ // To set view point on the map
292
+ fitMapBounds() {
293
+ const markerLatLngs = this.allMarkers.map((marker) => L.latLng(marker.lat, marker.lng));
294
+ this.map.fitBounds(markerLatLngs);
295
+ }
296
+ // To get Current Position
297
+ getPosition() {
298
+ return new Promise((resolve, reject) => {
299
+ navigator.geolocation.watchPosition((resp) => {
300
+ resolve({
301
+ lng: resp.coords.longitude,
302
+ lat: resp.coords.latitude
303
+ });
304
+ }, (err) => {
305
+ reject(err);
306
+ });
307
+ });
308
+ }
309
+ // To extract Location from the Task Details
310
+ getLocation(task) {
311
+ var _a, _b, _c, _d, _e, _f;
312
+ if (checkObjectPathExists(this.agentService.config, 'dashboard.taskLocationPath')) {
313
+ const location = getObjectValueFromPath(task, this.agentService.config.dashboard.taskLocationPath);
314
+ return location;
315
+ }
316
+ else {
317
+ return ((_d = (_c = (_b = (_a = task === null || task === void 0 ? void 0 : task.extras) === null || _a === void 0 ? void 0 : _a.task_details) === null || _b === void 0 ? void 0 : _b.customer_details) === null || _c === void 0 ? void 0 : _c.location) !== null && _d !== void 0 ? _d : (_f = (_e = task === null || task === void 0 ? void 0 : task.task_details) === null || _e === void 0 ? void 0 : _e.customer_details) === null || _f === void 0 ? void 0 : _f.location);
318
+ }
319
+ }
320
+ // To get Latitude & Longitude from Task Location
321
+ getLatLng(data, index) {
322
+ try {
323
+ const url = data.split('@');
324
+ const lat_long_match = url[1].split(',');
325
+ const lat = Number(lat_long_match[0]);
326
+ const long = Number(lat_long_match[1]);
327
+ return { lat: lat, lng: long, title: index + 1, color: 'blue' };
328
+ }
329
+ catch (_a) {
330
+ // If could not find Google Maps Location URL in Task
331
+ return {
332
+ lat: this.myPosition.lat,
333
+ lng: this.myPosition.lng,
334
+ title: index + 1,
335
+ color: 'red'
336
+ };
337
+ }
338
+ }
339
+ // To Calculate Distance between two markers
340
+ calculateDistance(point1, point2) {
341
+ const lat1 = point1.lat;
342
+ const lng1 = point1.lng;
343
+ const lat2 = point2.lat;
344
+ const lng2 = point2.lng;
345
+ const R = 6371; // Earth radius in kilometers
346
+ const dLat = (lat2 - lat1) * (Math.PI / 180);
347
+ const dLng = (lng2 - lng1) * (Math.PI / 180);
348
+ const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
349
+ Math.cos((lat1 * Math.PI) / 180) *
350
+ Math.cos((lat2 * Math.PI) / 180) *
351
+ Math.sin(dLng / 2) *
352
+ Math.sin(dLng / 2);
353
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
354
+ const distance = R * c;
355
+ return distance;
356
+ }
357
+ // To calculate nearest distance from marker
358
+ nearestNeighborAlgorithm(startingPoint, unvisitedPoints) {
359
+ let currentPoint = startingPoint;
360
+ const path = [currentPoint];
361
+ const visitedPoints = new Set([currentPoint]);
362
+ while (unvisitedPoints.length > 0) {
363
+ let nearestPoint = null;
364
+ let minDistance = Number.POSITIVE_INFINITY;
365
+ for (const point of unvisitedPoints) {
366
+ const distance = this.calculateDistance(currentPoint, point);
367
+ if (distance < minDistance) {
368
+ minDistance = distance;
369
+ nearestPoint = point;
370
+ }
371
+ }
372
+ path.push(nearestPoint);
373
+ visitedPoints.add(nearestPoint);
374
+ currentPoint = nearestPoint;
375
+ unvisitedPoints = unvisitedPoints.filter((point) => !visitedPoints.has(point));
376
+ }
377
+ return path;
378
+ }
379
+ }
380
+ /** @nocollapse */ MapService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, deps: [{ token: AgentService }], target: i0.ɵɵFactoryTarget.Injectable });
381
+ /** @nocollapse */ MapService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, providedIn: 'root' });
382
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, decorators: [{
383
+ type: Injectable,
384
+ args: [{
385
+ providedIn: 'root'
386
+ }]
387
+ }], ctorParameters: function () { return [{ type: AgentService }]; }, propDecorators: { directionsRenders: [{
388
+ type: ViewChildren,
389
+ args: ['directionsRender']
390
+ }] } });
391
+
572
392
  class CustomerDetailsComponent {
573
- constructor(userService) {
574
- this.userService = userService;
393
+ constructor(agentService, mapService) {
394
+ this.agentService = agentService;
395
+ this.mapService = mapService;
575
396
  this.customer = {
576
397
  agent_id: 'sparkcpaital_dev_agent_1',
577
398
  client_name: 'sparkcpaital_dev',
@@ -608,7 +429,17 @@ class CustomerDetailsComponent {
608
429
  ngOnInit() {
609
430
  var _a, _b, _c;
610
431
  this.viewTaskDetails =
611
- (_c = (_b = (_a = this.agentConfig) === null || _a === void 0 ? void 0 : _a.dashboardConfig) === null || _b === void 0 ? void 0 : _b.viewTaskDetails) !== null && _c !== void 0 ? _c : this.viewTaskDetails;
432
+ (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.viewTaskDetails) !== null && _c !== void 0 ? _c : this.viewTaskDetails;
433
+ }
434
+ getTaskCreationTime(task) {
435
+ var _a;
436
+ if (checkObjectPathExists(this.agentService.config, 'dashboard.taskCreationTimePath')) {
437
+ const time = getObjectValueFromPath(task, this.agentService.config.dashboard.taskCreationTimePath);
438
+ return this.convertEpochToDate(time);
439
+ }
440
+ else {
441
+ return this.convertEpochToDate((_a = task === null || task === void 0 ? void 0 : task.task_creation_time) !== null && _a !== void 0 ? _a : task === null || task === void 0 ? void 0 : task.start_time);
442
+ }
612
443
  }
613
444
  convertToTitleCase(inputString) {
614
445
  inputString = inputString.replace('$.task_details.customer_details.', '');
@@ -632,18 +463,19 @@ class CustomerDetailsComponent {
632
463
  goToMaps(location) {
633
464
  window.open(`${location}`, '_blank');
634
465
  }
635
- goToNextStep(e) {
466
+ handleOnClickNext(e) {
636
467
  this.nextStep.emit(e);
637
468
  }
638
469
  close() {
639
- this.userService.showTaskDetails = undefined;
470
+ this.agentService.isShowTaskDetails = undefined;
471
+ this.mapService.plotDirectionsForSelectedTask(null);
640
472
  }
641
473
  handleOnClickRemoveTask(task) {
642
474
  this.removeTask.emit(task);
643
475
  }
644
476
  }
645
- /** @nocollapse */ CustomerDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerDetailsComponent, deps: [{ token: UserService }], target: i0.ɵɵFactoryTarget.Component });
646
- /** @nocollapse */ CustomerDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerDetailsComponent, selector: "customer-details", inputs: { customer: "customer", agentConfig: "agentConfig" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, ngImport: i0, template: "<div class=\"customer-details-wrapper\">\n <div class=\"customer-details-heading\">Task Details</div>\n <div class=\"customer-details-body\">\n <div class=\"customer-details-user-id\">\n {{\n agentConfig?.dashboardConfig?.taskIdentifier\n ? getTaskDetails(agentConfig?.dashboardConfig?.taskIdentifier)\n : customer.user_id\n }}\n </div>\n\n <div class=\"customer-details-table\">\n <div\n class=\"customer-details-table-data\"\n *ngFor=\"let taskData of viewTaskDetails\"\n >\n <div class=\"customer-details-table-detail-value\">\n {{ getTaskDetails(taskData) }}\n </div>\n </div>\n </div>\n\n <div class=\"customer-details-date\">\n Task Created on: {{ convertEpochToDate(customer.task_creation_time) }}\n </div>\n\n <div class=\"customer-details-actions\">\n <div class=\"customer-details-task-buttons\">\n <kwikui-button\n *ngIf=\"agentConfig.dashboardConfig?.allowRemoveTask\"\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"agentConfig.dashboardConfig?.showCopyLink\"\n icon=\"tuiIconCopy\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'SHARE_JOURNEY_LINK' })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-details-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showMaps &&\n customer?.task_details?.customer_details?.location\n \"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToMaps(customer?.task_details?.customer_details?.location)\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showStartJourneyButton &&\n customer.session_status !== 'complete' &&\n customer.session_status !== ''\n \"\n label=\"Edit Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'EDIT_JOURNEY' })\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showStartJourneyButton &&\n customer.session_status == ''\n \"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'START_JOURNEY' })\n \"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".customer-details-wrapper{display:flex;flex-direction:column;align-items:stretch;overflow:hidden;grid-gap:.5rem;gap:.5rem;padding:1.5rem;height:100%;width:100%}.customer-details-wrapper .customer-details-heading{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:1rem 0;font-size:1.5rem;font-weight:600}.customer-details-wrapper .customer-details-body{display:flex;flex-direction:column;grid-gap:1.25rem;gap:1.25rem}.customer-details-wrapper .customer-details-body .customer-details-user-id{font-size:1.25rem;font-weight:500;padding:.5rem 0}.customer-details-wrapper .customer-details-body .customer-details-table{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:column}.customer-details-wrapper .customer-details-body .customer-details-table .customer-details-table-data .customer-details-table-detail-name{font-weight:500}.customer-details-wrapper .customer-details-body .customer-details-table .customer-details-table-data .customer-details-table-detail-value{word-wrap:break-word}.customer-details-wrapper .customer-details-body .customer-details-date{padding-top:1rem}.customer-details-wrapper .customer-details-body .customer-details-actions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-task-buttons{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:1rem 0}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.2rem;gap:.2rem;align-items:center;justify-content:flex-end}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-journey-buttons .customer-share-link{font-size:.7rem}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
477
+ /** @nocollapse */ CustomerDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerDetailsComponent, deps: [{ token: AgentService }, { token: MapService }], target: i0.ɵɵFactoryTarget.Component });
478
+ /** @nocollapse */ CustomerDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerDetailsComponent, selector: "customer-details", inputs: { customer: "customer", config: "config" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, ngImport: i0, template: "<div class=\"customer-details-wrapper\">\n <div class=\"customer-details-heading\">Task Details</div>\n <div class=\"customer-details-body\">\n <div class=\"customer-details-user-id\">\n {{\n config?.dashboard?.taskIdentifier\n ? getTaskDetails(config?.dashboard?.taskIdentifier)\n : customer.user_id\n }}\n </div>\n\n <div class=\"customer-details-table\">\n <div\n class=\"customer-details-table-data\"\n *ngFor=\"let taskData of viewTaskDetails\"\n >\n <div class=\"customer-details-table-detail-value\">\n {{ getTaskDetails(taskData) }}\n </div>\n </div>\n </div>\n\n <div class=\"customer-details-date\">\n Task Created on: {{ getTaskCreationTime(customer) }}\n </div>\n\n <div class=\"customer-details-actions\">\n <div class=\"customer-details-task-buttons\">\n <kwikui-button\n *ngIf=\"config.dashboard?.isAllowRemoveTask\"\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"config.dashboard?.isShowCopyLink\"\n icon=\"tuiIconCopy\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'SHARE_JOURNEY_LINK' })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-details-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isShowMaps &&\n customer?.task_details?.customer_details?.location\n \"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToMaps(customer?.task_details?.customer_details?.location)\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status !== 'complete' &&\n customer.session_status !== ''\n \"\n label=\"Edit Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'EDIT_JOURNEY' })\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status == ''\n \"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'START_JOURNEY' })\n \"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".customer-details-wrapper{display:flex;flex-direction:column;align-items:stretch;overflow:hidden;grid-gap:.5rem;gap:.5rem;padding:1.5rem;height:100%;width:100%}.customer-details-wrapper .customer-details-heading{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:1rem 0;font-size:1.5rem;font-weight:600}.customer-details-wrapper .customer-details-body{display:flex;flex-direction:column;grid-gap:1.25rem;gap:1.25rem}.customer-details-wrapper .customer-details-body .customer-details-user-id{font-size:1.25rem;font-weight:500;padding:.5rem 0}.customer-details-wrapper .customer-details-body .customer-details-table{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:column}.customer-details-wrapper .customer-details-body .customer-details-table .customer-details-table-data .customer-details-table-detail-name{font-weight:500}.customer-details-wrapper .customer-details-body .customer-details-table .customer-details-table-data .customer-details-table-detail-value{word-wrap:break-word}.customer-details-wrapper .customer-details-body .customer-details-date{padding-top:1rem}.customer-details-wrapper .customer-details-body .customer-details-actions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-task-buttons{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:1rem 0}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.2rem;gap:.2rem;align-items:center;justify-content:flex-end}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-journey-buttons .customer-share-link{font-size:.7rem}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
647
479
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerDetailsComponent, decorators: [{
648
480
  type: Component,
649
481
  args: [{
@@ -651,9 +483,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
651
483
  templateUrl: './customer-details.component.html',
652
484
  styleUrls: ['./customer-details.component.scss']
653
485
  }]
654
- }], ctorParameters: function () { return [{ type: UserService }]; }, propDecorators: { customer: [{
486
+ }], ctorParameters: function () { return [{ type: AgentService }, { type: MapService }]; }, propDecorators: { customer: [{
655
487
  type: Input
656
- }], agentConfig: [{
488
+ }], config: [{
657
489
  type: Input
658
490
  }], nextStep: [{
659
491
  type: Output
@@ -679,188 +511,6 @@ const VStatus = [
679
511
  EStatus.COMPLETE
680
512
  ];
681
513
 
682
- class InfoWindowService {
683
- constructor(mapService) {
684
- this.mapService = mapService;
685
- this.config = {
686
- fields: {
687
- name: {
688
- label: 'Name',
689
- value: 'name',
690
- display: 'value',
691
- style: {
692
- fontSize: '1rem',
693
- fontWeight: 600
694
- }
695
- },
696
- phone: {
697
- label: 'Call',
698
- value: 'phone',
699
- display: 'label',
700
- style: {
701
- fontSize: '0.8rem',
702
- padding: '0.1rem 0',
703
- textAlign: 'justify'
704
- },
705
- icon: 'https://cdn-icons-png.flaticon.com/512/60/60720.png'
706
- },
707
- address: {
708
- label: 'Directions',
709
- value: 'address',
710
- display: 'label',
711
- style: {
712
- fontSize: '0.8rem',
713
- padding: '0.1rem 0'
714
- },
715
- icon: 'https://cdn-icons-png.flaticon.com/512/62/62516.png'
716
- }
717
- }
718
- };
719
- this.mainInfoWindowStyle = {
720
- display: 'flex',
721
- 'flex-direction': 'column',
722
- 'justify-content': 'center',
723
- 'align-items': 'stretch',
724
- gap: '0.5rem',
725
- padding: '0.5rem'
726
- };
727
- this.fieldDivStyle = {
728
- gap: ' 0.5rem',
729
- display: 'flex',
730
- 'flex-direction': 'row'
731
- };
732
- }
733
- getOpenMarker() {
734
- return this.openMarker;
735
- }
736
- setOpenMarker(value) {
737
- this.openMarker = value;
738
- }
739
- /**
740
- * @description
741
- * Wrapper method to show Customer Info Window
742
- *
743
- * @function showInfo
744
- * @func showInfo
745
- * @method showInfo
746
- */
747
- showCustomerInformation(customer, marker) {
748
- let map = this.mapService.map;
749
- let contentString = this.createInfoContent(customer);
750
- let infowindow = new google.maps.InfoWindow({
751
- content: contentString
752
- });
753
- this.addEventListeners(customer, infowindow);
754
- this.closeLastOpenedInfoWindow();
755
- infowindow.open(map, marker);
756
- this.lastInfoWindowOpened = infowindow;
757
- this.mapService.map = Object.assign(Object.assign({}, this.mapService.map), { center: marker.getPosition });
758
- // map.setCenter(marker.getPosition());
759
- return { infowindow: infowindow };
760
- }
761
- addEventListeners(customer, infowindow) {
762
- // chnage -
763
- let addressLink = `http://maps.google.com/?q=${customer.extras.loc[0]}, ${customer.extras.loc[1]}`;
764
- google.maps.event.addListener(infowindow, 'domready', function () {
765
- document.getElementById('Call').addEventListener('click', function (e) {
766
- window.open(`tel:${customer.extras.phone}`, '_self');
767
- });
768
- document
769
- .getElementById('Directions')
770
- .addEventListener('click', function (e) {
771
- window.open(`${addressLink}`, '_blank');
772
- });
773
- document
774
- .getElementsByClassName('gm-ui-hover-effect')[0]
775
- .setAttribute('style', ' background: none;\
776
- display: block; \
777
- border: 0px; \
778
- margin: 0px; \
779
- padding: 0px; \
780
- text-transform: none; \
781
- appearance: none; \
782
- position: absolute; \
783
- cursor: pointer; \
784
- user-select: none; \
785
- top: 0px; \
786
- right: 0px; \
787
- width: 30px; \
788
- height: 30px; \
789
- ');
790
- });
791
- }
792
- /**
793
- * @description
794
- * Wrapper method to close Last Info Window
795
- *
796
- * @function closeLastOpenedInfoWindow
797
- * @func closeLastOpenedInfoWindow
798
- * @method closeLastOpenedInfoWindow
799
- */
800
- closeLastOpenedInfoWindow() {
801
- if (this.lastInfoWindowOpened) {
802
- this.lastInfoWindowOpened.close();
803
- }
804
- }
805
- /**
806
- * @description
807
- * Closes the previously opened info window.
808
- *
809
- * @function infoData
810
- * @func infoData
811
- * @method infoData
812
- */
813
- createInfoContent(customer) {
814
- let content = "<div style='padding:4px; font-family: Manrope;' >";
815
- content += this.createFields(customer, this.config.fields);
816
- content += '</div>';
817
- return content;
818
- }
819
- /**
820
- * @description
821
- * Wrapper method to create Fields Container
822
- *
823
- * @function createFields
824
- * @func createFields
825
- * @method createFields
826
- */
827
- createFields(customer, fields) {
828
- let _div = document.createElement('div');
829
- for (const property in this.mainInfoWindowStyle)
830
- _div.style[property] = this.mainInfoWindowStyle[property];
831
- for (let key of Object.keys(fields)) {
832
- let field = fields[key];
833
- let _fieldDiv = document.createElement('div');
834
- _fieldDiv.setAttribute('id', field.label);
835
- for (const property in this.fieldDivStyle)
836
- _fieldDiv.style[property] = this.fieldDivStyle[property];
837
- for (const property in field.style)
838
- _fieldDiv.style[property] = field.style[property];
839
- let string = field.display == 'label' ? field.label : customer.extras[field.value];
840
- if (field.icon) {
841
- let _icon = document.createElement('img');
842
- _icon.src = field.icon;
843
- _icon.style.width = field.style.fontSize;
844
- _icon.style.height = field.style.fontSize;
845
- _fieldDiv.appendChild(_icon);
846
- }
847
- let _fieldText = document.createElement('div');
848
- _fieldText.innerHTML = string;
849
- _fieldDiv.appendChild(_fieldText);
850
- _div.appendChild(_fieldDiv);
851
- }
852
- return _div.outerHTML;
853
- }
854
- }
855
- /** @nocollapse */ InfoWindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InfoWindowService, deps: [{ token: MapService }], target: i0.ɵɵFactoryTarget.Injectable });
856
- /** @nocollapse */ InfoWindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InfoWindowService, providedIn: 'root' });
857
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InfoWindowService, decorators: [{
858
- type: Injectable,
859
- args: [{
860
- providedIn: 'root'
861
- }]
862
- }], ctorParameters: function () { return [{ type: MapService }]; } });
863
-
864
514
  class StatusPillComponent {
865
515
  ngOnInit() {
866
516
  if (isEmptyValue(this.status)) {
@@ -873,7 +523,7 @@ class StatusPillComponent {
873
523
  }
874
524
  }
875
525
  /** @nocollapse */ StatusPillComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: StatusPillComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
876
- /** @nocollapse */ StatusPillComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, ngImport: i0, template: "<div [ngClass]=\"getStatusPillClass(status)\">{{status}}</div>\n", styles: [".status-pill{background-color:#555;padding:.1rem .5rem;border-radius:1rem;font-size:.7rem;color:#fff}.complete{background-color:var(--tui-positive)}.rejected{background-color:var(--tui-negative)}.auditing{background-color:var(--tui-primary)}.on-going{background-color:var(--tui-primary)}.after-audit{background-color:var(--tui-warning-fill);color:#222}\n"], directives: [{ type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
526
+ /** @nocollapse */ StatusPillComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, ngImport: i0, template: "<div [ngClass]=\"getStatusPillClass(status)\">{{status}}</div>\n", styles: [".status-pill{background-color:#555;padding:.1rem .5rem;border-radius:1rem;font-size:.7rem;color:#fff}.complete{background-color:var(--tui-positive)}.rejected{background-color:var(--tui-negative)}.auditing{background-color:var(--tui-primary)}.on-going{background-color:var(--tui-primary)}.after-audit{background-color:var(--tui-warning-fill);color:#222}\n"], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
877
527
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: StatusPillComponent, decorators: [{
878
528
  type: Component,
879
529
  args: [{
@@ -886,41 +536,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
886
536
  }] } });
887
537
 
888
538
  class CustomerTileComponent {
889
- /**
890
- * @description
891
- *
892
- * @constructor
893
- */
894
- constructor(mapService, infoWindowService, userService, hostElement) {
539
+ constructor(mapService, agentService, hostElement) {
895
540
  this.mapService = mapService;
896
- this.infoWindowService = infoWindowService;
897
- this.userService = userService;
541
+ this.agentService = agentService;
898
542
  this.hostElement = hostElement;
899
- /**
900
- * @description
901
- * Determines Customer Data
902
- *
903
- * @default
904
- * `{}`
905
- */
906
543
  this.customer = {};
907
- /**
908
- * @description
909
- * Determines Index of Customer Data in Customer List
910
- *
911
- * @default
912
- *
913
- */
914
544
  this.index = undefined;
915
545
  this.isMobileView = false;
916
546
  this.viewTaskDetails = [];
917
- /**
918
- * @description
919
- * Emitter to emit next Step
920
- *
921
- * @emits KwikIDAgentDashboardComponent#nextStep
922
- * @fires KwikIDAgentDashboardComponent#nextStep
923
- */
924
547
  this.nextStep = new EventEmitter();
925
548
  this.removeTask = new EventEmitter();
926
549
  }
@@ -932,74 +555,43 @@ class CustomerTileComponent {
932
555
  this.isMobileView = false;
933
556
  }
934
557
  }
935
- /**
936
- * @description
937
- * To set Google Maps API on script
938
- *
939
- * @ngOnInit
940
- */
941
558
  ngOnInit() {
942
559
  var _a, _b, _c;
943
560
  this.viewTaskDetails =
944
- (_c = (_b = (_a = this.agentConfig) === null || _a === void 0 ? void 0 : _a.dashboardConfig) === null || _b === void 0 ? void 0 : _b.viewTaskDetails) !== null && _c !== void 0 ? _c : this.viewTaskDetails;
561
+ (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.viewTaskDetails) !== null && _c !== void 0 ? _c : this.viewTaskDetails;
945
562
  }
946
563
  getTaskDetails(taskData) {
947
564
  return getObjectValueFromPath(this.customer, taskData);
948
565
  }
949
566
  openDetails() {
950
- if (this.userService.showTaskDetails !== this.index) {
951
- this.userService.showTaskDetails = this.index;
567
+ if (this.agentService.isShowTaskDetails !== this.index) {
568
+ this.agentService.isShowTaskDetails = this.index;
569
+ this.mapService.plotDirectionsForSelectedTask(this.index);
952
570
  }
953
571
  else {
954
- this.userService.showTaskDetails = undefined;
572
+ this.agentService.isShowTaskDetails = undefined;
573
+ this.mapService.plotDirectionsForSelectedTask(null);
955
574
  }
956
575
  }
957
- tileClick() {
958
- this.openDetails();
959
- if (this.index == this.infoWindowService.getOpenMarker()) {
960
- this.infoWindowService.setOpenMarker(null);
961
- //this.infoWindowService.lastInfoWindowOpened.close();
962
- }
963
- else {
964
- this.showDetails(this.customer, this.index);
965
- }
966
- }
967
- /**
968
- * @description
969
- * Wrapper method to show Customer Info Window
970
- *
971
- * @function showDetails
972
- * @func showDetails
973
- * @method showDetails
974
- */
975
- showDetails(customer, index) {
976
- let markers = this.mapService.getMarkers();
977
- let marker = markers[index + 1];
978
- // let { infowindow } = this.infoWindowService.showCustomerInformation(
979
- // customer,
980
- // marker
981
- // );
982
- this.infoWindowService.setOpenMarker(index);
983
- }
984
576
  getClass() {
985
- let string = "customer-tile-wrapper";
986
- if (this.userService.showTaskDetails == this.index) {
987
- string += " customer-tile-active";
577
+ let string = 'customer-tile-wrapper';
578
+ if (this.agentService.isShowTaskDetails == this.index) {
579
+ string += ' customer-tile-active';
988
580
  }
989
581
  return string;
990
582
  }
991
583
  goToMaps(location) {
992
584
  window.open(`${location}`, '_blank');
993
585
  }
994
- goToNextStep(e) {
586
+ handleOnClickNext(e) {
995
587
  this.nextStep.emit(e);
996
588
  }
997
589
  handleOnClickRemoveTask(task) {
998
590
  this.removeTask.emit(task);
999
591
  }
1000
592
  }
1001
- /** @nocollapse */ CustomerTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, deps: [{ token: MapService }, { token: InfoWindowService }, { token: UserService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1002
- /** @nocollapse */ CustomerTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerTileComponent, selector: "customer-tile", inputs: { customer: "customer", index: "index", agentConfig: "agentConfig" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "infoWindow", first: true, predicate: MapInfoWindow, descendants: true }], ngImport: i0, template: "<div [ngClass]=\"getClass()\">\n <div class=\"customer-tile-primary-container\">\n <div class=\"customer-tile-primary-container-data\">\n <div class=\"customer-tile-primary-container-userid\">\n {{\n agentConfig?.dashboardConfig?.taskIdentifier\n ? getTaskDetails(agentConfig?.dashboardConfig?.taskIdentifier)\n : customer.user_id\n }}\n </div>\n <status-pill\n *ngIf=\"agentConfig?.dashboardConfig?.showTaskStatus\"\n [status]=\"customer.session_status\"\n ></status-pill>\n </div>\n <kwikui-button\n *ngIf=\"!userService.isMobileView && !userService.showMapview\"\n [icon]=\"\n userService.showTaskDetails == index\n ? 'tuiIconChevronLeftLarge'\n : 'tuiIconChevronRightLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"openDetails()\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"userService.isMobileView || userService.showMapview\"\n [icon]=\"\n userService.showTaskDetails == index\n ? 'tuiIconChevronUpLarge'\n : 'tuiIconChevronDownLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"openDetails()\"\n ></kwikui-button>\n </div>\n <div\n [ngClass]=\"\n index == userService.showTaskDetails &&\n (userService.isMobileView || userService.showMapview)\n ? 'customer-tile-secondary-container'\n : 'data-collasped'\n \"\n >\n <div class=\"customer-tile-secondary-container-data\">\n <div\n *ngFor=\"let taskData of viewTaskDetails\"\n class=\"customer-tile-secondary-container-custom-details\"\n >\n {{ getTaskDetails(taskData) }}\n </div>\n </div>\n <div class=\"customer-tile-secondary-container-actions\">\n <div class=\"customer-tile-secondary-container-task-buttons\">\n <kwikui-button\n *ngIf=\"agentConfig.dashboardConfig?.allowRemoveTask\"\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"agentConfig.dashboardConfig?.showCopyLink\"\n icon=\"tuiIconCopy\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'SHARE_JOURNEY_LINK' })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-tile-secondary-container-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showMaps &&\n customer?.task_details?.customer_details?.location\n \"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"goToMaps(customer.task_details.customer_details.location)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showStartJourneyButton &&\n customer.session_status !== 'complete' &&\n customer.session_status !== ''\n \"\n label=\"Edit Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'EDIT_JOURNEY' })\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showStartJourneyButton &&\n customer.session_status == ''\n \"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'START_JOURNEY' })\n \"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".customer-tile-wrapper{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto;grid-gap:.5rem;gap:.5rem;padding:1rem;border-bottom:.5px solid #ddd}.customer-tile-wrapper .customer-tile-primary-container{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;width:100%;height:100%}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data{padding-left:.2rem;grid-gap:.6rem;gap:.6rem;display:flex;flex-direction:row;flex-wrap:wrap;align-content:stretch;justify-content:space-evenly;align-items:center}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data .customer-tile-primary-container-userid{font-weight:500;font-size:1.1rem;line-height:1rem}.customer-tile-wrapper .customer-tile-secondary-container{width:100%;height:100%;display:flex;flex-direction:column;overflow:auto;grid-gap:.5rem;gap:.5rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data{padding:.4rem .2rem;display:flex;flex-direction:column;font-size:.7rem;grid-gap:.3rem;gap:.3rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data .customer-tile-secondary-container-custom-details{width:100%;height:100%;line-height:.9rem;word-wrap:break-word}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-task-buttons{display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.2rem;gap:.2rem;align-items:center;justify-content:flex-end}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons .customer-share-link{font-size:.7rem}.customer-tile-wrapper .data-collasped{display:none}.customer-tile-active{background-color:#dcedfd}\n"], components: [{ type: StatusPillComponent, selector: "status-pill", inputs: ["status"] }, { type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
593
+ /** @nocollapse */ CustomerTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, deps: [{ token: MapService }, { token: AgentService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
594
+ /** @nocollapse */ CustomerTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerTileComponent, selector: "customer-tile", inputs: { customer: "customer", index: "index", config: "config" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, ngImport: i0, template: "<div [ngClass]=\"getClass()\">\n <div class=\"customer-tile-primary-container\">\n <div class=\"customer-tile-primary-container-data\">\n <div class=\"customer-tile-primary-container-userid\">\n {{\n config?.dashboard?.taskIdentifier\n ? getTaskDetails(config?.dashboard?.taskIdentifier)\n : customer.user_id\n }}\n </div>\n <status-pill\n *ngIf=\"config?.dashboard?.isShowTaskStatus\"\n [status]=\"customer.session_status\"\n ></status-pill>\n </div>\n <kwikui-button\n *ngIf=\"!agentService.isMobileView && !agentService.showMapview\"\n [icon]=\"\n agentService.isShowTaskDetails == index\n ? 'tuiIconChevronLeftLarge'\n : 'tuiIconChevronRightLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"openDetails()\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"agentService.isMobileView || agentService.showMapview\"\n [icon]=\"\n agentService.isShowTaskDetails == index\n ? 'tuiIconChevronUpLarge'\n : 'tuiIconChevronDownLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"openDetails()\"\n ></kwikui-button>\n </div>\n <div\n [ngClass]=\"\n index == agentService.isShowTaskDetails &&\n (agentService.isMobileView || agentService.showMapview)\n ? 'customer-tile-secondary-container'\n : 'data-collasped'\n \"\n >\n <div class=\"customer-tile-secondary-container-data\">\n <div\n *ngFor=\"let taskData of viewTaskDetails\"\n class=\"customer-tile-secondary-container-custom-details\"\n >\n {{ getTaskDetails(taskData) }}\n </div>\n <div\n *ngIf=\"\n agentService.config?.dashboard?.isShowMaps &&\n agentService.config?.dashboard?.isShowDistanceAndTime &&\n mapService.getSelectedTaskDistanceAndTime()\n \"\n class=\"customer-tile-secondary-container-custom-details\"\n >\n Distance: {{ mapService.getSelectedTaskDistanceAndTime()?.distance }} |\n Time: {{ mapService.getSelectedTaskDistanceAndTime()?.time }}\n </div>\n </div>\n <div class=\"customer-tile-secondary-container-actions\">\n <div class=\"customer-tile-secondary-container-task-buttons\">\n <kwikui-button\n *ngIf=\"config.dashboard?.isAllowRemoveTask\"\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"config.dashboard?.isShowCopyLink\"\n icon=\"tuiIconCopy\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"\n handleOnClickNext({\n customer: customer,\n stepType: 'SHARE_JOURNEY_LINK'\n })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-tile-secondary-container-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isShowMaps &&\n customer?.task_details?.customer_details?.location\n \"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"goToMaps(customer.task_details.customer_details.location)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status !== 'complete' &&\n customer.session_status !== ''\n \"\n label=\"Edit Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'EDIT_JOURNEY' })\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status == ''\n \"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'START_JOURNEY' })\n \"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".customer-tile-wrapper{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto;grid-gap:.5rem;gap:.5rem;padding:1rem;border-bottom:.5px solid #ddd}.customer-tile-wrapper .customer-tile-primary-container{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;width:100%;height:100%}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data{padding-left:.2rem;grid-gap:.6rem;gap:.6rem;display:flex;flex-direction:row;flex-wrap:wrap;align-content:stretch;justify-content:space-evenly;align-items:center}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data .customer-tile-primary-container-userid{font-weight:500;font-size:1.1rem;line-height:1rem}.customer-tile-wrapper .customer-tile-secondary-container{width:100%;height:100%;display:flex;flex-direction:column;overflow:auto;grid-gap:.5rem;gap:.5rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data{padding:.4rem .2rem;display:flex;flex-direction:column;font-size:.7rem;grid-gap:.3rem;gap:.3rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data .customer-tile-secondary-container-custom-details{width:100%;height:100%;line-height:.9rem;word-wrap:break-word}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-task-buttons{display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.2rem;gap:.2rem;align-items:center;justify-content:flex-end}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons .customer-share-link{font-size:.7rem}.customer-tile-wrapper .data-collasped{display:none}.customer-tile-active{background-color:#dcedfd}\n"], components: [{ type: StatusPillComponent, selector: "status-pill", inputs: ["status"] }, { type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1003
595
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, decorators: [{
1004
596
  type: Component,
1005
597
  args: [{
@@ -1007,22 +599,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1007
599
  templateUrl: './customer-tile.component.html',
1008
600
  styleUrls: ['./customer-tile.component.scss']
1009
601
  }]
1010
- }], ctorParameters: function () { return [{ type: MapService }, { type: InfoWindowService }, { type: UserService }, { type: i0.ElementRef }]; }, propDecorators: { windowResizeWatcher: [{
602
+ }], ctorParameters: function () { return [{ type: MapService }, { type: AgentService }, { type: i0.ElementRef }]; }, propDecorators: { windowResizeWatcher: [{
1011
603
  type: HostListener,
1012
604
  args: ['window:resize', ['$event']]
1013
605
  }], customer: [{
1014
606
  type: Input
1015
607
  }], index: [{
1016
608
  type: Input
1017
- }], agentConfig: [{
609
+ }], config: [{
1018
610
  type: Input
1019
611
  }], nextStep: [{
1020
612
  type: Output
1021
613
  }], removeTask: [{
1022
614
  type: Output
1023
- }], infoWindow: [{
1024
- type: ViewChild,
1025
- args: [MapInfoWindow]
1026
615
  }] } });
1027
616
 
1028
617
  class Ng2SearchPipe {
@@ -1107,7 +696,7 @@ class CustomerListComponent {
1107
696
  ngOnInit() { }
1108
697
  ngAfterViewInit() {
1109
698
  setTimeout(() => __awaiter(this, void 0, void 0, function* () {
1110
- if (this.agentConfig.dashboardConfig.showMaps) {
699
+ if (this.config.dashboard.isShowMaps) {
1111
700
  yield this.mapService.initMap();
1112
701
  this.filteredData = yield this.plotMarkers(this.customers);
1113
702
  }
@@ -1117,14 +706,16 @@ class CustomerListComponent {
1117
706
  }), 1000);
1118
707
  }
1119
708
  ngOnChanges() {
1120
- if (this.agentConfig.dashboardConfig.showMaps) {
1121
- this.filteredData = this.plotMarkers(this.customers);
1122
- }
1123
- else {
1124
- this.filteredData = this.customers;
1125
- }
709
+ return __awaiter(this, void 0, void 0, function* () {
710
+ if (this.config.dashboard.isShowMaps) {
711
+ this.filteredData = yield this.plotMarkers(this.customers);
712
+ }
713
+ else {
714
+ this.filteredData = this.customers;
715
+ }
716
+ });
1126
717
  }
1127
- goToNextStep(e) {
718
+ handleOnClickNext(e) {
1128
719
  this.nextStep.emit(e);
1129
720
  }
1130
721
  getDate(d) {
@@ -1141,16 +732,15 @@ class CustomerListComponent {
1141
732
  }
1142
733
  plotMarkers(customers) {
1143
734
  var _a;
1144
- if (!((_a = this.agentConfig.dashboardConfig) === null || _a === void 0 ? void 0 : _a.showHistory)) {
1145
- customers = customers.filter((customer) => {
1146
- return customer.status !== EStatus.COMPLETE;
1147
- });
1148
- }
1149
- let directionsResults$ = this.mapService.plotMarkers(customers);
1150
- directionsResults$.subscribe((val) => {
1151
- this.filteredData = this.mapService.sortList(val.routes[0].waypoint_order, customers);
735
+ return __awaiter(this, void 0, void 0, function* () {
736
+ if (!((_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.isPlotCompletedTaskMarkers)) {
737
+ customers = customers.filter((customer) => {
738
+ return customer.status !== EStatus.COMPLETE;
739
+ });
740
+ }
741
+ customers = yield this.mapService.plotDirectionsForAllTasks(customers);
742
+ return customers;
1152
743
  });
1153
- return customers;
1154
744
  }
1155
745
  getTuiDate(event) {
1156
746
  let year = event.year;
@@ -1179,7 +769,7 @@ class CustomerListComponent {
1179
769
  }
1180
770
  }
1181
771
  /** @nocollapse */ CustomerListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerListComponent, deps: [{ token: MapService }], target: i0.ɵɵFactoryTarget.Component });
1182
- /** @nocollapse */ CustomerListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerListComponent, selector: "customer-list", inputs: { customers: "customers", agentConfig: "agentConfig" }, outputs: { nextStep: "nextStep", removeTask: "removeTask", filterTaskList: "filterTaskList" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"customer-list-wrapper\">\n <div class=\"customer-list-filter\" [formGroup]=\"formGroup\">\n <kwikui-input-date-range\n *ngIf=\"agentConfig?.dashboardConfig?.showDateFilter\"\n [label]=\"'Date Range'\"\n [id]=\"'dateRange'\"\n [size]=\"'m'\"\n [maxLength]=\"maxLength\"\n [formControlName]=\"'dateRange'\"\n [formControl]=\"dateRangeFormControl\"\n (getKeyValue)=\"onDateRangeChange($event)\"\n ></kwikui-input-date-range>\n <kwikui-input\n *ngIf=\"agentConfig?.dashboardConfig?.showSearchFilter\"\n [label]=\"'Search'\"\n [id]=\"'search'\"\n icon=\"tuiIconSearch\"\n size=\"m\"\n placeholder=\"Search Any Task\"\n [formControlName]=\"'search'\"\n [formControl]=\"searchFormControl\"\n (getKeyValue)=\"onSearchFilter($event)\"\n ></kwikui-input>\n </div>\n\n <div class=\"customer-task-list\">\n <cdk-virtual-scroll-viewport itemSize=\"1\" class=\"customer-task-list-scroll\">\n <div\n *cdkVirtualFor=\"\n let customer of filteredData | filter: searchText;\n index as index\n \"\n >\n <customer-tile\n class=\"example-item\"\n [customer]=\"customer\"\n [agentConfig]=\"agentConfig\"\n [index]=\"index\"\n (nextStep)=\"goToNextStep($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-tile>\n </div>\n </cdk-virtual-scroll-viewport>\n </div>\n\n <div class=\"customer-list-empty\" *ngIf=\"filteredData.length === 0\">\n {{agentConfig?.dashboardConfig?.emptyTaskListMessage ?? '0 Tasks for the given Date.'}}\n </div>\n</div>\n", styles: [".customer-list-wrapper{width:100%;height:100%;display:flex;flex-direction:column}.customer-list-filter{height:-moz-fit-content;height:fit-content;width:100%;display:flex;flex-direction:column;padding:1rem;grid-gap:.8rem;gap:.8rem;border-bottom:.5px solid #ddd}.customer-list-empty{height:100%;width:100%;margin-top:.5rem;font-size:1rem;text-align:center}.customer-task-list{height:100%}.customer-task-list-scroll{height:100%;width:100%}.cdk-virtual-scroll-spacer{height:0!important}.example-item{height:50px}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i2.KwikUIInputDateRangeComponent, selector: "kwikui-input-date-range", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "maxLength", "min", "minLength", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputComponent, selector: "kwikui-input", inputs: ["case", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { type: CustomerTileComponent, selector: "customer-tile", inputs: ["customer", "index", "agentConfig"], outputs: ["nextStep", "removeTask"] }], directives: [{ type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }], pipes: { "filter": Ng2SearchPipe } });
772
+ /** @nocollapse */ CustomerListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerListComponent, selector: "customer-list", inputs: { customers: "customers", config: "config" }, outputs: { nextStep: "nextStep", removeTask: "removeTask", filterTaskList: "filterTaskList" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"customer-list-wrapper\">\n <div class=\"customer-list-filter\" [formGroup]=\"formGroup\">\n <kwikui-input-date-range\n *ngIf=\"config?.dashboard?.isShowDateFilter\"\n [label]=\"'Date Range'\"\n [id]=\"'dateRange'\"\n [size]=\"'m'\"\n [maxLength]=\"maxLength\"\n [formControlName]=\"'dateRange'\"\n [formControl]=\"dateRangeFormControl\"\n (getKeyValue)=\"onDateRangeChange($event)\"\n ></kwikui-input-date-range>\n <kwikui-input\n *ngIf=\"config?.dashboard?.isAllowSearchFilter\"\n [label]=\"'Search'\"\n [id]=\"'search'\"\n icon=\"tuiIconSearch\"\n size=\"m\"\n placeholder=\"Search Any Task\"\n [formControlName]=\"'search'\"\n [formControl]=\"searchFormControl\"\n (getKeyValue)=\"onSearchFilter($event)\"\n ></kwikui-input>\n </div>\n\n <div class=\"customer-task-list\">\n <cdk-virtual-scroll-viewport itemSize=\"1\" class=\"customer-task-list-scroll\">\n <div\n *cdkVirtualFor=\"\n let customer of filteredData | filter: searchText;\n index as index\n \"\n >\n <customer-tile\n class=\"example-item\"\n [customer]=\"customer\"\n [config]=\"config\"\n [index]=\"index\"\n (nextStep)=\"handleOnClickNext($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-tile>\n </div>\n </cdk-virtual-scroll-viewport>\n </div>\n\n <div class=\"customer-list-empty\" *ngIf=\"filteredData.length === 0\">\n {{config?.dashboard?.emptyTaskListMessage ?? '0 Tasks for the given Date.'}}\n </div>\n</div>\n", styles: [".customer-list-wrapper{width:100%;height:100%;display:flex;flex-direction:column}.customer-list-filter{height:-moz-fit-content;height:fit-content;width:100%;display:flex;flex-direction:column;padding:1rem;grid-gap:.8rem;gap:.8rem;border-bottom:.5px solid #ddd}.customer-list-empty{height:100%;width:100%;margin-top:.5rem;font-size:1rem;text-align:center}.customer-task-list{height:100%}.customer-task-list-scroll{height:100%;width:100%}.cdk-virtual-scroll-spacer{height:0!important}.example-item{height:50px}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i2.KwikUIInputDateRangeComponent, selector: "kwikui-input-date-range", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "maxLength", "min", "minLength", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputComponent, selector: "kwikui-input", inputs: ["case", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { type: CustomerTileComponent, selector: "customer-tile", inputs: ["customer", "index", "config"], outputs: ["nextStep", "removeTask"] }], directives: [{ type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }], pipes: { "filter": Ng2SearchPipe } });
1183
773
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerListComponent, decorators: [{
1184
774
  type: Component,
1185
775
  args: [{
@@ -1189,7 +779,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1189
779
  }]
1190
780
  }], ctorParameters: function () { return [{ type: MapService }]; }, propDecorators: { customers: [{
1191
781
  type: Input
1192
- }], agentConfig: [{
782
+ }], config: [{
1193
783
  type: Input
1194
784
  }], nextStep: [{
1195
785
  type: Output
@@ -1200,52 +790,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1200
790
  }] } });
1201
791
 
1202
792
  class KwikIDAgentDashboardComponent {
1203
- constructor(mapService, userService, httpClient, hostElement, dialogService) {
793
+ constructor(mapService, agentService, httpClient, hostElement, dialogService) {
1204
794
  this.mapService = mapService;
1205
- this.userService = userService;
795
+ this.agentService = agentService;
1206
796
  this.httpClient = httpClient;
1207
797
  this.hostElement = hostElement;
1208
798
  this.dialogService = dialogService;
1209
- this.agentConfig = {};
799
+ this.config = {};
1210
800
  this.taskList = [];
1211
801
  this.nextStep = new EventEmitter();
1212
802
  this.addTask = new EventEmitter();
1213
803
  this.removeTask = new EventEmitter();
1214
804
  this.filterTaskList = new EventEmitter();
1215
805
  this.loading = true;
1216
- this.options = {
1217
- stops: ['calc(5rem + 74vw)', 'calc(9rem + 74vw)']
1218
- };
1219
806
  this.open = false;
1220
807
  this.allFormsData = {};
1221
808
  this.String = String;
1222
- this.apiLoaded = httpClient
1223
- .jsonp('https://maps.googleapis.com/maps/api/js?key=AIzaSyA63JY0ja6ZGIR796vJqZARc0c2j8Vgpik&v=3.exp&libraries=geometry,drawing,places', 'callback')
1224
- .pipe(map(() => true), catchError(() => of(false)));
1225
809
  }
1226
810
  windowResizeWatcher() {
1227
811
  if (this.hostElement.nativeElement.offsetWidth < 600) {
1228
812
  this.isMobileView = true;
1229
- this.userService.isMobileView = true;
813
+ this.agentService.isMobileView = true;
1230
814
  }
1231
815
  else {
1232
816
  this.isMobileView = false;
1233
- this.userService.isMobileView = false;
817
+ this.agentService.isMobileView = false;
1234
818
  }
1235
819
  }
1236
820
  ngOnInit() {
1237
821
  var _a, _b, _c, _d, _e, _f;
1238
- this.userService.agentConfig = this.agentConfig;
1239
- this.userService.showMapview =
1240
- (_c = (_b = (_a = this.agentConfig) === null || _a === void 0 ? void 0 : _a.dashboardConfig) === null || _b === void 0 ? void 0 : _b.showMaps) !== null && _c !== void 0 ? _c : false;
1241
- this.userService.addTaskFormConfig =
1242
- (_f = (_e = (_d = this.agentConfig) === null || _d === void 0 ? void 0 : _d.dashboardConfig) === null || _e === void 0 ? void 0 : _e.addTaskFormConfig) !== null && _f !== void 0 ? _f : this.userService.addTaskFormConfig;
822
+ this.agentService.config = this.config;
823
+ this.agentService.showMapview =
824
+ (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.isShowMaps) !== null && _c !== void 0 ? _c : false;
825
+ this.agentService.addTaskForm =
826
+ (_f = (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.dashboard) === null || _e === void 0 ? void 0 : _e.addTaskForm) !== null && _f !== void 0 ? _f : this.agentService.addTaskForm;
1243
827
  this.loading = false;
1244
828
  setTimeout(() => {
1245
829
  this.windowResizeWatcher();
1246
830
  }, 1000);
1247
831
  }
1248
- goToNextStep(e) {
832
+ handleOnClickNext(e) {
1249
833
  this.nextStep.emit(e);
1250
834
  }
1251
835
  handleOnClickAddTask(task) {
@@ -1284,8 +868,8 @@ class KwikIDAgentDashboardComponent {
1284
868
  }
1285
869
  handleOnClickViewForms(e) { }
1286
870
  }
1287
- /** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, deps: [{ token: MapService }, { token: UserService }, { token: i3$1.HttpClient }, { token: i0.ElementRef }, { token: TuiDialogService }], target: i0.ɵɵFactoryTarget.Component });
1288
- /** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDAgentDashboardComponent, selector: "kwikid-agent-dashboard", inputs: { agentConfig: "agentConfig", taskList: "taskList" }, outputs: { nextStep: "nextStep", addTask: "addTask", removeTask: "removeTask", filterTaskList: "filterTaskList" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "infoWindow", first: true, predicate: MapInfoWindow, descendants: true }], ngImport: i0, template: "<div class=\"kwikid-agent-dashboard\" *ngIf=\"!loading\">\n <div class=\"wrapper\">\n <div class=\"dashboard-header\">\n <img\n *ngIf=\"\n userService.agentConfig.clientLogo &&\n userService.agentConfig?.dashboardConfig?.showClientLogo\n \"\n [src]=\"userService.agentConfig.clientLogo\"\n class=\"dashboard-header-client-logo\"\n />\n <div\n *ngIf=\"\n !userService.agentConfig.clientLogo ||\n !userService.agentConfig?.dashboardConfig?.showClientLogo\n \"\n class=\"dashboard-header-client-name\"\n >\n <kwikui-button\n [icon]=\"'tuiIconLink'\"\n appearance=\"mono\"\n size=\"m\"\n ></kwikui-button>\n\n {{ userService.agentConfig.clientName }}\n </div>\n <div>\n <kwikui-button\n *ngIf=\"userService.agentConfig?.dashboardConfig?.allowAddTask\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconAddRowLarge'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"showDialog(template)\"\n ></kwikui-button>\n <span (tuiActiveZoneChange)=\"onActiveZone($event)\">\n <kwikui-button\n [icon]=\"'tuiIconSettingsLarge'\"\n (onClick)=\"onClick()\"\n appearance=\"mono\"\n size=\"m\"\n [tuiDropdown]=\"dropdownContent\"\n [tuiDropdownManual]=\"open\"\n (tuiObscured)=\"onObscured($event)\"\n ></kwikui-button>\n <ng-template #dropdownContent>\n <div class=\"menu-dropdown\">\n <div class=\"menu-dropdown-header\">\n <div class=\"menu-dropdown-header-agent-name\">\n {{ userService.agentConfig.agentName }}\n </div>\n <div class=\"menu-dropdown-header-agent-id\">\n Agent ID: {{ userService.agentConfig.agentId }}\n </div>\n </div>\n <hr />\n <div\n class=\"menu-dropdown-body\"\n tuiGroup\n [collapsed]=\"true\"\n [rounded]=\"false\"\n [orientation]=\"'vertical'\"\n [size]=\"'m'\"\n >\n <kwikui-button\n *ngIf=\"this.agentConfig.dashboardConfig.showMaps\"\n id=\"\"\n label=\"{{\n userService.showMapview ? 'Hide Maps' : 'Show Maps'\n }}\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n icon=\"{{\n userService.showMapview ? 'tuiIconEyeOff' : 'tuiIconEye'\n }}\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"padding: 0rem !important\"\n (onClick)=\"userService.toggleMapview()\"\n ></kwikui-button>\n <kwikui-button\n id=\"\"\n label=\"Refresh\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconRefreshCw'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"refresh()\"\n ></kwikui-button>\n </div>\n <div class=\"menu-dropdown-footer\">\n <kwikui-button\n id=\"\"\n label=\"Logout\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconLogOut'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"goToNextStep({ stepType: 'LOGOUT' })\"\n ></kwikui-button>\n </div>\n </div>\n </ng-template>\n </span>\n </div>\n </div>\n\n <div class=\"dashboard-body\">\n <div\n *ngIf=\"apiLoaded | async\"\n [class]=\"userService.showMapview ? 'map' : 'map-hidden'\"\n >\n <google-map height=\"100%\" width=\"100%\" [options]=\"this.mapService.map\">\n <map-marker\n #marker=\"mapMarker\"\n *ngFor=\"\n let markerPosition of this.mapService.markers;\n let index = index\n \"\n [position]=\"markerPosition\"\n [label]=\"{ text: String(index), color: '#FFF' }\"\n (mapClick)=\"openInfoWindow(marker)\"\n ></map-marker>\n <map-directions-renderer\n *ngIf=\"\n this.mapService.directionsResults$ | async as directionsResults\n \"\n [directions]=\"directionsResults\"\n [options]=\"this.mapService.directionsRenderOption\"\n ></map-directions-renderer>\n <map-info-window>Info Window content</map-info-window>\n </google-map>\n </div>\n <div\n class=\"task-details\"\n *ngIf=\"\n !userService.isMobileView && userService.showTaskDetails != undefined && !userService.showMapview\n \"\n >\n <customer-details\n [customer]=\"taskList[userService.showTaskDetails]\"\n [agentConfig]=\"agentConfig\"\n (nextStep)=\"goToNextStep($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-details>\n </div>\n <div\n class=\"no-task-details\"\n *ngIf=\"\n !userService.isMobileView &&\n userService.showTaskDetails == undefined &&\n !userService.showMapview\n \"\n >\n <img src=\"assets/No-Results.jpg\" class=\"no-task-img\" alt=\"No Task\"/>\n <div class=\"\">Select a Task to view it's details.</div>\n </div>\n <div class=\"customer-list\">\n <customer-list\n [customers]=\"taskList\"\n [agentConfig]=\"agentConfig\"\n (nextStep)=\"goToNextStep($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n (filterTaskList)=\"handleOnFilterTaskList($event)\"\n ></customer-list>\n </div>\n </div>\n </div>\n</div>\n<div class=\"kwikid-agent-dashboard-loader\" *ngIf=\"loading\">\n <span class=\"loader\"></span>\n</div>\n\n<ng-template #template let-observer>\n <div class=\"add-task-header\">\n <h2>Add Task</h2>\n <kwikui-button\n icon=\"tuiIconX\"\n id=\"\"\n styles=\"\"\n type=\"button\"\n appearance=\"mono\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"observer.complete()\"\n ></kwikui-button>\n </div>\n <kwikid-form-view\n [formConfig]=\"userService.addTaskFormConfig\"\n [allFormsData]=\"allFormsData\"\n [isMobileView]=\"true\"\n (onClickViewForms)=\"this.handleOnClickViewForms($event)\"\n (onClickSaveForm)=\"this.handleOnClickSaveForm($event)\"\n ></kwikid-form-view>\n</ng-template>\n", styles: [".kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%;position:relative}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper .dashboard-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:max-content;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-logo{max-height:50px;padding-left:1rem}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{width:100%;height:100%;background-color:#fafafa;overflow:hidden}@media screen and (min-width: 600px){.kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper .dashboard-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:max-content;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:row-reverse;align-content:center;justify-content:flex-end;align-items:stretch;padding:1.5rem;grid-gap:1.5rem;gap:1.5rem;overflow:auto;background-color:#fafafa}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .task-details{width:100%;height:100%;position:relative;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}.kwikid-agent-dashboard .wrapper .dashboard-body .no-task-details{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;grid-gap:.5rem;gap:.5rem;overflow:hidden;color:#555}.kwikid-agent-dashboard .wrapper .dashboard-body .no-task-details .no-task-img{height:100px;width:100px}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{min-width:300px;max-width:400px;width:100%;height:100%;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}}.menu{position:absolute;transition:\"0.15s linear 0s\"}.kwikid-agent-dashboard-loader{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;z-index:100}.kwikid-agent-dashboard-loader .loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:3px solid;border-color:#fff #fff transparent;box-sizing:border-box;animation:rotation 1s linear infinite}.kwikid-agent-dashboard-loader .loader:after{content:\"\";box-sizing:border-box;position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;border:3px solid;border-color:transparent var(--tui-primary) var(--tui-primary);width:24px;height:24px;border-radius:50%;animation:rotationBack .5s linear infinite;transform-origin:center center}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotationBack{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}.kwikid-agent-dashboard-loader .t-loader{display:none!important}.add-task-header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:.5rem 0 1rem 1rem}:host{width:100%;height:100%}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}.menu-dropdown{display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;grid-gap:.5rem;gap:.5rem;padding:1rem 1.5rem}.menu-dropdown .menu-dropdown-header{display:flex;flex-direction:column;align-content:flex-start;justify-content:space-between;align-items:flex-start;grid-gap:1rem;gap:1rem}.menu-dropdown .menu-dropdown-header .menu-dropdown-header-agent-name{font-size:1.2rem;font-weight:600}.menu-dropdown .menu-dropdown-header .menu-dropdown-header-agent-id{font-size:.8rem;font-weight:600}.menu-dropdown .menu-dropdown-buttons ::ng-deep .t-wrapper{padding:0!important}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }, { type: i5.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }, { type: CustomerDetailsComponent, selector: "customer-details", inputs: ["customer", "agentConfig"], outputs: ["nextStep", "removeTask"] }, { type: CustomerListComponent, selector: "customer-list", inputs: ["customers", "agentConfig"], outputs: ["nextStep", "removeTask", "filterTaskList"] }, { type: i8.KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["allFormsData", "apiCallResponse", "buttonClickResponse", "formConfig", "formData", "isMobileView", "popupFormCallback", "userConfig"], outputs: ["getLogs", "getUnsavedDataState", "onActionShowPopupForm", "onClickApiCall", "onClickFormFieldButton", "onClickGoBack", "onClickSaveForm", "onClickViewForms"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i11.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i11.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i11.TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])" }, { type: i11.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i11.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.MapMarker, selector: "map-marker", inputs: ["title", "position", "label", "clickable", "options", "icon", "visible"], outputs: ["animationChanged", "mapClick", "clickableChanged", "cursorChanged", "mapDblclick", "mapDrag", "mapDragend", "draggableChanged", "mapDragstart", "flatChanged", "iconChanged", "mapMousedown", "mapMouseout", "mapMouseover", "mapMouseup", "positionChanged", "mapRightclick", "shapeChanged", "titleChanged", "visibleChanged", "zindexChanged"], exportAs: ["mapMarker"] }, { type: i5.MapDirectionsRenderer, selector: "map-directions-renderer", inputs: ["directions", "options"], outputs: ["directionsChanged"], exportAs: ["mapDirectionsRenderer"] }, { type: i5.MapInfoWindow, selector: "map-info-window", inputs: ["options", "position"], outputs: ["closeclick", "contentChanged", "domready", "positionChanged", "zindexChanged"], exportAs: ["mapInfoWindow"] }], pipes: { "async": i6.AsyncPipe } });
871
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, deps: [{ token: MapService }, { token: AgentService }, { token: i3$1.HttpClient }, { token: i0.ElementRef }, { token: TuiDialogService }], target: i0.ɵɵFactoryTarget.Component });
872
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDAgentDashboardComponent, selector: "kwikid-agent-dashboard", inputs: { config: "config", taskList: "taskList" }, outputs: { nextStep: "nextStep", addTask: "addTask", removeTask: "removeTask", filterTaskList: "filterTaskList" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "infoWindow", first: true, predicate: MapInfoWindow, descendants: true }, { propertyName: "mapElement", first: true, predicate: ["map"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"kwikid-agent-dashboard\" *ngIf=\"!loading\">\n <div class=\"wrapper\">\n <header>\n <img\n *ngIf=\"\n agentService.config?.clientLogo &&\n agentService.config?.dashboard?.isShowClientLogo\n \"\n [src]=\"agentService.config.clientLogo\"\n class=\"client-logo\"\n />\n <div\n *ngIf=\"\n !agentService.config.clientLogo ||\n !agentService.config?.dashboard?.isShowClientLogo\n \"\n class=\"client-name\"\n >\n <kwikui-button\n [icon]=\"'tuiIconLink'\"\n appearance=\"mono\"\n size=\"m\"\n ></kwikui-button>\n\n {{ agentService.config.clientName }}\n </div>\n <div>\n <kwikui-button\n *ngIf=\"agentService.config?.dashboard?.isAllowAddTask\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconAddRowLarge'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"showDialog(template)\"\n ></kwikui-button>\n <kwikui-button\n appearance=\"mono\"\n class=\"menu-dropdown-buttons\"\n [icon]=\"'tuiIconRefreshCwLarge'\"\n size=\"m\"\n type=\"button\"\n (onClick)=\"refresh()\"\n ></kwikui-button>\n <span (tuiActiveZoneChange)=\"onActiveZone($event)\">\n <kwikui-button\n [icon]=\"'tuiIconSettingsLarge'\"\n (onClick)=\"onClick()\"\n appearance=\"mono\"\n size=\"m\"\n [tuiDropdown]=\"dropdownContent\"\n [tuiDropdownManual]=\"open\"\n (tuiObscured)=\"onObscured($event)\"\n ></kwikui-button>\n <ng-template #dropdownContent>\n <div class=\"menu-dropdown\">\n <div class=\"menu-dropdown-header\">\n <div class=\"menu-dropdown-header-agent-name\">\n {{ agentService.config.agentName }}\n </div>\n <div class=\"menu-dropdown-header-agent-id\">\n Agent ID: {{ agentService.config.agentId }}\n </div>\n </div>\n <hr />\n <div\n class=\"menu-dropdown-body\"\n tuiGroup\n [collapsed]=\"true\"\n [rounded]=\"false\"\n [orientation]=\"'vertical'\"\n [size]=\"'m'\"\n >\n <kwikui-button\n *ngIf=\"this.config.dashboard.isShowMaps\"\n id=\"\"\n label=\"{{\n agentService.showMapview ? 'Hide Maps' : 'Show Maps'\n }}\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n icon=\"{{\n agentService.showMapview ? 'tuiIconEyeOff' : 'tuiIconEye'\n }}\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"padding: 0rem !important\"\n (onClick)=\"agentService.toggleMapview()\"\n ></kwikui-button>\n </div>\n <div class=\"menu-dropdown-footer\">\n <kwikui-button\n id=\"\"\n label=\"Logout\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconLogOut'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"handleOnClickNext({ stepType: 'LOGOUT' })\"\n ></kwikui-button>\n </div>\n </div>\n </ng-template>\n </span>\n </div>\n </header>\n\n <div class=\"dashboard-body\">\n <div [class]=\"agentService.showMapview ? 'map' : 'map-hidden'\">\n <div id=\"map\" style=\"height: 100%\"></div>\n </div>\n\n <div\n class=\"task-details\"\n *ngIf=\"\n !agentService.isMobileView &&\n agentService.isShowTaskDetails != undefined &&\n !agentService.showMapview\n \"\n >\n <customer-details\n [customer]=\"taskList[agentService.isShowTaskDetails]\"\n [config]=\"config\"\n (nextStep)=\"handleOnClickNext($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-details>\n </div>\n\n <div\n class=\"no-task-details\"\n *ngIf=\"\n !agentService.isMobileView &&\n agentService.isShowTaskDetails == undefined &&\n !agentService.showMapview\n \"\n >\n <img src=\"assets/No-Results.jpg\" class=\"no-task-img\" alt=\"No Task\" />\n <div class=\"\">Select a Task to view it's details.</div>\n </div>\n\n <div class=\"customer-list\">\n <customer-list\n [customers]=\"taskList\"\n [config]=\"config\"\n (nextStep)=\"handleOnClickNext($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n (filterTaskList)=\"handleOnFilterTaskList($event)\"\n ></customer-list>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"kwikid-agent-dashboard-loader\" *ngIf=\"loading\">\n <span class=\"loader\"></span>\n</div>\n\n<ng-template #template let-observer>\n <div class=\"add-task-header\">\n <h2>Add Task</h2>\n <kwikui-button\n icon=\"tuiIconX\"\n id=\"\"\n styles=\"\"\n type=\"button\"\n appearance=\"mono\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"observer.complete()\"\n ></kwikui-button>\n </div>\n <kwikid-form-view\n [allFormsData]=\"allFormsData\"\n [formConfig]=\"agentService.addTaskForm\"\n [isMobileView]=\"true\"\n (onClickViewForms)=\"this.handleOnClickViewForms($event)\"\n (onClickSaveForm)=\"this.handleOnClickSaveForm($event)\"\n ></kwikid-form-view>\n</ng-template>\n", styles: [".kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%;position:relative}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:4rem;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper header .client-logo{height:100%;padding-left:1rem}.kwikid-agent-dashboard .wrapper header .client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{width:100%;height:100%;background-color:#fafafa;overflow:hidden}@media screen and (min-width: 600px){.kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:4rem;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper header .client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:row-reverse;align-content:center;justify-content:flex-end;align-items:stretch;padding:1.5rem;grid-gap:1.5rem;gap:1.5rem;overflow:auto;background-color:#fafafa}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .task-details{width:100%;height:100%;position:relative;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}.kwikid-agent-dashboard .wrapper .dashboard-body .no-task-details{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;grid-gap:.5rem;gap:.5rem;overflow:hidden;color:#555}.kwikid-agent-dashboard .wrapper .dashboard-body .no-task-details .no-task-img{height:100px;width:100px}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{min-width:300px;max-width:400px;width:100%;height:100%;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}}.menu{position:absolute;transition:\"0.15s linear 0s\"}.kwikid-agent-dashboard-loader{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;z-index:100}.kwikid-agent-dashboard-loader .loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:3px solid;border-color:#fff #fff transparent;box-sizing:border-box;animation:rotation 1s linear infinite}.kwikid-agent-dashboard-loader .loader:after{content:\"\";box-sizing:border-box;position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;border:3px solid;border-color:transparent var(--tui-primary) var(--tui-primary);width:24px;height:24px;border-radius:50%;animation:rotationBack .5s linear infinite;transform-origin:center center}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotationBack{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}.kwikid-agent-dashboard-loader .t-loader{display:none!important}.add-task-header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:.5rem 0 1rem 1rem}:host{width:100%;height:100%}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}.menu-dropdown{display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;grid-gap:.5rem;gap:.5rem;padding:1rem 1.5rem}.menu-dropdown .menu-dropdown-header{display:flex;flex-direction:column;align-content:flex-start;justify-content:space-between;align-items:flex-start;grid-gap:1rem;gap:1rem}.menu-dropdown .menu-dropdown-header .menu-dropdown-header-agent-name{font-size:1.2rem;font-weight:600}.menu-dropdown .menu-dropdown-header .menu-dropdown-header-agent-id{font-size:.8rem;font-weight:600}.menu-dropdown .menu-dropdown-buttons ::ng-deep .t-wrapper{padding:0!important}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }, { type: CustomerDetailsComponent, selector: "customer-details", inputs: ["customer", "config"], outputs: ["nextStep", "removeTask"] }, { type: CustomerListComponent, selector: "customer-list", inputs: ["customers", "config"], outputs: ["nextStep", "removeTask", "filterTaskList"] }, { type: i7.KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["allFormsData", "apiCallResponse", "buttonClickResponse", "formConfig", "formData", "isMobileView", "popupFormCallback", "userConfig"], outputs: ["getLogs", "getUnsavedDataState", "onActionShowPopupForm", "onClickApiCall", "onClickFormFieldButton", "onClickGoBack", "onClickSaveForm", "onClickViewForms"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i10.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i10.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i10.TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])" }, { type: i10.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i10.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }] });
1289
873
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, decorators: [{
1290
874
  type: Component,
1291
875
  args: [{
@@ -1293,13 +877,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1293
877
  templateUrl: './kwikid-agent-dashboard.component.html',
1294
878
  styleUrls: ['./kwikid-agent-dashboard.component.scss']
1295
879
  }]
1296
- }], ctorParameters: function () { return [{ type: MapService }, { type: UserService }, { type: i3$1.HttpClient }, { type: i0.ElementRef }, { type: i11.TuiDialogService, decorators: [{
880
+ }], ctorParameters: function () { return [{ type: MapService }, { type: AgentService }, { type: i3$1.HttpClient }, { type: i0.ElementRef }, { type: i10.TuiDialogService, decorators: [{
1297
881
  type: Inject,
1298
882
  args: [TuiDialogService]
1299
883
  }] }]; }, propDecorators: { windowResizeWatcher: [{
1300
884
  type: HostListener,
1301
885
  args: ['window:resize', ['$event']]
1302
- }], agentConfig: [{
886
+ }], config: [{
1303
887
  type: Input
1304
888
  }], taskList: [{
1305
889
  type: Input
@@ -1314,6 +898,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1314
898
  }], infoWindow: [{
1315
899
  type: ViewChild,
1316
900
  args: [MapInfoWindow, { static: false }]
901
+ }], mapElement: [{
902
+ type: ViewChild,
903
+ args: ['map', { static: true }]
1317
904
  }] } });
1318
905
 
1319
906
  class KwikIDAgentDashboardModule {