@djb25/digit-ui-module-ekyc 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/index.css +1 -0
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.modern.js +2884 -682
  5. package/dist/index.modern.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/Module.js +28 -7
  8. package/src/components/AadhaarVerification.js +415 -0
  9. package/src/components/AddressDetails.js +207 -0
  10. package/src/components/CeoDashboard.js +201 -0
  11. package/src/components/DesktopInbox.js +1 -1
  12. package/src/components/EKYCCard.js +4 -0
  13. package/src/components/MeterDetails.js +372 -0
  14. package/src/components/PropertyInfo.js +303 -0
  15. package/src/components/Review.js +572 -0
  16. package/src/components/analytics/charts/ClusterHeatmap.js +88 -0
  17. package/src/components/analytics/charts/TaskStatusChart.js +92 -0
  18. package/src/components/analytics/components/AnalyticsTable.js +106 -0
  19. package/src/components/analytics/components/DashboardLayout.js +72 -0
  20. package/src/components/analytics/components/EmptyState.js +27 -0
  21. package/src/components/analytics/components/ErrorBoundary.js +27 -0
  22. package/src/components/analytics/components/FilterBar.js +73 -0
  23. package/src/components/analytics/components/NotificationPanel.js +77 -0
  24. package/src/components/analytics/components/SLAWidget.js +56 -0
  25. package/src/components/analytics/components/SkeletonLoader.js +53 -0
  26. package/src/components/analytics/components/SummaryCard.js +74 -0
  27. package/src/components/analytics/components/WorkflowTimeline.js +55 -0
  28. package/src/components/analytics/styles/Dashboard.css +54 -0
  29. package/src/components/analytics/utils/exportUtils.js +64 -0
  30. package/src/components/analytics/utils/filterSerializer.js +50 -0
  31. package/src/config/config.js +1 -1
  32. package/src/pages/citizen/index.js +74 -18
  33. package/src/pages/employee/ConsumerDetails.js +10 -281
  34. package/src/pages/employee/Inbox.js +6 -4
  35. package/src/pages/employee/index.js +55 -8
  36. package/src/pages/employee/AadhaarVerification.js +0 -512
  37. package/src/pages/employee/AddressDetails.js +0 -548
  38. package/src/pages/employee/MeterDetails.js +0 -496
  39. package/src/pages/employee/PropertyInfo.js +0 -489
  40. package/src/pages/employee/Review.js +0 -314
@@ -1,10 +1,11 @@
1
- import React, { useRef, useEffect, useMemo, useState, createContext, isValidElement, cloneElement, createElement, useContext, useCallback, useReducer, Fragment } from 'react';
1
+ import React, { useRef, useEffect, useMemo, useState, createContext, isValidElement, cloneElement, createElement, useContext, useCallback, useReducer, Fragment as Fragment$1 } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { useHistory, Link, useLocation, useRouteMatch, Switch, Route, Redirect } from 'react-router-dom';
4
- import { PersonIcon, EmployeeModuleCard, Loader, Card, InboxLinks, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Label, Tooltip, CardLabelError, InboxComposer, Toast, Modal, RadioButtons, CardHeader, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, ActionBar, LinkButton, EditIcon as EditIcon$1, FormStep, CardLabel, UploadFile, VerticalTimeline, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, ModuleLinksView, CitizenHomeCard, DocumentIcon } from '@djb25/digit-ui-react-components';
4
+ import { PersonIcon, EmployeeModuleCard, Loader, Card, InboxLinks, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Label, CustomTooltip, CardLabelError, InboxComposer, Toast, Modal, RadioButtons, CardHeader, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, ActionBar, LinkButton, EditIcon as EditIcon$1, FormStep, CardLabel, UploadFile, VerticalTimeline, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, ModuleLinksView, CitizenHomeCard, DocumentIcon } from '@djb25/digit-ui-react-components';
5
5
  import * as Chartjs from 'chart.js/auto';
6
6
  import Chartjs__default, { Chart } from 'chart.js/auto';
7
7
  import 'react-dom';
8
+ import { Chart as Chart$1, registerables } from 'chart.js';
8
9
 
9
10
  const EKYCCard = () => {
10
11
  const {
@@ -24,6 +25,9 @@ const EKYCCard = () => {
24
25
  }, {
25
26
  label: t("EKYC_INBOX"),
26
27
  link: `/digit-ui/employee/ekyc/inbox`
28
+ }, {
29
+ label: t("CEO_M.F_DOR_FINANCE_VIEW"),
30
+ link: `/digit-ui/employee/ekyc/ceo-dashboard`
27
31
  }, {
28
32
  label: t("EKYC_MAPPING"),
29
33
  link: `/digit-ui/employee/ekyc/mapping`
@@ -332,7 +336,7 @@ const DesktopInbox = ({
332
336
  }
333
337
  }], [t, parentRoute]);
334
338
  const tableData = useMemo(() => {
335
- return (data === null || data === void 0 ? void 0 : data.items) || [];
339
+ return (data === null || data === void 0 ? void 0 : data.items) || (Array.isArray(data) ? data : []);
336
340
  }, [data]);
337
341
  return /*#__PURE__*/React.createElement("div", {
338
342
  className: "app-container"
@@ -1080,7 +1084,7 @@ const SearchFormFieldsComponents = ({
1080
1084
  className: "mobile-input"
1081
1085
  }, /*#__PURE__*/React.createElement(Label, {
1082
1086
  className: "flex-roww flex-gap-2"
1083
- }, t("EKYC_K_NUMBER") || "K Number", /*#__PURE__*/React.createElement(Tooltip, {
1087
+ }, t("EKYC_K_NUMBER") || "K Number", /*#__PURE__*/React.createElement(CustomTooltip, {
1084
1088
  message: t("EKYC_K_NUMBER_MESSAGE")
1085
1089
  })), /*#__PURE__*/React.createElement(Controller, {
1086
1090
  name: "kNumber",
@@ -1180,13 +1184,14 @@ const Inbox = ({
1180
1184
  sla: 0
1181
1185
  };
1182
1186
  }
1187
+ const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
1183
1188
  return {
1184
1189
  ...item,
1185
1190
  applicationNo: item.kno || item.applicationNumber || "",
1186
- connectionNo: item.connectionNo || "",
1187
- owner: item.consumerName || item.citizenName || "",
1191
+ connectionNo: item.kno || "",
1192
+ owner: fullName || item.consumerName || item.citizenName || "",
1188
1193
  applicationNumber: item.kno || item.applicationNumber || "",
1189
- citizenName: item.consumerName || item.citizenName || "",
1194
+ citizenName: fullName || item.consumerName || item.citizenName || "",
1190
1195
  status: item.status || "",
1191
1196
  sla: item.sla ?? 0
1192
1197
  };
@@ -1195,7 +1200,7 @@ const Inbox = ({
1195
1200
  const totalRecords = (dashboardData === null || dashboardData === void 0 ? void 0 : (_dashboardData$dashbo2 = dashboardData.dashboardInfo) === null || _dashboardData$dashbo2 === void 0 ? void 0 : _dashboardData$dashbo2.totalRecords) || (dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.totalCount) || 0;
1196
1201
  const checkPathName = location.pathname.includes("ekyc/inbox");
1197
1202
  const PropsForInboxLinks = {
1198
- headerText: checkPathName ? "MODULE_WATER" : "MODULE_SW"
1203
+ headerText: checkPathName ? "EKYC_MODULE" : "MODULE_SW"
1199
1204
  };
1200
1205
  const SearchFormFields = useCallback(({
1201
1206
  registerRef,
@@ -1359,7 +1364,8 @@ const Inbox = ({
1359
1364
  PropsForInboxLinks
1360
1365
  }, propsForSearchForm, propsForFilterForm, {
1361
1366
  propsForInboxTable,
1362
- formState
1367
+ formState,
1368
+ countData: dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo
1363
1369
  })));
1364
1370
  };
1365
1371
 
@@ -2720,9 +2726,6 @@ const ActionButton = ({
2720
2726
  jumpTo,
2721
2727
  state
2722
2728
  }) => {
2723
- const {
2724
- t
2725
- } = useTranslation();
2726
2729
  const history = useHistory();
2727
2730
  function routeTo() {
2728
2731
  history.push(jumpTo, {
@@ -2733,13 +2736,15 @@ const ActionButton = ({
2733
2736
  return /*#__PURE__*/React.createElement(LinkButton, {
2734
2737
  label: /*#__PURE__*/React.createElement(EditIcon$1, {
2735
2738
  style: {
2736
- marginTop: "-30px",
2737
- float: "right",
2738
- position: "relative",
2739
- bottom: "32px"
2739
+ width: "20px",
2740
+ height: "20px",
2741
+ fill: "#F47738"
2740
2742
  }
2741
2743
  }),
2742
- className: "check-page-link-button",
2744
+ style: {
2745
+ margin: 0,
2746
+ padding: 0
2747
+ },
2743
2748
  onClick: routeTo
2744
2749
  });
2745
2750
  };
@@ -2747,16 +2752,145 @@ const checkForNA = value => value !== null && value !== undefined && value !== "
2747
2752
  const boolToYesNo = (value, t) => {
2748
2753
  if (value === true || value === "true" || String(value).toLowerCase() === "yes") return t("CORE_COMMON_YES");
2749
2754
  if (value === false || value === "false" || String(value).toLowerCase() === "no") return t("CORE_COMMON_NO");
2755
+ if (value === "true") return t("CORE_COMMON_YES");
2756
+ if (value === "false") return t("CORE_COMMON_NO");
2750
2757
  return "N/A";
2751
2758
  };
2752
- const extractActiveData = (searchData, flowState) => {
2759
+ const extractReviewData = (searchData, flowState) => {
2753
2760
  const rawData = searchData && Object.keys(searchData).length > 0 ? searchData : (flowState === null || flowState === void 0 ? void 0 : flowState.reviewData) || {};
2754
- const reviewWrapper = (rawData === null || rawData === void 0 ? void 0 : rawData.applicationReview) || rawData;
2761
+ const reviewWrapper = (rawData === null || rawData === void 0 ? void 0 : rawData.applicationReviewInfo) || (rawData === null || rawData === void 0 ? void 0 : rawData.applicationReview) || rawData;
2755
2762
  const applicationData = (Array.isArray(reviewWrapper) ? reviewWrapper[0] : reviewWrapper) || {};
2756
- return (applicationData === null || applicationData === void 0 ? void 0 : applicationData.newData) || applicationData;
2763
+ return {
2764
+ newData: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.newData) || applicationData,
2765
+ oldData: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.oldData) || null
2766
+ };
2767
+ };
2768
+ const ReviewSection = ({
2769
+ title,
2770
+ fields,
2771
+ newData,
2772
+ oldData,
2773
+ t,
2774
+ jumpTo,
2775
+ state
2776
+ }) => {
2777
+ return /*#__PURE__*/React.createElement("div", {
2778
+ className: "review-section-wrapper",
2779
+ style: {
2780
+ marginBottom: "48px",
2781
+ background: "#fff",
2782
+ borderRadius: "12px",
2783
+ border: "1px solid #EAECF0",
2784
+ overflow: "hidden"
2785
+ }
2786
+ }, /*#__PURE__*/React.createElement("div", {
2787
+ style: {
2788
+ padding: "20px 24px",
2789
+ background: "#F9FAFB",
2790
+ borderBottom: "1px solid #EAECF0",
2791
+ display: "flex",
2792
+ justifyContent: "space-between",
2793
+ alignItems: "center"
2794
+ }
2795
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
2796
+ style: {
2797
+ margin: 0,
2798
+ fontSize: "18px",
2799
+ color: "#101828",
2800
+ fontWeight: "700"
2801
+ }
2802
+ }, title), jumpTo && /*#__PURE__*/React.createElement(ActionButton, {
2803
+ jumpTo: jumpTo,
2804
+ state: state
2805
+ })), /*#__PURE__*/React.createElement("div", {
2806
+ style: {
2807
+ padding: "0 24px"
2808
+ }
2809
+ }, /*#__PURE__*/React.createElement("table", {
2810
+ style: {
2811
+ width: "100%",
2812
+ borderCollapse: "collapse",
2813
+ tableLayout: "fixed"
2814
+ }
2815
+ }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
2816
+ style: {
2817
+ padding: "16px 0",
2818
+ textAlign: "left",
2819
+ color: "#667085",
2820
+ fontSize: "12px",
2821
+ fontWeight: "600",
2822
+ textTransform: "uppercase",
2823
+ width: "30%"
2824
+ }
2825
+ }, t("EKYC_FIELD_NAME")), /*#__PURE__*/React.createElement("th", {
2826
+ style: {
2827
+ padding: "16px 0",
2828
+ textAlign: "left",
2829
+ color: "#667085",
2830
+ fontSize: "12px",
2831
+ fontWeight: "600",
2832
+ textTransform: "uppercase",
2833
+ width: "35%"
2834
+ }
2835
+ }, t("EKYC_EXISTING_INFORMATION")), /*#__PURE__*/React.createElement("th", {
2836
+ style: {
2837
+ padding: "16px 0",
2838
+ textAlign: "left",
2839
+ color: "#667085",
2840
+ fontSize: "12px",
2841
+ fontWeight: "600",
2842
+ textTransform: "uppercase",
2843
+ width: "35%"
2844
+ }
2845
+ }, t("EKYC_PROPOSED_UPDATES")))), /*#__PURE__*/React.createElement("tbody", null, fields.map((field, idx) => {
2846
+ const valNew = newData === null || newData === void 0 ? void 0 : newData[field.key];
2847
+ const valOld = oldData === null || oldData === void 0 ? void 0 : oldData[field.key];
2848
+ const isChanged = oldData && String(valNew) !== String(valOld) && valOld !== undefined && valOld !== null;
2849
+ return /*#__PURE__*/React.createElement("tr", {
2850
+ key: idx,
2851
+ style: {
2852
+ borderTop: "1px solid #F2F4F7"
2853
+ }
2854
+ }, /*#__PURE__*/React.createElement("td", {
2855
+ style: {
2856
+ padding: "16px 0",
2857
+ fontSize: "14px",
2858
+ color: "#344054",
2859
+ fontWeight: "500"
2860
+ }
2861
+ }, t(field.label)), /*#__PURE__*/React.createElement("td", {
2862
+ style: {
2863
+ padding: "16px 0",
2864
+ fontSize: "14px",
2865
+ color: "#667085"
2866
+ }
2867
+ }, field.isBool ? boolToYesNo(valOld, t) : checkForNA(valOld)), /*#__PURE__*/React.createElement("td", {
2868
+ style: {
2869
+ padding: "16px 0",
2870
+ fontSize: "14px",
2871
+ color: isChanged ? "#1B8B32" : "#101828",
2872
+ fontWeight: isChanged ? "700" : "400"
2873
+ }
2874
+ }, /*#__PURE__*/React.createElement("div", {
2875
+ style: {
2876
+ display: "flex",
2877
+ alignItems: "center",
2878
+ gap: "8px"
2879
+ }
2880
+ }, field.isBool ? boolToYesNo(valNew, t) : checkForNA(valNew), isChanged && /*#__PURE__*/React.createElement("span", {
2881
+ style: {
2882
+ background: "#ECFDF3",
2883
+ color: "#067647",
2884
+ padding: "2px 8px",
2885
+ borderRadius: "12px",
2886
+ fontSize: "10px",
2887
+ fontWeight: "600"
2888
+ }
2889
+ }, t("EKYC_CHANGED")))));
2890
+ })))));
2757
2891
  };
2758
2892
  const Review = () => {
2759
- var _editedProperty$conne, _editedProperty$conne2, _editedProperty$userT, _editedProperty$noOfF, _editedMeter$meterSta, _editedMeter$workingS, _editedMeter$lastBill;
2893
+ var _newDataRaw$connectio, _newDataRaw$connectio2, _newDataRaw$connectio3, _newDataRaw$address, _newDataRaw$address2, _newDataRaw$address3, _newDataRaw$address4, _newDataRaw$address5, _newDataRaw$address6, _newDataRaw$address7, _newDataRaw$address8, _newDataRaw$address9, _newDataRaw$address0, _newDataRaw$address1, _newDataRaw$address10, _newDataRaw$address11, _newDataRaw$address12, _newDataRaw$address13, _newDataRaw$address14, _newDataRaw$property, _newDataRaw$property2, _editedProperty$conne, _newDataRaw$property3, _editedProperty$conne2, _newDataRaw$property4, _editedProperty$userT, _newDataRaw$property5, _editedProperty$noOfF, _newDataRaw$property6, _newDataRaw$property7, _newDataRaw$meter, _editedMeter$meterSta, _newDataRaw$meter2, _newDataRaw$meter3, _newDataRaw$meter4, _newDataRaw$meter5, _editedMeter$workingS, _newDataRaw$meter6, _editedMeter$lastBill, _newDataRaw$meter7, _newDataRaw$meter8;
2760
2894
  const {
2761
2895
  t
2762
2896
  } = useTranslation();
@@ -2764,6 +2898,8 @@ const Review = () => {
2764
2898
  const location = useLocation();
2765
2899
  const [agree, setAgree] = useState(false);
2766
2900
  const [isSubmitting, setIsSubmitting] = useState(false);
2901
+ const [showPreview, setShowPreview] = useState(false);
2902
+ const [previewUrl, setPreviewUrl] = useState("");
2767
2903
  const flowState = location.state || {};
2768
2904
  const {
2769
2905
  kNumber,
@@ -2778,6 +2914,8 @@ const Review = () => {
2778
2914
  meterDetails: editedMeter = {}
2779
2915
  } = edits;
2780
2916
  const tenantId = Digit.ULBService.getCurrentTenantId();
2917
+ const workflowMutation = Digit.Hooks.ekyc.useEkycWorkflow(tenantId);
2918
+ const updateMutation = Digit.Hooks.ekyc.useEkycUpdate(tenantId);
2781
2919
  const {
2782
2920
  data: searchData,
2783
2921
  isLoading: isSearchLoading
@@ -2787,67 +2925,308 @@ const Review = () => {
2787
2925
  }, tenantId, {
2788
2926
  enabled: !!activeKno
2789
2927
  });
2790
- const activeData = extractActiveData(searchData, flowState);
2791
- const apiConn = (activeData === null || activeData === void 0 ? void 0 : activeData.connectionDetails) || activeData || {};
2792
- const apiAddr = (activeData === null || activeData === void 0 ? void 0 : activeData.addressDetails) || activeData || {};
2793
- const apiProp = (activeData === null || activeData === void 0 ? void 0 : activeData.propertyInfo) || activeData || {};
2794
- const apiMeter = (activeData === null || activeData === void 0 ? void 0 : activeData.meterDetails) || activeData || {};
2928
+ const {
2929
+ newData: apiNewData,
2930
+ oldData: apiOldData
2931
+ } = extractReviewData(searchData, flowState);
2932
+ const prepareConsolidatedData = data => {
2933
+ if (!data) return null;
2934
+ const apiConn = (data === null || data === void 0 ? void 0 : data.connectionDetails) || data || {};
2935
+ const apiAddr = (data === null || data === void 0 ? void 0 : data.addressDetails) || data || {};
2936
+ const apiProp = (data === null || data === void 0 ? void 0 : data.propertyInfo) || data || {};
2937
+ const apiMeter = (data === null || data === void 0 ? void 0 : data.meterDetails) || data || {};
2938
+ return {
2939
+ connection: {
2940
+ consumerName: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.consumerName) || (apiConn !== null && apiConn !== void 0 && apiConn.firstName ? [apiConn.firstName, apiConn.middleName, apiConn.lastName].filter(Boolean).join(" ") : null),
2941
+ address: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.address) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.addressRaw),
2942
+ connectionType: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.connectionType) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.connectionCategory),
2943
+ meterNumber: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.meterNumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.meterNo),
2944
+ phoneNumber: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.phoneNumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.mobileNo) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.mobileNumber),
2945
+ email: apiConn === null || apiConn === void 0 ? void 0 : apiConn.email,
2946
+ statusflag: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.statusflag) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.statusFlag),
2947
+ ekycStatus: apiConn === null || apiConn === void 0 ? void 0 : apiConn.ekycStatus,
2948
+ knumber: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.knumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.kno)
2949
+ },
2950
+ address: {
2951
+ fullAddress: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.fullAddress) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.addressRaw),
2952
+ flatHouseNumber: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.flatHouseNumber) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.flatNo),
2953
+ buildingTower: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.buildingTower) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.building),
2954
+ landmark: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.landmark,
2955
+ pinCode: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.pinCode) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.pincode),
2956
+ ward: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.ward) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.locality),
2957
+ assembly: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.assembly,
2958
+ gpsValid: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.gpsValid,
2959
+ latitude: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.latitude,
2960
+ longitude: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.longitude,
2961
+ mobileNo: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.mobileNo) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.mobileNumber),
2962
+ whatsappNo: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.whatsappNo,
2963
+ email: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.email,
2964
+ noOfPerson: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.noOfPerson) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.noOfPersons),
2965
+ knumber: (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.knumber) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.kno),
2966
+ doorPhotoFilestoreId: apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.doorPhotoFilestoreId
2967
+ },
2968
+ property: {
2969
+ kno: apiProp === null || apiProp === void 0 ? void 0 : apiProp.kno,
2970
+ pidNumber: apiProp === null || apiProp === void 0 ? void 0 : apiProp.pidNumber,
2971
+ typeOfConnection: apiProp === null || apiProp === void 0 ? void 0 : apiProp.typeOfConnection,
2972
+ connectionCategory: apiProp === null || apiProp === void 0 ? void 0 : apiProp.connectionCategory,
2973
+ userType: apiProp === null || apiProp === void 0 ? void 0 : apiProp.userType,
2974
+ numberOfFloors: (apiProp === null || apiProp === void 0 ? void 0 : apiProp.numberOfFloors) || (apiProp === null || apiProp === void 0 ? void 0 : apiProp.noOfFloor),
2975
+ tenantName: apiProp === null || apiProp === void 0 ? void 0 : apiProp.tenantName,
2976
+ tenantMobile: apiProp === null || apiProp === void 0 ? void 0 : apiProp.tenantMobile,
2977
+ ekycStatus: apiProp === null || apiProp === void 0 ? void 0 : apiProp.ekycStatus,
2978
+ propertyDocumentFileStoreId: apiProp === null || apiProp === void 0 ? void 0 : apiProp.propertyDocumentFileStoreId,
2979
+ buildingImageFileStoreId: apiProp === null || apiProp === void 0 ? void 0 : apiProp.buildingImageFileStoreId
2980
+ },
2981
+ meter: {
2982
+ kno: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.kno,
2983
+ metered: (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterStatus) === "METERED" || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.metered),
2984
+ meterNumber: (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterNumber) || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterNo),
2985
+ meterMake: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterMake,
2986
+ meterLocationAddress: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterLocationAddress,
2987
+ meterLatitude: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterLatitude,
2988
+ meterLongitude: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterLongitude,
2989
+ workingStatus: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.workingStatus,
2990
+ lastBillRaised: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.lastBillRaised,
2991
+ systemMeterId: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.systemMeterId,
2992
+ meterPhotoFileStoreId: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterPhotoFileStoreId
2993
+ }
2994
+ };
2995
+ };
2996
+ const newDataRaw = prepareConsolidatedData(apiNewData);
2997
+ const oldDataRaw = prepareConsolidatedData(apiOldData);
2795
2998
  const connectionData = {
2796
- consumerName: (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.name) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.consumerName),
2797
- address: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.address) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.addressRaw),
2798
- connectionType: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.connectionType) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.connectionCategory),
2799
- meterNumber: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.meterNumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.meterNo),
2800
- phoneNumber: (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.mobileNumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.phoneNumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.mobileNo),
2801
- email: apiConn === null || apiConn === void 0 ? void 0 : apiConn.email,
2802
- statusflag: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.statusflag) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.statusFlag),
2803
- ekycStatus: apiConn === null || apiConn === void 0 ? void 0 : apiConn.ekycStatus,
2804
- knumber: (apiConn === null || apiConn === void 0 ? void 0 : apiConn.knumber) || (apiConn === null || apiConn === void 0 ? void 0 : apiConn.kno) || activeKno
2999
+ ...(newDataRaw === null || newDataRaw === void 0 ? void 0 : newDataRaw.connection),
3000
+ consumerName: (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.name) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$connectio = newDataRaw.connection) === null || _newDataRaw$connectio === void 0 ? void 0 : _newDataRaw$connectio.consumerName),
3001
+ phoneNumber: (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.mobileNumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$connectio2 = newDataRaw.connection) === null || _newDataRaw$connectio2 === void 0 ? void 0 : _newDataRaw$connectio2.phoneNumber),
3002
+ knumber: (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$connectio3 = newDataRaw.connection) === null || _newDataRaw$connectio3 === void 0 ? void 0 : _newDataRaw$connectio3.knumber) || activeKno
2805
3003
  };
2806
3004
  const addressData = {
2807
- fullAddress: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.fullAddress) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.fullAddress) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.addressRaw),
2808
- flatHouseNumber: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.flatHouseNumber) || (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.flatNo) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.flatHouseNumber),
2809
- buildingTower: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.buildingTower) || (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.building) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.buildingTower),
2810
- landmark: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.landmark) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.landmark),
2811
- pinCode: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.pinCode) || (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.pincode) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.pinCode) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.pincode),
2812
- ward: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.ward) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.ward) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.locality),
2813
- assembly: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.assembly) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.assembly),
2814
- gpsValid: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.gpsValid) !== undefined ? editedAddress.gpsValid : apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.gpsValid,
2815
- latitude: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.latitude) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.latitude),
2816
- longitude: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.longitude) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.longitude),
2817
- mobileNo: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.mobileNo) || (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.mobileNumber) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.mobileNo),
2818
- whatsappNo: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.whatsappNo) || (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.whatsappNumber) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.whatsappNo),
2819
- email: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.email) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.email),
2820
- noOfPerson: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.noOfPerson) || (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.noOfPersons) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.noOfPerson),
2821
- knumber: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.knumber) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.knumber) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.kno) || activeKno,
2822
- doorPhotoFilestoreId: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.doorPhotoFileStoreId) || (apiAddr === null || apiAddr === void 0 ? void 0 : apiAddr.doorPhotoFilestoreId)
3005
+ ...(newDataRaw === null || newDataRaw === void 0 ? void 0 : newDataRaw.address),
3006
+ fullAddress: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.fullAddress) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address = newDataRaw.address) === null || _newDataRaw$address === void 0 ? void 0 : _newDataRaw$address.fullAddress),
3007
+ flatHouseNumber: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.flatHouseNumber) || (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.flatNo) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address2 = newDataRaw.address) === null || _newDataRaw$address2 === void 0 ? void 0 : _newDataRaw$address2.flatHouseNumber),
3008
+ buildingTower: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.buildingTower) || (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.building) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address3 = newDataRaw.address) === null || _newDataRaw$address3 === void 0 ? void 0 : _newDataRaw$address3.buildingTower),
3009
+ landmark: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.landmark) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address4 = newDataRaw.address) === null || _newDataRaw$address4 === void 0 ? void 0 : _newDataRaw$address4.landmark),
3010
+ pinCode: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.pinCode) || (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.pincode) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address5 = newDataRaw.address) === null || _newDataRaw$address5 === void 0 ? void 0 : _newDataRaw$address5.pinCode),
3011
+ ward: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.ward) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address6 = newDataRaw.address) === null || _newDataRaw$address6 === void 0 ? void 0 : _newDataRaw$address6.ward),
3012
+ assembly: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.assembly) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address7 = newDataRaw.address) === null || _newDataRaw$address7 === void 0 ? void 0 : _newDataRaw$address7.assembly),
3013
+ gpsValid: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.gpsValid) !== undefined ? editedAddress.gpsValid : newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address8 = newDataRaw.address) === null || _newDataRaw$address8 === void 0 ? void 0 : _newDataRaw$address8.gpsValid,
3014
+ latitude: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.latitude) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address9 = newDataRaw.address) === null || _newDataRaw$address9 === void 0 ? void 0 : _newDataRaw$address9.latitude),
3015
+ longitude: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.longitude) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address0 = newDataRaw.address) === null || _newDataRaw$address0 === void 0 ? void 0 : _newDataRaw$address0.longitude),
3016
+ mobileNo: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.mobileNo) || (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.mobileNumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address1 = newDataRaw.address) === null || _newDataRaw$address1 === void 0 ? void 0 : _newDataRaw$address1.mobileNo),
3017
+ whatsappNo: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.whatsappNo) || (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.whatsappNumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address10 = newDataRaw.address) === null || _newDataRaw$address10 === void 0 ? void 0 : _newDataRaw$address10.whatsappNo),
3018
+ email: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.email) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address11 = newDataRaw.address) === null || _newDataRaw$address11 === void 0 ? void 0 : _newDataRaw$address11.email),
3019
+ noOfPerson: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.noOfPerson) || (aadhaarData === null || aadhaarData === void 0 ? void 0 : aadhaarData.noOfPersons) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address12 = newDataRaw.address) === null || _newDataRaw$address12 === void 0 ? void 0 : _newDataRaw$address12.noOfPerson),
3020
+ knumber: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.knumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address13 = newDataRaw.address) === null || _newDataRaw$address13 === void 0 ? void 0 : _newDataRaw$address13.knumber) || activeKno,
3021
+ doorPhotoFilestoreId: (editedAddress === null || editedAddress === void 0 ? void 0 : editedAddress.doorPhotoFileStoreId) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$address14 = newDataRaw.address) === null || _newDataRaw$address14 === void 0 ? void 0 : _newDataRaw$address14.doorPhotoFilestoreId)
2823
3022
  };
2824
3023
  const propertyData = {
2825
- kno: (apiProp === null || apiProp === void 0 ? void 0 : apiProp.kno) || activeKno,
2826
- pidNumber: (editedProperty === null || editedProperty === void 0 ? void 0 : editedProperty.pidNumber) || (apiProp === null || apiProp === void 0 ? void 0 : apiProp.pidNumber),
2827
- typeOfConnection: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$conne = editedProperty.connectionTypeData) === null || _editedProperty$conne === void 0 ? void 0 : _editedProperty$conne.label) || (apiProp === null || apiProp === void 0 ? void 0 : apiProp.typeOfConnection),
2828
- connectionCategory: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$conne2 = editedProperty.connectionCategoryData) === null || _editedProperty$conne2 === void 0 ? void 0 : _editedProperty$conne2.label) || (apiProp === null || apiProp === void 0 ? void 0 : apiProp.connectionCategory),
2829
- userType: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$userT = editedProperty.userTypeData) === null || _editedProperty$userT === void 0 ? void 0 : _editedProperty$userT.label) || (apiProp === null || apiProp === void 0 ? void 0 : apiProp.userType),
2830
- numberOfFloors: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$noOfF = editedProperty.noOfFloorsData) === null || _editedProperty$noOfF === void 0 ? void 0 : _editedProperty$noOfF.label) || (apiProp === null || apiProp === void 0 ? void 0 : apiProp.numberOfFloors),
2831
- tenantName: apiProp === null || apiProp === void 0 ? void 0 : apiProp.tenantName,
2832
- tenantMobile: apiProp === null || apiProp === void 0 ? void 0 : apiProp.tenantMobile,
2833
- ekycStatus: apiProp === null || apiProp === void 0 ? void 0 : apiProp.ekycStatus,
2834
- propertyDocumentFileStoreId: (editedProperty === null || editedProperty === void 0 ? void 0 : editedProperty.propertyDocumentFileStoreId) || (apiProp === null || apiProp === void 0 ? void 0 : apiProp.propertyDocumentFileStoreId),
2835
- buildingImageFileStoreId: apiProp === null || apiProp === void 0 ? void 0 : apiProp.buildingImageFileStoreId
3024
+ ...(newDataRaw === null || newDataRaw === void 0 ? void 0 : newDataRaw.property),
3025
+ kno: (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property = newDataRaw.property) === null || _newDataRaw$property === void 0 ? void 0 : _newDataRaw$property.kno) || activeKno,
3026
+ pidNumber: (editedProperty === null || editedProperty === void 0 ? void 0 : editedProperty.pidNumber) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property2 = newDataRaw.property) === null || _newDataRaw$property2 === void 0 ? void 0 : _newDataRaw$property2.pidNumber),
3027
+ typeOfConnection: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$conne = editedProperty.connectionTypeData) === null || _editedProperty$conne === void 0 ? void 0 : _editedProperty$conne.label) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property3 = newDataRaw.property) === null || _newDataRaw$property3 === void 0 ? void 0 : _newDataRaw$property3.typeOfConnection),
3028
+ connectionCategory: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$conne2 = editedProperty.connectionCategoryData) === null || _editedProperty$conne2 === void 0 ? void 0 : _editedProperty$conne2.label) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property4 = newDataRaw.property) === null || _newDataRaw$property4 === void 0 ? void 0 : _newDataRaw$property4.connectionCategory),
3029
+ userType: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$userT = editedProperty.userTypeData) === null || _editedProperty$userT === void 0 ? void 0 : _editedProperty$userT.label) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property5 = newDataRaw.property) === null || _newDataRaw$property5 === void 0 ? void 0 : _newDataRaw$property5.userType),
3030
+ numberOfFloors: (editedProperty === null || editedProperty === void 0 ? void 0 : (_editedProperty$noOfF = editedProperty.noOfFloorsData) === null || _editedProperty$noOfF === void 0 ? void 0 : _editedProperty$noOfF.label) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property6 = newDataRaw.property) === null || _newDataRaw$property6 === void 0 ? void 0 : _newDataRaw$property6.numberOfFloors),
3031
+ propertyDocumentFileStoreId: (editedProperty === null || editedProperty === void 0 ? void 0 : editedProperty.propertyDocumentFileStoreId) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$property7 = newDataRaw.property) === null || _newDataRaw$property7 === void 0 ? void 0 : _newDataRaw$property7.propertyDocumentFileStoreId)
2836
3032
  };
2837
3033
  const meterData = {
2838
- kno: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.kno) || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.kno) || activeKno,
2839
- metered: (editedMeter === null || editedMeter === void 0 ? void 0 : (_editedMeter$meterSta = editedMeter.meterStatusData) === null || _editedMeter$meterSta === void 0 ? void 0 : _editedMeter$meterSta.value) === "Metered" || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.metered),
2840
- meterNumber: (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterNumber) || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterNo),
2841
- meterMake: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterMake) || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterMake),
2842
- meterLocationAddress: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterLocation) || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterLocationAddress),
2843
- meterLatitude: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterLatitude,
2844
- meterLongitude: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterLongitude,
2845
- workingStatus: (editedMeter === null || editedMeter === void 0 ? void 0 : (_editedMeter$workingS = editedMeter.workingStatusData) === null || _editedMeter$workingS === void 0 ? void 0 : _editedMeter$workingS.value) === "Working" || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.workingStatus),
2846
- lastBillRaised: (editedMeter === null || editedMeter === void 0 ? void 0 : (_editedMeter$lastBill = editedMeter.lastBillRaisedData) === null || _editedMeter$lastBill === void 0 ? void 0 : _editedMeter$lastBill.value) === "Yes" || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.lastBillRaised),
2847
- systemMeterId: apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.systemMeterId,
2848
- meterPhotoFileStoreId: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterPhotoFileStoreId) || (apiMeter === null || apiMeter === void 0 ? void 0 : apiMeter.meterPhotoFileStoreId)
3034
+ ...(newDataRaw === null || newDataRaw === void 0 ? void 0 : newDataRaw.meter),
3035
+ kno: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.kno) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter = newDataRaw.meter) === null || _newDataRaw$meter === void 0 ? void 0 : _newDataRaw$meter.kno) || activeKno,
3036
+ metered: (editedMeter === null || editedMeter === void 0 ? void 0 : (_editedMeter$meterSta = editedMeter.meterStatusData) === null || _editedMeter$meterSta === void 0 ? void 0 : _editedMeter$meterSta.value) === "Metered" || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter2 = newDataRaw.meter) === null || _newDataRaw$meter2 === void 0 ? void 0 : _newDataRaw$meter2.metered),
3037
+ meterNumber: newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter3 = newDataRaw.meter) === null || _newDataRaw$meter3 === void 0 ? void 0 : _newDataRaw$meter3.meterNumber,
3038
+ meterMake: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterMake) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter4 = newDataRaw.meter) === null || _newDataRaw$meter4 === void 0 ? void 0 : _newDataRaw$meter4.meterMake),
3039
+ meterLocationAddress: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterLocation) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter5 = newDataRaw.meter) === null || _newDataRaw$meter5 === void 0 ? void 0 : _newDataRaw$meter5.meterLocationAddress),
3040
+ workingStatus: (editedMeter === null || editedMeter === void 0 ? void 0 : (_editedMeter$workingS = editedMeter.workingStatusData) === null || _editedMeter$workingS === void 0 ? void 0 : _editedMeter$workingS.value) === "Working" || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter6 = newDataRaw.meter) === null || _newDataRaw$meter6 === void 0 ? void 0 : _newDataRaw$meter6.workingStatus),
3041
+ lastBillRaised: (editedMeter === null || editedMeter === void 0 ? void 0 : (_editedMeter$lastBill = editedMeter.lastBillRaisedData) === null || _editedMeter$lastBill === void 0 ? void 0 : _editedMeter$lastBill.value) === "Yes" || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter7 = newDataRaw.meter) === null || _newDataRaw$meter7 === void 0 ? void 0 : _newDataRaw$meter7.lastBillRaised),
3042
+ meterPhotoFileStoreId: (editedMeter === null || editedMeter === void 0 ? void 0 : editedMeter.meterPhotoFileStoreId) || (newDataRaw === null || newDataRaw === void 0 ? void 0 : (_newDataRaw$meter8 = newDataRaw.meter) === null || _newDataRaw$meter8 === void 0 ? void 0 : _newDataRaw$meter8.meterPhotoFileStoreId)
2849
3043
  };
3044
+ const connectionFields = [{
3045
+ label: "EKYC_K_NUMBER",
3046
+ key: "knumber"
3047
+ }, {
3048
+ label: "EKYC_CONSUMER_NAME",
3049
+ key: "consumerName"
3050
+ }, {
3051
+ label: "EKYC_ADDRESS",
3052
+ key: "address"
3053
+ }, {
3054
+ label: "EKYC_CONNECTION_TYPE",
3055
+ key: "connectionType"
3056
+ }, {
3057
+ label: "EKYC_METER_NO",
3058
+ key: "meterNumber"
3059
+ }, {
3060
+ label: "EKYC_MOBILE_NO",
3061
+ key: "phoneNumber"
3062
+ }, {
3063
+ label: "EKYC_EMAIL",
3064
+ key: "email"
3065
+ }, {
3066
+ label: "EKYC_STATUS_FLAG",
3067
+ key: "statusflag"
3068
+ }, {
3069
+ label: "EKYC_STATUS",
3070
+ key: "ekycStatus"
3071
+ }];
3072
+ const addressFields = [{
3073
+ label: "EKYC_FULL_ADDRESS",
3074
+ key: "fullAddress"
3075
+ }, {
3076
+ label: "EKYC_FLAT_HOUSE_NO",
3077
+ key: "flatHouseNumber"
3078
+ }, {
3079
+ label: "EKYC_BUILDING_TOWER",
3080
+ key: "buildingTower"
3081
+ }, {
3082
+ label: "EKYC_LANDMARK",
3083
+ key: "landmark"
3084
+ }, {
3085
+ label: "EKYC_PINCODE",
3086
+ key: "pinCode"
3087
+ }, {
3088
+ label: "EKYC_LOCALITY",
3089
+ key: "ward"
3090
+ }, {
3091
+ label: "EKYC_ASSEMBLY",
3092
+ key: "assembly"
3093
+ }, {
3094
+ label: "EKYC_GPS_VALID",
3095
+ key: "gpsValid",
3096
+ isBool: true
3097
+ }, {
3098
+ label: "EKYC_LATITUDE",
3099
+ key: "latitude"
3100
+ }, {
3101
+ label: "EKYC_LONGITUDE",
3102
+ key: "longitude"
3103
+ }, {
3104
+ label: "EKYC_MOBILE_NO",
3105
+ key: "mobileNo"
3106
+ }, {
3107
+ label: "EKYC_WHATSAPP_NO",
3108
+ key: "whatsappNo"
3109
+ }, {
3110
+ label: "EKYC_EMAIL",
3111
+ key: "email"
3112
+ }, {
3113
+ label: "EKYC_NO_OF_PERSONS",
3114
+ key: "noOfPerson"
3115
+ }, {
3116
+ label: "EKYC_K_NUMBER",
3117
+ key: "knumber"
3118
+ }];
3119
+ const propertyFields = [{
3120
+ label: "EKYC_CONNECTION_CATEGORY",
3121
+ key: "connectionCategory"
3122
+ }, {
3123
+ label: "EKYC_PID_NUMBER",
3124
+ key: "pidNumber"
3125
+ }, {
3126
+ label: "EKYC_TYPE_OF_CONNECTION",
3127
+ key: "typeOfConnection"
3128
+ }, {
3129
+ label: "EKYC_USER_TYPE",
3130
+ key: "userType"
3131
+ }, {
3132
+ label: "EKYC_FLOOR_COUNT",
3133
+ key: "numberOfFloors"
3134
+ }, {
3135
+ label: "EKYC_TENANT_NAME",
3136
+ key: "tenantName"
3137
+ }, {
3138
+ label: "EKYC_TENANT_MOBILE",
3139
+ key: "tenantMobile"
3140
+ }, {
3141
+ label: "EKYC_STATUS",
3142
+ key: "ekycStatus"
3143
+ }];
3144
+ const meterFields = [{
3145
+ label: "EKYC_METERED",
3146
+ key: "metered",
3147
+ isBool: true
3148
+ }, {
3149
+ label: "EKYC_METER_NO",
3150
+ key: "meterNumber"
3151
+ }, {
3152
+ label: "EKYC_METER_MAKE",
3153
+ key: "meterMake"
3154
+ }, {
3155
+ label: "EKYC_METER_LOCATION_ADDRESS",
3156
+ key: "meterLocationAddress"
3157
+ }, {
3158
+ label: "EKYC_METER_LATITUDE",
3159
+ key: "meterLatitude"
3160
+ }, {
3161
+ label: "EKYC_METER_LONGITUDE",
3162
+ key: "meterLongitude"
3163
+ }, {
3164
+ label: "EKYC_WORKING_STATUS",
3165
+ key: "workingStatus",
3166
+ isBool: true
3167
+ }, {
3168
+ label: "EKYC_LAST_BILL_RAISED",
3169
+ key: "lastBillRaised",
3170
+ isBool: true
3171
+ }, {
3172
+ label: "EKYC_SYSTEM_METER_ID",
3173
+ key: "systemMeterId"
3174
+ }];
2850
3175
  const handleDeclaration = () => setAgree(!agree);
3176
+ const handleReject = async () => {
3177
+ var _Digit$UserService$ge, _Digit$UserService$ge2, _Digit$UserService$ge3;
3178
+ const payload = {
3179
+ RequestInfo: {
3180
+ apiId: "Rainmaker",
3181
+ ver: "1.0",
3182
+ msgId: "message-id",
3183
+ authToken: (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.access_token
3184
+ },
3185
+ kno: activeKno,
3186
+ action: "REJECTED",
3187
+ remarks: "Application rejected by reviewer",
3188
+ reviewedBy: (_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : (_Digit$UserService$ge3 = _Digit$UserService$ge2.info) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.userName,
3189
+ role: "ZRO"
3190
+ };
3191
+ try {
3192
+ const result = await workflowMutation.mutateAsync(payload);
3193
+ if (result) {
3194
+ history.push("/digit-ui/employee/ekyc/response", {
3195
+ success: true,
3196
+ result
3197
+ });
3198
+ }
3199
+ } catch (err) {
3200
+ console.error("Reject Error:", err);
3201
+ }
3202
+ };
3203
+ const handleApprove = async () => {
3204
+ var _Digit$UserService$ge4, _Digit$UserService$ge5, _Digit$UserService$ge6;
3205
+ const payload = {
3206
+ RequestInfo: {
3207
+ apiId: "Rainmaker",
3208
+ ver: "1.0",
3209
+ msgId: "message-id",
3210
+ authToken: (_Digit$UserService$ge4 = Digit.UserService.getUser()) === null || _Digit$UserService$ge4 === void 0 ? void 0 : _Digit$UserService$ge4.access_token
3211
+ },
3212
+ kno: activeKno,
3213
+ action: "APPROVED",
3214
+ remarks: "All documents verified",
3215
+ reviewedBy: (_Digit$UserService$ge5 = Digit.UserService.getUser()) === null || _Digit$UserService$ge5 === void 0 ? void 0 : (_Digit$UserService$ge6 = _Digit$UserService$ge5.info) === null || _Digit$UserService$ge6 === void 0 ? void 0 : _Digit$UserService$ge6.userName,
3216
+ role: "ZRO"
3217
+ };
3218
+ try {
3219
+ const result = await workflowMutation.mutateAsync(payload);
3220
+ if (result) {
3221
+ history.push("/digit-ui/employee/ekyc/response", {
3222
+ success: true,
3223
+ result
3224
+ });
3225
+ }
3226
+ } catch (err) {
3227
+ console.error("Approve Error:", err);
3228
+ }
3229
+ };
2851
3230
  const handleFinalSubmit = async () => {
2852
3231
  setIsSubmitting(true);
2853
3232
  try {
@@ -2861,7 +3240,7 @@ const Review = () => {
2861
3240
  meterDetails: meterData
2862
3241
  }
2863
3242
  };
2864
- const result = await Digit.EkycService.application_update(payload, tenantId);
3243
+ const result = await updateMutation.mutateAsync(payload);
2865
3244
  if (result) {
2866
3245
  history.push("/digit-ui/employee/ekyc/response", {
2867
3246
  success: true,
@@ -2874,258 +3253,254 @@ const Review = () => {
2874
3253
  setIsSubmitting(false);
2875
3254
  }
2876
3255
  };
3256
+ const handleViewDocument = fileStoreId => {
3257
+ if (!fileStoreId) return;
3258
+ const documentUrl = `https://dev-djb.nitcon.in/filestore/v1/files/id?tenantId=dl.djb&fileStoreId=${fileStoreId}`;
3259
+ setPreviewUrl(documentUrl);
3260
+ setShowPreview(true);
3261
+ };
2877
3262
  if (isSearchLoading || isSubmitting) return /*#__PURE__*/React.createElement(Loader, null);
2878
3263
  const baseUrl = "/digit-ui/employee/ekyc";
2879
3264
  return /*#__PURE__*/React.createElement("div", {
2880
- className: "review-container"
2881
- }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
3265
+ className: "employeeCard overflow-y-scroll"
3266
+ }, /*#__PURE__*/React.createElement(Card, {
3267
+ style: {
3268
+ padding: "32px"
3269
+ }
3270
+ }, /*#__PURE__*/React.createElement("div", {
2882
3271
  style: {
2883
3272
  display: "flex",
2884
3273
  justifyContent: "space-between",
2885
3274
  alignItems: "center",
2886
- marginBottom: "20px"
3275
+ marginBottom: "40px",
3276
+ borderBottom: "1px solid #EAECF0",
3277
+ paddingBottom: "20px"
2887
3278
  }
2888
3279
  }, /*#__PURE__*/React.createElement(CardHeader, {
2889
3280
  style: {
2890
- margin: 0
3281
+ margin: 0,
3282
+ fontSize: "28px"
2891
3283
  }
2892
3284
  }, t("EKYC_REVIEW_APPLICATION")), /*#__PURE__*/React.createElement("div", {
2893
3285
  style: {
2894
3286
  background: "#F9FAFB",
2895
- border: "0.5px solid #EAECF0",
2896
- borderRadius: "20px",
2897
- padding: "4px 14px",
2898
- fontSize: "12px",
2899
- color: "#667085"
3287
+ border: "1px solid #EAECF0",
3288
+ borderRadius: "24px",
3289
+ padding: "8px 20px",
3290
+ fontSize: "14px",
3291
+ color: "#475467",
3292
+ fontWeight: "500"
2900
3293
  }
2901
3294
  }, t("EKYC_K_NUMBER"), ": ", /*#__PURE__*/React.createElement("span", {
2902
3295
  style: {
2903
- color: "#0B0C0C",
2904
- fontWeight: "600"
2905
- }
2906
- }, activeKno))), /*#__PURE__*/React.createElement(CardSubHeader, null, t("EKYC_CONNECTION_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
2907
- style: {
2908
- marginTop: "20px",
2909
- marginBottom: "30px"
2910
- }
2911
- }, /*#__PURE__*/React.createElement(Row, {
2912
- label: t("EKYC_K_NUMBER"),
2913
- text: checkForNA(connectionData.knumber)
2914
- }), /*#__PURE__*/React.createElement(Row, {
2915
- label: t("EKYC_CONSUMER_NAME"),
2916
- text: checkForNA(connectionData.consumerName)
2917
- }), /*#__PURE__*/React.createElement(Row, {
2918
- label: t("EKYC_ADDRESS"),
2919
- text: checkForNA(connectionData.address)
2920
- }), /*#__PURE__*/React.createElement(Row, {
2921
- label: t("EKYC_CONNECTION_TYPE"),
2922
- text: checkForNA(connectionData.connectionType)
2923
- }), /*#__PURE__*/React.createElement(Row, {
2924
- label: t("EKYC_METER_NO"),
2925
- text: checkForNA(connectionData.meterNumber)
2926
- }), /*#__PURE__*/React.createElement(Row, {
2927
- label: t("EKYC_MOBILE_NO"),
2928
- text: checkForNA(connectionData.phoneNumber)
2929
- }), /*#__PURE__*/React.createElement(Row, {
2930
- label: t("EKYC_EMAIL"),
2931
- text: checkForNA(connectionData.email)
2932
- }), /*#__PURE__*/React.createElement(Row, {
2933
- label: t("EKYC_STATUS_FLAG"),
2934
- text: checkForNA(connectionData.statusflag)
2935
- }), /*#__PURE__*/React.createElement(Row, {
2936
- label: t("EKYC_STATUS"),
2937
- text: checkForNA(connectionData.ekycStatus)
2938
- })), /*#__PURE__*/React.createElement(CardSubHeader, null, t("EKYC_ADDRESS_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
2939
- style: {
2940
- marginTop: "20px",
2941
- marginBottom: "30px"
3296
+ color: "#101828",
3297
+ fontWeight: "700"
3298
+ }
3299
+ }, activeKno))), /*#__PURE__*/React.createElement(ReviewSection, {
3300
+ title: t("EKYC_CONNECTION_DETAILS"),
3301
+ fields: connectionFields,
3302
+ newData: connectionData,
3303
+ oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.connection,
3304
+ t: t,
3305
+ jumpTo: `${baseUrl}/consumer-details`,
3306
+ state: {
3307
+ ...flowState,
3308
+ reviewData: searchData,
3309
+ edits
3310
+ }
3311
+ }), /*#__PURE__*/React.createElement(ReviewSection, {
3312
+ title: t("EKYC_ADDRESS_DETAILS"),
3313
+ fields: addressFields,
3314
+ newData: addressData,
3315
+ oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.address,
3316
+ t: t,
3317
+ jumpTo: `${baseUrl}/address-details`,
3318
+ state: {
3319
+ ...flowState,
3320
+ reviewData: searchData,
3321
+ edits
3322
+ }
3323
+ }), /*#__PURE__*/React.createElement(ReviewSection, {
3324
+ title: t("EKYC_PROPERTY_INFO"),
3325
+ fields: propertyFields,
3326
+ newData: propertyData,
3327
+ oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.property,
3328
+ t: t,
3329
+ jumpTo: `${baseUrl}/property-info`,
3330
+ state: {
3331
+ ...flowState,
3332
+ reviewData: searchData,
3333
+ edits
3334
+ }
3335
+ }), /*#__PURE__*/React.createElement(ReviewSection, {
3336
+ title: t("EKYC_METER_DETAILS"),
3337
+ fields: meterFields,
3338
+ newData: meterData,
3339
+ oldData: oldDataRaw === null || oldDataRaw === void 0 ? void 0 : oldDataRaw.meter,
3340
+ t: t,
3341
+ jumpTo: `${baseUrl}/meter-details`,
3342
+ state: {
3343
+ ...flowState,
3344
+ reviewData: searchData,
3345
+ edits
2942
3346
  }
2943
- }, /*#__PURE__*/React.createElement(Row, {
2944
- label: t("EKYC_FULL_ADDRESS"),
2945
- text: checkForNA(addressData.fullAddress),
2946
- actionButton: /*#__PURE__*/React.createElement(ActionButton, {
2947
- jumpTo: `${baseUrl}/address-details`,
2948
- state: {
2949
- ...flowState,
2950
- reviewData: searchData,
2951
- edits
2952
- }
2953
- })
2954
- }), /*#__PURE__*/React.createElement(Row, {
2955
- label: t("EKYC_FLAT_HOUSE_NO"),
2956
- text: checkForNA(addressData.flatHouseNumber)
2957
- }), /*#__PURE__*/React.createElement(Row, {
2958
- label: t("EKYC_BUILDING_TOWER"),
2959
- text: checkForNA(addressData.buildingTower)
2960
- }), /*#__PURE__*/React.createElement(Row, {
2961
- label: t("EKYC_LANDMARK"),
2962
- text: checkForNA(addressData.landmark)
2963
- }), /*#__PURE__*/React.createElement(Row, {
2964
- label: t("EKYC_PINCODE"),
2965
- text: checkForNA(addressData.pinCode)
2966
- }), /*#__PURE__*/React.createElement(Row, {
2967
- label: t("EKYC_LOCALITY"),
2968
- text: checkForNA(addressData.ward)
2969
- }), /*#__PURE__*/React.createElement(Row, {
2970
- label: t("EKYC_ASSEMBLY"),
2971
- text: checkForNA(addressData.assembly)
2972
- }), /*#__PURE__*/React.createElement(Row, {
2973
- label: t("EKYC_GPS_VALID"),
2974
- text: boolToYesNo(addressData.gpsValid, t)
2975
- }), /*#__PURE__*/React.createElement(Row, {
2976
- label: t("EKYC_LATITUDE"),
2977
- text: checkForNA(addressData.latitude)
2978
- }), /*#__PURE__*/React.createElement(Row, {
2979
- label: t("EKYC_LONGITUDE"),
2980
- text: checkForNA(addressData.longitude)
2981
- }), /*#__PURE__*/React.createElement(Row, {
2982
- label: t("EKYC_MOBILE_NO"),
2983
- text: checkForNA(addressData.mobileNo)
2984
- }), /*#__PURE__*/React.createElement(Row, {
2985
- label: t("EKYC_WHATSAPP_NO"),
2986
- text: checkForNA(addressData.whatsappNo)
2987
- }), /*#__PURE__*/React.createElement(Row, {
2988
- label: t("EKYC_EMAIL"),
2989
- text: checkForNA(addressData.email)
2990
- }), /*#__PURE__*/React.createElement(Row, {
2991
- label: t("EKYC_NO_OF_PERSONS"),
2992
- text: checkForNA(addressData.noOfPerson)
2993
- }), /*#__PURE__*/React.createElement(Row, {
2994
- label: t("EKYC_K_NUMBER"),
2995
- text: checkForNA(addressData.knumber)
2996
- })), /*#__PURE__*/React.createElement(CardSubHeader, null, t("EKYC_PROPERTY_INFO")), /*#__PURE__*/React.createElement(StatusTable, {
3347
+ }), /*#__PURE__*/React.createElement("div", {
2997
3348
  style: {
2998
- marginTop: "20px",
2999
- marginBottom: "30px"
3349
+ marginTop: "40px"
3000
3350
  }
3001
- }, /*#__PURE__*/React.createElement(Row, {
3002
- label: t("EKYC_CONNECTION_CATEGORY"),
3003
- text: checkForNA(propertyData.connectionCategory),
3004
- actionButton: /*#__PURE__*/React.createElement(ActionButton, {
3005
- jumpTo: `${baseUrl}/property-info`,
3006
- state: {
3007
- ...flowState,
3008
- reviewData: searchData,
3009
- edits
3010
- }
3011
- })
3012
- }), /*#__PURE__*/React.createElement(Row, {
3013
- label: t("EKYC_PID_NUMBER"),
3014
- text: checkForNA(propertyData.pidNumber)
3015
- }), /*#__PURE__*/React.createElement(Row, {
3016
- label: t("EKYC_TYPE_OF_CONNECTION"),
3017
- text: checkForNA(propertyData.typeOfConnection)
3018
- }), /*#__PURE__*/React.createElement(Row, {
3019
- label: t("EKYC_USER_TYPE"),
3020
- text: checkForNA(propertyData.userType)
3021
- }), /*#__PURE__*/React.createElement(Row, {
3022
- label: t("EKYC_FLOOR_COUNT"),
3023
- text: checkForNA(propertyData.numberOfFloors)
3024
- }), /*#__PURE__*/React.createElement(Row, {
3025
- label: t("EKYC_TENANT_NAME"),
3026
- text: checkForNA(propertyData.tenantName)
3027
- }), /*#__PURE__*/React.createElement(Row, {
3028
- label: t("EKYC_TENANT_MOBILE"),
3029
- text: checkForNA(propertyData.tenantMobile)
3030
- }), /*#__PURE__*/React.createElement(Row, {
3031
- label: t("EKYC_STATUS"),
3032
- text: checkForNA(propertyData.ekycStatus)
3033
- })), /*#__PURE__*/React.createElement(CardSubHeader, null, t("EKYC_METER_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
3351
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
3034
3352
  style: {
3035
- marginTop: "20px",
3036
- marginBottom: "30px"
3353
+ marginBottom: "20px"
3037
3354
  }
3038
- }, /*#__PURE__*/React.createElement(Row, {
3039
- label: t("EKYC_METERED"),
3040
- text: boolToYesNo(meterData.metered, t),
3041
- actionButton: /*#__PURE__*/React.createElement(ActionButton, {
3042
- jumpTo: `${baseUrl}/meter-details`,
3043
- state: {
3044
- ...flowState,
3045
- reviewData: searchData,
3046
- edits
3047
- }
3048
- })
3049
- }), /*#__PURE__*/React.createElement(Row, {
3050
- label: t("EKYC_METER_NO"),
3051
- text: checkForNA(meterData.meterNumber)
3052
- }), /*#__PURE__*/React.createElement(Row, {
3053
- label: t("EKYC_METER_MAKE"),
3054
- text: checkForNA(meterData.meterMake)
3055
- }), /*#__PURE__*/React.createElement(Row, {
3056
- label: t("EKYC_METER_LOCATION_ADDRESS"),
3057
- text: checkForNA(meterData.meterLocationAddress)
3058
- }), /*#__PURE__*/React.createElement(Row, {
3059
- label: t("EKYC_METER_LATITUDE"),
3060
- text: checkForNA(meterData.meterLatitude)
3061
- }), /*#__PURE__*/React.createElement(Row, {
3062
- label: t("EKYC_METER_LONGITUDE"),
3063
- text: checkForNA(meterData.meterLongitude)
3064
- }), /*#__PURE__*/React.createElement(Row, {
3065
- label: t("EKYC_WORKING_STATUS"),
3066
- text: boolToYesNo(meterData.workingStatus, t)
3067
- }), /*#__PURE__*/React.createElement(Row, {
3068
- label: t("EKYC_LAST_BILL_RAISED"),
3069
- text: boolToYesNo(meterData.lastBillRaised, t)
3070
- }), /*#__PURE__*/React.createElement(Row, {
3071
- label: t("EKYC_SYSTEM_METER_ID"),
3072
- text: checkForNA(meterData.systemMeterId)
3073
- })), /*#__PURE__*/React.createElement(CardSubHeader, null, t("EKYC_DOCUMENTS")), /*#__PURE__*/React.createElement(StatusTable, {
3355
+ }, t("EKYC_DOCUMENTS")), /*#__PURE__*/React.createElement(StatusTable, {
3074
3356
  style: {
3075
- marginTop: "20px",
3076
- marginBottom: "30px"
3357
+ maxWidth: "600px"
3077
3358
  }
3078
3359
  }, /*#__PURE__*/React.createElement(Row, {
3079
3360
  label: t("EKYC_DOOR_PHOTO"),
3080
3361
  text: addressData.doorPhotoFilestoreId ? t("EKYC_PHOTO_AVAILABLE") : t("CS_NA"),
3081
- actionButton: addressData.doorPhotoFilestoreId && /*#__PURE__*/React.createElement(GenericFileIcon, {
3362
+ actionButton: addressData.doorPhotoFilestoreId && /*#__PURE__*/React.createElement("div", {
3363
+ onClick: () => handleViewDocument(addressData.doorPhotoFilestoreId)
3364
+ }, /*#__PURE__*/React.createElement(GenericFileIcon, {
3082
3365
  style: {
3083
- cursor: "pointer"
3366
+ cursor: "pointer",
3367
+ fill: "#F47738"
3084
3368
  }
3085
- })
3369
+ }))
3086
3370
  }), /*#__PURE__*/React.createElement(Row, {
3087
3371
  label: t("EKYC_METER_PHOTO"),
3088
3372
  text: meterData.meterPhotoFileStoreId ? t("EKYC_PHOTO_AVAILABLE") : t("CS_NA"),
3089
- actionButton: meterData.meterPhotoFileStoreId && /*#__PURE__*/React.createElement(GenericFileIcon, {
3373
+ actionButton: meterData.meterPhotoFileStoreId && /*#__PURE__*/React.createElement("div", {
3374
+ onClick: () => handleViewDocument(meterData.meterPhotoFileStoreId)
3375
+ }, /*#__PURE__*/React.createElement(GenericFileIcon, {
3090
3376
  style: {
3091
- cursor: "pointer"
3377
+ cursor: "pointer",
3378
+ fill: "#F47738"
3092
3379
  }
3093
- })
3380
+ }))
3094
3381
  }), /*#__PURE__*/React.createElement(Row, {
3095
3382
  label: t("EKYC_BUILDING_IMAGE"),
3096
3383
  text: propertyData.buildingImageFileStoreId ? t("EKYC_PHOTO_AVAILABLE") : t("CS_NA"),
3097
- actionButton: propertyData.buildingImageFileStoreId && /*#__PURE__*/React.createElement(GenericFileIcon, {
3384
+ actionButton: propertyData.buildingImageFileStoreId && /*#__PURE__*/React.createElement("div", {
3385
+ onClick: () => handleViewDocument(propertyData.buildingImageFileStoreId)
3386
+ }, /*#__PURE__*/React.createElement(GenericFileIcon, {
3098
3387
  style: {
3099
- cursor: "pointer"
3388
+ cursor: "pointer",
3389
+ fill: "#F47738"
3100
3390
  }
3101
- })
3391
+ }))
3102
3392
  }), /*#__PURE__*/React.createElement(Row, {
3103
3393
  label: t("EKYC_PROPERTY_DOCUMENTS"),
3104
3394
  text: propertyData.propertyDocumentFileStoreId ? t("EKYC_DOCS_AVAILABLE") : t("CS_NA"),
3105
- actionButton: propertyData.propertyDocumentFileStoreId && /*#__PURE__*/React.createElement(GenericFileIcon, {
3395
+ actionButton: propertyData.propertyDocumentFileStoreId && /*#__PURE__*/React.createElement("div", {
3396
+ onClick: () => handleViewDocument(propertyData.propertyDocumentFileStoreId)
3397
+ }, /*#__PURE__*/React.createElement(GenericFileIcon, {
3106
3398
  style: {
3107
- cursor: "pointer"
3399
+ cursor: "pointer",
3400
+ fill: "#F47738"
3108
3401
  }
3109
- })
3110
- })), /*#__PURE__*/React.createElement(CheckBox, {
3402
+ }))
3403
+ }))), /*#__PURE__*/React.createElement("div", {
3404
+ style: {
3405
+ marginTop: "40px",
3406
+ paddingTop: "30px",
3407
+ borderTop: "1px solid #EAECF0"
3408
+ }
3409
+ }, /*#__PURE__*/React.createElement(CheckBox, {
3111
3410
  id: "agreeDeclaration",
3112
3411
  name: "agreeDeclaration",
3113
- label: t("EKYC_FINAL_DECLARATION"),
3412
+ label: /*#__PURE__*/React.createElement("span", {
3413
+ style: {
3414
+ fontSize: "16px",
3415
+ color: "#344054"
3416
+ }
3417
+ }, t("EKYC_FINAL_DECLARATION")),
3114
3418
  onChange: handleDeclaration,
3115
- checked: agree,
3116
- style: {
3117
- marginTop: "20px"
3118
- }
3119
- })), /*#__PURE__*/React.createElement(ActionBar, {
3419
+ checked: agree
3420
+ }))), /*#__PURE__*/React.createElement(ActionBar, {
3120
3421
  style: {
3121
3422
  position: "static",
3122
- marginTop: "24px"
3423
+ marginTop: "32px",
3424
+ display: "flex",
3425
+ justifyContent: "flex-end"
3123
3426
  }
3124
3427
  }, /*#__PURE__*/React.createElement(SubmitBar, {
3428
+ label: t("EKYC_REJECT"),
3429
+ onSubmit: handleReject,
3430
+ disabled: !agree
3431
+ }), /*#__PURE__*/React.createElement(SubmitBar, {
3432
+ label: t("EKYC_APPROVE"),
3433
+ onSubmit: handleApprove,
3434
+ disabled: !agree
3435
+ }), /*#__PURE__*/React.createElement(SubmitBar, {
3125
3436
  label: t("EKYC_SUBMIT_APPLICATION"),
3126
3437
  onSubmit: handleFinalSubmit,
3127
3438
  disabled: !agree
3128
- })));
3439
+ })), showPreview && /*#__PURE__*/React.createElement("div", {
3440
+ style: {
3441
+ position: "fixed",
3442
+ top: 0,
3443
+ left: 0,
3444
+ width: "100%",
3445
+ height: "100%",
3446
+ backgroundColor: "rgba(0,0,0,0.7)",
3447
+ display: "flex",
3448
+ justifyContent: "center",
3449
+ alignItems: "center",
3450
+ zIndex: 10000
3451
+ }
3452
+ }, /*#__PURE__*/React.createElement("div", {
3453
+ style: {
3454
+ position: "relative",
3455
+ backgroundColor: "#fff",
3456
+ padding: "30px",
3457
+ borderRadius: "12px",
3458
+ maxWidth: "600px",
3459
+ width: "100%",
3460
+ maxHeight: "70vh",
3461
+ overflow: "auto",
3462
+ boxShadow: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)"
3463
+ }
3464
+ }, /*#__PURE__*/React.createElement("div", {
3465
+ onClick: () => setShowPreview(false),
3466
+ style: {
3467
+ position: "absolute",
3468
+ top: "10px",
3469
+ right: "10px",
3470
+ cursor: "pointer",
3471
+ fontWeight: "bold",
3472
+ fontSize: "20px",
3473
+ color: "#333",
3474
+ background: "#eee",
3475
+ width: "30px",
3476
+ height: "30px",
3477
+ display: "flex",
3478
+ justifyContent: "center",
3479
+ alignItems: "center",
3480
+ borderRadius: "50%"
3481
+ }
3482
+ }, "\xD7"), /*#__PURE__*/React.createElement("img", {
3483
+ src: previewUrl,
3484
+ alt: "Document Preview",
3485
+ style: {
3486
+ maxWidth: "100%",
3487
+ height: "auto",
3488
+ display: "block"
3489
+ },
3490
+ onError: e => {
3491
+ e.target.style.display = "none";
3492
+ e.target.nextSibling.style.display = "block";
3493
+ }
3494
+ }), /*#__PURE__*/React.createElement("div", {
3495
+ style: {
3496
+ display: "none",
3497
+ padding: "40px",
3498
+ textAlign: "center"
3499
+ }
3500
+ }, /*#__PURE__*/React.createElement("p", null, t("EKYC_DOCUMENT_PREVIEW_NOT_AVAILABLE")), /*#__PURE__*/React.createElement(LinkButton, {
3501
+ label: t("EKYC_OPEN_IN_NEW_TAB"),
3502
+ onClick: () => window.open(previewUrl, "_blank")
3503
+ })))));
3129
3504
  };
3130
3505
 
3131
3506
  var QueryClientContext = function () {
@@ -3149,41 +3524,117 @@ var useQueryClient = function useQueryClient() {
3149
3524
 
3150
3525
  const AadhaarVerification = ({
3151
3526
  config,
3152
- onSelect
3527
+ onSelect,
3528
+ formData
3153
3529
  }) => {
3154
- const [kno, setKno] = useState("");
3155
- const [consumerType, setConsumerType] = useState(null);
3156
- const [occupantType, setOccupantType] = useState(null);
3157
- const [categoryType, setCategoryType] = useState(null);
3158
- const [consumerName, setConsumerName] = useState("");
3159
- const [firstName, setFirstName] = useState("");
3160
- const [middleName, setMiddleName] = useState("");
3161
- const [lastName, setLastName] = useState("");
3162
- const [gender, setGender] = useState(null);
3163
- const [relation, setRelation] = useState("");
3164
- const [mobile, setMobile] = useState("");
3165
- const [whatsapp, setWhatsapp] = useState("");
3166
- const [email, setEmail] = useState("");
3167
- const [residents, setResidents] = useState("");
3168
- const [documentProof, setDocumentProof] = useState(null);
3169
- const [documentId, setDocumentId] = useState(null);
3170
- const [ownerMobile, setOwnerMobile] = useState("");
3171
- const [tenantVerification, setTenantVerification] = useState("");
3172
- const [designation, setDesignation] = useState("");
3173
- const [department, setDepartment] = useState("");
3174
- const [employeeId, setEmployeeId] = useState("");
3175
- const [landline, setLandline] = useState("");
3176
- const [entityRelation, setEntityRelation] = useState("");
3177
- const [contactPerson, setContactPerson] = useState("");
3178
- const [entityName, setEntityName] = useState("");
3179
- const [idProof, setIdProof] = useState(null);
3180
- const [idNumber, setIdNumber] = useState("");
3181
- const [idFile, setIdFile] = useState(null);
3182
- const [consent, setConsent] = useState(false);
3183
- const [informantIsConsumer, setInformantIsConsumer] = useState(true);
3184
- const [informantName, setInformantName] = useState("");
3185
- const [informantRelation, setInformantRelation] = useState("");
3530
+ const location = useLocation();
3531
+ const flowState = location.state || {};
3532
+ const tenantId = Digit.ULBService.getCurrentTenantId();
3533
+ const searchKno = (flowState === null || flowState === void 0 ? void 0 : flowState.kNumber) || (flowState === null || flowState === void 0 ? void 0 : flowState.kno) || (formData === null || formData === void 0 ? void 0 : formData.kNumber) || (formData === null || formData === void 0 ? void 0 : formData.kno) || sessionStorage.getItem("EKYC_K_NUMBER");
3534
+ const {
3535
+ isLoading,
3536
+ data: searchData
3537
+ } = Digit.Hooks.ekyc.useSearchConnection({
3538
+ tenantId,
3539
+ details: {
3540
+ kno: searchKno
3541
+ }
3542
+ }, {
3543
+ enabled: !!searchKno,
3544
+ cacheTime: 0
3545
+ });
3546
+ const updateMutation = Digit.Hooks.ekyc.useEkycUpdate(tenantId);
3547
+ const savedData = (formData === null || formData === void 0 ? void 0 : formData.aadhaarVerification) || {};
3548
+ const [kno, setKno] = useState(savedData.kno || searchKno || "");
3549
+ const [consumerType, setConsumerType] = useState(savedData.consumerType ? {
3550
+ name: savedData.consumerType
3551
+ } : null);
3552
+ const [occupantType, setOccupantType] = useState(savedData.occupantType ? {
3553
+ name: savedData.occupantType
3554
+ } : null);
3555
+ const [categoryType, setCategoryType] = useState(savedData.categoryType ? {
3556
+ name: savedData.categoryType
3557
+ } : null);
3558
+ const [consumerName, setConsumerName] = useState(savedData.consumerName || "");
3559
+ const [firstName, setFirstName] = useState(savedData.firstName || "");
3560
+ const [middleName, setMiddleName] = useState(savedData.middleName || "");
3561
+ const [lastName, setLastName] = useState(savedData.lastName || "");
3562
+ const [gender, setGender] = useState(savedData.gender ? {
3563
+ name: savedData.gender
3564
+ } : null);
3565
+ const [parentSpouseName, setParentSpouseName] = useState(savedData.parentSpouseName || "");
3566
+ const [relation, setRelation] = useState(savedData.relation || "");
3567
+ const [mobile, setMobile] = useState(savedData.mobile || "");
3568
+ const [whatsapp, setWhatsapp] = useState(savedData.whatsapp || "");
3569
+ const [email, setEmail] = useState(savedData.email || "");
3570
+ const [residents, setResidents] = useState(savedData.residents || "");
3571
+ const [documentProof, setDocumentProof] = useState(savedData.documentProof || null);
3572
+ const [documentId, setDocumentId] = useState(savedData.documentId || null);
3573
+ const [ownerMobile, setOwnerMobile] = useState(savedData.ownerMobile || "");
3574
+ const [tenantVerification, setTenantVerification] = useState(savedData.tenantVerification || "");
3575
+ const [designation, setDesignation] = useState(savedData.designation || "");
3576
+ const [department, setDepartment] = useState(savedData.department || "");
3577
+ const [employeeId, setEmployeeId] = useState(savedData.employeeId || "");
3578
+ const [landline, setLandline] = useState(savedData.landline || "");
3579
+ const [entityRelation, setEntityRelation] = useState(savedData.entityRelation || "");
3580
+ const [contactPerson, setContactPerson] = useState(savedData.contactPerson || "");
3581
+ const [entityName, setEntityName] = useState(savedData.entityName || "");
3582
+ const [idProof, setIdProof] = useState(savedData.idProof ? {
3583
+ name: savedData.idProof
3584
+ } : null);
3585
+ const [idNumber, setIdNumber] = useState(savedData.idNumber || "");
3586
+ const [documentNumber, setDocumentNumber] = useState(savedData.documentNumber || "");
3587
+ const [identityType, setIdentityType] = useState(savedData.identityType ? {
3588
+ name: savedData.identityType
3589
+ } : null);
3590
+ const [idFile, setIdFile] = useState(savedData.idFile || null);
3591
+ const [consent, setConsent] = useState(savedData.consent || false);
3592
+ const [informantIsConsumer, setInformantIsConsumer] = useState(savedData.informantIsConsumer ?? true);
3593
+ const [informantName, setInformantName] = useState(savedData.informantName || "");
3594
+ const [informantRelation, setInformantRelation] = useState(savedData.informantRelation || "");
3186
3595
  const [toast, setToast] = useState(null);
3596
+ useEffect(() => {
3597
+ const rawData = searchData || (formData === null || formData === void 0 ? void 0 : formData.connectionDetails);
3598
+ const details = (rawData === null || rawData === void 0 ? void 0 : rawData.connectionDetails) || rawData || {};
3599
+ const addrDetails = (rawData === null || rawData === void 0 ? void 0 : rawData.addressDetails) || {};
3600
+ if (details && Object.keys(details).length > 0 && !savedData.firstName) {
3601
+ if (!kno && searchKno) setKno(searchKno);
3602
+ if (details.firstName) {
3603
+ setFirstName(details.firstName);
3604
+ if (details.middleName) setMiddleName(details.middleName);
3605
+ if (details.lastName) setLastName(details.lastName);
3606
+ } else if (details.consumerName) {
3607
+ setConsumerName(details.consumerName);
3608
+ const parts = details.consumerName.trim().split(/\s+/);
3609
+ setFirstName(parts[0] || "");
3610
+ if (parts.length === 2) setLastName(parts[1]);
3611
+ if (parts.length > 2) {
3612
+ setMiddleName(parts.slice(1, -1).join(" "));
3613
+ setLastName(parts[parts.length - 1]);
3614
+ }
3615
+ }
3616
+ if (details.phoneNumber || addrDetails.mobileNo) setMobile(details.phoneNumber || addrDetails.mobileNo);
3617
+ if (details.email || addrDetails.email) setEmail(details.email || addrDetails.email);
3618
+ if (addrDetails.whatsappNo) setWhatsapp(addrDetails.whatsappNo);
3619
+ if (addrDetails.noOfPerson) setResidents(String(addrDetails.noOfPerson));
3620
+ if (details.consumerType) setConsumerType({
3621
+ name: details.consumerType
3622
+ });
3623
+ if (details.occupantType) setOccupantType({
3624
+ name: details.occupantType
3625
+ });
3626
+ if (details.gender) setGender({
3627
+ name: details.gender
3628
+ });
3629
+ if (details.parentSpouse) setParentSpouseName(details.parentSpouse);
3630
+ if (details.documentNumber) {
3631
+ setDocumentId(details.documentNumber);
3632
+ setIdNumber(details.documentNumber);
3633
+ }
3634
+ if (details.informantName) setInformantName(details.informantName);
3635
+ if (details.informantRelation) setInformantRelation(details.informantRelation);
3636
+ }
3637
+ }, [searchData, formData === null || formData === void 0 ? void 0 : formData.connectionDetails, searchKno]);
3187
3638
  const consumerTypeOptions = [{
3188
3639
  name: "Individual"
3189
3640
  }, {
@@ -3205,6 +3656,15 @@ const AadhaarVerification = ({
3205
3656
  }, {
3206
3657
  name: "Not prefer to say"
3207
3658
  }];
3659
+ const identityTypeOptions = [{
3660
+ name: "Aadhaar Card"
3661
+ }, {
3662
+ name: "Driving License"
3663
+ }, {
3664
+ name: "Passport"
3665
+ }, {
3666
+ name: "Voter ID"
3667
+ }];
3208
3668
  const uploadFile = async (e, setter, idSetter) => {
3209
3669
  const file = e.target.files[0];
3210
3670
  if (!file) return;
@@ -3234,14 +3694,7 @@ const AadhaarVerification = ({
3234
3694
  if ((occupantType === null || occupantType === void 0 ? void 0 : occupantType.name) === "Tenanted" && !documentId && !ownerMobile) return false;
3235
3695
  return consent;
3236
3696
  };
3237
- const onStepSelect = () => {
3238
- if (!isValid()) {
3239
- setToast({
3240
- type: "error",
3241
- message: "Fill required fields"
3242
- });
3243
- return;
3244
- }
3697
+ const onStepSelect = async () => {
3245
3698
  const data = {
3246
3699
  kno,
3247
3700
  consumerType: consumerType === null || consumerType === void 0 ? void 0 : consumerType.name,
@@ -3252,6 +3705,7 @@ const AadhaarVerification = ({
3252
3705
  middleName,
3253
3706
  lastName,
3254
3707
  gender: gender === null || gender === void 0 ? void 0 : gender.name,
3708
+ parentSpouseName,
3255
3709
  relation,
3256
3710
  mobile,
3257
3711
  whatsapp,
@@ -3274,15 +3728,32 @@ const AadhaarVerification = ({
3274
3728
  informantName,
3275
3729
  informantRelation
3276
3730
  };
3277
- onSelect(config.key, data);
3731
+ try {
3732
+ await updateMutation.mutateAsync({
3733
+ RequestInfo: {},
3734
+ updateType: "CONSUMER",
3735
+ ...data
3736
+ });
3737
+ setToast({
3738
+ type: "success",
3739
+ message: "Data updated successfully!"
3740
+ });
3741
+ onSelect(config.key, data);
3742
+ } catch (error) {
3743
+ setToast({
3744
+ type: "error",
3745
+ message: "Failed to update consumer details"
3746
+ });
3747
+ }
3278
3748
  };
3279
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
3749
+ if (isLoading) {
3750
+ return /*#__PURE__*/React.createElement(Loader, null);
3751
+ }
3752
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(FormStep, {
3280
3753
  onSelect: onStepSelect,
3281
- config: config
3282
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "K Number *"), /*#__PURE__*/React.createElement(TextInput, {
3283
- value: kno,
3284
- onChange: e => setKno(e.target.value)
3285
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Consumer Type *"), /*#__PURE__*/React.createElement(Dropdown, {
3754
+ config: config,
3755
+ isDisabled: !isValid()
3756
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Consumer Type *"), /*#__PURE__*/React.createElement(Dropdown, {
3286
3757
  option: consumerTypeOptions,
3287
3758
  selected: consumerType,
3288
3759
  select: setConsumerType
@@ -3307,6 +3778,9 @@ const AadhaarVerification = ({
3307
3778
  option: genderOptions,
3308
3779
  selected: gender,
3309
3780
  select: setGender
3781
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Parent/Spouse Name "), /*#__PURE__*/React.createElement(TextInput, {
3782
+ value: parentSpouseName,
3783
+ onChange: e => setParentSpouseName(e.target.value)
3310
3784
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Mobile *"), /*#__PURE__*/React.createElement(TextInput, {
3311
3785
  value: mobile,
3312
3786
  onChange: e => setMobile(e.target.value)
@@ -3319,15 +3793,34 @@ const AadhaarVerification = ({
3319
3793
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "No. of Residents *"), /*#__PURE__*/React.createElement(TextInput, {
3320
3794
  value: residents,
3321
3795
  onChange: e => setResidents(e.target.value)
3322
- })), (occupantType === null || occupantType === void 0 ? void 0 : occupantType.name) === "Tenanted" && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Document Proof"), /*#__PURE__*/React.createElement(UploadFile, {
3796
+ })), /*#__PURE__*/React.createElement("div", null, console.log("identityType", identityType), /*#__PURE__*/React.createElement(CardLabel, null, "Type of Identity *"), /*#__PURE__*/React.createElement(Dropdown, {
3797
+ option: identityTypeOptions,
3798
+ selected: identityType,
3799
+ select: setIdentityType
3800
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Proof of Identity"), /*#__PURE__*/React.createElement(UploadFile, {
3801
+ onUpload: e => uploadFile(e, setDocumentProof, setDocumentId)
3802
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Document Number"), /*#__PURE__*/React.createElement(TextInput, {
3803
+ value: documentNumber,
3804
+ onChange: e => setDocumentNumber(e.target.value)
3805
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Informant Is Consumer"), /*#__PURE__*/React.createElement(CheckBox, {
3806
+ label: "Yes, the informant is the consumer",
3807
+ checked: informantIsConsumer,
3808
+ onChange: e => setInformantIsConsumer(e.target.checked)
3809
+ })), !informantIsConsumer && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Informant Name"), /*#__PURE__*/React.createElement(TextInput, {
3810
+ value: informantName,
3811
+ onChange: e => setInformantName(e.target.value)
3812
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Informant Relation"), /*#__PURE__*/React.createElement(TextInput, {
3813
+ value: informantRelation,
3814
+ onChange: e => setInformantRelation(e.target.value)
3815
+ }))), (occupantType === null || occupantType === void 0 ? void 0 : occupantType.name) === "Tenanted" && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Document Proof"), /*#__PURE__*/React.createElement(UploadFile, {
3323
3816
  onUpload: e => uploadFile(e, setDocumentProof, setDocumentId)
3324
- })), !documentId && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Owner Mobile *"), /*#__PURE__*/React.createElement(TextInput, {
3817
+ })), !documentId && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Owner Mobile *"), /*#__PURE__*/React.createElement(TextInput, {
3325
3818
  value: ownerMobile,
3326
3819
  onChange: e => setOwnerMobile(e.target.value)
3327
3820
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Tenant Verification"), /*#__PURE__*/React.createElement(TextInput, {
3328
3821
  value: tenantVerification,
3329
3822
  onChange: e => setTenantVerification(e.target.value)
3330
- })))), (consumerType === null || consumerType === void 0 ? void 0 : consumerType.name) === "Govt" && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Designation"), /*#__PURE__*/React.createElement(TextInput, {
3823
+ })))), (consumerType === null || consumerType === void 0 ? void 0 : consumerType.name) === "Govt" && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Designation"), /*#__PURE__*/React.createElement(TextInput, {
3331
3824
  value: designation,
3332
3825
  onChange: e => setDesignation(e.target.value)
3333
3826
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Department"), /*#__PURE__*/React.createElement(TextInput, {
@@ -3336,13 +3829,17 @@ const AadhaarVerification = ({
3336
3829
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Employee ID"), /*#__PURE__*/React.createElement(TextInput, {
3337
3830
  value: employeeId,
3338
3831
  onChange: e => setEmployeeId(e.target.value)
3339
- }))), (consumerType === null || consumerType === void 0 ? void 0 : consumerType.name) === "Company_Society_Org" && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Entity Name"), /*#__PURE__*/React.createElement(TextInput, {
3832
+ }))), (consumerType === null || consumerType === void 0 ? void 0 : consumerType.name) === "Company_Society_Org" && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Entity Name"), /*#__PURE__*/React.createElement(TextInput, {
3340
3833
  value: entityName,
3341
3834
  onChange: e => setEntityName(e.target.value)
3342
3835
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Contact Person"), /*#__PURE__*/React.createElement(TextInput, {
3343
3836
  value: contactPerson,
3344
3837
  onChange: e => setContactPerson(e.target.value)
3345
- })))));
3838
+ })))), toast && /*#__PURE__*/React.createElement(Toast, {
3839
+ error: toast.type === "error",
3840
+ label: toast.message,
3841
+ onClose: () => setToast(null)
3842
+ }));
3346
3843
  };
3347
3844
 
3348
3845
  const ekycConfig = [{
@@ -3526,6 +4023,7 @@ const EmployeeApp = ({
3526
4023
  } = useTranslation();
3527
4024
  const location = useLocation();
3528
4025
  sessionStorage.removeItem("revalidateddone");
4026
+ const CeoDashboard = Digit.ComponentRegistryService.getComponent("CeoDashboard");
3529
4027
  const getBreadcrumbLabel = () => {
3530
4028
  const pathname = location.pathname;
3531
4029
  if (pathname.includes("/dashboard")) return "ES_COMMON_INBOX";
@@ -3559,102 +4057,140 @@ const EmployeeApp = ({
3559
4057
  className: "employee-form-content"
3560
4058
  }, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
3561
4059
  path: `${path}/dashboard`,
3562
- component: () => /*#__PURE__*/React.createElement(Dashboard, {
4060
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
4061
+ layoutClass: "normal"
4062
+ }, /*#__PURE__*/React.createElement(Dashboard, {
3563
4063
  parentRoute: path,
3564
4064
  businessService: "EKYC",
3565
4065
  moduleCode: "EKYC",
3566
4066
  isInbox: true
3567
- })
4067
+ }))
3568
4068
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
3569
4069
  path: `${path}/inbox`,
3570
- component: () => /*#__PURE__*/React.createElement(Inbox, {
4070
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
4071
+ layoutClass: "normal"
4072
+ }, /*#__PURE__*/React.createElement(Inbox, {
3571
4073
  parentRoute: path,
3572
4074
  businessService: "EKYC",
3573
4075
  moduleCode: "EKYC",
3574
4076
  isInbox: true
3575
- })
4077
+ }))
3576
4078
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
3577
4079
  path: `${path}/create-kyc`,
3578
- component: () => /*#__PURE__*/React.createElement(Create, null)
4080
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
4081
+ layoutClass: "normal"
4082
+ }, /*#__PURE__*/React.createElement(Create, null))
3579
4083
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
3580
4084
  path: `${path}/mapping`,
3581
- component: () => /*#__PURE__*/React.createElement(Mapping, null)
4085
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
4086
+ layoutClass: "normal"
4087
+ }, /*#__PURE__*/React.createElement(Mapping, null))
3582
4088
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
3583
4089
  path: formStepRoutes.map(route => `${path}/${route}`),
3584
- component: props => /*#__PURE__*/React.createElement(EKYCForm, Object.assign({}, props, {
4090
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
4091
+ layoutClass: "normal"
4092
+ }, /*#__PURE__*/React.createElement(EKYCForm, Object.assign({}, props, {
3585
4093
  path: path
3586
- }))
4094
+ })))
3587
4095
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
3588
4096
  path: `${path}/review`,
3589
- component: () => /*#__PURE__*/React.createElement(Review, null)
4097
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
4098
+ layoutClass: "normal"
4099
+ }, /*#__PURE__*/React.createElement(Review, null))
4100
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
4101
+ path: `${path}/ceo-dashboard`,
4102
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
4103
+ layoutClass: "normal"
4104
+ }, /*#__PURE__*/React.createElement(CeoDashboard, null))
3590
4105
  }))))));
3591
4106
  };
3592
4107
 
3593
- const AddressDetails = ({
4108
+ const PropertyInfo = ({
3594
4109
  config,
3595
- onSelect
4110
+ onSelect,
4111
+ formData
3596
4112
  }) => {
3597
- var _mdmsData$MdmsRes, _mdmsData$MdmsRes$ego, _mdmsData$MdmsRes$ego2, _mdmsData$MdmsRes$ego3, _mdmsData$MdmsRes$ego4;
3598
4113
  const {
3599
4114
  t
3600
4115
  } = useTranslation();
4116
+ const location = useLocation();
4117
+ const flowState = location.state || {};
3601
4118
  const tenantId = Digit.ULBService.getCurrentTenantId();
3602
- const [houseNo, setHouseNo] = useState("");
3603
- const [street, setStreet] = useState("");
3604
- const [locality, setLocality] = useState("");
3605
- const [landmark, setLandmark] = useState("");
3606
- const [subLocality, setSubLocality] = useState(null);
3607
- const [pinCode, setPinCode] = useState("");
3608
- const [assembly, setAssembly] = useState(null);
3609
- const [ward, setWard] = useState(null);
3610
- const [zone, setZone] = useState(null);
3611
- const [latitude, setLatitude] = useState("");
3612
- const [longitude, setLongitude] = useState("");
3613
- const [addressType, setAddressType] = useState(null);
3614
- const [doorPhoto, setDoorPhoto] = useState(null);
3615
- const [doorPhotoFileStoreId, setDoorPhotoFileStoreId] = useState(null);
3616
- const [toast, setToast] = useState(null);
4119
+ const searchKno = (flowState === null || flowState === void 0 ? void 0 : flowState.kNumber) || (flowState === null || flowState === void 0 ? void 0 : flowState.kno) || (formData === null || formData === void 0 ? void 0 : formData.kNumber) || (formData === null || formData === void 0 ? void 0 : formData.kno) || sessionStorage.getItem("EKYC_K_NUMBER");
3617
4120
  const {
3618
- data: mdmsData,
3619
- isLoading
3620
- } = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
3621
- const assemblies = (mdmsData === null || mdmsData === void 0 ? void 0 : (_mdmsData$MdmsRes = mdmsData.MdmsRes) === null || _mdmsData$MdmsRes === void 0 ? void 0 : (_mdmsData$MdmsRes$ego = _mdmsData$MdmsRes["egov-location"]) === null || _mdmsData$MdmsRes$ego === void 0 ? void 0 : (_mdmsData$MdmsRes$ego2 = _mdmsData$MdmsRes$ego.TenantBoundary) === null || _mdmsData$MdmsRes$ego2 === void 0 ? void 0 : (_mdmsData$MdmsRes$ego3 = _mdmsData$MdmsRes$ego2[0]) === null || _mdmsData$MdmsRes$ego3 === void 0 ? void 0 : (_mdmsData$MdmsRes$ego4 = _mdmsData$MdmsRes$ego3.boundary) === null || _mdmsData$MdmsRes$ego4 === void 0 ? void 0 : _mdmsData$MdmsRes$ego4.children) || [];
4121
+ isLoading,
4122
+ data: searchData
4123
+ } = Digit.Hooks.ekyc.useSearchConnection({
4124
+ tenantId,
4125
+ details: {
4126
+ kno: searchKno
4127
+ }
4128
+ }, {
4129
+ enabled: !!searchKno,
4130
+ cacheTime: 0
4131
+ });
4132
+ const updateMutation = Digit.Hooks.ekyc.useEkycUpdate(tenantId);
4133
+ const savedData = (formData === null || formData === void 0 ? void 0 : formData.propertyDetails) || {};
4134
+ const [pidNumber, setPidNumber] = useState(savedData.pidNumber || "");
4135
+ const [propertyType, setPropertyType] = useState(savedData.propertyType ? {
4136
+ name: savedData.propertyType
4137
+ } : null);
4138
+ const [subPropertyCategory, setSubPropertyCategory] = useState(savedData.subPropertyCategory ? {
4139
+ name: savedData.subPropertyCategory
4140
+ } : null);
4141
+ const [noOfFloors, setNoOfFloors] = useState(savedData.noOfFloors || "");
4142
+ const [floorNo, setFloorNo] = useState(savedData.floorNo || "");
4143
+ const [noOfRooms, setNoOfRooms] = useState(savedData.noOfRooms || "");
4144
+ const [noOfBeds, setNoOfBeds] = useState(savedData.noOfBeds || "");
4145
+ const [dwellingUnits, setDwellingUnits] = useState(savedData.dwellingUnits || "");
4146
+ const [buildingImage, setBuildingImage] = useState(null);
4147
+ const [buildingImageId, setBuildingImageId] = useState(savedData.buildingImageId || null);
4148
+ const [toast, setToast] = useState(null);
4149
+ const propertyTypeOptions = [{
4150
+ name: "Residential"
4151
+ }, {
4152
+ name: "Commercial"
4153
+ }, {
4154
+ name: "Hotel"
4155
+ }, {
4156
+ name: "Hospital"
4157
+ }, {
4158
+ name: "Nursing Home"
4159
+ }];
3622
4160
  useEffect(() => {
3623
- let isMounted = true;
3624
- if (navigator.geolocation) {
3625
- navigator.geolocation.getCurrentPosition(pos => {
3626
- if (!isMounted) return;
3627
- setLatitude(pos.coords.latitude);
3628
- setLongitude(pos.coords.longitude);
3629
- }, () => {
3630
- if (!isMounted) return;
3631
- setToast({
3632
- type: "error",
3633
- message: "GPS access denied"
4161
+ const rawData = searchData || (formData === null || formData === void 0 ? void 0 : formData.connectionDetails);
4162
+ const propertyInfo = (rawData === null || rawData === void 0 ? void 0 : rawData.propertyInfo) || (rawData === null || rawData === void 0 ? void 0 : rawData.propertyDetails) || {};
4163
+ if (propertyInfo && Object.keys(propertyInfo).length > 0 && !savedData.pidNumber) {
4164
+ if (propertyInfo.pidNumber) setPidNumber(propertyInfo.pidNumber);
4165
+ if (propertyInfo.numberOfFloors || propertyInfo.noOfFloor) setNoOfFloors(String(propertyInfo.numberOfFloors || propertyInfo.noOfFloor));
4166
+ if (propertyInfo.buildingImageFileStoreId) setBuildingImageId(propertyInfo.buildingImageFileStoreId);
4167
+ if (propertyInfo.subPropertyCategory) {
4168
+ const matchingType = propertyTypeOptions.find(type => type.name.toLowerCase() === propertyInfo.subPropertyCategory.toLowerCase());
4169
+ if (matchingType) setPropertyType(matchingType);else setPropertyType({
4170
+ name: propertyInfo.subPropertyCategory
4171
+ });
4172
+ setSubPropertyCategory({
4173
+ name: propertyInfo.subPropertyCategory
4174
+ });
4175
+ }
4176
+ if (propertyInfo.propertyType) {
4177
+ setSubPropertyCategory({
4178
+ name: propertyInfo.propertyType
4179
+ });
4180
+ if (!propertyInfo.subPropertyCategory) setPropertyType({
4181
+ name: propertyInfo.propertyType
3634
4182
  });
3635
- });
3636
- }
3637
- return () => {
3638
- isMounted = false;
3639
- };
3640
- }, []);
3641
- const handlePincodeChange = e => {
3642
- const value = e.target.value;
3643
- if (/^\d{0,6}$/.test(value)) {
3644
- setPinCode(value);
3645
- if (value.length === 6) {
3646
- fetchLocationByPincode(value);
3647
4183
  }
4184
+ if (propertyInfo.floorNo) setFloorNo(propertyInfo.floorNo);
4185
+ if (propertyInfo.numberOfRooms !== null && propertyInfo.numberOfRooms !== undefined) setNoOfRooms(String(propertyInfo.numberOfRooms));
4186
+ if (propertyInfo.numberOfBeds !== null && propertyInfo.numberOfBeds !== undefined) setNoOfBeds(String(propertyInfo.numberOfBeds));
4187
+ if (propertyInfo.numberOfDwellingUnits !== null && propertyInfo.numberOfDwellingUnits !== undefined) setDwellingUnits(String(propertyInfo.numberOfDwellingUnits));
3648
4188
  }
3649
- };
3650
- const fetchLocationByPincode = pin => {
3651
- console.log("Fetching location for PIN:", pin);
3652
- };
3653
- const selectphoto = async e => {
3654
- let isMounted = true;
4189
+ }, [searchData, formData === null || formData === void 0 ? void 0 : formData.connectionDetails]);
4190
+ const handleUpload = async e => {
3655
4191
  const file = e.target.files[0];
3656
4192
  if (!file) return;
3657
- if (file.size >= 2000000) {
4193
+ if (file.size > 2000000) {
3658
4194
  setToast({
3659
4195
  type: "error",
3660
4196
  message: "Max size 2MB exceeded"
@@ -3664,15 +4200,11 @@ const AddressDetails = ({
3664
4200
  try {
3665
4201
  var _res$data, _res$data$files, _res$data$files$;
3666
4202
  const res = await Digit.UploadServices.Filestorage("EKYC", file, tenantId);
3667
- if (!isMounted) return;
3668
4203
  const fileStoreId = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$files = _res$data.files) === null || _res$data$files === void 0 ? void 0 : (_res$data$files$ = _res$data$files[0]) === null || _res$data$files$ === void 0 ? void 0 : _res$data$files$.fileStoreId;
3669
4204
  if (fileStoreId) {
3670
- setDoorPhotoFileStoreId(fileStoreId);
4205
+ setBuildingImageId(fileStoreId);
3671
4206
  const reader = new FileReader();
3672
- reader.onloadend = () => {
3673
- if (!isMounted) return;
3674
- setDoorPhoto(reader.result);
3675
- };
4207
+ reader.onloadend = () => setBuildingImage(reader.result);
3676
4208
  reader.readAsDataURL(file);
3677
4209
  setToast({
3678
4210
  type: "success",
@@ -3680,222 +4212,69 @@ const AddressDetails = ({
3680
4212
  });
3681
4213
  }
3682
4214
  } catch {
3683
- if (!isMounted) return;
3684
4215
  setToast({
3685
4216
  type: "error",
3686
4217
  message: "Upload failed"
3687
4218
  });
3688
4219
  }
3689
- return () => {
3690
- isMounted = false;
3691
- };
3692
- };
3693
- const removePhoto = () => {
3694
- setDoorPhoto(null);
3695
- setDoorPhotoFileStoreId(null);
3696
4220
  };
3697
4221
  const isValid = () => {
3698
- return houseNo && street && pinCode.length === 6 && assembly && ward && zone && latitude && longitude && doorPhotoFileStoreId;
4222
+ if (!propertyType) return false;
4223
+ if (!subPropertyCategory) return false;
4224
+ if (!noOfFloors || Number(noOfFloors) < 1) return false;
4225
+ if (!buildingImageId) return false;
4226
+ if ((propertyType === null || propertyType === void 0 ? void 0 : propertyType.name) === "Hotel" && !noOfRooms) return false;
4227
+ if (((propertyType === null || propertyType === void 0 ? void 0 : propertyType.name) === "Hospital" || (propertyType === null || propertyType === void 0 ? void 0 : propertyType.name) === "Nursing Home") && !noOfBeds) return false;
4228
+ return true;
3699
4229
  };
3700
- const onStepSelect = () => {
3701
- if (!isValid()) {
4230
+ const onStepSelect = async () => {
4231
+ const data = {
4232
+ pidNumber,
4233
+ propertyType: propertyType === null || propertyType === void 0 ? void 0 : propertyType.name,
4234
+ subPropertyCategory: subPropertyCategory === null || subPropertyCategory === void 0 ? void 0 : subPropertyCategory.name,
4235
+ noOfFloors,
4236
+ floorNo,
4237
+ noOfRooms,
4238
+ noOfBeds,
4239
+ dwellingUnits,
4240
+ buildingImageId
4241
+ };
4242
+ try {
4243
+ await updateMutation.mutateAsync({
4244
+ RequestInfo: {},
4245
+ updateType: "PROPERTY",
4246
+ kno: searchKno,
4247
+ ...data
4248
+ });
4249
+ setToast({
4250
+ type: "success",
4251
+ message: "Property details updated successfully!"
4252
+ });
4253
+ onSelect(config.key, data);
4254
+ } catch (error) {
3702
4255
  setToast({
3703
4256
  type: "error",
3704
- message: "Please fill all mandatory fields"
4257
+ message: "Failed to update property details"
3705
4258
  });
3706
- return;
3707
4259
  }
3708
- const data = {
3709
- houseNo,
3710
- street,
3711
- locality,
3712
- landmark,
3713
- subLocality,
3714
- pinCode,
3715
- assembly: assembly === null || assembly === void 0 ? void 0 : assembly.name,
3716
- ward: ward === null || ward === void 0 ? void 0 : ward.name,
3717
- zone: zone === null || zone === void 0 ? void 0 : zone.name,
3718
- latitude,
3719
- longitude,
3720
- addressType: addressType === null || addressType === void 0 ? void 0 : addressType.name,
3721
- doorPhotoFilestoreId: doorPhotoFileStoreId
3722
- };
3723
- onSelect(config.key, data);
3724
4260
  };
3725
- if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
3726
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
4261
+ if (isLoading) {
4262
+ return /*#__PURE__*/React.createElement(Loader, null);
4263
+ }
4264
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(FormStep, {
3727
4265
  t: t,
3728
4266
  onSelect: onStepSelect,
3729
4267
  config: config,
3730
- label: t("ES_COMMON_CONTINUE")
3731
- }, /*#__PURE__*/React.createElement(CardLabel, null, "House No / Flat No *"), /*#__PURE__*/React.createElement(TextInput, {
3732
- value: houseNo,
3733
- onChange: e => setHouseNo(e.target.value)
3734
- }), /*#__PURE__*/React.createElement(CardLabel, null, "Street / Address Line *"), /*#__PURE__*/React.createElement(TextInput, {
3735
- value: street,
3736
- onChange: e => setStreet(e.target.value)
3737
- }), /*#__PURE__*/React.createElement(CardLabel, null, "Locality"), /*#__PURE__*/React.createElement(TextInput, {
3738
- value: locality,
3739
- onChange: e => setLocality(e.target.value)
3740
- }), /*#__PURE__*/React.createElement(CardLabel, null, "Landmark"), /*#__PURE__*/React.createElement(TextInput, {
3741
- value: landmark,
3742
- onChange: e => setLandmark(e.target.value)
3743
- }), /*#__PURE__*/React.createElement(CardLabel, null, "Sub Locality"), /*#__PURE__*/React.createElement(Dropdown, {
3744
- option: [],
3745
- selected: subLocality,
3746
- select: setSubLocality
3747
- }), /*#__PURE__*/React.createElement(CardLabel, null, "PIN Code *"), /*#__PURE__*/React.createElement(TextInput, {
3748
- value: pinCode,
3749
- onChange: handlePincodeChange,
3750
- maxLength: 6
3751
- }), /*#__PURE__*/React.createElement(CardLabel, null, "Assembly *"), /*#__PURE__*/React.createElement(Dropdown, {
3752
- option: assemblies,
3753
- selected: assembly,
3754
- select: setAssembly
3755
- }), /*#__PURE__*/React.createElement(CardLabel, null, "Ward *"), /*#__PURE__*/React.createElement(Dropdown, {
3756
- option: (assembly === null || assembly === void 0 ? void 0 : assembly.children) || [],
3757
- selected: ward,
3758
- select: setWard
3759
- }), /*#__PURE__*/React.createElement(CardLabel, null, "Zone *"), /*#__PURE__*/React.createElement(Dropdown, {
3760
- option: (ward === null || ward === void 0 ? void 0 : ward.children) || [],
3761
- selected: zone,
3762
- select: setZone
3763
- }), /*#__PURE__*/React.createElement(CardLabel, null, "Latitude"), /*#__PURE__*/React.createElement(TextInput, {
3764
- value: latitude,
3765
- disabled: true
3766
- }), /*#__PURE__*/React.createElement(CardLabel, null, "Longitude"), /*#__PURE__*/React.createElement(TextInput, {
3767
- value: longitude,
3768
- disabled: true
3769
- }), /*#__PURE__*/React.createElement(CardLabel, null, "Address Type"), /*#__PURE__*/React.createElement(Dropdown, {
3770
- option: [{
3771
- name: "Permanent"
3772
- }, {
3773
- name: "Correspondence"
3774
- }, {
3775
- name: "Other"
3776
- }],
3777
- selected: addressType,
3778
- select: setAddressType
3779
- }), /*#__PURE__*/React.createElement(CardLabel, null, "Door Image *"), /*#__PURE__*/React.createElement(UploadFile, {
3780
- onUpload: selectphoto,
3781
- onDelete: removePhoto,
3782
- message: doorPhotoFileStoreId ? "Uploaded" : "No file selected"
3783
- }), doorPhoto && /*#__PURE__*/React.createElement("img", {
3784
- src: doorPhoto,
3785
- alt: "preview",
3786
- style: {
3787
- width: "100%",
3788
- marginTop: "10px"
3789
- }
3790
- }), toast && /*#__PURE__*/React.createElement(Toast, {
3791
- label: toast.message,
3792
- error: toast.type === "error",
3793
- onClose: () => setToast(null)
3794
- })));
3795
- };
3796
-
3797
- const PropertyInfo = ({
3798
- config,
3799
- onSelect
3800
- }) => {
3801
- const {
3802
- t
3803
- } = useTranslation();
3804
- const tenantId = Digit.ULBService.getCurrentTenantId();
3805
- const [pidNumber, setPidNumber] = useState("");
3806
- const [propertyType, setPropertyType] = useState(null);
3807
- const [subPropertyCategory, setSubPropertyCategory] = useState(null);
3808
- const [noOfFloors, setNoOfFloors] = useState("");
3809
- const [floorNo, setFloorNo] = useState("");
3810
- const [noOfRooms, setNoOfRooms] = useState("");
3811
- const [noOfBeds, setNoOfBeds] = useState("");
3812
- const [dwellingUnits, setDwellingUnits] = useState("");
3813
- const [buildingImage, setBuildingImage] = useState(null);
3814
- const [buildingImageId, setBuildingImageId] = useState(null);
3815
- const [toast, setToast] = useState(null);
3816
- const propertyTypeOptions = [{
3817
- name: "Residential"
3818
- }, {
3819
- name: "Commercial"
3820
- }, {
3821
- name: "Hotel"
3822
- }, {
3823
- name: "Hospital"
3824
- }, {
3825
- name: "Nursing Home"
3826
- }];
3827
- const handleUpload = async e => {
3828
- const file = e.target.files[0];
3829
- if (!file) return;
3830
- if (file.size > 2000000) {
3831
- setToast({
3832
- type: "error",
3833
- message: "Max size 2MB exceeded"
3834
- });
3835
- return;
3836
- }
3837
- try {
3838
- var _res$data, _res$data$files, _res$data$files$;
3839
- const res = await Digit.UploadServices.Filestorage("EKYC", file, tenantId);
3840
- const fileStoreId = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$files = _res$data.files) === null || _res$data$files === void 0 ? void 0 : (_res$data$files$ = _res$data$files[0]) === null || _res$data$files$ === void 0 ? void 0 : _res$data$files$.fileStoreId;
3841
- if (fileStoreId) {
3842
- setBuildingImageId(fileStoreId);
3843
- const reader = new FileReader();
3844
- reader.onloadend = () => setBuildingImage(reader.result);
3845
- reader.readAsDataURL(file);
3846
- setToast({
3847
- type: "success",
3848
- message: "Upload successful"
3849
- });
3850
- }
3851
- } catch {
3852
- setToast({
3853
- type: "error",
3854
- message: "Upload failed"
3855
- });
3856
- }
3857
- };
3858
- const isValid = () => {
3859
- if (!noOfFloors || Number(noOfFloors) < 1) return false;
3860
- if (!buildingImageId) return false;
3861
- if ((propertyType === null || propertyType === void 0 ? void 0 : propertyType.name) === "Hotel" && !noOfRooms) return false;
3862
- if (((propertyType === null || propertyType === void 0 ? void 0 : propertyType.name) === "Hospital" || (propertyType === null || propertyType === void 0 ? void 0 : propertyType.name) === "Nursing Home") && !noOfBeds) return false;
3863
- return true;
3864
- };
3865
- const onStepSelect = () => {
3866
- if (!isValid()) {
3867
- setToast({
3868
- type: "error",
3869
- message: "Fill all required fields"
3870
- });
3871
- return;
3872
- }
3873
- const data = {
3874
- pidNumber,
3875
- propertyType: propertyType === null || propertyType === void 0 ? void 0 : propertyType.name,
3876
- subPropertyCategory: subPropertyCategory === null || subPropertyCategory === void 0 ? void 0 : subPropertyCategory.name,
3877
- noOfFloors,
3878
- floorNo,
3879
- noOfRooms,
3880
- noOfBeds,
3881
- dwellingUnits,
3882
- buildingImageId
3883
- };
3884
- onSelect(config.key, data);
3885
- };
3886
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
3887
- t: t,
3888
- onSelect: onStepSelect,
3889
- config: config,
3890
- label: t("ES_COMMON_CONTINUE")
3891
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "PID Number"), /*#__PURE__*/React.createElement(TextInput, {
3892
- value: pidNumber,
3893
- onChange: e => setPidNumber(e.target.value)
3894
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Property Type"), /*#__PURE__*/React.createElement(Dropdown, {
3895
- option: propertyTypeOptions,
3896
- selected: propertyType,
3897
- select: setPropertyType
3898
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Sub Property Category"), /*#__PURE__*/React.createElement(Dropdown, {
4268
+ label: t("ES_COMMON_CONTINUE"),
4269
+ isDisabled: !isValid()
4270
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "PID Number"), /*#__PURE__*/React.createElement(TextInput, {
4271
+ value: pidNumber,
4272
+ onChange: e => setPidNumber(e.target.value)
4273
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Property Type"), /*#__PURE__*/React.createElement(Dropdown, {
4274
+ option: propertyTypeOptions,
4275
+ selected: propertyType,
4276
+ select: setPropertyType
4277
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Sub Property Category"), /*#__PURE__*/React.createElement(Dropdown, {
3899
4278
  option: [],
3900
4279
  selected: subPropertyCategory,
3901
4280
  select: setSubPropertyCategory
@@ -3953,28 +4332,62 @@ const PropertyInfo = ({
3953
4332
 
3954
4333
  const MeterDetails = ({
3955
4334
  config,
3956
- onSelect
4335
+ onSelect,
4336
+ formData
3957
4337
  }) => {
4338
+ const location = useLocation();
4339
+ const flowState = location.state || {};
3958
4340
  const tenantId = Digit.ULBService.getCurrentTenantId();
3959
- const [connectionCategory, setConnectionCategory] = useState("");
3960
- const [saType, setSaType] = useState("");
3961
- const [status, setStatus] = useState("");
3962
- const [mrCode, setMrCode] = useState("");
3963
- const [areaCode, setAreaCode] = useState("");
3964
- const [mrKey, setMrKey] = useState("");
3965
- const [meterNumber, setMeterNumber] = useState("");
3966
- const [meterMaker, setMeterMaker] = useState("");
3967
- const [meterStatus, setMeterStatus] = useState(null);
3968
- const [meterCondition, setMeterCondition] = useState(null);
3969
- const [meterLocation, setMeterLocation] = useState(null);
3970
- const [lastBillReceived, setLastBillReceived] = useState(null);
3971
- const [billMonthYear, setBillMonthYear] = useState(null);
3972
- const [reason, setReason] = useState("");
3973
- const [accessToMeter, setAccessToMeter] = useState(null);
3974
- const [sewerConnection, setSewerConnection] = useState(null);
3975
- const [septicTank, setSepticTank] = useState(null);
4341
+ const searchKno = (flowState === null || flowState === void 0 ? void 0 : flowState.kNumber) || (flowState === null || flowState === void 0 ? void 0 : flowState.kno) || (formData === null || formData === void 0 ? void 0 : formData.kNumber) || (formData === null || formData === void 0 ? void 0 : formData.kno) || sessionStorage.getItem("EKYC_K_NUMBER");
4342
+ const {
4343
+ isLoading,
4344
+ data: searchData
4345
+ } = Digit.Hooks.ekyc.useSearchConnection({
4346
+ tenantId,
4347
+ details: {
4348
+ kno: searchKno
4349
+ }
4350
+ }, {
4351
+ enabled: !!searchKno,
4352
+ cacheTime: 0
4353
+ });
4354
+ const updateMutation = Digit.Hooks.ekyc.useEkycUpdate(tenantId);
4355
+ const savedData = (formData === null || formData === void 0 ? void 0 : formData.meterDetails) || {};
4356
+ const [connectionCategory, setConnectionCategory] = useState(savedData.connectionCategory || "");
4357
+ const [saType, setSaType] = useState(savedData.saType || "");
4358
+ const [status, setStatus] = useState(savedData.status || "");
4359
+ const [mrCode, setMrCode] = useState(savedData.mrCode || "");
4360
+ const [areaCode, setAreaCode] = useState(savedData.areaCode || "");
4361
+ const [mrKey, setMrKey] = useState(savedData.mrKey || "");
4362
+ const [meterNumber, setMeterNumber] = useState(savedData.meterNumber || "");
4363
+ const [meterMaker, setMeterMaker] = useState(savedData.meterMaker || "");
4364
+ const [meterStatus, setMeterStatus] = useState(savedData.meterStatus ? {
4365
+ name: savedData.meterStatus
4366
+ } : null);
4367
+ const [meterCondition, setMeterCondition] = useState(savedData.meterCondition ? {
4368
+ name: savedData.meterCondition
4369
+ } : null);
4370
+ const [meterLocation, setMeterLocation] = useState(savedData.meterLocation ? {
4371
+ name: savedData.meterLocation
4372
+ } : null);
4373
+ const [lastBillReceived, setLastBillReceived] = useState(savedData.lastBillReceived ? {
4374
+ name: savedData.lastBillReceived
4375
+ } : null);
4376
+ const [billMonthYear, setBillMonthYear] = useState(savedData.billMonthYear ? {
4377
+ name: savedData.billMonthYear
4378
+ } : null);
4379
+ const [reason, setReason] = useState(savedData.reason || "");
4380
+ const [accessToMeter, setAccessToMeter] = useState(savedData.accessToMeter ? {
4381
+ name: savedData.accessToMeter
4382
+ } : null);
4383
+ const [sewerConnection, setSewerConnection] = useState(savedData.sewerConnection ? {
4384
+ name: savedData.sewerConnection
4385
+ } : null);
4386
+ const [septicTank, setSepticTank] = useState(savedData.septicTank ? {
4387
+ name: savedData.septicTank
4388
+ } : null);
3976
4389
  const [meterPhoto, setMeterPhoto] = useState(null);
3977
- const [meterPhotoId, setMeterPhotoId] = useState(null);
4390
+ const [meterPhotoId, setMeterPhotoId] = useState(savedData.meterPhotoId || null);
3978
4391
  const [toast, setToast] = useState(null);
3979
4392
  const yesNo = [{
3980
4393
  name: "Yes"
@@ -4006,6 +4419,91 @@ const MeterDetails = ({
4006
4419
  });
4007
4420
  }
4008
4421
  }
4422
+ useEffect(() => {
4423
+ const rawData = searchData || (formData === null || formData === void 0 ? void 0 : formData.connectionDetails);
4424
+ const apiMeter = (rawData === null || rawData === void 0 ? void 0 : rawData.meterDetails) || rawData || {};
4425
+ if (apiMeter && Object.keys(apiMeter).length > 0 && !savedData.connectionCategory) {
4426
+ if (apiMeter.connectionCategory) setConnectionCategory(apiMeter.connectionCategory);
4427
+ if (apiMeter.saType) setSaType(apiMeter.saType);
4428
+ if (apiMeter.statusFlag) setStatus(apiMeter.statusFlag);
4429
+ if (apiMeter.mrcode) setMrCode(String(apiMeter.mrcode));
4430
+ if (apiMeter.areacode) setAreaCode(String(apiMeter.areacode));
4431
+ if (apiMeter.mrkey) setMrKey(String(apiMeter.mrkey));
4432
+ if (apiMeter.meterNumber) setMeterNumber(apiMeter.meterNumber);
4433
+ if (apiMeter.meterMake) setMeterMaker(apiMeter.meterMake);
4434
+ if (apiMeter.meterStatus) {
4435
+ const matchingStatus = meterStatusOptions.find(o => o.name.toLowerCase() === apiMeter.meterStatus.toLowerCase());
4436
+ if (matchingStatus) setMeterStatus(matchingStatus);else setMeterStatus({
4437
+ name: apiMeter.meterStatus
4438
+ });
4439
+ } else if (apiMeter.metered !== undefined) {
4440
+ setMeterStatus({
4441
+ name: apiMeter.metered ? "Metered" : "Unmetered"
4442
+ });
4443
+ }
4444
+ if (apiMeter.meterCondition) {
4445
+ const matchingCond = meterConditionOptions.find(o => o.name.toLowerCase() === apiMeter.meterCondition.toLowerCase());
4446
+ if (matchingCond) setMeterCondition(matchingCond);else setMeterCondition({
4447
+ name: apiMeter.meterCondition
4448
+ });
4449
+ }
4450
+ if (apiMeter.meterLocation) {
4451
+ const matchingLoc = meterLocationOptions.find(o => o.name.toLowerCase() === apiMeter.meterLocation.toLowerCase() || apiMeter.meterLocation.toLowerCase().includes(o.name.toLowerCase()));
4452
+ if (matchingLoc) setMeterLocation(matchingLoc);else setMeterLocation({
4453
+ name: apiMeter.meterLocation
4454
+ });
4455
+ }
4456
+ if (apiMeter.lastBillRaised !== undefined && apiMeter.lastBillRaised !== null) {
4457
+ const strVal = String(apiMeter.lastBillRaised).toLowerCase();
4458
+ if (strVal === "true" || strVal === "yes") setLastBillReceived({
4459
+ name: "Yes"
4460
+ });else setLastBillReceived({
4461
+ name: "No"
4462
+ });
4463
+ }
4464
+ if (apiMeter.lastBillReceivedDate) {
4465
+ const formatted = apiMeter.lastBillReceivedDate.replace("-", "/");
4466
+ const parsedParts = formatted.split("/");
4467
+ if (parsedParts.length === 2) {
4468
+ const mon = parseInt(parsedParts[0], 10);
4469
+ const yr = parseInt(parsedParts[1], 10);
4470
+ setBillMonthYear({
4471
+ name: `${mon}/${yr}`
4472
+ });
4473
+ } else {
4474
+ setBillMonthYear({
4475
+ name: apiMeter.lastBillReceivedDate
4476
+ });
4477
+ }
4478
+ }
4479
+ if (apiMeter.lastBillNotRaisedReason) setReason(apiMeter.lastBillNotRaisedReason);
4480
+ if (apiMeter.accessToMeter !== undefined && apiMeter.accessToMeter !== null) {
4481
+ const strVal = String(apiMeter.accessToMeter).toLowerCase();
4482
+ if (strVal === "true" || strVal === "yes") setAccessToMeter({
4483
+ name: "Yes"
4484
+ });else setAccessToMeter({
4485
+ name: "No"
4486
+ });
4487
+ }
4488
+ if (apiMeter.sewerConnection !== undefined && apiMeter.sewerConnection !== null) {
4489
+ const strVal = String(apiMeter.sewerConnection).toLowerCase();
4490
+ if (strVal === "true" || strVal === "yes") setSewerConnection({
4491
+ name: "Yes"
4492
+ });else setSewerConnection({
4493
+ name: "No"
4494
+ });
4495
+ }
4496
+ if (apiMeter.septicTank !== undefined && apiMeter.septicTank !== null) {
4497
+ const strVal = String(apiMeter.septicTank).toLowerCase();
4498
+ if (strVal === "true" || strVal === "yes") setSepticTank({
4499
+ name: "Yes"
4500
+ });else setSepticTank({
4501
+ name: "No"
4502
+ });
4503
+ }
4504
+ if (apiMeter.meterPhotoFileStoreId) setMeterPhotoId(apiMeter.meterPhotoFileStoreId);
4505
+ }
4506
+ }, [searchData, formData === null || formData === void 0 ? void 0 : formData.connectionDetails]);
4009
4507
  const isFrozen = (meterStatus === null || meterStatus === void 0 ? void 0 : meterStatus.name) === "Can not be identified";
4010
4508
  const uploadPhoto = async e => {
4011
4509
  const file = e.target.files[0];
@@ -4035,17 +4533,11 @@ const MeterDetails = ({
4035
4533
  if (!sewerConnection) return false;
4036
4534
  if ((meterStatus === null || meterStatus === void 0 ? void 0 : meterStatus.name) === "Metered" && !meterPhotoId) return false;
4037
4535
  if ((lastBillReceived === null || lastBillReceived === void 0 ? void 0 : lastBillReceived.name) === "No" && !reason) return false;
4536
+ if ((lastBillReceived === null || lastBillReceived === void 0 ? void 0 : lastBillReceived.name) === "Yes" && !billMonthYear) return false;
4038
4537
  if ((sewerConnection === null || sewerConnection === void 0 ? void 0 : sewerConnection.name) === "No" && !septicTank) return false;
4039
4538
  return true;
4040
4539
  };
4041
- const onStepSelect = () => {
4042
- if (!isValid()) {
4043
- setToast({
4044
- type: "error",
4045
- message: "Fill all mandatory fields"
4046
- });
4047
- return;
4048
- }
4540
+ const onStepSelect = async () => {
4049
4541
  const data = {
4050
4542
  connectionCategory,
4051
4543
  saType,
@@ -4066,11 +4558,32 @@ const MeterDetails = ({
4066
4558
  septicTank: septicTank === null || septicTank === void 0 ? void 0 : septicTank.name,
4067
4559
  meterPhotoId
4068
4560
  };
4069
- onSelect(config.key, data);
4561
+ try {
4562
+ await updateMutation.mutateAsync({
4563
+ RequestInfo: {},
4564
+ updateType: "METER",
4565
+ kno: searchKno,
4566
+ ...data
4567
+ });
4568
+ setToast({
4569
+ type: "success",
4570
+ message: "Meter details updated successfully!"
4571
+ });
4572
+ onSelect(config.key, data);
4573
+ } catch (error) {
4574
+ setToast({
4575
+ type: "error",
4576
+ message: "Failed to update meter details"
4577
+ });
4578
+ }
4070
4579
  };
4071
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
4580
+ if (isLoading) {
4581
+ return /*#__PURE__*/React.createElement(Loader, null);
4582
+ }
4583
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(FormStep, {
4072
4584
  onSelect: onStepSelect,
4073
- config: config
4585
+ config: config,
4586
+ isDisabled: !isValid()
4074
4587
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Connection Category *"), /*#__PURE__*/React.createElement(TextInput, {
4075
4588
  value: connectionCategory,
4076
4589
  onChange: e => setConnectionCategory(e.target.value)
@@ -4089,7 +4602,7 @@ const MeterDetails = ({
4089
4602
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "MR Key"), /*#__PURE__*/React.createElement(TextInput, {
4090
4603
  value: mrKey,
4091
4604
  onChange: e => setMrKey(e.target.value)
4092
- })), !isFrozen && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Meter Number"), /*#__PURE__*/React.createElement(TextInput, {
4605
+ })), !isFrozen && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Meter Number"), /*#__PURE__*/React.createElement(TextInput, {
4093
4606
  value: meterNumber,
4094
4607
  onChange: e => setMeterNumber(e.target.value)
4095
4608
  })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Meter Maker"), /*#__PURE__*/React.createElement(TextInput, {
@@ -4099,7 +4612,7 @@ const MeterDetails = ({
4099
4612
  option: meterConditionOptions,
4100
4613
  selected: meterCondition,
4101
4614
  select: setMeterCondition
4102
- })), (meterStatus === null || meterStatus === void 0 ? void 0 : meterStatus.name) === "Metered" && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Meter Photo *"), /*#__PURE__*/React.createElement(UploadFile, {
4615
+ })), (meterStatus === null || meterStatus === void 0 ? void 0 : meterStatus.name) === "Metered" && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, "Meter Photo *"), /*#__PURE__*/React.createElement(UploadFile, {
4103
4616
  onUpload: uploadPhoto,
4104
4617
  message: meterPhotoId ? "Uploaded" : "No file"
4105
4618
  })), meterPhoto && /*#__PURE__*/React.createElement("div", {
@@ -4433,68 +4946,1736 @@ const Inbox$1 = ({
4433
4946
  })));
4434
4947
  };
4435
4948
 
4436
- const CitizenApp = () => {
4949
+ const AddressDetails = ({
4950
+ config,
4951
+ onSelect
4952
+ }) => {
4953
+ var _mdmsData$MdmsRes, _mdmsData$MdmsRes$ego, _mdmsData$MdmsRes$ego2, _mdmsData$MdmsRes$ego3, _mdmsData$MdmsRes$ego4;
4437
4954
  const {
4438
4955
  t
4439
4956
  } = useTranslation();
4440
- const location = useLocation();
4957
+ const tenantId = Digit.ULBService.getCurrentTenantId();
4958
+ const [houseNo, setHouseNo] = useState("");
4959
+ const [street, setStreet] = useState("");
4960
+ const [locality, setLocality] = useState("");
4961
+ const [landmark, setLandmark] = useState("");
4962
+ const [subLocality, setSubLocality] = useState(null);
4963
+ const [pinCode, setPinCode] = useState("");
4964
+ const [assembly, setAssembly] = useState(null);
4965
+ const [ward, setWard] = useState(null);
4966
+ const [zone, setZone] = useState(null);
4967
+ const [latitude, setLatitude] = useState("");
4968
+ const [longitude, setLongitude] = useState("");
4969
+ const [addressType, setAddressType] = useState(null);
4970
+ const [doorPhoto, setDoorPhoto] = useState(null);
4971
+ const [doorPhotoFileStoreId, setDoorPhotoFileStoreId] = useState(null);
4972
+ const [toast, setToast] = useState(null);
4441
4973
  const {
4442
- path
4443
- } = useRouteMatch();
4444
- sessionStorage.removeItem("revalidateddone");
4445
- const getBreadcrumbLabel = () => {
4446
- const pathname = location.pathname;
4447
- if (pathname.includes("/create-kyc")) return "EKYC_CREATE_KYC";
4448
- if (pathname.includes("/aadhaar-verification")) return "EKYC_AADHAAR_VERIFICATION";
4449
- if (pathname.includes("/address-details")) return "EKYC_ADDRESS_DETAILS";
4450
- if (pathname.includes("/property-info")) return "EKYC_PROPERTY_INFO";
4451
- if (pathname.includes("/meter-details")) return "EKYC_METER_DETAILS";
4452
- if (pathname.includes("/review")) return "EKYC_REVIEW";
4453
- return "EKYC_HOME";
4974
+ data: mdmsData,
4975
+ isLoading
4976
+ } = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
4977
+ const assemblies = (mdmsData === null || mdmsData === void 0 ? void 0 : (_mdmsData$MdmsRes = mdmsData.MdmsRes) === null || _mdmsData$MdmsRes === void 0 ? void 0 : (_mdmsData$MdmsRes$ego = _mdmsData$MdmsRes["egov-location"]) === null || _mdmsData$MdmsRes$ego === void 0 ? void 0 : (_mdmsData$MdmsRes$ego2 = _mdmsData$MdmsRes$ego.TenantBoundary) === null || _mdmsData$MdmsRes$ego2 === void 0 ? void 0 : (_mdmsData$MdmsRes$ego3 = _mdmsData$MdmsRes$ego2[0]) === null || _mdmsData$MdmsRes$ego3 === void 0 ? void 0 : (_mdmsData$MdmsRes$ego4 = _mdmsData$MdmsRes$ego3.boundary) === null || _mdmsData$MdmsRes$ego4 === void 0 ? void 0 : _mdmsData$MdmsRes$ego4.children) || [];
4978
+ useEffect(() => {
4979
+ let isMounted = true;
4980
+ if (navigator.geolocation) {
4981
+ navigator.geolocation.getCurrentPosition(pos => {
4982
+ if (!isMounted) return;
4983
+ setLatitude(pos.coords.latitude);
4984
+ setLongitude(pos.coords.longitude);
4985
+ }, () => {
4986
+ if (!isMounted) return;
4987
+ setToast({
4988
+ type: "error",
4989
+ message: "GPS access denied"
4990
+ });
4991
+ });
4992
+ }
4993
+ return () => {
4994
+ isMounted = false;
4995
+ };
4996
+ }, []);
4997
+ const handlePincodeChange = e => {
4998
+ const value = e.target.value;
4999
+ if (/^\d{0,6}$/.test(value)) {
5000
+ setPinCode(value);
5001
+ if (value.length === 6) {
5002
+ fetchLocationByPincode(value);
5003
+ }
5004
+ }
4454
5005
  };
4455
- const breadcrumbs = [{
4456
- icon: HomeIcon,
4457
- path: "/digit-ui/citizen"
4458
- }, {
4459
- label: t(getBreadcrumbLabel())
4460
- }];
4461
- return /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement("div", {
4462
- className: "ground-container employee-app-container form-container"
4463
- }, /*#__PURE__*/React.createElement(ModuleHeader, {
4464
- leftContent: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArrowLeft, {
4465
- className: "icon"
4466
- }), t("CS_COMMON_BACK")),
4467
- onLeftClick: () => window.history.back(),
4468
- breadcrumbs: breadcrumbs
4469
- }), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
4470
- exact: true,
4471
- path: `${path}`,
4472
- component: () => /*#__PURE__*/React.createElement(Home, null)
4473
- }), /*#__PURE__*/React.createElement(PrivateRoute, {
4474
- path: `${path}/dashboard`,
4475
- component: () => /*#__PURE__*/React.createElement(Dashboard, null)
4476
- }), /*#__PURE__*/React.createElement(PrivateRoute, {
4477
- path: `${path}/inbox`,
4478
- component: () => /*#__PURE__*/React.createElement(Inbox$1, null)
4479
- }), /*#__PURE__*/React.createElement(PrivateRoute, {
4480
- path: `${path}/aadhaar-verification`,
4481
- component: () => /*#__PURE__*/React.createElement(AadhaarVerification, null)
4482
- }), /*#__PURE__*/React.createElement(PrivateRoute, {
4483
- path: `${path}/address-details`,
4484
- component: () => /*#__PURE__*/React.createElement(AddressDetails, null)
4485
- }), /*#__PURE__*/React.createElement(PrivateRoute, {
4486
- path: `${path}/property-info`,
4487
- component: () => /*#__PURE__*/React.createElement(PropertyInfo, null)
4488
- }), /*#__PURE__*/React.createElement(PrivateRoute, {
4489
- path: `${path}/meter-details`,
4490
- component: () => /*#__PURE__*/React.createElement(MeterDetails, null)
4491
- }), /*#__PURE__*/React.createElement(PrivateRoute, {
4492
- path: `${path}/review`,
4493
- component: () => /*#__PURE__*/React.createElement(Review, null)
4494
- }))));
4495
- };
4496
-
4497
- const EkycModule = ({
5006
+ const fetchLocationByPincode = pin => {
5007
+ console.log("Fetching location for PIN:", pin);
5008
+ };
5009
+ const selectphoto = async e => {
5010
+ let isMounted = true;
5011
+ const file = e.target.files[0];
5012
+ if (!file) return;
5013
+ if (file.size >= 2000000) {
5014
+ setToast({
5015
+ type: "error",
5016
+ message: "Max size 2MB exceeded"
5017
+ });
5018
+ return;
5019
+ }
5020
+ try {
5021
+ var _res$data, _res$data$files, _res$data$files$;
5022
+ const res = await Digit.UploadServices.Filestorage("EKYC", file, tenantId);
5023
+ if (!isMounted) return;
5024
+ const fileStoreId = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$files = _res$data.files) === null || _res$data$files === void 0 ? void 0 : (_res$data$files$ = _res$data$files[0]) === null || _res$data$files$ === void 0 ? void 0 : _res$data$files$.fileStoreId;
5025
+ if (fileStoreId) {
5026
+ setDoorPhotoFileStoreId(fileStoreId);
5027
+ const reader = new FileReader();
5028
+ reader.onloadend = () => {
5029
+ if (!isMounted) return;
5030
+ setDoorPhoto(reader.result);
5031
+ };
5032
+ reader.readAsDataURL(file);
5033
+ setToast({
5034
+ type: "success",
5035
+ message: "Upload successful"
5036
+ });
5037
+ }
5038
+ } catch {
5039
+ if (!isMounted) return;
5040
+ setToast({
5041
+ type: "error",
5042
+ message: "Upload failed"
5043
+ });
5044
+ }
5045
+ return () => {
5046
+ isMounted = false;
5047
+ };
5048
+ };
5049
+ const removePhoto = () => {
5050
+ setDoorPhoto(null);
5051
+ setDoorPhotoFileStoreId(null);
5052
+ };
5053
+ const isValid = () => {
5054
+ return houseNo && street && pinCode.length === 6 && assembly && ward && zone && latitude && longitude && doorPhotoFileStoreId;
5055
+ };
5056
+ const onStepSelect = () => {
5057
+ if (!isValid()) {
5058
+ setToast({
5059
+ type: "error",
5060
+ message: "Please fill all mandatory fields"
5061
+ });
5062
+ return;
5063
+ }
5064
+ const data = {
5065
+ houseNo,
5066
+ street,
5067
+ locality,
5068
+ landmark,
5069
+ subLocality,
5070
+ pinCode,
5071
+ assembly: assembly === null || assembly === void 0 ? void 0 : assembly.name,
5072
+ ward: ward === null || ward === void 0 ? void 0 : ward.name,
5073
+ zone: zone === null || zone === void 0 ? void 0 : zone.name,
5074
+ latitude,
5075
+ longitude,
5076
+ addressType: addressType === null || addressType === void 0 ? void 0 : addressType.name,
5077
+ doorPhotoFilestoreId: doorPhotoFileStoreId
5078
+ };
5079
+ onSelect(config.key, data);
5080
+ };
5081
+ if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
5082
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(FormStep, {
5083
+ t: t,
5084
+ onSelect: onStepSelect,
5085
+ config: config,
5086
+ label: t("ES_COMMON_CONTINUE")
5087
+ }, /*#__PURE__*/React.createElement(CardLabel, null, "House No / Flat No *"), /*#__PURE__*/React.createElement(TextInput, {
5088
+ value: houseNo,
5089
+ onChange: e => setHouseNo(e.target.value)
5090
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "Street / Address Line *"), /*#__PURE__*/React.createElement(TextInput, {
5091
+ value: street,
5092
+ onChange: e => setStreet(e.target.value)
5093
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "Locality"), /*#__PURE__*/React.createElement(TextInput, {
5094
+ value: locality,
5095
+ onChange: e => setLocality(e.target.value)
5096
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "Landmark"), /*#__PURE__*/React.createElement(TextInput, {
5097
+ value: landmark,
5098
+ onChange: e => setLandmark(e.target.value)
5099
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "Sub Locality"), /*#__PURE__*/React.createElement(Dropdown, {
5100
+ option: [],
5101
+ selected: subLocality,
5102
+ select: setSubLocality
5103
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "PIN Code *"), /*#__PURE__*/React.createElement(TextInput, {
5104
+ value: pinCode,
5105
+ onChange: handlePincodeChange,
5106
+ maxLength: 6
5107
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "Assembly *"), /*#__PURE__*/React.createElement(Dropdown, {
5108
+ option: assemblies,
5109
+ selected: assembly,
5110
+ select: setAssembly
5111
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "Ward *"), /*#__PURE__*/React.createElement(Dropdown, {
5112
+ option: (assembly === null || assembly === void 0 ? void 0 : assembly.children) || [],
5113
+ selected: ward,
5114
+ select: setWard
5115
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "Zone *"), /*#__PURE__*/React.createElement(Dropdown, {
5116
+ option: (ward === null || ward === void 0 ? void 0 : ward.children) || [],
5117
+ selected: zone,
5118
+ select: setZone
5119
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "Latitude"), /*#__PURE__*/React.createElement(TextInput, {
5120
+ value: latitude,
5121
+ disabled: true
5122
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "Longitude"), /*#__PURE__*/React.createElement(TextInput, {
5123
+ value: longitude,
5124
+ disabled: true
5125
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "Address Type"), /*#__PURE__*/React.createElement(Dropdown, {
5126
+ option: [{
5127
+ name: "Permanent"
5128
+ }, {
5129
+ name: "Correspondence"
5130
+ }, {
5131
+ name: "Other"
5132
+ }],
5133
+ selected: addressType,
5134
+ select: setAddressType
5135
+ }), /*#__PURE__*/React.createElement(CardLabel, null, "Door Image *"), /*#__PURE__*/React.createElement(UploadFile, {
5136
+ onUpload: selectphoto,
5137
+ onDelete: removePhoto,
5138
+ message: doorPhotoFileStoreId ? "Uploaded" : "No file selected"
5139
+ }), doorPhoto && /*#__PURE__*/React.createElement("img", {
5140
+ src: doorPhoto,
5141
+ alt: "preview",
5142
+ style: {
5143
+ width: "100%",
5144
+ marginTop: "10px"
5145
+ }
5146
+ }), toast && /*#__PURE__*/React.createElement(Toast, {
5147
+ label: toast.message,
5148
+ error: toast.type === "error",
5149
+ onClose: () => setToast(null)
5150
+ })));
5151
+ };
5152
+
5153
+ const CitizenApp = () => {
5154
+ const {
5155
+ t
5156
+ } = useTranslation();
5157
+ const location = useLocation();
5158
+ const {
5159
+ path
5160
+ } = useRouteMatch();
5161
+ sessionStorage.removeItem("revalidateddone");
5162
+ const getBreadcrumbLabel = () => {
5163
+ const pathname = location.pathname;
5164
+ if (pathname.includes("/create-kyc")) return "EKYC_CREATE_KYC";
5165
+ if (pathname.includes("/aadhaar-verification")) return "EKYC_AADHAAR_VERIFICATION";
5166
+ if (pathname.includes("/address-details")) return "EKYC_ADDRESS_DETAILS";
5167
+ if (pathname.includes("/property-info")) return "EKYC_PROPERTY_INFO";
5168
+ if (pathname.includes("/meter-details")) return "EKYC_METER_DETAILS";
5169
+ if (pathname.includes("/review")) return "EKYC_REVIEW";
5170
+ return "EKYC_HOME";
5171
+ };
5172
+ const breadcrumbs = [{
5173
+ icon: HomeIcon,
5174
+ path: "/digit-ui/citizen"
5175
+ }, {
5176
+ label: t(getBreadcrumbLabel())
5177
+ }];
5178
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
5179
+ className: "ground-container form-container"
5180
+ }, /*#__PURE__*/React.createElement(ModuleHeader, {
5181
+ leftContent: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArrowLeft, {
5182
+ className: "icon"
5183
+ }), t("CS_COMMON_BACK")),
5184
+ onLeftClick: () => window.history.back(),
5185
+ breadcrumbs: breadcrumbs
5186
+ }), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
5187
+ exact: true,
5188
+ path: `${path}`,
5189
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
5190
+ layoutClass: "normal"
5191
+ }, /*#__PURE__*/React.createElement(Home, null))
5192
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
5193
+ path: `${path}/dashboard`,
5194
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
5195
+ layoutClass: "normal"
5196
+ }, /*#__PURE__*/React.createElement(Dashboard, null))
5197
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
5198
+ path: `${path}/inbox`,
5199
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
5200
+ layoutClass: "normal"
5201
+ }, /*#__PURE__*/React.createElement(Inbox$1, null))
5202
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
5203
+ path: `${path}/aadhaar-verification`,
5204
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
5205
+ layoutClass: "normal"
5206
+ }, /*#__PURE__*/React.createElement(AadhaarVerification, null))
5207
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
5208
+ path: `${path}/address-details`,
5209
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
5210
+ layoutClass: "normal"
5211
+ }, /*#__PURE__*/React.createElement(AddressDetails, null))
5212
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
5213
+ path: `${path}/property-info`,
5214
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
5215
+ layoutClass: "normal"
5216
+ }, /*#__PURE__*/React.createElement(PropertyInfo, null))
5217
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
5218
+ path: `${path}/meter-details`,
5219
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
5220
+ layoutClass: "normal"
5221
+ }, /*#__PURE__*/React.createElement(MeterDetails, null))
5222
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
5223
+ path: `${path}/review`,
5224
+ component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
5225
+ layoutClass: "normal"
5226
+ }, /*#__PURE__*/React.createElement(Review, null))
5227
+ }))));
5228
+ };
5229
+
5230
+ const DashboardLayout = ({
5231
+ header,
5232
+ filters,
5233
+ children,
5234
+ onNotificationClick,
5235
+ activeRole,
5236
+ onRoleChange
5237
+ }) => {
5238
+ const {
5239
+ t
5240
+ } = useTranslation();
5241
+ const roles = ["CEO", "CLUSTER_MANAGER", "AGENCY_SUPERVISOR"];
5242
+ return /*#__PURE__*/React.createElement("div", {
5243
+ className: "enterprise-dashboard-layout",
5244
+ style: {
5245
+ background: "linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%)",
5246
+ minHeight: "100vh"
5247
+ }
5248
+ }, /*#__PURE__*/React.createElement("div", {
5249
+ className: "glass-card",
5250
+ style: {
5251
+ padding: "24px 32px",
5252
+ display: "flex",
5253
+ justifyContent: "space-between",
5254
+ alignItems: "center",
5255
+ borderRadius: "0",
5256
+ borderTop: "none",
5257
+ borderLeft: "none",
5258
+ borderRight: "none"
5259
+ }
5260
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h1", {
5261
+ style: {
5262
+ fontSize: "28px",
5263
+ fontWeight: "900",
5264
+ color: "#1E293B",
5265
+ letterSpacing: "-0.05em"
5266
+ }
5267
+ }, t(header)), /*#__PURE__*/React.createElement("p", {
5268
+ style: {
5269
+ fontSize: "14px",
5270
+ color: "#64748B",
5271
+ marginTop: "4px",
5272
+ fontWeight: "500"
5273
+ }
5274
+ }, t("EKYC_DASHBOARD_SUBTITLE_ALT") || "Operational analytics & performance monitoring.")), /*#__PURE__*/React.createElement("div", {
5275
+ style: {
5276
+ display: "flex",
5277
+ alignItems: "center",
5278
+ gap: "20px"
5279
+ }
5280
+ }, /*#__PURE__*/React.createElement("div", {
5281
+ style: {
5282
+ display: "flex",
5283
+ background: "#F3F4F6",
5284
+ padding: "4px",
5285
+ borderRadius: "8px",
5286
+ gap: "4px"
5287
+ }
5288
+ }, roles.map(role => /*#__PURE__*/React.createElement("button", {
5289
+ key: role,
5290
+ onClick: () => onRoleChange(role),
5291
+ style: {
5292
+ padding: "6px 12px",
5293
+ borderRadius: "6px",
5294
+ fontSize: "12px",
5295
+ fontWeight: "700",
5296
+ border: "none",
5297
+ cursor: "pointer",
5298
+ background: activeRole === role ? "var(--primary-gradient)" : "transparent",
5299
+ color: activeRole === role ? "#FFFFFF" : "#64748B",
5300
+ boxShadow: activeRole === role ? "0 4px 12px rgba(99, 102, 241, 0.3)" : "none",
5301
+ transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
5302
+ }
5303
+ }, t(role)))), /*#__PURE__*/React.createElement("button", {
5304
+ onClick: onNotificationClick,
5305
+ style: {
5306
+ position: "relative",
5307
+ background: "#F3F4F6",
5308
+ border: "none",
5309
+ padding: "10px",
5310
+ borderRadius: "50%",
5311
+ cursor: "pointer"
5312
+ }
5313
+ }, /*#__PURE__*/React.createElement("span", {
5314
+ style: {
5315
+ fontSize: "20px"
5316
+ }
5317
+ }, "\uD83D\uDD14"), /*#__PURE__*/React.createElement("span", {
5318
+ style: {
5319
+ position: "absolute",
5320
+ top: "0",
5321
+ right: "0",
5322
+ width: "10px",
5323
+ height: "10px",
5324
+ background: "#EF4444",
5325
+ borderRadius: "50%",
5326
+ border: "2px solid #FFF"
5327
+ }
5328
+ })))), filters, /*#__PURE__*/React.createElement("div", {
5329
+ style: {
5330
+ padding: "24px",
5331
+ maxWidth: "1600px",
5332
+ margin: "0 auto"
5333
+ }
5334
+ }, children), /*#__PURE__*/React.createElement("div", {
5335
+ style: {
5336
+ padding: "40px 24px",
5337
+ textAlign: "center",
5338
+ color: "#9CA3AF",
5339
+ fontSize: "12px"
5340
+ }
5341
+ }, t("EKYC_POWERED_BY_UPYOG"), " | ", new Date().getFullYear(), " \xA9 ", t("EKYC_GOVT_DJB")));
5342
+ };
5343
+
5344
+ const FilterBar = ({
5345
+ filters,
5346
+ config,
5347
+ onFilterChange,
5348
+ onReset
5349
+ }) => {
5350
+ const {
5351
+ t
5352
+ } = useTranslation();
5353
+ return /*#__PURE__*/React.createElement("div", {
5354
+ className: "dashboard-filter-bar glass-card",
5355
+ style: {
5356
+ position: "sticky",
5357
+ top: "0",
5358
+ zIndex: "100",
5359
+ padding: "20px 28px",
5360
+ display: "flex",
5361
+ alignItems: "center",
5362
+ gap: "24px",
5363
+ flexWrap: "wrap",
5364
+ borderRadius: "0 0 24px 24px",
5365
+ marginTop: "-1px"
5366
+ }
5367
+ }, /*#__PURE__*/React.createElement("div", {
5368
+ style: {
5369
+ display: "flex",
5370
+ alignItems: "center",
5371
+ gap: "8px",
5372
+ borderRight: "1px solid #E5E7EB",
5373
+ paddingRight: "16px"
5374
+ }
5375
+ }, /*#__PURE__*/React.createElement("span", {
5376
+ style: {
5377
+ fontSize: "14px",
5378
+ fontWeight: "700",
5379
+ color: "#374151"
5380
+ }
5381
+ }, t("EKYC_GLOBAL_FILTERS"))), /*#__PURE__*/React.createElement("div", {
5382
+ style: {
5383
+ display: "flex",
5384
+ gap: "12px",
5385
+ flex: 1,
5386
+ flexWrap: "wrap"
5387
+ }
5388
+ }, config.map(filter => /*#__PURE__*/React.createElement("div", {
5389
+ key: filter.id,
5390
+ style: {
5391
+ display: "flex",
5392
+ flexDirection: "column",
5393
+ gap: "4px"
5394
+ }
5395
+ }, /*#__PURE__*/React.createElement("label", {
5396
+ style: {
5397
+ fontSize: "11px",
5398
+ fontWeight: "600",
5399
+ color: "#6B7280",
5400
+ textTransform: "uppercase"
5401
+ }
5402
+ }, t(filter.label)), /*#__PURE__*/React.createElement("select", {
5403
+ value: filters[filter.id] || filter.default,
5404
+ onChange: e => onFilterChange(filter.id, e.target.value),
5405
+ style: {
5406
+ padding: "6px 12px",
5407
+ borderRadius: "6px",
5408
+ border: "1px solid #D1D5DB",
5409
+ background: "#F9FAFB",
5410
+ fontSize: "13px",
5411
+ outline: "none",
5412
+ minWidth: "140px"
5413
+ }
5414
+ }, filter.options.map(opt => /*#__PURE__*/React.createElement("option", {
5415
+ key: opt,
5416
+ value: opt
5417
+ }, opt)))))), /*#__PURE__*/React.createElement("div", {
5418
+ style: {
5419
+ display: "flex",
5420
+ gap: "12px"
5421
+ }
5422
+ }, /*#__PURE__*/React.createElement("button", {
5423
+ onClick: onReset,
5424
+ style: {
5425
+ padding: "8px 16px",
5426
+ borderRadius: "8px",
5427
+ background: "transparent",
5428
+ color: "#6B7280",
5429
+ border: "1px solid #D1D5DB",
5430
+ cursor: "pointer",
5431
+ fontSize: "14px",
5432
+ fontWeight: "600"
5433
+ }
5434
+ }, t("EKYC_RESET"))));
5435
+ };
5436
+
5437
+ const SummaryCard = ({
5438
+ label,
5439
+ value,
5440
+ color,
5441
+ icon,
5442
+ trend,
5443
+ isCurrency,
5444
+ suffix: _suffix = "",
5445
+ onClick
5446
+ }) => {
5447
+ const {
5448
+ t
5449
+ } = useTranslation();
5450
+ const formatValue = val => {
5451
+ if (isCurrency) {
5452
+ return `₹${new Intl.NumberFormat('en-IN').format(val)}`;
5453
+ }
5454
+ return new Intl.NumberFormat('en-IN').format(val);
5455
+ };
5456
+ return /*#__PURE__*/React.createElement("div", {
5457
+ className: "summary-card glass-card",
5458
+ onClick: onClick,
5459
+ style: {
5460
+ padding: "28px 24px",
5461
+ cursor: onClick ? "pointer" : "default",
5462
+ display: "flex",
5463
+ flexDirection: "column",
5464
+ justifyContent: "space-between",
5465
+ height: "100%",
5466
+ minHeight: "160px",
5467
+ position: "relative",
5468
+ overflow: "hidden"
5469
+ },
5470
+ onMouseOver: e => {
5471
+ if (onClick) {
5472
+ e.currentTarget.style.transform = "translateY(-8px) scale(1.02)";
5473
+ }
5474
+ },
5475
+ onMouseOut: e => {
5476
+ if (onClick) {
5477
+ e.currentTarget.style.transform = "translateY(0) scale(1)";
5478
+ }
5479
+ }
5480
+ }, /*#__PURE__*/React.createElement("div", {
5481
+ style: {
5482
+ display: "flex",
5483
+ justifyContent: "space-between",
5484
+ alignItems: "flex-start"
5485
+ }
5486
+ }, /*#__PURE__*/React.createElement("span", {
5487
+ style: {
5488
+ fontSize: "13px",
5489
+ fontWeight: "700",
5490
+ color: "#6B7280",
5491
+ letterSpacing: "0.05em",
5492
+ textTransform: "uppercase"
5493
+ }
5494
+ }, t(label)), /*#__PURE__*/React.createElement("div", {
5495
+ style: {
5496
+ padding: "10px",
5497
+ borderRadius: "12px",
5498
+ background: `linear-gradient(135deg, ${color}20 0%, ${color}40 100%)`,
5499
+ color: color,
5500
+ boxShadow: `0 4px 12px ${color}20`
5501
+ }
5502
+ }, /*#__PURE__*/React.createElement("span", {
5503
+ style: {
5504
+ fontSize: "20px"
5505
+ }
5506
+ }, icon === "document" ? "📄" : icon === "check" ? "✅" : icon === "clock" ? "⏳" : icon === "rupee" ? "₹" : "📊"))), /*#__PURE__*/React.createElement("div", {
5507
+ style: {
5508
+ marginTop: "12px"
5509
+ }
5510
+ }, /*#__PURE__*/React.createElement("div", {
5511
+ style: {
5512
+ fontSize: "28px",
5513
+ fontWeight: "800",
5514
+ color: "#111827"
5515
+ }
5516
+ }, formatValue(value), _suffix), trend && /*#__PURE__*/React.createElement("div", {
5517
+ style: {
5518
+ display: "flex",
5519
+ alignItems: "center",
5520
+ marginTop: "8px",
5521
+ fontSize: "12px",
5522
+ fontWeight: "600"
5523
+ }
5524
+ }, /*#__PURE__*/React.createElement("span", {
5525
+ style: {
5526
+ color: trend > 0 ? "#10B981" : "#EF4444"
5527
+ }
5528
+ }, trend > 0 ? "↗" : "↘", " ", Math.abs(trend), "%"), /*#__PURE__*/React.createElement("span", {
5529
+ style: {
5530
+ color: "#9CA3AF",
5531
+ marginLeft: "4px"
5532
+ }
5533
+ }, t("EKYC_FROM_PREV_MONTH")))));
5534
+ };
5535
+
5536
+ Chart$1.register(...registerables);
5537
+ const TaskStatusChart = ({
5538
+ data,
5539
+ title
5540
+ }) => {
5541
+ const {
5542
+ t
5543
+ } = useTranslation();
5544
+ const chartRef = useRef(null);
5545
+ const chartInstance = useRef(null);
5546
+ useEffect(() => {
5547
+ if (chartRef.current && data) {
5548
+ if (chartInstance.current) chartInstance.current.destroy();
5549
+ const ctx = chartRef.current.getContext("2d");
5550
+ const gradientBlue = ctx.createLinearGradient(0, 0, 0, 400);
5551
+ gradientBlue.addColorStop(0, '#3B82F6');
5552
+ gradientBlue.addColorStop(1, '#2563EB');
5553
+ const gradientAmber = ctx.createLinearGradient(0, 0, 0, 400);
5554
+ gradientAmber.addColorStop(0, '#F59E0B');
5555
+ gradientAmber.addColorStop(1, '#D97706');
5556
+ const gradientIndigo = ctx.createLinearGradient(0, 0, 0, 400);
5557
+ gradientIndigo.addColorStop(0, '#6366F1');
5558
+ gradientIndigo.addColorStop(1, '#4F46E5');
5559
+ const gradientEmerald = ctx.createLinearGradient(0, 0, 0, 400);
5560
+ gradientEmerald.addColorStop(0, '#10B981');
5561
+ gradientEmerald.addColorStop(1, '#059669');
5562
+ const colors = [gradientBlue, gradientAmber, gradientIndigo, gradientEmerald, '#EC4899', '#EF4444'];
5563
+ const labels = data.map(item => t(item.stageName));
5564
+ const values = data.map(item => item.count);
5565
+ const ChartConstructor = Chart$1.Chart || Chart$1;
5566
+ chartInstance.current = new ChartConstructor(ctx, {
5567
+ type: "doughnut",
5568
+ data: {
5569
+ labels,
5570
+ datasets: [{
5571
+ data: values,
5572
+ backgroundColor: colors.slice(0, labels.length),
5573
+ borderWidth: 2,
5574
+ borderColor: "#ffffff",
5575
+ hoverOffset: 10
5576
+ }]
5577
+ },
5578
+ options: {
5579
+ responsive: true,
5580
+ maintainAspectRatio: false,
5581
+ cutout: '70%',
5582
+ plugins: {
5583
+ legend: {
5584
+ position: 'right',
5585
+ labels: {
5586
+ usePointStyle: true,
5587
+ padding: 15,
5588
+ font: {
5589
+ size: 12
5590
+ }
5591
+ }
5592
+ },
5593
+ tooltip: {
5594
+ backgroundColor: '#1F2937',
5595
+ padding: 10,
5596
+ bodyFont: {
5597
+ size: 13
5598
+ }
5599
+ }
5600
+ }
5601
+ }
5602
+ });
5603
+ }
5604
+ return () => {
5605
+ if (chartInstance.current) chartInstance.current.destroy();
5606
+ };
5607
+ }, [data, t]);
5608
+ return /*#__PURE__*/React.createElement("div", {
5609
+ className: "task-status-chart-container glass-card",
5610
+ style: {
5611
+ height: "320px",
5612
+ width: "100%",
5613
+ padding: "24px"
5614
+ }
5615
+ }, title && /*#__PURE__*/React.createElement("h3", {
5616
+ className: "chart-title",
5617
+ style: {
5618
+ marginBottom: "24px",
5619
+ fontSize: "18px",
5620
+ fontWeight: "700",
5621
+ color: "#111827"
5622
+ }
5623
+ }, t(title)), /*#__PURE__*/React.createElement("div", {
5624
+ style: {
5625
+ height: "220px"
5626
+ }
5627
+ }, /*#__PURE__*/React.createElement("canvas", {
5628
+ ref: chartRef
5629
+ })));
5630
+ };
5631
+
5632
+ const ClusterHeatmap = ({
5633
+ data,
5634
+ title,
5635
+ onDrillDown
5636
+ }) => {
5637
+ const {
5638
+ t
5639
+ } = useTranslation();
5640
+ if (!data || data.length === 0) return null;
5641
+ const getIntensityColor = score => {
5642
+ if (score > 80) return "#EF4444";
5643
+ if (score > 50) return "#F59E0B";
5644
+ return "#10B981";
5645
+ };
5646
+ return /*#__PURE__*/React.createElement("div", {
5647
+ className: "cluster-heatmap-container glass-card",
5648
+ style: {
5649
+ padding: "28px"
5650
+ }
5651
+ }, title && /*#__PURE__*/React.createElement("h3", {
5652
+ className: "chart-title",
5653
+ style: {
5654
+ marginBottom: "28px",
5655
+ fontSize: "18px",
5656
+ fontWeight: "800",
5657
+ color: "#111827",
5658
+ letterSpacing: "-0.025em"
5659
+ }
5660
+ }, t(title)), /*#__PURE__*/React.createElement("div", {
5661
+ className: "heatmap-grid",
5662
+ style: {
5663
+ display: "grid",
5664
+ gridTemplateColumns: "repeat(auto-fill, minmax(240px, 1fr))",
5665
+ gap: "20px"
5666
+ }
5667
+ }, data.map(cluster => /*#__PURE__*/React.createElement("div", {
5668
+ key: cluster.clusterId,
5669
+ className: "heatmap-card glass-card",
5670
+ onClick: () => onDrillDown === null || onDrillDown === void 0 ? void 0 : onDrillDown(cluster),
5671
+ style: {
5672
+ padding: "20px",
5673
+ background: "#FFFFFF",
5674
+ border: `1px solid ${getIntensityColor(cluster.intensityScore)}40`,
5675
+ cursor: "pointer",
5676
+ position: "relative",
5677
+ overflow: "hidden"
5678
+ }
5679
+ }, /*#__PURE__*/React.createElement("div", {
5680
+ className: "intensity-bar",
5681
+ style: {
5682
+ position: "absolute",
5683
+ top: 0,
5684
+ left: 0,
5685
+ height: "4px",
5686
+ width: "100%",
5687
+ background: getIntensityColor(cluster.intensityScore)
5688
+ }
5689
+ }), /*#__PURE__*/React.createElement("div", {
5690
+ style: {
5691
+ display: "flex",
5692
+ justifyContent: "space-between",
5693
+ alignItems: "flex-start",
5694
+ marginBottom: "12px"
5695
+ }
5696
+ }, /*#__PURE__*/React.createElement("span", {
5697
+ style: {
5698
+ fontWeight: "600",
5699
+ fontSize: "14px",
5700
+ color: "#374151"
5701
+ }
5702
+ }, cluster.clusterName), /*#__PURE__*/React.createElement("span", {
5703
+ style: {
5704
+ fontSize: "12px",
5705
+ fontWeight: "700",
5706
+ padding: "2px 8px",
5707
+ borderRadius: "12px",
5708
+ background: `${getIntensityColor(cluster.intensityScore)}20`,
5709
+ color: getIntensityColor(cluster.intensityScore)
5710
+ }
5711
+ }, cluster.intensityScore, "%")), /*#__PURE__*/React.createElement("div", {
5712
+ className: "cluster-stats",
5713
+ style: {
5714
+ display: "flex",
5715
+ flexDirection: "column",
5716
+ gap: "8px"
5717
+ }
5718
+ }, /*#__PURE__*/React.createElement("div", {
5719
+ style: {
5720
+ display: "flex",
5721
+ justifyContent: "space-between",
5722
+ fontSize: "12px"
5723
+ }
5724
+ }, /*#__PURE__*/React.createElement("span", {
5725
+ style: {
5726
+ color: "#6B7280"
5727
+ }
5728
+ }, t("EKYC_PENDING_WORKLOAD")), /*#__PURE__*/React.createElement("span", {
5729
+ style: {
5730
+ fontWeight: "600",
5731
+ color: "#1F2937"
5732
+ }
5733
+ }, cluster.pendingWorkload)), /*#__PURE__*/React.createElement("div", {
5734
+ style: {
5735
+ display: "flex",
5736
+ justifyContent: "space-between",
5737
+ fontSize: "12px"
5738
+ }
5739
+ }, /*#__PURE__*/React.createElement("span", {
5740
+ style: {
5741
+ color: "#6B7280"
5742
+ }
5743
+ }, t("EKYC_ACTIVE_AGENCIES")), /*#__PURE__*/React.createElement("span", {
5744
+ style: {
5745
+ fontWeight: "600",
5746
+ color: "#1F2937"
5747
+ }
5748
+ }, cluster.activeAgencies))), /*#__PURE__*/React.createElement("div", {
5749
+ className: "mini-spark",
5750
+ style: {
5751
+ marginTop: "12px",
5752
+ display: "flex",
5753
+ gap: "2px",
5754
+ alignItems: "flex-end",
5755
+ height: "20px"
5756
+ }
5757
+ }, cluster.wards.map((ward, idx) => /*#__PURE__*/React.createElement("div", {
5758
+ key: idx,
5759
+ style: {
5760
+ flex: 1,
5761
+ height: `${Math.min(100, ward.pendingCount / cluster.pendingWorkload * 100)}%`,
5762
+ background: getIntensityColor(cluster.intensityScore),
5763
+ opacity: 0.6,
5764
+ borderRadius: "1px"
5765
+ }
5766
+ })))))));
5767
+ };
5768
+
5769
+ const ExportUtils = {
5770
+ exportToCsv: (data, filename = "dashboard_export.csv", columns = []) => {
5771
+ if (!data || !data.length) return;
5772
+ const keys = columns.length ? columns.map(c => c.id) : Object.keys(data[0]);
5773
+ const headers = columns.length ? columns.map(c => c.label) : keys;
5774
+ const csvRows = [];
5775
+ csvRows.push(headers.map(h => `"${String(h).replace(/"/g, '""')}"`).join(","));
5776
+ data.forEach(row => {
5777
+ const values = keys.map(k => {
5778
+ const val = row[k] !== undefined && row[k] !== null ? row[k] : "";
5779
+ return `"${String(val).replace(/"/g, '""')}"`;
5780
+ });
5781
+ csvRows.push(values.join(","));
5782
+ });
5783
+ const csvString = csvRows.join("\n");
5784
+ const blob = new Blob([csvString], {
5785
+ type: "text/csv;charset=utf-8;"
5786
+ });
5787
+ const link = document.createElement("a");
5788
+ if (link.download !== undefined) {
5789
+ const url = URL.createObjectURL(blob);
5790
+ link.setAttribute("href", url);
5791
+ link.setAttribute("download", filename);
5792
+ link.style.visibility = "hidden";
5793
+ document.body.appendChild(link);
5794
+ link.click();
5795
+ document.body.removeChild(link);
5796
+ }
5797
+ },
5798
+ exportToExcel: (data, filename = "dashboard_report.xlsx", columns = []) => {
5799
+ ExportUtils.exportToCsv(data, filename.replace(".xlsx", ".csv"), columns);
5800
+ },
5801
+ printDashboard: () => {
5802
+ if (typeof window !== "undefined") {
5803
+ window.print();
5804
+ }
5805
+ }
5806
+ };
5807
+
5808
+ const AnalyticsTable = ({
5809
+ data,
5810
+ columns,
5811
+ title,
5812
+ filename
5813
+ }) => {
5814
+ const {
5815
+ t
5816
+ } = useTranslation();
5817
+ const [searchTerm, setSearchTerm] = useState("");
5818
+ const [sortConfig, setSortConfig] = useState({
5819
+ key: null,
5820
+ direction: 'asc'
5821
+ });
5822
+ const sortedData = useMemo(() => {
5823
+ let items = [...(data || [])];
5824
+ if (searchTerm) {
5825
+ items = items.filter(item => Object.values(item).some(val => String(val).toLowerCase().includes(searchTerm.toLowerCase())));
5826
+ }
5827
+ if (sortConfig.key) {
5828
+ items.sort((a, b) => {
5829
+ if (a[sortConfig.key] < b[sortConfig.key]) {
5830
+ return sortConfig.direction === 'asc' ? -1 : 1;
5831
+ }
5832
+ if (a[sortConfig.key] > b[sortConfig.key]) {
5833
+ return sortConfig.direction === 'asc' ? 1 : -1;
5834
+ }
5835
+ return 0;
5836
+ });
5837
+ }
5838
+ return items;
5839
+ }, [data, searchTerm, sortConfig]);
5840
+ const requestSort = key => {
5841
+ let direction = 'asc';
5842
+ if (sortConfig.key === key && sortConfig.direction === 'asc') {
5843
+ direction = 'desc';
5844
+ }
5845
+ setSortConfig({
5846
+ key,
5847
+ direction
5848
+ });
5849
+ };
5850
+ return /*#__PURE__*/React.createElement("div", {
5851
+ className: "analytics-table-card glass-card",
5852
+ style: {
5853
+ padding: "0",
5854
+ overflow: "hidden"
5855
+ }
5856
+ }, /*#__PURE__*/React.createElement("div", {
5857
+ className: "table-header",
5858
+ style: {
5859
+ padding: "28px",
5860
+ borderBottom: "1px solid rgba(229, 231, 235, 0.5)",
5861
+ display: "flex",
5862
+ justifyContent: "space-between",
5863
+ alignItems: "center",
5864
+ flexWrap: "wrap",
5865
+ gap: "16px"
5866
+ }
5867
+ }, /*#__PURE__*/React.createElement("h3", {
5868
+ style: {
5869
+ fontSize: "18px",
5870
+ fontWeight: "800",
5871
+ color: "#111827",
5872
+ letterSpacing: "-0.025em"
5873
+ }
5874
+ }, t(title)), /*#__PURE__*/React.createElement("div", {
5875
+ style: {
5876
+ display: "flex",
5877
+ gap: "12px",
5878
+ alignItems: "center"
5879
+ }
5880
+ }, /*#__PURE__*/React.createElement("input", {
5881
+ type: "text",
5882
+ placeholder: t("EKYC_SEARCH_RECORDS"),
5883
+ value: searchTerm,
5884
+ onChange: e => setSearchTerm(e.target.value),
5885
+ style: {
5886
+ padding: "8px 16px",
5887
+ borderRadius: "8px",
5888
+ border: "1px solid #D1D5DB",
5889
+ outline: "none",
5890
+ fontSize: "14px"
5891
+ }
5892
+ }), /*#__PURE__*/React.createElement("button", {
5893
+ onClick: () => ExportUtils.exportToCsv(sortedData, filename, columns),
5894
+ style: {
5895
+ padding: "10px 20px",
5896
+ borderRadius: "12px",
5897
+ background: "var(--primary-gradient)",
5898
+ color: "#FFF",
5899
+ border: "none",
5900
+ cursor: "pointer",
5901
+ fontWeight: "700",
5902
+ fontSize: "14px",
5903
+ boxShadow: "0 4px 6px rgba(99, 102, 241, 0.2)"
5904
+ }
5905
+ }, t("EKYC_EXPORT_CSV")))), /*#__PURE__*/React.createElement("div", {
5906
+ className: "table-body",
5907
+ style: {
5908
+ overflowX: "auto"
5909
+ }
5910
+ }, /*#__PURE__*/React.createElement("table", {
5911
+ style: {
5912
+ width: "100%",
5913
+ borderCollapse: "collapse",
5914
+ textAlign: "left"
5915
+ }
5916
+ }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", {
5917
+ style: {
5918
+ background: "#F9FAFB"
5919
+ }
5920
+ }, columns.map(col => /*#__PURE__*/React.createElement("th", {
5921
+ key: col.id,
5922
+ onClick: () => requestSort(col.id),
5923
+ style: {
5924
+ padding: "16px 28px",
5925
+ fontSize: "11px",
5926
+ fontWeight: "700",
5927
+ color: "#6B7280",
5928
+ textTransform: "uppercase",
5929
+ cursor: "pointer",
5930
+ borderBottom: "1px solid rgba(229, 231, 235, 0.5)",
5931
+ letterSpacing: "0.05em"
5932
+ }
5933
+ }, /*#__PURE__*/React.createElement("div", {
5934
+ style: {
5935
+ display: "flex",
5936
+ alignItems: "center",
5937
+ gap: "4px"
5938
+ }
5939
+ }, t(col.label), sortConfig.key === col.id && /*#__PURE__*/React.createElement("span", null, sortConfig.direction === 'asc' ? '↑' : '↓')))))), /*#__PURE__*/React.createElement("tbody", null, sortedData.map((row, idx) => /*#__PURE__*/React.createElement("tr", {
5940
+ key: idx,
5941
+ style: {
5942
+ borderBottom: "1px solid #F3F4F6",
5943
+ transition: "background 0.2s"
5944
+ },
5945
+ onMouseOver: e => e.currentTarget.style.background = "#F9FAFB",
5946
+ onMouseOut: e => e.currentTarget.style.background = "transparent"
5947
+ }, columns.map(col => /*#__PURE__*/React.createElement("td", {
5948
+ key: col.id,
5949
+ style: {
5950
+ padding: "16px 28px",
5951
+ fontSize: "14px",
5952
+ color: "#4B5563",
5953
+ fontWeight: col.id === "agencyName" ? "600" : "400"
5954
+ }
5955
+ }, col.isCurrency ? `₹${new Intl.NumberFormat('en-IN').format(row[col.id])}` : col.isPercentage ? `${row[col.id]}%` : row[col.id]))))))));
5956
+ };
5957
+
5958
+ const SLAWidget = ({
5959
+ slaPercentage,
5960
+ avgTime,
5961
+ breachedCount
5962
+ }) => {
5963
+ const {
5964
+ t
5965
+ } = useTranslation();
5966
+ const getStatusColor = pct => {
5967
+ if (pct > 90) return "#10B981";
5968
+ if (pct > 75) return "#F59E0B";
5969
+ return "#EF4444";
5970
+ };
5971
+ return /*#__PURE__*/React.createElement("div", {
5972
+ className: "sla-widget-card glass-card",
5973
+ style: {
5974
+ padding: "28px"
5975
+ }
5976
+ }, /*#__PURE__*/React.createElement("h3", {
5977
+ style: {
5978
+ fontSize: "18px",
5979
+ fontWeight: "800",
5980
+ color: "#111827",
5981
+ marginBottom: "28px",
5982
+ letterSpacing: "-0.025em"
5983
+ }
5984
+ }, t("EKYC_SLA_PERFORMANCE")), /*#__PURE__*/React.createElement("div", {
5985
+ style: {
5986
+ display: "flex",
5987
+ alignItems: "center",
5988
+ gap: "24px",
5989
+ marginBottom: "24px"
5990
+ }
5991
+ }, /*#__PURE__*/React.createElement("div", {
5992
+ style: {
5993
+ position: "relative",
5994
+ width: "100px",
5995
+ height: "100px",
5996
+ display: "flex",
5997
+ alignItems: "center",
5998
+ justifyContent: "center"
5999
+ }
6000
+ }, /*#__PURE__*/React.createElement("svg", {
6001
+ width: "100",
6002
+ height: "100",
6003
+ viewBox: "0 0 100 100"
6004
+ }, /*#__PURE__*/React.createElement("circle", {
6005
+ cx: "50",
6006
+ cy: "50",
6007
+ r: "40",
6008
+ stroke: "#F3F4F6",
6009
+ strokeWidth: "8",
6010
+ fill: "none"
6011
+ }), /*#__PURE__*/React.createElement("circle", {
6012
+ cx: "50",
6013
+ cy: "50",
6014
+ r: "40",
6015
+ stroke: getStatusColor(slaPercentage),
6016
+ strokeWidth: "8",
6017
+ fill: "none",
6018
+ strokeDasharray: `${slaPercentage * 2.51} 251`,
6019
+ transform: "rotate(-90 50 50)",
6020
+ strokeLinecap: "round"
6021
+ }), /*#__PURE__*/React.createElement("text", {
6022
+ x: "50",
6023
+ y: "55",
6024
+ textAnchor: "middle",
6025
+ fontSize: "18",
6026
+ fontWeight: "700",
6027
+ fill: "#111827"
6028
+ }, slaPercentage, "%"))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
6029
+ style: {
6030
+ fontSize: "14px",
6031
+ color: "#6B7280"
6032
+ }
6033
+ }, t("EKYC_SLA_COMPLIANCE")), /*#__PURE__*/React.createElement("div", {
6034
+ style: {
6035
+ fontSize: "20px",
6036
+ fontWeight: "700",
6037
+ color: "#111827"
6038
+ }
6039
+ }, t("EKYC_OPTIMAL_PERFORMANCE")))), /*#__PURE__*/React.createElement("div", {
6040
+ style: {
6041
+ display: "grid",
6042
+ gridTemplateColumns: "1fr 1fr",
6043
+ gap: "16px",
6044
+ borderTop: "1px solid #F3F4F6",
6045
+ paddingTop: "20px"
6046
+ }
6047
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
6048
+ style: {
6049
+ fontSize: "12px",
6050
+ color: "#6B7280",
6051
+ marginBottom: "4px"
6052
+ }
6053
+ }, t("EKYC_AVG_LATENCY")), /*#__PURE__*/React.createElement("div", {
6054
+ style: {
6055
+ fontSize: "18px",
6056
+ fontWeight: "700",
6057
+ color: "#111827"
6058
+ }
6059
+ }, avgTime, "h")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
6060
+ style: {
6061
+ fontSize: "12px",
6062
+ color: "#6B7280",
6063
+ marginBottom: "4px"
6064
+ }
6065
+ }, t("EKYC_BREACH_COUNT")), /*#__PURE__*/React.createElement("div", {
6066
+ style: {
6067
+ fontSize: "18px",
6068
+ fontWeight: "700",
6069
+ color: "#EF4444"
6070
+ }
6071
+ }, breachedCount))));
6072
+ };
6073
+
6074
+ const WorkflowTimeline = ({
6075
+ stages
6076
+ }) => {
6077
+ const {
6078
+ t
6079
+ } = useTranslation();
6080
+ if (!stages || stages.length === 0) return null;
6081
+ return /*#__PURE__*/React.createElement("div", {
6082
+ className: "workflow-timeline-card glass-card",
6083
+ style: {
6084
+ padding: "28px"
6085
+ }
6086
+ }, /*#__PURE__*/React.createElement("h3", {
6087
+ style: {
6088
+ fontSize: "18px",
6089
+ fontWeight: "800",
6090
+ color: "#111827",
6091
+ marginBottom: "28px",
6092
+ letterSpacing: "-0.025em"
6093
+ }
6094
+ }, t("EKYC_WORKFLOW_BOTTLENECK_ANALYSIS")), /*#__PURE__*/React.createElement("div", {
6095
+ className: "timeline-container",
6096
+ style: {
6097
+ display: "flex",
6098
+ flexDirection: "column",
6099
+ gap: "16px"
6100
+ }
6101
+ }, stages.map((stage, idx) => /*#__PURE__*/React.createElement("div", {
6102
+ key: idx,
6103
+ style: {
6104
+ display: "flex",
6105
+ gap: "16px",
6106
+ alignItems: "flex-start"
6107
+ }
6108
+ }, /*#__PURE__*/React.createElement("div", {
6109
+ style: {
6110
+ display: "flex",
6111
+ flexDirection: "column",
6112
+ alignItems: "center"
6113
+ }
6114
+ }, /*#__PURE__*/React.createElement("div", {
6115
+ style: {
6116
+ width: "12px",
6117
+ height: "12px",
6118
+ borderRadius: "50%",
6119
+ background: stage.avgDurationHours > 20 ? "#EF4444" : "#10B981",
6120
+ marginTop: "4px"
6121
+ }
6122
+ }), idx !== stages.length - 1 && /*#__PURE__*/React.createElement("div", {
6123
+ style: {
6124
+ width: "2px",
6125
+ height: "40px",
6126
+ background: "#E5E7EB"
6127
+ }
6128
+ })), /*#__PURE__*/React.createElement("div", {
6129
+ style: {
6130
+ flex: 1
6131
+ }
6132
+ }, /*#__PURE__*/React.createElement("div", {
6133
+ style: {
6134
+ display: "flex",
6135
+ justifyContent: "space-between",
6136
+ marginBottom: "4px"
6137
+ }
6138
+ }, /*#__PURE__*/React.createElement("span", {
6139
+ style: {
6140
+ fontSize: "14px",
6141
+ fontWeight: "600",
6142
+ color: "#374151"
6143
+ }
6144
+ }, t(stage.stageName)), /*#__PURE__*/React.createElement("span", {
6145
+ style: {
6146
+ fontSize: "12px",
6147
+ fontWeight: "700",
6148
+ color: stage.avgDurationHours > 20 ? "#EF4444" : "#10B981"
6149
+ }
6150
+ }, stage.avgDurationHours, "h ", t("EKYC_AVG"))), /*#__PURE__*/React.createElement("div", {
6151
+ style: {
6152
+ width: "100%",
6153
+ height: "6px",
6154
+ background: "#F3F4F6",
6155
+ borderRadius: "3px",
6156
+ overflow: "hidden"
6157
+ }
6158
+ }, /*#__PURE__*/React.createElement("div", {
6159
+ style: {
6160
+ width: `${Math.min(100, stage.count / 1000 * 100)}%`,
6161
+ height: "100%",
6162
+ background: stage.avgDurationHours > 20 ? "#EF444480" : "#10B98180"
6163
+ }
6164
+ })), /*#__PURE__*/React.createElement("div", {
6165
+ style: {
6166
+ fontSize: "12px",
6167
+ color: "#6B7280",
6168
+ marginTop: "4px"
6169
+ }
6170
+ }, stage.count, " ", t("EKYC_APPLICATIONS_IN_STAGE")))))));
6171
+ };
6172
+
6173
+ const NotificationPanel = ({
6174
+ notifications,
6175
+ isOpen,
6176
+ onClose
6177
+ }) => {
6178
+ const {
6179
+ t
6180
+ } = useTranslation();
6181
+ if (!isOpen) return null;
6182
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
6183
+ onClick: onClose,
6184
+ style: {
6185
+ position: "fixed",
6186
+ top: 0,
6187
+ left: 0,
6188
+ width: "100%",
6189
+ height: "100%",
6190
+ background: "rgba(0,0,0,0.3)",
6191
+ zIndex: 999
6192
+ }
6193
+ }), /*#__PURE__*/React.createElement("div", {
6194
+ className: "notification-panel",
6195
+ style: {
6196
+ position: "fixed",
6197
+ top: 0,
6198
+ right: 0,
6199
+ width: "350px",
6200
+ height: "100%",
6201
+ background: "#FFFFFF",
6202
+ zIndex: 1000,
6203
+ boxShadow: "-4px 0 15px rgba(0,0,0,0.1)",
6204
+ display: "flex",
6205
+ flexDirection: "column"
6206
+ }
6207
+ }, /*#__PURE__*/React.createElement("div", {
6208
+ style: {
6209
+ padding: "20px",
6210
+ borderBottom: "1px solid #F3F4F6",
6211
+ display: "flex",
6212
+ justifyContent: "space-between",
6213
+ alignItems: "center"
6214
+ }
6215
+ }, /*#__PURE__*/React.createElement("h3", {
6216
+ style: {
6217
+ fontSize: "18px",
6218
+ fontWeight: "700",
6219
+ color: "#111827"
6220
+ }
6221
+ }, t("EKYC_ALERTS_CENTER")), /*#__PURE__*/React.createElement("button", {
6222
+ onClick: onClose,
6223
+ style: {
6224
+ background: "none",
6225
+ border: "none",
6226
+ fontSize: "24px",
6227
+ cursor: "pointer",
6228
+ color: "#9CA3AF"
6229
+ }
6230
+ }, "\xD7")), /*#__PURE__*/React.createElement("div", {
6231
+ style: {
6232
+ flex: 1,
6233
+ overflowY: "auto",
6234
+ padding: "16px"
6235
+ }
6236
+ }, notifications.length === 0 ? /*#__PURE__*/React.createElement("div", {
6237
+ style: {
6238
+ textAlign: "center",
6239
+ color: "#9CA3AF",
6240
+ marginTop: "40px"
6241
+ }
6242
+ }, t("EKYC_NO_NEW_ALERTS")) : notifications.map((alert, idx) => /*#__PURE__*/React.createElement("div", {
6243
+ key: idx,
6244
+ style: {
6245
+ padding: "16px",
6246
+ borderRadius: "12px",
6247
+ background: alert.priority === "HIGH" ? "#FEF2F2" : "#F9FAFB",
6248
+ border: `1px solid ${alert.priority === "HIGH" ? "#FECACA" : "#E5E7EB"}`,
6249
+ marginBottom: "12px"
6250
+ }
6251
+ }, /*#__PURE__*/React.createElement("div", {
6252
+ style: {
6253
+ display: "flex",
6254
+ justifyContent: "space-between",
6255
+ marginBottom: "4px"
6256
+ }
6257
+ }, /*#__PURE__*/React.createElement("span", {
6258
+ style: {
6259
+ fontSize: "10px",
6260
+ fontWeight: "800",
6261
+ padding: "2px 6px",
6262
+ borderRadius: "4px",
6263
+ background: alert.priority === "HIGH" ? "#EF4444" : "#3B82F6",
6264
+ color: "#FFFFFF"
6265
+ }
6266
+ }, alert.priority), /*#__PURE__*/React.createElement("span", {
6267
+ style: {
6268
+ fontSize: "11px",
6269
+ color: "#9CA3AF"
6270
+ }
6271
+ }, alert.time)), /*#__PURE__*/React.createElement("h4", {
6272
+ style: {
6273
+ fontSize: "14px",
6274
+ fontWeight: "600",
6275
+ color: "#374151",
6276
+ marginBottom: "4px"
6277
+ }
6278
+ }, t(alert.title)), /*#__PURE__*/React.createElement("p", {
6279
+ style: {
6280
+ fontSize: "13px",
6281
+ color: "#6B7280"
6282
+ }
6283
+ }, t(alert.message))))), /*#__PURE__*/React.createElement("div", {
6284
+ style: {
6285
+ padding: "16px",
6286
+ borderTop: "1px solid #F3F4F6"
6287
+ }
6288
+ }, /*#__PURE__*/React.createElement("button", {
6289
+ style: {
6290
+ width: "100%",
6291
+ padding: "12px",
6292
+ borderRadius: "8px",
6293
+ background: "#F3F4F6",
6294
+ color: "#374151",
6295
+ border: "none",
6296
+ fontWeight: "600",
6297
+ cursor: "pointer"
6298
+ }
6299
+ }, t("EKYC_MARK_ALL_READ")))));
6300
+ };
6301
+
6302
+ const SkeletonLoader = ({
6303
+ type: _type = "card",
6304
+ count: _count = 1
6305
+ }) => {
6306
+ const renderSkeleton = () => {
6307
+ switch (_type) {
6308
+ case "card":
6309
+ return /*#__PURE__*/React.createElement("div", {
6310
+ className: "skeleton-card",
6311
+ style: {
6312
+ padding: "24px",
6313
+ background: "#F3F4F6",
6314
+ borderRadius: "12px",
6315
+ height: "140px",
6316
+ animation: "pulse 1.5s infinite"
6317
+ }
6318
+ }, /*#__PURE__*/React.createElement("div", {
6319
+ style: {
6320
+ height: "16px",
6321
+ width: "40%",
6322
+ background: "#E5E7EB",
6323
+ marginBottom: "16px",
6324
+ borderRadius: "4px"
6325
+ }
6326
+ }), /*#__PURE__*/React.createElement("div", {
6327
+ style: {
6328
+ height: "32px",
6329
+ width: "70%",
6330
+ background: "#E5E7EB",
6331
+ marginBottom: "12px",
6332
+ borderRadius: "4px"
6333
+ }
6334
+ }), /*#__PURE__*/React.createElement("div", {
6335
+ style: {
6336
+ height: "12px",
6337
+ width: "30%",
6338
+ background: "#E5E7EB",
6339
+ borderRadius: "4px"
6340
+ }
6341
+ }));
6342
+ case "chart":
6343
+ return /*#__PURE__*/React.createElement("div", {
6344
+ className: "skeleton-chart",
6345
+ style: {
6346
+ padding: "24px",
6347
+ background: "#F3F4F6",
6348
+ borderRadius: "12px",
6349
+ height: "300px",
6350
+ animation: "pulse 1.5s infinite"
6351
+ }
6352
+ }, /*#__PURE__*/React.createElement("div", {
6353
+ style: {
6354
+ height: "20px",
6355
+ width: "30%",
6356
+ background: "#E5E7EB",
6357
+ marginBottom: "24px",
6358
+ borderRadius: "4px"
6359
+ }
6360
+ }), /*#__PURE__*/React.createElement("div", {
6361
+ style: {
6362
+ height: "200px",
6363
+ width: "100%",
6364
+ background: "#E5E7EB",
6365
+ borderRadius: "8px"
6366
+ }
6367
+ }));
6368
+ case "table":
6369
+ return /*#__PURE__*/React.createElement("div", {
6370
+ className: "skeleton-table",
6371
+ style: {
6372
+ padding: "16px",
6373
+ background: "#F3F4F6",
6374
+ borderRadius: "12px",
6375
+ animation: "pulse 1.5s infinite"
6376
+ }
6377
+ }, [1, 2, 3, 4, 5].map(i => /*#__PURE__*/React.createElement("div", {
6378
+ key: i,
6379
+ style: {
6380
+ height: "40px",
6381
+ width: "100%",
6382
+ background: "#E5E7EB",
6383
+ marginBottom: "8px",
6384
+ borderRadius: "4px"
6385
+ }
6386
+ })));
6387
+ default:
6388
+ return null;
6389
+ }
6390
+ };
6391
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("style", null, `
6392
+ @keyframes pulse {
6393
+ 0% { opacity: 1; }
6394
+ 50% { opacity: 0.5; }
6395
+ 100% { opacity: 1; }
6396
+ }
6397
+ `), /*#__PURE__*/React.createElement("div", {
6398
+ style: {
6399
+ display: "grid",
6400
+ gap: "16px",
6401
+ gridTemplateColumns: _type === "card" ? "repeat(auto-fill, minmax(240px, 1fr))" : "1fr"
6402
+ }
6403
+ }, Array(_count).fill(0).map((_, i) => /*#__PURE__*/React.createElement(React.Fragment, {
6404
+ key: i
6405
+ }, renderSkeleton()))));
6406
+ };
6407
+
6408
+ class ErrorBoundary extends React.Component {
6409
+ constructor(props) {
6410
+ super(props);
6411
+ this.state = {
6412
+ hasError: false
6413
+ };
6414
+ }
6415
+ static getDerivedStateFromError(error) {
6416
+ return {
6417
+ hasError: true
6418
+ };
6419
+ }
6420
+ render() {
6421
+ if (this.state.hasError) {
6422
+ return /*#__PURE__*/React.createElement("div", {
6423
+ style: {
6424
+ padding: "20px",
6425
+ background: "#FEF2F2",
6426
+ border: "1px solid #FECACA",
6427
+ borderRadius: "8px",
6428
+ textAlign: "center"
6429
+ }
6430
+ }, /*#__PURE__*/React.createElement("h4", {
6431
+ style: {
6432
+ color: "#991B1B",
6433
+ marginBottom: "8px"
6434
+ }
6435
+ }, "Widget Error"), /*#__PURE__*/React.createElement("p", {
6436
+ style: {
6437
+ color: "#B91C1C",
6438
+ fontSize: "12px"
6439
+ }
6440
+ }, "Failed to render this component."));
6441
+ }
6442
+ return this.props.children;
6443
+ }
6444
+ }
6445
+
6446
+ const EmptyState = ({
6447
+ message: _message = "EKYC_NO_DATA_FOUND"
6448
+ }) => {
6449
+ const {
6450
+ t
6451
+ } = useTranslation();
6452
+ return /*#__PURE__*/React.createElement("div", {
6453
+ className: "empty-state-container",
6454
+ style: {
6455
+ display: "flex",
6456
+ flexDirection: "column",
6457
+ alignItems: "center",
6458
+ justifyContent: "center",
6459
+ padding: "60px 20px",
6460
+ background: "#F9FAFB",
6461
+ borderRadius: "12px",
6462
+ border: "1px dashed #D1D5DB"
6463
+ }
6464
+ }, /*#__PURE__*/React.createElement("div", {
6465
+ style: {
6466
+ fontSize: "48px",
6467
+ marginBottom: "16px"
6468
+ }
6469
+ }, "\uD83D\uDD0D"), /*#__PURE__*/React.createElement("h3", {
6470
+ style: {
6471
+ fontSize: "18px",
6472
+ fontWeight: "600",
6473
+ color: "#374151",
6474
+ marginBottom: "8px"
6475
+ }
6476
+ }, t("EKYC_EMPTY_STATE_TITLE") || "No Results Found"), /*#__PURE__*/React.createElement("p", {
6477
+ style: {
6478
+ color: "#6B7280",
6479
+ textAlign: "center",
6480
+ maxWidth: "300px"
6481
+ }
6482
+ }, t(_message) || "Try adjusting your filters or check back later for updated metrics."));
6483
+ };
6484
+
6485
+ const CeoDashboard = () => {
6486
+ var _config$widgets, _config$widgets$summa;
6487
+ const {
6488
+ t
6489
+ } = useTranslation();
6490
+ const {
6491
+ routeToInbox
6492
+ } = Digit.Hooks.ekyc.useInboxRouting();
6493
+ const [activeRole, setActiveRole] = useState("CEO");
6494
+ const [isNotificationOpen, setIsNotificationOpen] = useState(false);
6495
+ const [filters, setFilters] = useState({
6496
+ financialYear: "2025-26",
6497
+ clusterId: "ALL",
6498
+ agencyId: "ALL"
6499
+ });
6500
+ const {
6501
+ config,
6502
+ tenantId
6503
+ } = Digit.Hooks.ekyc.useEkycDashboardConfigs(activeRole);
6504
+ const {
6505
+ summary: kpiData,
6506
+ agencies: agencyData,
6507
+ heatmap: clusterData,
6508
+ workflow: workflowData,
6509
+ isLoading,
6510
+ isError
6511
+ } = Digit.Hooks.ekyc.useEkycDashboardData(activeRole, filters);
6512
+ const handleFilterChange = (id, value) => {
6513
+ setFilters(prev => ({
6514
+ ...prev,
6515
+ [id]: value
6516
+ }));
6517
+ };
6518
+ const handleReset = () => {
6519
+ setFilters({
6520
+ financialYear: "2025-26",
6521
+ clusterId: "ALL",
6522
+ agencyId: "ALL"
6523
+ });
6524
+ };
6525
+ const handleKpiClick = kpi => {
6526
+ routeToInbox(kpi.targetRoute, {
6527
+ ...filters,
6528
+ status: kpi.status
6529
+ });
6530
+ };
6531
+ const notifications = [{
6532
+ title: "EKYC_SLA_BREACH_ALERT",
6533
+ message: "EKYC_ALERT_DESC_1",
6534
+ priority: "HIGH",
6535
+ time: "10m ago"
6536
+ }, {
6537
+ title: "EKYC_SYSTEM_UPDATE",
6538
+ message: "EKYC_ALERT_DESC_3",
6539
+ priority: "NORMAL",
6540
+ time: "5h ago"
6541
+ }];
6542
+ if (isError) return /*#__PURE__*/React.createElement(EmptyState, {
6543
+ message: "EKYC_ERROR_FETCHING_DATA"
6544
+ });
6545
+ return /*#__PURE__*/React.createElement(DashboardLayout, {
6546
+ header: config.title,
6547
+ activeRole: activeRole,
6548
+ onRoleChange: role => {
6549
+ setActiveRole(role);
6550
+ handleReset();
6551
+ },
6552
+ onNotificationClick: () => setIsNotificationOpen(true),
6553
+ filters: /*#__PURE__*/React.createElement(FilterBar, {
6554
+ filters: filters,
6555
+ config: config.globalFilters,
6556
+ onFilterChange: handleFilterChange,
6557
+ onReset: handleReset
6558
+ })
6559
+ }, /*#__PURE__*/React.createElement(NotificationPanel, {
6560
+ isOpen: isNotificationOpen,
6561
+ onClose: () => setIsNotificationOpen(false),
6562
+ notifications: notifications
6563
+ }), /*#__PURE__*/React.createElement("section", {
6564
+ style: {
6565
+ marginBottom: "32px"
6566
+ }
6567
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6568
+ type: "card",
6569
+ count: 4
6570
+ }) : /*#__PURE__*/React.createElement("div", {
6571
+ style: {
6572
+ display: "grid",
6573
+ gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))",
6574
+ gap: "24px"
6575
+ }
6576
+ }, config === null || config === void 0 ? void 0 : (_config$widgets = config.widgets) === null || _config$widgets === void 0 ? void 0 : (_config$widgets$summa = _config$widgets.summary) === null || _config$widgets$summa === void 0 ? void 0 : _config$widgets$summa.map((kpiKey, idx) => {
6577
+ var _config$kpis;
6578
+ const kpiMeta = config === null || config === void 0 ? void 0 : (_config$kpis = config.kpis) === null || _config$kpis === void 0 ? void 0 : _config$kpis[kpiKey];
6579
+ if (!kpiMeta) return null;
6580
+ const value = (kpiData === null || kpiData === void 0 ? void 0 : kpiData[kpiKey]) || 0;
6581
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
6582
+ key: kpiKey
6583
+ }, /*#__PURE__*/React.createElement("div", {
6584
+ className: "animate-fade-in",
6585
+ style: {
6586
+ animationDelay: `${idx * 0.1}s`
6587
+ }
6588
+ }, /*#__PURE__*/React.createElement(SummaryCard, {
6589
+ label: kpiMeta.label,
6590
+ value: value,
6591
+ color: kpiMeta.color,
6592
+ icon: kpiMeta.icon,
6593
+ trend: kpiData === null || kpiData === void 0 ? void 0 : kpiData[`${kpiKey}Trend`],
6594
+ onClick: () => handleKpiClick(kpiMeta)
6595
+ })));
6596
+ }))), /*#__PURE__*/React.createElement("div", {
6597
+ style: {
6598
+ display: "grid",
6599
+ gridTemplateColumns: "repeat(12, 1fr)",
6600
+ gap: "24px"
6601
+ }
6602
+ }, /*#__PURE__*/React.createElement("div", {
6603
+ style: {
6604
+ gridColumn: "span 12",
6605
+ background: "#FFF",
6606
+ padding: "24px",
6607
+ borderRadius: "16px",
6608
+ boxShadow: "0 1px 3px rgba(0,0,0,0.1)"
6609
+ }
6610
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6611
+ type: "chart"
6612
+ }) : /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(TaskStatusChart, {
6613
+ title: "EKYC_APPLICATION_STATUS",
6614
+ data: (workflowData === null || workflowData === void 0 ? void 0 : workflowData.stageBreakdown) || []
6615
+ }))), /*#__PURE__*/React.createElement("div", {
6616
+ style: {
6617
+ gridColumn: "span 4"
6618
+ }
6619
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6620
+ type: "chart"
6621
+ }) : /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(SLAWidget, {
6622
+ slaPercentage: (workflowData === null || workflowData === void 0 ? void 0 : workflowData.slaCompliance) || 0,
6623
+ avgTime: (workflowData === null || workflowData === void 0 ? void 0 : workflowData.avgProcessingTimeHours) || 0,
6624
+ breachedCount: (workflowData === null || workflowData === void 0 ? void 0 : workflowData.breachCount) || 0
6625
+ }))), /*#__PURE__*/React.createElement("div", {
6626
+ style: {
6627
+ gridColumn: "span 8"
6628
+ }
6629
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6630
+ type: "chart"
6631
+ }) : /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(WorkflowTimeline, {
6632
+ stages: (workflowData === null || workflowData === void 0 ? void 0 : workflowData.stageBreakdown) || []
6633
+ }))), /*#__PURE__*/React.createElement("div", {
6634
+ style: {
6635
+ gridColumn: "span 12",
6636
+ background: "#FFF",
6637
+ padding: "24px",
6638
+ borderRadius: "16px",
6639
+ boxShadow: "0 1px 3px rgba(0,0,0,0.1)"
6640
+ }
6641
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6642
+ type: "chart"
6643
+ }) : /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(ClusterHeatmap, {
6644
+ title: "EKYC_CLUSTER_WORKLOAD_HEATMAP",
6645
+ data: clusterData || [],
6646
+ onDrillDown: cluster => handleFilterChange("clusterId", cluster.clusterId)
6647
+ }))), /*#__PURE__*/React.createElement("div", {
6648
+ style: {
6649
+ gridColumn: "span 12"
6650
+ }
6651
+ }, isLoading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
6652
+ type: "table"
6653
+ }) : /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(AnalyticsTable, {
6654
+ title: "EKYC_AGENCY_PERFORMANCE_METRICS",
6655
+ filename: "agency_performance_report.csv",
6656
+ data: agencyData || [],
6657
+ columns: [{
6658
+ id: "agencyName",
6659
+ label: "EKYC_AGENCY_NAME"
6660
+ }, {
6661
+ id: "totalAssigned",
6662
+ label: "EKYC_TOTAL_ASSIGNED"
6663
+ }, {
6664
+ id: "totalCompleted",
6665
+ label: "EKYC_TOTAL_COMPLETED"
6666
+ }, {
6667
+ id: "pendingCount",
6668
+ label: "EKYC_PENDING"
6669
+ }, {
6670
+ id: "slaCompliance",
6671
+ label: "EKYC_SLA_COMPLIANCE",
6672
+ isPercentage: true
6673
+ }]
6674
+ })))));
6675
+ };
6676
+
6677
+ const EkycModule = ({
6678
+ stateCode,
4498
6679
  userType,
4499
6680
  tenants
4500
6681
  }) => {
@@ -4502,7 +6683,27 @@ const EkycModule = ({
4502
6683
  path,
4503
6684
  url
4504
6685
  } = useRouteMatch();
6686
+ const moduleCode = "EKYC";
6687
+ const language = Digit.StoreData.getCurrentLanguage();
6688
+ const {
6689
+ isLoading,
6690
+ data: store
6691
+ } = Digit.Services.useStore({
6692
+ stateCode,
6693
+ moduleCode,
6694
+ language
6695
+ });
4505
6696
  Digit.SessionStorage.set("EKYC_TENANTS", tenants);
6697
+ useEffect(() => Digit.LocalizationService.getLocale({
6698
+ modules: [`rainmaker-ekyc`, `rainmaker-${Digit.ULBService.getCurrentTenantId()}`],
6699
+ locale: Digit.StoreData.getCurrentLanguage(),
6700
+ tenantId: Digit.ULBService.getCurrentTenantId()
6701
+ }), []);
6702
+ if (isLoading) {
6703
+ return /*#__PURE__*/React.createElement(Loader, {
6704
+ page: true
6705
+ });
6706
+ }
4506
6707
  if (userType === "employee") {
4507
6708
  return /*#__PURE__*/React.createElement(EmployeeApp, {
4508
6709
  path: path,
@@ -4545,7 +6746,8 @@ const componentsToRegister = {
4545
6746
  AadhaarVerification,
4546
6747
  AddressDetails,
4547
6748
  PropertyInfo,
4548
- MeterDetails
6749
+ MeterDetails,
6750
+ CeoDashboard
4549
6751
  };
4550
6752
  const initEkycComponents = () => {
4551
6753
  Object.entries(componentsToRegister).forEach(([key, value]) => {