kwikid-agent-dashboard 0.0.20 → 0.0.22

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,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/google-maps'), require('@taiga-ui/core'), require('rxjs'), require('rxjs/operators'), require('@angular/common/http'), require('kwikui'), require('kwikid-toolkit'), require('@angular/common'), require('@angular/forms'), require('@taiga-ui/cdk'), require('@angular/cdk/scrolling'), require('kwikid-forms'), require('@taiga-ui/addon-mobile')) :
3
- typeof define === 'function' && define.amd ? define('kwikid-agent-dashboard', ['exports', '@angular/core', '@angular/google-maps', '@taiga-ui/core', 'rxjs', 'rxjs/operators', '@angular/common/http', 'kwikui', 'kwikid-toolkit', '@angular/common', '@angular/forms', '@taiga-ui/cdk', '@angular/cdk/scrolling', 'kwikid-forms', '@taiga-ui/addon-mobile'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["kwikid-agent-dashboard"] = {}, global.ng.core, global.ng.googleMaps, global["@taiga-ui/core"], global.rxjs, global.rxjs.operators, global.ng.common.http, global.i2, global.kwikidToolkit, global.ng.common, global.ng.forms, global["@taiga-ui/cdk"], global.ng.cdk.scrolling, global.i8, global["@taiga-ui/addon-mobile"]));
5
- })(this, (function (exports, i0, i5, i11, rxjs, operators, i3$1, i2, kwikidToolkit, i6, i5$1, i10, i3, i8, addonMobile) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/google-maps'), require('@taiga-ui/core'), require('leaflet'), require('leaflet-routing-machine'), require('kwikid-toolkit'), require('@angular/common/http'), require('kwikui'), require('@angular/common'), require('@angular/forms'), require('@taiga-ui/cdk'), require('@angular/cdk/scrolling'), require('kwikid-forms'), require('@taiga-ui/addon-mobile')) :
3
+ typeof define === 'function' && define.amd ? define('kwikid-agent-dashboard', ['exports', '@angular/core', '@angular/google-maps', '@taiga-ui/core', 'leaflet', 'leaflet-routing-machine', 'kwikid-toolkit', '@angular/common/http', 'kwikui', '@angular/common', '@angular/forms', '@taiga-ui/cdk', '@angular/cdk/scrolling', 'kwikid-forms', '@taiga-ui/addon-mobile'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["kwikid-agent-dashboard"] = {}, global.ng.core, global.ng.googleMaps, global["@taiga-ui/core"], global.L, null, global.kwikidToolkit, global.ng.common.http, global.i2, global.ng.common, global.ng.forms, global["@taiga-ui/cdk"], global.ng.cdk.scrolling, global.i7, global["@taiga-ui/addon-mobile"]));
5
+ })(this, (function (exports, i0, googleMaps, i10, L, leafletRoutingMachine, kwikidToolkit, i3$1, i2, i5, i5$1, i9, i3, i7, addonMobile) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -23,15 +23,15 @@
23
23
  }
24
24
 
25
25
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
- var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
27
- var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
26
+ var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
27
+ var L__namespace = /*#__PURE__*/_interopNamespace(L);
28
28
  var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
29
29
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
30
- var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
30
+ var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
31
31
  var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
32
- var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
32
+ var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
33
33
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
34
- var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
34
+ var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
35
35
 
36
36
  /******************************************************************************
37
37
  Copyright (c) Microsoft Corporation.
@@ -497,192 +497,17 @@
497
497
  __disposeResources: __disposeResources,
498
498
  };
499
499
 
500
- var MapService = /** @class */ (function () {
501
- function MapService(mapDirectionsService) {
502
- this.mapDirectionsService = mapDirectionsService;
503
- this.markers = [];
504
- this.directionsRenderOption = {};
505
- }
506
- MapService.prototype.getMarkers = function () {
507
- return this.markers;
508
- };
509
- MapService.prototype.setMarkers = function (markers) {
510
- this.markers = markers;
511
- };
512
- MapService.prototype.initMap = function () {
513
- return __awaiter(this, void 0, void 0, function () {
514
- var _a;
515
- return __generator(this, function (_b) {
516
- switch (_b.label) {
517
- case 0:
518
- _a = this;
519
- return [4 /*yield*/, this.getPosition()];
520
- case 1:
521
- _a.myPosition = _b.sent();
522
- this.map = {
523
- zoom: 10,
524
- center: this.myPosition,
525
- streetViewControl: false,
526
- mapTypeControl: false,
527
- fullscreenControl: false,
528
- zoomControl: false
529
- };
530
- return [2 /*return*/];
531
- }
532
- });
533
- });
534
- };
535
- MapService.prototype.plotMarkers = function (customers) {
536
- var _this = this;
537
- this.markers = [];
538
- var path = [];
539
- this.markers.push(this.myPosition);
540
- customers.map(function (customer) {
541
- path.push({
542
- location: _this.getLatLng(customer.task_details.customer_details.location),
543
- stopover: true
544
- });
545
- });
546
- var request = {
547
- origin: this.myPosition,
548
- destination: this.myPosition,
549
- waypoints: path,
550
- optimizeWaypoints: true,
551
- travelMode: google.maps.TravelMode.DRIVING
552
- };
553
- this.directionsRenderOption = {
554
- suppressMarkers: true
555
- };
556
- this.directionsResults$ = this.mapDirectionsService
557
- .route(request)
558
- .pipe(operators.map(function (response) { return response.result; }));
559
- this.directionsResults$.subscribe(function (val) {
560
- customers = _this.sortList(val.routes[0].waypoint_order, customers);
561
- customers.map(function (customer) {
562
- _this.markers.push(_this.getLatLng(customer.task_details.customer_details.location));
563
- });
564
- });
565
- return this.directionsResults$;
566
- };
567
- MapService.prototype.getPosition = function () {
568
- return new Promise(function (resolve, reject) {
569
- navigator.geolocation.watchPosition(function (resp) {
570
- resolve({
571
- lng: resp.coords.longitude,
572
- lat: resp.coords.latitude
573
- });
574
- }, function (err) {
575
- reject(err);
576
- });
577
- });
578
- };
579
- MapService.prototype.getLatLng = function (data) {
580
- var url = data.split('@');
581
- var lat_long_match = url[1].split(',');
582
- var lat = Number(lat_long_match[0]);
583
- var long = Number(lat_long_match[1]);
584
- return { lat: lat, lng: long };
585
- };
586
- MapService.prototype.sortList = function (order, customersData) {
587
- var c = [];
588
- for (var i = 0; i < customersData.length; i++) {
589
- var customer = customersData[order[i]];
590
- c.push(customer);
591
- }
592
- return c;
593
- };
594
- return MapService;
595
- }());
596
- /** @nocollapse */ MapService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, deps: [{ token: i5__namespace.MapDirectionsService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
597
- /** @nocollapse */ MapService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, providedIn: 'root' });
598
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, decorators: [{
599
- type: i0.Injectable,
600
- args: [{
601
- providedIn: 'root'
602
- }]
603
- }], ctorParameters: function () { return [{ type: i5__namespace.MapDirectionsService }]; }, propDecorators: { directionsRenders: [{
604
- type: i0.ViewChildren,
605
- args: ['directionsRender']
606
- }] } });
607
-
608
- var UserService = /** @class */ (function () {
609
- function UserService() {
500
+ var AgentService = /** @class */ (function () {
501
+ function AgentService() {
610
502
  this.isListOpen = true;
611
503
  this.showMapview = false;
612
- this.addTaskFormConfig = {
504
+ this.addTaskForm = {
613
505
  key: 'ADD_TASK',
614
506
  title: 'Add Task',
615
507
  fields: [
616
508
  {
617
509
  key: 'name',
618
510
  label: 'Customer Name',
619
- disabled: false,
620
- messages: [],
621
- default: {
622
- value: {
623
- is_found: false,
624
- value: '',
625
- sources: [
626
- {
627
- key: 'OBJECT',
628
- props: {
629
- object: {
630
- key: 'ALL_FORMS_DATA',
631
- path: '$.ADD_TASK.name'
632
- }
633
- },
634
- value: '',
635
- validation: {
636
- is_valid: false,
637
- triggers: ['ON_INIT'],
638
- rules: [
639
- {
640
- id: '1',
641
- key: 'VALUE_CHECK',
642
- props: {
643
- value: {
644
- source: {
645
- key: 'OBJECT',
646
- props: {
647
- object: {
648
- key: 'ALL_FORMS_DATA',
649
- path: '$.ADD_TASK.name'
650
- }
651
- }
652
- }
653
- },
654
- pattern: {
655
- key: 'IS_NOT_EMPTY'
656
- }
657
- }
658
- }
659
- ],
660
- actions: [
661
- {
662
- id: '1',
663
- key: 'SET_FIELD_DEFAULT_VALUE',
664
- condition: '1',
665
- props: {
666
- fieldKey: 'name',
667
- value: {
668
- source: {
669
- key: 'OBJECT',
670
- props: {
671
- object: {
672
- key: 'ALL_FORMS_DATA',
673
- path: '$.ADD_TASK.name'
674
- }
675
- }
676
- }
677
- }
678
- }
679
- }
680
- ]
681
- }
682
- }
683
- ]
684
- }
685
- },
686
511
  validators: {
687
512
  required: true
688
513
  },
@@ -696,73 +521,6 @@
696
521
  {
697
522
  key: 'phone',
698
523
  label: 'Phone Number',
699
- disabled: false,
700
- messages: [],
701
- default: {
702
- value: {
703
- is_found: false,
704
- value: '',
705
- sources: [
706
- {
707
- key: 'OBJECT',
708
- props: {
709
- object: {
710
- key: 'ALL_FORMS_DATA',
711
- path: '$.ADD_TASK.phone'
712
- }
713
- },
714
- value: '',
715
- validation: {
716
- is_valid: false,
717
- triggers: ['ON_INIT'],
718
- rules: [
719
- {
720
- id: '1',
721
- key: 'VALUE_CHECK',
722
- props: {
723
- value: {
724
- source: {
725
- key: 'OBJECT',
726
- props: {
727
- object: {
728
- key: 'ALL_FORMS_DATA',
729
- path: '$.ADD_TASK.phone'
730
- }
731
- }
732
- }
733
- },
734
- pattern: {
735
- key: 'IS_NOT_EMPTY'
736
- }
737
- }
738
- }
739
- ],
740
- actions: [
741
- {
742
- id: '1',
743
- key: 'SET_FIELD_DEFAULT_VALUE',
744
- condition: '1',
745
- props: {
746
- fieldKey: 'phone',
747
- value: {
748
- source: {
749
- key: 'OBJECT',
750
- props: {
751
- object: {
752
- key: 'ALL_FORMS_DATA',
753
- path: '$.ADD_TASK.phone'
754
- }
755
- }
756
- }
757
- }
758
- }
759
- }
760
- ]
761
- }
762
- }
763
- ]
764
- }
765
- },
766
524
  validators: {
767
525
  required: true
768
526
  },
@@ -778,73 +536,6 @@
778
536
  {
779
537
  key: 'address',
780
538
  label: 'Address',
781
- disabled: false,
782
- messages: [],
783
- default: {
784
- value: {
785
- is_found: false,
786
- value: '',
787
- sources: [
788
- {
789
- key: 'OBJECT',
790
- props: {
791
- object: {
792
- key: 'ALL_FORMS_DATA',
793
- path: '$.ADD_TASK.address'
794
- }
795
- },
796
- value: '',
797
- validation: {
798
- is_valid: false,
799
- triggers: ['ON_INIT'],
800
- rules: [
801
- {
802
- id: '1',
803
- key: 'VALUE_CHECK',
804
- props: {
805
- value: {
806
- source: {
807
- key: 'OBJECT',
808
- props: {
809
- object: {
810
- key: 'ALL_FORMS_DATA',
811
- path: '$.ADD_TASK.address'
812
- }
813
- }
814
- }
815
- },
816
- pattern: {
817
- key: 'IS_NOT_EMPTY'
818
- }
819
- }
820
- }
821
- ],
822
- actions: [
823
- {
824
- id: '1',
825
- key: 'SET_FIELD_DEFAULT_VALUE',
826
- condition: '1',
827
- props: {
828
- fieldKey: 'address',
829
- value: {
830
- source: {
831
- key: 'OBJECT',
832
- props: {
833
- object: {
834
- key: 'ALL_FORMS_DATA',
835
- path: '$.ADD_TASK.address'
836
- }
837
- }
838
- }
839
- }
840
- }
841
- }
842
- ]
843
- }
844
- }
845
- ]
846
- }
847
- },
848
539
  validators: {
849
540
  required: true
850
541
  },
@@ -858,73 +549,6 @@
858
549
  {
859
550
  key: 'city',
860
551
  label: 'City',
861
- disabled: false,
862
- messages: [],
863
- default: {
864
- value: {
865
- is_found: false,
866
- value: '',
867
- sources: [
868
- {
869
- key: 'OBJECT',
870
- props: {
871
- object: {
872
- key: 'ALL_FORMS_DATA',
873
- path: '$.ADD_TASK.city'
874
- }
875
- },
876
- value: '',
877
- validation: {
878
- is_valid: false,
879
- triggers: ['ON_INIT'],
880
- rules: [
881
- {
882
- id: '1',
883
- key: 'VALUE_CHECK',
884
- props: {
885
- value: {
886
- source: {
887
- key: 'OBJECT',
888
- props: {
889
- object: {
890
- key: 'ALL_FORMS_DATA',
891
- path: '$.ADD_TASK.city'
892
- }
893
- }
894
- }
895
- },
896
- pattern: {
897
- key: 'IS_NOT_EMPTY'
898
- }
899
- }
900
- }
901
- ],
902
- actions: [
903
- {
904
- id: '1',
905
- key: 'SET_FIELD_DEFAULT_VALUE',
906
- condition: '1',
907
- props: {
908
- fieldKey: 'city',
909
- value: {
910
- source: {
911
- key: 'OBJECT',
912
- props: {
913
- object: {
914
- key: 'ALL_FORMS_DATA',
915
- path: '$.ADD_TASK.city'
916
- }
917
- }
918
- }
919
- }
920
- }
921
- }
922
- ]
923
- }
924
- }
925
- ]
926
- }
927
- },
928
552
  validators: {
929
553
  required: true
930
554
  },
@@ -938,73 +562,6 @@
938
562
  {
939
563
  key: 'location',
940
564
  label: 'Location URL',
941
- disabled: false,
942
- messages: [],
943
- default: {
944
- value: {
945
- is_found: false,
946
- value: '',
947
- sources: [
948
- {
949
- key: 'OBJECT',
950
- props: {
951
- object: {
952
- key: 'ALL_FORMS_DATA',
953
- path: '$.ADD_TASK.location'
954
- }
955
- },
956
- value: '',
957
- validation: {
958
- is_valid: false,
959
- triggers: ['ON_INIT'],
960
- rules: [
961
- {
962
- id: '1',
963
- key: 'VALUE_CHECK',
964
- props: {
965
- value: {
966
- source: {
967
- key: 'OBJECT',
968
- props: {
969
- object: {
970
- key: 'ALL_FORMS_DATA',
971
- path: '$.ADD_TASK.location'
972
- }
973
- }
974
- }
975
- },
976
- pattern: {
977
- key: 'IS_NOT_EMPTY'
978
- }
979
- }
980
- }
981
- ],
982
- actions: [
983
- {
984
- id: '1',
985
- key: 'SET_FIELD_DEFAULT_VALUE',
986
- condition: '1',
987
- props: {
988
- fieldKey: 'location',
989
- value: {
990
- source: {
991
- key: 'OBJECT',
992
- props: {
993
- object: {
994
- key: 'ALL_FORMS_DATA',
995
- path: '$.ADD_TASK.location'
996
- }
997
- }
998
- }
999
- }
1000
- }
1001
- }
1002
- ]
1003
- }
1004
- }
1005
- ]
1006
- }
1007
- },
1008
565
  validators: {
1009
566
  required: true
1010
567
  },
@@ -1039,27 +596,297 @@
1039
596
  }
1040
597
  };
1041
598
  }
1042
- UserService.prototype.ngOnInit = function () { };
1043
- UserService.prototype.setAgentConfig = function (agentConfig) {
1044
- this.agentConfig = agentConfig;
599
+ AgentService.prototype.ngOnInit = function () { };
600
+ AgentService.prototype.setAgentConfig = function (config) {
601
+ this.config = config;
1045
602
  };
1046
- UserService.prototype.toggleMapview = function () {
603
+ AgentService.prototype.toggleMapview = function () {
1047
604
  this.showMapview = !this.showMapview;
1048
605
  };
1049
- return UserService;
606
+ return AgentService;
1050
607
  }());
1051
- /** @nocollapse */ UserService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: UserService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1052
- /** @nocollapse */ UserService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: UserService, providedIn: 'root' });
1053
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: UserService, decorators: [{
608
+ /** @nocollapse */ AgentService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AgentService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
609
+ /** @nocollapse */ AgentService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AgentService, providedIn: 'root' });
610
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AgentService, decorators: [{
1054
611
  type: i0.Injectable,
1055
612
  args: [{
1056
613
  providedIn: 'root'
1057
614
  }]
1058
615
  }], ctorParameters: function () { return []; } });
1059
616
 
617
+ var MapService = /** @class */ (function () {
618
+ function MapService(agentService) {
619
+ this.agentService = agentService;
620
+ this.allMarkers = [];
621
+ }
622
+ // To Initialize Map
623
+ MapService.prototype.initMap = function () {
624
+ return __awaiter(this, void 0, void 0, function () {
625
+ var _g;
626
+ return __generator(this, function (_h) {
627
+ switch (_h.label) {
628
+ case 0:
629
+ _g = this;
630
+ return [4 /*yield*/, this.getPosition()];
631
+ case 1:
632
+ _g.myPosition = _h.sent();
633
+ this.map = L__namespace.map('map', {
634
+ center: [this.myPosition.lat, this.myPosition.lng],
635
+ zoom: 13
636
+ });
637
+ L__namespace.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(this.map);
638
+ return [2 /*return*/];
639
+ }
640
+ });
641
+ });
642
+ };
643
+ // To Add Marker in Map
644
+ MapService.prototype.addMarker = function (_g) {
645
+ var lat = _g.lat, lng = _g.lng, title = _g.title, color = _g.color;
646
+ L__namespace.marker([lat, lng], {
647
+ icon: L__namespace.icon({
648
+ iconUrl: color == 'red' ? 'assets/map-marker-0.png' : 'assets/map-marker-1.png'
649
+ })
650
+ })
651
+ .addTo(this.map)
652
+ .bindPopup(title);
653
+ };
654
+ // To Plot Directions for All Tasks
655
+ MapService.prototype.plotDirectionsForAllTasks = function (tasks) {
656
+ var _this = this;
657
+ if (this.map) {
658
+ this.allMarkers = [];
659
+ // Create Agent Marker & Plot It.
660
+ var myMarker = {
661
+ lat: this.myPosition.lat,
662
+ lng: this.myPosition.lng,
663
+ title: 0,
664
+ color: 'red'
665
+ };
666
+ this.addMarker(myMarker);
667
+ this.allMarkers.push(myMarker);
668
+ // Create Markers for all Tasks
669
+ tasks.map(function (task, index) {
670
+ var marker = _this.getLatLng(_this.getLocation(task), index);
671
+ _this.allMarkers.push(marker);
672
+ });
673
+ // Run Algorithm to get optimized Routes
674
+ var startingPoint = this.allMarkers[0];
675
+ var unvisitedWaypoints = this.allMarkers.slice(1);
676
+ var optimizedRoute = this.nearestNeighborAlgorithm(startingPoint, unvisitedWaypoints);
677
+ // Sort All Markers as per optimized routes
678
+ this.allMarkers = this.sortTasksAsPerDistance(optimizedRoute, this.allMarkers, true);
679
+ // Sort All Tasks as per optimized routes
680
+ tasks = this.sortTasksAsPerDistance(optimizedRoute.slice(1), tasks, false);
681
+ // Plot Markers for All Tasks
682
+ tasks.map(function (task, index) {
683
+ var marker = _this.getLatLng(_this.getLocation(task), index);
684
+ _this.addMarker(marker);
685
+ });
686
+ // Set Styles for all Task Routes
687
+ var styles = [
688
+ { color: 'blue', opacity: 1, weight: 8 },
689
+ { color: 'white', opacity: 0.6, weight: 12 }
690
+ ];
691
+ // Set Routes for all Tasks
692
+ this.allTasksRoutes = this.setRoutes(this.allMarkers, styles);
693
+ this.fitMapBounds();
694
+ }
695
+ return tasks;
696
+ };
697
+ // To plot Direction for selected Task
698
+ MapService.prototype.plotDirectionsForSelectedTask = function (index) {
699
+ if (index !== null) {
700
+ // Remove Previously Selected Task Route
701
+ if (this.selectedTaskRoutes) {
702
+ this.map.removeControl(this.selectedTaskRoutes);
703
+ }
704
+ // Remove All Tasks Routes
705
+ if (this.allTasksRoutes) {
706
+ this.map.removeControl(this.allTasksRoutes);
707
+ }
708
+ var taskMarker = this.allMarkers[index + 1];
709
+ // If Location is Available in Task Details
710
+ if (taskMarker.color != 'red') {
711
+ var markers = [this.allMarkers[0], taskMarker];
712
+ var styles = [
713
+ { color: 'green', opacity: 1, weight: 8 },
714
+ { color: 'white', opacity: 0.4, weight: 12 }
715
+ ];
716
+ this.selectedTaskRoutes = this.setRoutes(markers, styles);
717
+ this.setSelectedTaskDistanceAndTime();
718
+ }
719
+ else {
720
+ alert('No Location Available');
721
+ }
722
+ }
723
+ // Set All Tasks Routes Again & Remove Selected Tasks route
724
+ else {
725
+ if (this.selectedTaskRoutes) {
726
+ this.map.removeControl(this.selectedTaskRoutes);
727
+ }
728
+ this.map.addControl(this.allTasksRoutes);
729
+ this.selectedTaskRoutes = undefined;
730
+ }
731
+ this.fitMapBounds();
732
+ };
733
+ // Get Distance & Time of Selected Task
734
+ MapService.prototype.getSelectedTaskDistanceAndTime = function () {
735
+ return this.selectedTaskDistanceAndTime;
736
+ };
737
+ // Set Distance & Time of Selected Task
738
+ MapService.prototype.setSelectedTaskDistanceAndTime = function () {
739
+ this.selectedTaskRoutes.on('routesfound', function (e) {
740
+ var routes = e.routes;
741
+ var summary = routes[0].summary;
742
+ var distance = summary.totalDistance / 1000;
743
+ var time = Math.round((summary.totalTime % 3600) / 60);
744
+ this.selectedTaskDistanceAndTime = {
745
+ distance: distance,
746
+ time: time
747
+ };
748
+ });
749
+ };
750
+ // To sort Task as per nearest distance
751
+ MapService.prototype.sortTasksAsPerDistance = function (order, tasks, isMarker) {
752
+ var sortedTasks = [];
753
+ for (var i = 0; i < tasks.length; i++) {
754
+ var title = isMarker ? order[i].title : order[i].title - 1;
755
+ var task = tasks[title];
756
+ sortedTasks.push(task);
757
+ }
758
+ return sortedTasks;
759
+ };
760
+ // To set routes in the maps
761
+ MapService.prototype.setRoutes = function (markers, styles) {
762
+ return L__namespace.Routing.control({
763
+ waypoints: markers,
764
+ lineOptions: {
765
+ styles: styles
766
+ },
767
+ createMarker: function () {
768
+ return null;
769
+ },
770
+ routeWhileDragging: true
771
+ }).addTo(this.map);
772
+ };
773
+ // To set view point on the map
774
+ MapService.prototype.fitMapBounds = function () {
775
+ var markerLatLngs = this.allMarkers.map(function (marker) { return L__namespace.latLng(marker.lat, marker.lng); });
776
+ this.map.fitBounds(markerLatLngs);
777
+ };
778
+ // To get Current Position
779
+ MapService.prototype.getPosition = function () {
780
+ return new Promise(function (resolve, reject) {
781
+ navigator.geolocation.watchPosition(function (resp) {
782
+ resolve({
783
+ lng: resp.coords.longitude,
784
+ lat: resp.coords.latitude
785
+ });
786
+ }, function (err) {
787
+ reject(err);
788
+ });
789
+ });
790
+ };
791
+ // To extract Location from the Task Details
792
+ MapService.prototype.getLocation = function (task) {
793
+ var _a, _b, _c, _d, _e, _f;
794
+ if (kwikidToolkit.checkObjectPathExists(this.agentService.config, 'dashboard.taskLocationPath')) {
795
+ var location = kwikidToolkit.getObjectValueFromPath(task, this.agentService.config.dashboard.taskLocationPath);
796
+ return location;
797
+ }
798
+ else {
799
+ 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);
800
+ }
801
+ };
802
+ // To get Latitude & Longitude from Task Location
803
+ MapService.prototype.getLatLng = function (data, index) {
804
+ try {
805
+ var url = data.split('@');
806
+ var lat_long_match = url[1].split(',');
807
+ var lat = Number(lat_long_match[0]);
808
+ var long = Number(lat_long_match[1]);
809
+ return { lat: lat, lng: long, title: index + 1, color: 'blue' };
810
+ }
811
+ catch (_a) {
812
+ // If could not find Google Maps Location URL in Task
813
+ return {
814
+ lat: this.myPosition.lat,
815
+ lng: this.myPosition.lng,
816
+ title: index + 1,
817
+ color: 'red'
818
+ };
819
+ }
820
+ };
821
+ // To Calculate Distance between two markers
822
+ MapService.prototype.calculateDistance = function (point1, point2) {
823
+ var lat1 = point1.lat;
824
+ var lng1 = point1.lng;
825
+ var lat2 = point2.lat;
826
+ var lng2 = point2.lng;
827
+ var R = 6371; // Earth radius in kilometers
828
+ var dLat = (lat2 - lat1) * (Math.PI / 180);
829
+ var dLng = (lng2 - lng1) * (Math.PI / 180);
830
+ var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
831
+ Math.cos((lat1 * Math.PI) / 180) *
832
+ Math.cos((lat2 * Math.PI) / 180) *
833
+ Math.sin(dLng / 2) *
834
+ Math.sin(dLng / 2);
835
+ var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
836
+ var distance = R * c;
837
+ return distance;
838
+ };
839
+ // To calculate nearest distance from marker
840
+ MapService.prototype.nearestNeighborAlgorithm = function (startingPoint, unvisitedPoints) {
841
+ var e_1, _g;
842
+ var currentPoint = startingPoint;
843
+ var path = [currentPoint];
844
+ var visitedPoints = new Set([currentPoint]);
845
+ while (unvisitedPoints.length > 0) {
846
+ var nearestPoint = null;
847
+ var minDistance = Number.POSITIVE_INFINITY;
848
+ try {
849
+ for (var unvisitedPoints_1 = (e_1 = void 0, __values(unvisitedPoints)), unvisitedPoints_1_1 = unvisitedPoints_1.next(); !unvisitedPoints_1_1.done; unvisitedPoints_1_1 = unvisitedPoints_1.next()) {
850
+ var point = unvisitedPoints_1_1.value;
851
+ var distance = this.calculateDistance(currentPoint, point);
852
+ if (distance < minDistance) {
853
+ minDistance = distance;
854
+ nearestPoint = point;
855
+ }
856
+ }
857
+ }
858
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
859
+ finally {
860
+ try {
861
+ if (unvisitedPoints_1_1 && !unvisitedPoints_1_1.done && (_g = unvisitedPoints_1.return)) _g.call(unvisitedPoints_1);
862
+ }
863
+ finally { if (e_1) throw e_1.error; }
864
+ }
865
+ path.push(nearestPoint);
866
+ visitedPoints.add(nearestPoint);
867
+ currentPoint = nearestPoint;
868
+ unvisitedPoints = unvisitedPoints.filter(function (point) { return !visitedPoints.has(point); });
869
+ }
870
+ return path;
871
+ };
872
+ return MapService;
873
+ }());
874
+ /** @nocollapse */ MapService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, deps: [{ token: AgentService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
875
+ /** @nocollapse */ MapService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, providedIn: 'root' });
876
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, decorators: [{
877
+ type: i0.Injectable,
878
+ args: [{
879
+ providedIn: 'root'
880
+ }]
881
+ }], ctorParameters: function () { return [{ type: AgentService }]; }, propDecorators: { directionsRenders: [{
882
+ type: i0.ViewChildren,
883
+ args: ['directionsRender']
884
+ }] } });
885
+
1060
886
  var CustomerDetailsComponent = /** @class */ (function () {
1061
- function CustomerDetailsComponent(userService) {
1062
- this.userService = userService;
887
+ function CustomerDetailsComponent(agentService, mapService) {
888
+ this.agentService = agentService;
889
+ this.mapService = mapService;
1063
890
  this.customer = {
1064
891
  agent_id: 'sparkcpaital_dev_agent_1',
1065
892
  client_name: 'sparkcpaital_dev',
@@ -1096,7 +923,17 @@
1096
923
  CustomerDetailsComponent.prototype.ngOnInit = function () {
1097
924
  var _a, _b, _c;
1098
925
  this.viewTaskDetails =
1099
- (_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;
926
+ (_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;
927
+ };
928
+ CustomerDetailsComponent.prototype.getTaskCreationTime = function (task) {
929
+ var _a;
930
+ if (kwikidToolkit.checkObjectPathExists(this.agentService.config, 'dashboard.taskCreationTimePath')) {
931
+ var time = kwikidToolkit.getObjectValueFromPath(task, this.agentService.config.dashboard.taskCreationTimePath);
932
+ return this.convertEpochToDate(time);
933
+ }
934
+ else {
935
+ 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);
936
+ }
1100
937
  };
1101
938
  CustomerDetailsComponent.prototype.convertToTitleCase = function (inputString) {
1102
939
  inputString = inputString.replace('$.task_details.customer_details.', '');
@@ -1120,19 +957,20 @@
1120
957
  CustomerDetailsComponent.prototype.goToMaps = function (location) {
1121
958
  window.open("" + location, '_blank');
1122
959
  };
1123
- CustomerDetailsComponent.prototype.goToNextStep = function (e) {
960
+ CustomerDetailsComponent.prototype.handleOnClickNext = function (e) {
1124
961
  this.nextStep.emit(e);
1125
962
  };
1126
963
  CustomerDetailsComponent.prototype.close = function () {
1127
- this.userService.showTaskDetails = undefined;
964
+ this.agentService.isShowTaskDetails = undefined;
965
+ this.mapService.plotDirectionsForSelectedTask(null);
1128
966
  };
1129
967
  CustomerDetailsComponent.prototype.handleOnClickRemoveTask = function (task) {
1130
968
  this.removeTask.emit(task);
1131
969
  };
1132
970
  return CustomerDetailsComponent;
1133
971
  }());
1134
- /** @nocollapse */ CustomerDetailsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerDetailsComponent, deps: [{ token: UserService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1135
- /** @nocollapse */ CustomerDetailsComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
972
+ /** @nocollapse */ CustomerDetailsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerDetailsComponent, deps: [{ token: AgentService }, { token: MapService }], target: i0__namespace.ɵɵFactoryTarget.Component });
973
+ /** @nocollapse */ CustomerDetailsComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1136
974
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerDetailsComponent, decorators: [{
1137
975
  type: i0.Component,
1138
976
  args: [{
@@ -1140,9 +978,9 @@
1140
978
  templateUrl: './customer-details.component.html',
1141
979
  styleUrls: ['./customer-details.component.scss']
1142
980
  }]
1143
- }], ctorParameters: function () { return [{ type: UserService }]; }, propDecorators: { customer: [{
981
+ }], ctorParameters: function () { return [{ type: AgentService }, { type: MapService }]; }, propDecorators: { customer: [{
1144
982
  type: i0.Input
1145
- }], agentConfig: [{
983
+ }], config: [{
1146
984
  type: i0.Input
1147
985
  }], nextStep: [{
1148
986
  type: i0.Output
@@ -1150,200 +988,6 @@
1150
988
  type: i0.Output
1151
989
  }] } });
1152
990
 
1153
- var InfoWindowService = /** @class */ (function () {
1154
- function InfoWindowService(mapService) {
1155
- this.mapService = mapService;
1156
- this.config = {
1157
- fields: {
1158
- name: {
1159
- label: 'Name',
1160
- value: 'name',
1161
- display: 'value',
1162
- style: {
1163
- fontSize: '1rem',
1164
- fontWeight: 600
1165
- }
1166
- },
1167
- phone: {
1168
- label: 'Call',
1169
- value: 'phone',
1170
- display: 'label',
1171
- style: {
1172
- fontSize: '0.8rem',
1173
- padding: '0.1rem 0',
1174
- textAlign: 'justify'
1175
- },
1176
- icon: 'https://cdn-icons-png.flaticon.com/512/60/60720.png'
1177
- },
1178
- address: {
1179
- label: 'Directions',
1180
- value: 'address',
1181
- display: 'label',
1182
- style: {
1183
- fontSize: '0.8rem',
1184
- padding: '0.1rem 0'
1185
- },
1186
- icon: 'https://cdn-icons-png.flaticon.com/512/62/62516.png'
1187
- }
1188
- }
1189
- };
1190
- this.mainInfoWindowStyle = {
1191
- display: 'flex',
1192
- 'flex-direction': 'column',
1193
- 'justify-content': 'center',
1194
- 'align-items': 'stretch',
1195
- gap: '0.5rem',
1196
- padding: '0.5rem'
1197
- };
1198
- this.fieldDivStyle = {
1199
- gap: ' 0.5rem',
1200
- display: 'flex',
1201
- 'flex-direction': 'row'
1202
- };
1203
- }
1204
- InfoWindowService.prototype.getOpenMarker = function () {
1205
- return this.openMarker;
1206
- };
1207
- InfoWindowService.prototype.setOpenMarker = function (value) {
1208
- this.openMarker = value;
1209
- };
1210
- /**
1211
- * @description
1212
- * Wrapper method to show Customer Info Window
1213
- *
1214
- * @function showInfo
1215
- * @func showInfo
1216
- * @method showInfo
1217
- */
1218
- InfoWindowService.prototype.showCustomerInformation = function (customer, marker) {
1219
- var map = this.mapService.map;
1220
- var contentString = this.createInfoContent(customer);
1221
- var infowindow = new google.maps.InfoWindow({
1222
- content: contentString
1223
- });
1224
- this.addEventListeners(customer, infowindow);
1225
- this.closeLastOpenedInfoWindow();
1226
- infowindow.open(map, marker);
1227
- this.lastInfoWindowOpened = infowindow;
1228
- this.mapService.map = Object.assign(Object.assign({}, this.mapService.map), { center: marker.getPosition });
1229
- // map.setCenter(marker.getPosition());
1230
- return { infowindow: infowindow };
1231
- };
1232
- InfoWindowService.prototype.addEventListeners = function (customer, infowindow) {
1233
- // chnage -
1234
- var addressLink = "http://maps.google.com/?q=" + customer.extras.loc[0] + ", " + customer.extras.loc[1];
1235
- google.maps.event.addListener(infowindow, 'domready', function () {
1236
- document.getElementById('Call').addEventListener('click', function (e) {
1237
- window.open("tel:" + customer.extras.phone, '_self');
1238
- });
1239
- document
1240
- .getElementById('Directions')
1241
- .addEventListener('click', function (e) {
1242
- window.open("" + addressLink, '_blank');
1243
- });
1244
- document
1245
- .getElementsByClassName('gm-ui-hover-effect')[0]
1246
- .setAttribute('style', ' background: none;\
1247
- display: block; \
1248
- border: 0px; \
1249
- margin: 0px; \
1250
- padding: 0px; \
1251
- text-transform: none; \
1252
- appearance: none; \
1253
- position: absolute; \
1254
- cursor: pointer; \
1255
- user-select: none; \
1256
- top: 0px; \
1257
- right: 0px; \
1258
- width: 30px; \
1259
- height: 30px; \
1260
- ');
1261
- });
1262
- };
1263
- /**
1264
- * @description
1265
- * Wrapper method to close Last Info Window
1266
- *
1267
- * @function closeLastOpenedInfoWindow
1268
- * @func closeLastOpenedInfoWindow
1269
- * @method closeLastOpenedInfoWindow
1270
- */
1271
- InfoWindowService.prototype.closeLastOpenedInfoWindow = function () {
1272
- if (this.lastInfoWindowOpened) {
1273
- this.lastInfoWindowOpened.close();
1274
- }
1275
- };
1276
- /**
1277
- * @description
1278
- * Closes the previously opened info window.
1279
- *
1280
- * @function infoData
1281
- * @func infoData
1282
- * @method infoData
1283
- */
1284
- InfoWindowService.prototype.createInfoContent = function (customer) {
1285
- var content = "<div style='padding:4px; font-family: Manrope;' >";
1286
- content += this.createFields(customer, this.config.fields);
1287
- content += '</div>';
1288
- return content;
1289
- };
1290
- /**
1291
- * @description
1292
- * Wrapper method to create Fields Container
1293
- *
1294
- * @function createFields
1295
- * @func createFields
1296
- * @method createFields
1297
- */
1298
- InfoWindowService.prototype.createFields = function (customer, fields) {
1299
- var e_1, _a;
1300
- var _div = document.createElement('div');
1301
- for (var property in this.mainInfoWindowStyle)
1302
- _div.style[property] = this.mainInfoWindowStyle[property];
1303
- try {
1304
- for (var _b = __values(Object.keys(fields)), _c = _b.next(); !_c.done; _c = _b.next()) {
1305
- var key = _c.value;
1306
- var field = fields[key];
1307
- var _fieldDiv = document.createElement('div');
1308
- _fieldDiv.setAttribute('id', field.label);
1309
- for (var property in this.fieldDivStyle)
1310
- _fieldDiv.style[property] = this.fieldDivStyle[property];
1311
- for (var property in field.style)
1312
- _fieldDiv.style[property] = field.style[property];
1313
- var string = field.display == 'label' ? field.label : customer.extras[field.value];
1314
- if (field.icon) {
1315
- var _icon = document.createElement('img');
1316
- _icon.src = field.icon;
1317
- _icon.style.width = field.style.fontSize;
1318
- _icon.style.height = field.style.fontSize;
1319
- _fieldDiv.appendChild(_icon);
1320
- }
1321
- var _fieldText = document.createElement('div');
1322
- _fieldText.innerHTML = string;
1323
- _fieldDiv.appendChild(_fieldText);
1324
- _div.appendChild(_fieldDiv);
1325
- }
1326
- }
1327
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1328
- finally {
1329
- try {
1330
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1331
- }
1332
- finally { if (e_1) throw e_1.error; }
1333
- }
1334
- return _div.outerHTML;
1335
- };
1336
- return InfoWindowService;
1337
- }());
1338
- /** @nocollapse */ InfoWindowService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: InfoWindowService, deps: [{ token: MapService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1339
- /** @nocollapse */ InfoWindowService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: InfoWindowService, providedIn: 'root' });
1340
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: InfoWindowService, decorators: [{
1341
- type: i0.Injectable,
1342
- args: [{
1343
- providedIn: 'root'
1344
- }]
1345
- }], ctorParameters: function () { return [{ type: MapService }]; } });
1346
-
1347
991
  var EStatus;
1348
992
  (function (EStatus) {
1349
993
  EStatus["NOT_STARTED"] = "not started";
@@ -1377,7 +1021,7 @@
1377
1021
  return StatusPillComponent;
1378
1022
  }());
1379
1023
  /** @nocollapse */ StatusPillComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StatusPillComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1380
- /** @nocollapse */ StatusPillComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, ngImport: i0__namespace, 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__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1024
+ /** @nocollapse */ StatusPillComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, ngImport: i0__namespace, 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__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1381
1025
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StatusPillComponent, decorators: [{
1382
1026
  type: i0.Component,
1383
1027
  args: [{
@@ -1390,41 +1034,14 @@
1390
1034
  }] } });
1391
1035
 
1392
1036
  var CustomerTileComponent = /** @class */ (function () {
1393
- /**
1394
- * @description
1395
- *
1396
- * @constructor
1397
- */
1398
- function CustomerTileComponent(mapService, infoWindowService, userService, hostElement) {
1037
+ function CustomerTileComponent(mapService, agentService, hostElement) {
1399
1038
  this.mapService = mapService;
1400
- this.infoWindowService = infoWindowService;
1401
- this.userService = userService;
1039
+ this.agentService = agentService;
1402
1040
  this.hostElement = hostElement;
1403
- /**
1404
- * @description
1405
- * Determines Customer Data
1406
- *
1407
- * @default
1408
- * `{}`
1409
- */
1410
1041
  this.customer = {};
1411
- /**
1412
- * @description
1413
- * Determines Index of Customer Data in Customer List
1414
- *
1415
- * @default
1416
- *
1417
- */
1418
1042
  this.index = undefined;
1419
1043
  this.isMobileView = false;
1420
1044
  this.viewTaskDetails = [];
1421
- /**
1422
- * @description
1423
- * Emitter to emit next Step
1424
- *
1425
- * @emits KwikIDAgentDashboardComponent#nextStep
1426
- * @fires KwikIDAgentDashboardComponent#nextStep
1427
- */
1428
1045
  this.nextStep = new i0.EventEmitter();
1429
1046
  this.removeTask = new i0.EventEmitter();
1430
1047
  }
@@ -1436,66 +1053,35 @@
1436
1053
  this.isMobileView = false;
1437
1054
  }
1438
1055
  };
1439
- /**
1440
- * @description
1441
- * To set Google Maps API on script
1442
- *
1443
- * @ngOnInit
1444
- */
1445
1056
  CustomerTileComponent.prototype.ngOnInit = function () {
1446
1057
  var _a, _b, _c;
1447
1058
  this.viewTaskDetails =
1448
- (_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;
1059
+ (_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;
1449
1060
  };
1450
1061
  CustomerTileComponent.prototype.getTaskDetails = function (taskData) {
1451
1062
  return kwikidToolkit.getObjectValueFromPath(this.customer, taskData);
1452
1063
  };
1453
1064
  CustomerTileComponent.prototype.openDetails = function () {
1454
- if (this.userService.showTaskDetails !== this.index) {
1455
- this.userService.showTaskDetails = this.index;
1065
+ if (this.agentService.isShowTaskDetails !== this.index) {
1066
+ this.agentService.isShowTaskDetails = this.index;
1067
+ this.mapService.plotDirectionsForSelectedTask(this.index);
1456
1068
  }
1457
1069
  else {
1458
- this.userService.showTaskDetails = undefined;
1459
- }
1460
- };
1461
- CustomerTileComponent.prototype.tileClick = function () {
1462
- this.openDetails();
1463
- if (this.index == this.infoWindowService.getOpenMarker()) {
1464
- this.infoWindowService.setOpenMarker(null);
1465
- //this.infoWindowService.lastInfoWindowOpened.close();
1070
+ this.agentService.isShowTaskDetails = undefined;
1071
+ this.mapService.plotDirectionsForSelectedTask(null);
1466
1072
  }
1467
- else {
1468
- this.showDetails(this.customer, this.index);
1469
- }
1470
- };
1471
- /**
1472
- * @description
1473
- * Wrapper method to show Customer Info Window
1474
- *
1475
- * @function showDetails
1476
- * @func showDetails
1477
- * @method showDetails
1478
- */
1479
- CustomerTileComponent.prototype.showDetails = function (customer, index) {
1480
- var markers = this.mapService.getMarkers();
1481
- var marker = markers[index + 1];
1482
- // let { infowindow } = this.infoWindowService.showCustomerInformation(
1483
- // customer,
1484
- // marker
1485
- // );
1486
- this.infoWindowService.setOpenMarker(index);
1487
1073
  };
1488
1074
  CustomerTileComponent.prototype.getClass = function () {
1489
- var string = "customer-tile-wrapper";
1490
- if (this.userService.showTaskDetails == this.index) {
1491
- string += " customer-tile-active";
1075
+ var string = 'customer-tile-wrapper';
1076
+ if (this.agentService.isShowTaskDetails == this.index) {
1077
+ string += ' customer-tile-active';
1492
1078
  }
1493
1079
  return string;
1494
1080
  };
1495
1081
  CustomerTileComponent.prototype.goToMaps = function (location) {
1496
1082
  window.open("" + location, '_blank');
1497
1083
  };
1498
- CustomerTileComponent.prototype.goToNextStep = function (e) {
1084
+ CustomerTileComponent.prototype.handleOnClickNext = function (e) {
1499
1085
  this.nextStep.emit(e);
1500
1086
  };
1501
1087
  CustomerTileComponent.prototype.handleOnClickRemoveTask = function (task) {
@@ -1503,8 +1089,8 @@
1503
1089
  };
1504
1090
  return CustomerTileComponent;
1505
1091
  }());
1506
- /** @nocollapse */ CustomerTileComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerTileComponent, deps: [{ token: MapService }, { token: InfoWindowService }, { token: UserService }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1507
- /** @nocollapse */ CustomerTileComponent.ɵcmp = i0__namespace.ɵɵ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: i5.MapInfoWindow, descendants: true }], ngImport: i0__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1092
+ /** @nocollapse */ CustomerTileComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerTileComponent, deps: [{ token: MapService }, { token: AgentService }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1093
+ /** @nocollapse */ CustomerTileComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i5__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1508
1094
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerTileComponent, decorators: [{
1509
1095
  type: i0.Component,
1510
1096
  args: [{
@@ -1512,22 +1098,19 @@
1512
1098
  templateUrl: './customer-tile.component.html',
1513
1099
  styleUrls: ['./customer-tile.component.scss']
1514
1100
  }]
1515
- }], ctorParameters: function () { return [{ type: MapService }, { type: InfoWindowService }, { type: UserService }, { type: i0__namespace.ElementRef }]; }, propDecorators: { windowResizeWatcher: [{
1101
+ }], ctorParameters: function () { return [{ type: MapService }, { type: AgentService }, { type: i0__namespace.ElementRef }]; }, propDecorators: { windowResizeWatcher: [{
1516
1102
  type: i0.HostListener,
1517
1103
  args: ['window:resize', ['$event']]
1518
1104
  }], customer: [{
1519
1105
  type: i0.Input
1520
1106
  }], index: [{
1521
1107
  type: i0.Input
1522
- }], agentConfig: [{
1108
+ }], config: [{
1523
1109
  type: i0.Input
1524
1110
  }], nextStep: [{
1525
1111
  type: i0.Output
1526
1112
  }], removeTask: [{
1527
1113
  type: i0.Output
1528
- }], infoWindow: [{
1529
- type: i0.ViewChild,
1530
- args: [i5.MapInfoWindow]
1531
1114
  }] } });
1532
1115
 
1533
1116
  var Ng2SearchPipe = /** @class */ (function () {
@@ -1606,7 +1189,7 @@
1606
1189
  this.fromDate = this.getDate(null);
1607
1190
  this.toDate = this.getDate(null);
1608
1191
  this.dateRangeFormControl = new i5$1.FormControl({
1609
- value: new i10.TuiDayRange(new i10.TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()), new i10.TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate())),
1192
+ value: new i9.TuiDayRange(new i9.TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()), new i9.TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate())),
1610
1193
  disabled: false
1611
1194
  });
1612
1195
  this.formGroup.addControl('dateRange', this.dateRangeFormControl);
@@ -1617,36 +1200,48 @@
1617
1200
  CustomerListComponent.prototype.ngAfterViewInit = function () {
1618
1201
  var _this = this;
1619
1202
  setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
1620
- var _a;
1621
- return __generator(this, function (_b) {
1622
- switch (_b.label) {
1203
+ var _b;
1204
+ return __generator(this, function (_c) {
1205
+ switch (_c.label) {
1623
1206
  case 0:
1624
- if (!this.agentConfig.dashboardConfig.showMaps) return [3 /*break*/, 3];
1207
+ if (!this.config.dashboard.isShowMaps) return [3 /*break*/, 3];
1625
1208
  return [4 /*yield*/, this.mapService.initMap()];
1626
1209
  case 1:
1627
- _b.sent();
1628
- _a = this;
1210
+ _c.sent();
1211
+ _b = this;
1629
1212
  return [4 /*yield*/, this.plotMarkers(this.customers)];
1630
1213
  case 2:
1631
- _a.filteredData = _b.sent();
1214
+ _b.filteredData = _c.sent();
1632
1215
  return [3 /*break*/, 4];
1633
1216
  case 3:
1634
1217
  this.filteredData = this.customers;
1635
- _b.label = 4;
1218
+ _c.label = 4;
1636
1219
  case 4: return [2 /*return*/];
1637
1220
  }
1638
1221
  });
1639
1222
  }); }, 1000);
1640
1223
  };
1641
1224
  CustomerListComponent.prototype.ngOnChanges = function () {
1642
- if (this.agentConfig.dashboardConfig.showMaps) {
1643
- this.filteredData = this.plotMarkers(this.customers);
1644
- }
1645
- else {
1646
- this.filteredData = this.customers;
1647
- }
1225
+ return __awaiter(this, void 0, void 0, function () {
1226
+ var _b;
1227
+ return __generator(this, function (_c) {
1228
+ switch (_c.label) {
1229
+ case 0:
1230
+ if (!this.config.dashboard.isShowMaps) return [3 /*break*/, 2];
1231
+ _b = this;
1232
+ return [4 /*yield*/, this.plotMarkers(this.customers)];
1233
+ case 1:
1234
+ _b.filteredData = _c.sent();
1235
+ return [3 /*break*/, 3];
1236
+ case 2:
1237
+ this.filteredData = this.customers;
1238
+ _c.label = 3;
1239
+ case 3: return [2 /*return*/];
1240
+ }
1241
+ });
1242
+ });
1648
1243
  };
1649
- CustomerListComponent.prototype.goToNextStep = function (e) {
1244
+ CustomerListComponent.prototype.handleOnClickNext = function (e) {
1650
1245
  this.nextStep.emit(e);
1651
1246
  };
1652
1247
  CustomerListComponent.prototype.getDate = function (d) {
@@ -1662,12 +1257,23 @@
1662
1257
  return today;
1663
1258
  };
1664
1259
  CustomerListComponent.prototype.plotMarkers = function (customers) {
1665
- var _this = this;
1666
- var directionsResults$ = this.mapService.plotMarkers(customers);
1667
- directionsResults$.subscribe(function (val) {
1668
- _this.filteredData = _this.mapService.sortList(val.routes[0].waypoint_order, customers);
1260
+ var _a;
1261
+ return __awaiter(this, void 0, void 0, function () {
1262
+ return __generator(this, function (_b) {
1263
+ switch (_b.label) {
1264
+ case 0:
1265
+ if (!((_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.isPlotCompletedTaskMarkers)) {
1266
+ customers = customers.filter(function (customer) {
1267
+ return customer.status !== EStatus.COMPLETE;
1268
+ });
1269
+ }
1270
+ return [4 /*yield*/, this.mapService.plotDirectionsForAllTasks(customers)];
1271
+ case 1:
1272
+ customers = _b.sent();
1273
+ return [2 /*return*/, customers];
1274
+ }
1275
+ });
1669
1276
  });
1670
- return customers;
1671
1277
  };
1672
1278
  CustomerListComponent.prototype.getTuiDate = function (event) {
1673
1279
  var year = event.year;
@@ -1697,7 +1303,7 @@
1697
1303
  return CustomerListComponent;
1698
1304
  }());
1699
1305
  /** @nocollapse */ CustomerListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerListComponent, deps: [{ token: MapService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1700
- /** @nocollapse */ CustomerListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.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__namespace.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__namespace.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__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5__namespace$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i3__namespace.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }], pipes: { "filter": Ng2SearchPipe } });
1306
+ /** @nocollapse */ CustomerListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.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__namespace.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__namespace.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__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5__namespace$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i3__namespace.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }], pipes: { "filter": Ng2SearchPipe } });
1701
1307
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerListComponent, decorators: [{
1702
1308
  type: i0.Component,
1703
1309
  args: [{
@@ -1707,7 +1313,7 @@
1707
1313
  }]
1708
1314
  }], ctorParameters: function () { return [{ type: MapService }]; }, propDecorators: { customers: [{
1709
1315
  type: i0.Input
1710
- }], agentConfig: [{
1316
+ }], config: [{
1711
1317
  type: i0.Input
1712
1318
  }], nextStep: [{
1713
1319
  type: i0.Output
@@ -1718,53 +1324,47 @@
1718
1324
  }] } });
1719
1325
 
1720
1326
  var KwikIDAgentDashboardComponent = /** @class */ (function () {
1721
- function KwikIDAgentDashboardComponent(mapService, userService, httpClient, hostElement, dialogService) {
1327
+ function KwikIDAgentDashboardComponent(mapService, agentService, httpClient, hostElement, dialogService) {
1722
1328
  this.mapService = mapService;
1723
- this.userService = userService;
1329
+ this.agentService = agentService;
1724
1330
  this.httpClient = httpClient;
1725
1331
  this.hostElement = hostElement;
1726
1332
  this.dialogService = dialogService;
1727
- this.agentConfig = {};
1333
+ this.config = {};
1728
1334
  this.taskList = [];
1729
1335
  this.nextStep = new i0.EventEmitter();
1730
1336
  this.addTask = new i0.EventEmitter();
1731
1337
  this.removeTask = new i0.EventEmitter();
1732
1338
  this.filterTaskList = new i0.EventEmitter();
1733
1339
  this.loading = true;
1734
- this.options = {
1735
- stops: ['calc(5rem + 74vw)', 'calc(9rem + 74vw)']
1736
- };
1737
1340
  this.open = false;
1738
1341
  this.allFormsData = {};
1739
1342
  this.String = String;
1740
- this.apiLoaded = httpClient
1741
- .jsonp('https://maps.googleapis.com/maps/api/js?key=AIzaSyA63JY0ja6ZGIR796vJqZARc0c2j8Vgpik&v=3.exp&libraries=geometry,drawing,places', 'callback')
1742
- .pipe(operators.map(function () { return true; }), operators.catchError(function () { return rxjs.of(false); }));
1743
1343
  }
1744
1344
  KwikIDAgentDashboardComponent.prototype.windowResizeWatcher = function () {
1745
1345
  if (this.hostElement.nativeElement.offsetWidth < 600) {
1746
1346
  this.isMobileView = true;
1747
- this.userService.isMobileView = true;
1347
+ this.agentService.isMobileView = true;
1748
1348
  }
1749
1349
  else {
1750
1350
  this.isMobileView = false;
1751
- this.userService.isMobileView = false;
1351
+ this.agentService.isMobileView = false;
1752
1352
  }
1753
1353
  };
1754
1354
  KwikIDAgentDashboardComponent.prototype.ngOnInit = function () {
1755
1355
  var _this = this;
1756
1356
  var _a, _b, _c, _d, _e, _f;
1757
- this.userService.agentConfig = this.agentConfig;
1758
- this.userService.showMapview =
1759
- (_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;
1760
- this.userService.addTaskFormConfig =
1761
- (_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;
1357
+ this.agentService.config = this.config;
1358
+ this.agentService.showMapview =
1359
+ (_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;
1360
+ this.agentService.addTaskForm =
1361
+ (_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;
1762
1362
  this.loading = false;
1763
1363
  setTimeout(function () {
1764
1364
  _this.windowResizeWatcher();
1765
1365
  }, 1000);
1766
1366
  };
1767
- KwikIDAgentDashboardComponent.prototype.goToNextStep = function (e) {
1367
+ KwikIDAgentDashboardComponent.prototype.handleOnClickNext = function (e) {
1768
1368
  this.nextStep.emit(e);
1769
1369
  };
1770
1370
  KwikIDAgentDashboardComponent.prototype.handleOnClickAddTask = function (task) {
@@ -1804,8 +1404,8 @@
1804
1404
  KwikIDAgentDashboardComponent.prototype.handleOnClickViewForms = function (e) { };
1805
1405
  return KwikIDAgentDashboardComponent;
1806
1406
  }());
1807
- /** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardComponent, deps: [{ token: MapService }, { token: UserService }, { token: i3__namespace$1.HttpClient }, { token: i0__namespace.ElementRef }, { token: i11.TuiDialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1808
- /** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0__namespace.ɵɵ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: i5.MapInfoWindow, descendants: true }], ngImport: i0__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }, { type: i5__namespace.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__namespace.KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["formConfig", "formData", "isMobileView", "allFormsData", "userConfig", "apiCallResponse", "buttonClickResponse", "popupFormCallback"], outputs: ["onClickGoBack", "onClickViewForms", "getUnsavedDataState", "onClickSaveForm", "onClickApiCall", "onActionShowPopupForm", "onClickFormFieldButton"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i11__namespace.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i11__namespace.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i11__namespace.TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])" }, { type: i11__namespace.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i11__namespace.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.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__namespace.MapDirectionsRenderer, selector: "map-directions-renderer", inputs: ["directions", "options"], outputs: ["directionsChanged"], exportAs: ["mapDirectionsRenderer"] }, { type: i5__namespace.MapInfoWindow, selector: "map-info-window", inputs: ["options", "position"], outputs: ["closeclick", "contentChanged", "domready", "positionChanged", "zindexChanged"], exportAs: ["mapInfoWindow"] }], pipes: { "async": i6__namespace.AsyncPipe } });
1407
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardComponent, deps: [{ token: MapService }, { token: AgentService }, { token: i3__namespace$1.HttpClient }, { token: i0__namespace.ElementRef }, { token: i10.TuiDialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1408
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0__namespace.ɵɵ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: googleMaps.MapInfoWindow, descendants: true }, { propertyName: "mapElement", first: true, predicate: ["map"], descendants: true, static: true }], ngImport: i0__namespace, 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__namespace.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__namespace.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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9__namespace.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i10__namespace.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i10__namespace.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i10__namespace.TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])" }, { type: i10__namespace.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i10__namespace.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }] });
1809
1409
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardComponent, decorators: [{
1810
1410
  type: i0.Component,
1811
1411
  args: [{
@@ -1814,14 +1414,14 @@
1814
1414
  styleUrls: ['./kwikid-agent-dashboard.component.scss']
1815
1415
  }]
1816
1416
  }], ctorParameters: function () {
1817
- return [{ type: MapService }, { type: UserService }, { type: i3__namespace$1.HttpClient }, { type: i0__namespace.ElementRef }, { type: i11__namespace.TuiDialogService, decorators: [{
1417
+ return [{ type: MapService }, { type: AgentService }, { type: i3__namespace$1.HttpClient }, { type: i0__namespace.ElementRef }, { type: i10__namespace.TuiDialogService, decorators: [{
1818
1418
  type: i0.Inject,
1819
- args: [i11.TuiDialogService]
1419
+ args: [i10.TuiDialogService]
1820
1420
  }] }];
1821
1421
  }, propDecorators: { windowResizeWatcher: [{
1822
1422
  type: i0.HostListener,
1823
1423
  args: ['window:resize', ['$event']]
1824
- }], agentConfig: [{
1424
+ }], config: [{
1825
1425
  type: i0.Input
1826
1426
  }], taskList: [{
1827
1427
  type: i0.Input
@@ -1835,7 +1435,10 @@
1835
1435
  type: i0.Output
1836
1436
  }], infoWindow: [{
1837
1437
  type: i0.ViewChild,
1838
- args: [i5.MapInfoWindow, { static: false }]
1438
+ args: [googleMaps.MapInfoWindow, { static: false }]
1439
+ }], mapElement: [{
1440
+ type: i0.ViewChild,
1441
+ args: ['map', { static: true }]
1839
1442
  }] } });
1840
1443
 
1841
1444
  var KwikIDAgentDashboardModule = /** @class */ (function () {
@@ -1849,7 +1452,7 @@
1849
1452
  CustomerTileComponent,
1850
1453
  Ng2SearchPipe,
1851
1454
  StatusPillComponent,
1852
- CustomerDetailsComponent], imports: [i6.CommonModule,
1455
+ CustomerDetailsComponent], imports: [i5.CommonModule,
1853
1456
  i3$1.HttpClientModule,
1854
1457
  i5$1.FormsModule,
1855
1458
  i5$1.ReactiveFormsModule,
@@ -1860,20 +1463,20 @@
1860
1463
  i2.KwikUIInputSelectModule,
1861
1464
  i2.KwikUITableModule,
1862
1465
  i2.KwikUITablePaginationModule,
1863
- i8.KwikIDFormViewModule,
1864
- i11.TuiRootModule,
1865
- i11.TuiDialogModule,
1866
- i11.TuiDropdownModule,
1466
+ i7.KwikIDFormViewModule,
1467
+ i10.TuiRootModule,
1468
+ i10.TuiDialogModule,
1469
+ i10.TuiDropdownModule,
1867
1470
  addonMobile.TuiSidebarModule,
1868
- i10.TuiActiveZoneModule,
1869
- i11.TuiGroupModule,
1870
- i11.TuiSvgModule,
1471
+ i9.TuiActiveZoneModule,
1472
+ i10.TuiGroupModule,
1473
+ i10.TuiSvgModule,
1871
1474
  i3.ScrollingModule,
1872
- i5.GoogleMapsModule,
1475
+ googleMaps.GoogleMapsModule,
1873
1476
  i3$1.HttpClientModule,
1874
1477
  i3$1.HttpClientJsonpModule], exports: [KwikIDAgentDashboardComponent] });
1875
1478
  /** @nocollapse */ KwikIDAgentDashboardModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardModule, imports: [[
1876
- i6.CommonModule,
1479
+ i5.CommonModule,
1877
1480
  i3$1.HttpClientModule,
1878
1481
  i5$1.FormsModule,
1879
1482
  i5$1.ReactiveFormsModule,
@@ -1884,16 +1487,16 @@
1884
1487
  i2.KwikUIInputSelectModule,
1885
1488
  i2.KwikUITableModule,
1886
1489
  i2.KwikUITablePaginationModule,
1887
- i8.KwikIDFormViewModule,
1888
- i11.TuiRootModule,
1889
- i11.TuiDialogModule,
1890
- i11.TuiDropdownModule,
1490
+ i7.KwikIDFormViewModule,
1491
+ i10.TuiRootModule,
1492
+ i10.TuiDialogModule,
1493
+ i10.TuiDropdownModule,
1891
1494
  addonMobile.TuiSidebarModule,
1892
- i10.TuiActiveZoneModule,
1893
- i11.TuiGroupModule,
1894
- i11.TuiSvgModule,
1495
+ i9.TuiActiveZoneModule,
1496
+ i10.TuiGroupModule,
1497
+ i10.TuiSvgModule,
1895
1498
  i3.ScrollingModule,
1896
- i5.GoogleMapsModule,
1499
+ googleMaps.GoogleMapsModule,
1897
1500
  i3$1.HttpClientModule,
1898
1501
  i3$1.HttpClientJsonpModule
1899
1502
  ]] });
@@ -1909,7 +1512,7 @@
1909
1512
  CustomerDetailsComponent
1910
1513
  ],
1911
1514
  imports: [
1912
- i6.CommonModule,
1515
+ i5.CommonModule,
1913
1516
  i3$1.HttpClientModule,
1914
1517
  i5$1.FormsModule,
1915
1518
  i5$1.ReactiveFormsModule,
@@ -1920,16 +1523,16 @@
1920
1523
  i2.KwikUIInputSelectModule,
1921
1524
  i2.KwikUITableModule,
1922
1525
  i2.KwikUITablePaginationModule,
1923
- i8.KwikIDFormViewModule,
1924
- i11.TuiRootModule,
1925
- i11.TuiDialogModule,
1926
- i11.TuiDropdownModule,
1526
+ i7.KwikIDFormViewModule,
1527
+ i10.TuiRootModule,
1528
+ i10.TuiDialogModule,
1529
+ i10.TuiDropdownModule,
1927
1530
  addonMobile.TuiSidebarModule,
1928
- i10.TuiActiveZoneModule,
1929
- i11.TuiGroupModule,
1930
- i11.TuiSvgModule,
1531
+ i9.TuiActiveZoneModule,
1532
+ i10.TuiGroupModule,
1533
+ i10.TuiSvgModule,
1931
1534
  i3.ScrollingModule,
1932
- i5.GoogleMapsModule,
1535
+ googleMaps.GoogleMapsModule,
1933
1536
  i3$1.HttpClientModule,
1934
1537
  i3$1.HttpClientJsonpModule
1935
1538
  ],