@djb25/digit-ui-module-fsm 1.0.24 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { ShippingTruck, EmployeeModuleCard, TickMark, FormStep as FormStep$1, RadioOrSelect, LabelFieldPair, CardLabel as CardLabel$1, Dropdown as Dropdown$1, TextInput as TextInput$1, RadioButtons, Loader, LocationSearchCard, TextArea as TextArea$1, CardLabelError as CardLabelError$1, CitizenInfoLabel, CardText as CardText$1, WrapUnMaskComponent, PitDimension, ImageUploadHandler, KeyNote, Card, CardHeader as CardHeader$1, CardSubHeader, StatusTable, Row, SubmitBar as SubmitBar$1, LinkButton as LinkButton$1, Banner, Header, TelePhone, CardSectionHeader, CheckPoint, ConnectingCheckPoints, ActionLinks, Rating, RatingCard, ActionBar, Menu, Toast, BackButton, PrivateRoute, LayoutWrapper, ULBHomeCard, AddNewIcon, ViewReportIcon, InboxIcon, Table, CheckBox, CloseSvg, Localities, RemoveableTag, ApplyFilterBar, Label, LinkLabel, DatePicker as DatePicker$2, DetailsCard, SearchAction, FilterAction, PopUp, AppContainer, ModuleHeader, ArrowLeft, BreadCrumb, HomeIcon, Modal, FormComposer, UploadPitPhoto, ImageViewer, BreakLine, MultiUploadWrapper, AddIcon, ToggleSwitch, InfoIcon, EditIcon, DeleteIcon, VerticalTimeline, CitizenHomeCard, CitizenTruck } from '@djb25/digit-ui-react-components';
1
+ import { ShippingTruck, EmployeeModuleCard, TickMark, FormStep as FormStep$1, RadioOrSelect, LabelFieldPair, CardLabel as CardLabel$1, Dropdown, TextInput as TextInput$1, RadioButtons, Loader, LocationSearchCard, TextArea as TextArea$1, CardLabelError as CardLabelError$1, CitizenInfoLabel, CardText as CardText$1, WrapUnMaskComponent, PitDimension, ImageUploadHandler, KeyNote, Card, CardHeader as CardHeader$1, CardSubHeader, StatusTable, Row, SubmitBar as SubmitBar$1, LinkButton as LinkButton$1, Banner, Header, TelePhone, CardSectionHeader, CheckPoint, ConnectingCheckPoints, ActionLinks, Rating, RatingCard, ActionBar, Menu, Toast, BackButton, PrivateRoute, LayoutWrapper, ULBHomeCard, AddNewIcon, ViewReportIcon, InboxIcon, Table, CheckBox, CloseSvg, Localities, RemoveableTag, ApplyFilterBar, Label, LinkLabel, DatePicker, DetailsCard, SearchAction, FilterAction, PopUp, AppContainer, ModuleHeader, ArrowLeft, BreadCrumb, HomeIcon, Modal, FormComposer, UploadPitPhoto, ImageViewer, MultiUploadWrapper, AddIcon, ToggleSwitch, InfoIcon, EditIcon, DeleteIcon, VerticalTimeline, CitizenHomeCard, CitizenTruck } from '@djb25/digit-ui-react-components';
2
2
  import React, { useState, useEffect, Fragment as Fragment$1, forwardRef, useCallback, useMemo, useRef } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useParams, useHistory, Link, useRouteMatch, Switch, Route, Redirect } from 'react-router-dom';
@@ -16,6 +16,171 @@ function _extends() {
16
16
  }, _extends.apply(null, arguments);
17
17
  }
18
18
 
19
+ const _Pact = /*#__PURE__*/function () {
20
+ function _Pact() {}
21
+ _Pact.prototype.then = function (onFulfilled, onRejected) {
22
+ const result = new _Pact();
23
+ const state = this.s;
24
+ if (state) {
25
+ const callback = state & 1 ? onFulfilled : onRejected;
26
+ if (callback) {
27
+ try {
28
+ _settle(result, 1, callback(this.v));
29
+ } catch (e) {
30
+ _settle(result, 2, e);
31
+ }
32
+ return result;
33
+ } else {
34
+ return this;
35
+ }
36
+ }
37
+ this.o = function (_this) {
38
+ try {
39
+ const value = _this.v;
40
+ if (_this.s & 1) {
41
+ _settle(result, 1, onFulfilled ? onFulfilled(value) : value);
42
+ } else if (onRejected) {
43
+ _settle(result, 1, onRejected(value));
44
+ } else {
45
+ _settle(result, 2, value);
46
+ }
47
+ } catch (e) {
48
+ _settle(result, 2, e);
49
+ }
50
+ };
51
+ return result;
52
+ };
53
+ return _Pact;
54
+ }();
55
+ function _settle(pact, state, value) {
56
+ if (!pact.s) {
57
+ if (value instanceof _Pact) {
58
+ if (value.s) {
59
+ if (state & 1) {
60
+ state = value.s;
61
+ }
62
+ value = value.v;
63
+ } else {
64
+ value.o = _settle.bind(null, pact, state);
65
+ return;
66
+ }
67
+ }
68
+ if (value && value.then) {
69
+ value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
70
+ return;
71
+ }
72
+ pact.s = state;
73
+ pact.v = value;
74
+ const observer = pact.o;
75
+ if (observer) {
76
+ observer(pact);
77
+ }
78
+ }
79
+ }
80
+ function _isSettledPact(thenable) {
81
+ return thenable instanceof _Pact && thenable.s & 1;
82
+ }
83
+ function _forTo(array, body, check) {
84
+ var i = -1,
85
+ pact,
86
+ reject;
87
+ function _cycle(result) {
88
+ try {
89
+ while (++i < array.length && (!check || !check())) {
90
+ result = body(i);
91
+ if (result && result.then) {
92
+ if (_isSettledPact(result)) {
93
+ result = result.v;
94
+ } else {
95
+ result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
96
+ return;
97
+ }
98
+ }
99
+ }
100
+ if (pact) {
101
+ _settle(pact, 1, result);
102
+ } else {
103
+ pact = result;
104
+ }
105
+ } catch (e) {
106
+ _settle(pact || (pact = new _Pact()), 2, e);
107
+ }
108
+ }
109
+ _cycle();
110
+ return pact;
111
+ }
112
+ const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
113
+ function _forOf(target, body, check) {
114
+ if (typeof target[_iteratorSymbol] === "function") {
115
+ var iterator = target[_iteratorSymbol](),
116
+ step,
117
+ pact,
118
+ reject;
119
+ function _cycle(result) {
120
+ try {
121
+ while (!(step = iterator.next()).done && (!check || !check())) {
122
+ result = body(step.value);
123
+ if (result && result.then) {
124
+ if (_isSettledPact(result)) {
125
+ result = result.v;
126
+ } else {
127
+ result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
128
+ return;
129
+ }
130
+ }
131
+ }
132
+ if (pact) {
133
+ _settle(pact, 1, result);
134
+ } else {
135
+ pact = result;
136
+ }
137
+ } catch (e) {
138
+ _settle(pact || (pact = new _Pact()), 2, e);
139
+ }
140
+ }
141
+ _cycle();
142
+ if (iterator.return) {
143
+ var _fixup = function (value) {
144
+ try {
145
+ if (!step.done) {
146
+ iterator.return();
147
+ }
148
+ } catch (e) {}
149
+ return value;
150
+ };
151
+ if (pact && pact.then) {
152
+ return pact.then(_fixup, function (e) {
153
+ throw _fixup(e);
154
+ });
155
+ }
156
+ _fixup();
157
+ }
158
+ return pact;
159
+ }
160
+ if (!("length" in target)) {
161
+ throw new TypeError("Object is not iterable");
162
+ }
163
+ var values = [];
164
+ for (var i = 0; i < target.length; i++) {
165
+ values.push(target[i]);
166
+ }
167
+ return _forTo(values, function (i) {
168
+ return body(values[i]);
169
+ }, check);
170
+ }
171
+ const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
172
+ function _catch(body, recover) {
173
+ try {
174
+ var result = body();
175
+ } catch (e) {
176
+ return recover(e);
177
+ }
178
+ if (result && result.then) {
179
+ return result.then(void 0, recover);
180
+ }
181
+ return result;
182
+ }
183
+
19
184
  const getPropertyTypeLocale = value => {
20
185
  return `PROPERTYTYPE_MASTERS_${value === null || value === void 0 ? void 0 : value.split(".")[0]}`;
21
186
  };
@@ -36,6 +201,121 @@ const convertEpochToDate = dateEpoch => {
36
201
  return null;
37
202
  }
38
203
  };
204
+ const normalizeTenantId = tenant => {
205
+ var _window, _digitObj$ULBService, _digitObj$ULBService$;
206
+ const digitObj = typeof Digit !== "undefined" ? Digit : (_window = window) === null || _window === void 0 ? void 0 : _window.Digit;
207
+ const currentTenant = (digitObj === null || digitObj === void 0 ? void 0 : (_digitObj$ULBService = digitObj.ULBService) === null || _digitObj$ULBService === void 0 ? void 0 : (_digitObj$ULBService$ = _digitObj$ULBService.getCurrentTenantId) === null || _digitObj$ULBService$ === void 0 ? void 0 : _digitObj$ULBService$.call(_digitObj$ULBService)) || "dl.djb";
208
+ if (!tenant || tenant === "dl") {
209
+ return currentTenant && currentTenant.startsWith("dl") ? currentTenant : "dl.djb";
210
+ }
211
+ if (!tenant.includes(".")) {
212
+ return currentTenant && currentTenant.startsWith(tenant) ? currentTenant : `${tenant}.djb`;
213
+ }
214
+ return tenant;
215
+ };
216
+ const billingSlabCache = new Map();
217
+ const inFlightRequests = new Map();
218
+ const fetchBillingSlabDetails = function (tenantId, formData) {
219
+ try {
220
+ var _window2, _formData$address, _formData$address$pro, _formData$tripData, _formData$tripData$ve, _formData$selectTripN, _formData$selectTripN2, _formData$tripData2, _formData$address2, _formData$address2$ci, _formData$subtype, _formData$propertyTyp;
221
+ const digitObj = typeof Digit !== "undefined" ? Digit : (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.Digit;
222
+ if (!digitObj || !digitObj.FSMService || !digitObj.FSMService.billingSlabSearch) {
223
+ return Promise.resolve(null);
224
+ }
225
+ const propertyLocation = formData === null || formData === void 0 ? void 0 : (_formData$address = formData.address) === null || _formData$address === void 0 ? void 0 : (_formData$address$pro = _formData$address.propertyLocation) === null || _formData$address$pro === void 0 ? void 0 : _formData$address$pro.code;
226
+ if (propertyLocation && propertyLocation !== "WITHIN_ULB_LIMITS") {
227
+ return Promise.resolve(null);
228
+ }
229
+ const capacity = (formData === null || formData === void 0 ? void 0 : (_formData$tripData = formData.tripData) === null || _formData$tripData === void 0 ? void 0 : (_formData$tripData$ve = _formData$tripData.vehicleType) === null || _formData$tripData$ve === void 0 ? void 0 : _formData$tripData$ve.capacity) || (formData === null || formData === void 0 ? void 0 : (_formData$selectTripN = formData.selectTripNo) === null || _formData$selectTripN === void 0 ? void 0 : (_formData$selectTripN2 = _formData$selectTripN.vehicleCapacity) === null || _formData$selectTripN2 === void 0 ? void 0 : _formData$selectTripN2.capacity) || (formData === null || formData === void 0 ? void 0 : (_formData$tripData2 = formData.tripData) === null || _formData$tripData2 === void 0 ? void 0 : _formData$tripData2.vehicleCapacity);
230
+ if (!capacity) {
231
+ return Promise.resolve(null);
232
+ }
233
+ const {
234
+ slum: slumDetails
235
+ } = (formData === null || formData === void 0 ? void 0 : formData.address) || {};
236
+ const isSlum = typeof slumDetails === "string" && slumDetails && slumDetails !== "NO" && slumDetails !== "false" || typeof slumDetails === "object" && (slumDetails === null || slumDetails === void 0 ? void 0 : slumDetails.code);
237
+ const slum = isSlum ? "YES" : "NO";
238
+ const targetTenant = normalizeTenantId(tenantId || (formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : (_formData$address2$ci = _formData$address2.city) === null || _formData$address2$ci === void 0 ? void 0 : _formData$address2$ci.code));
239
+ const subtypeCode = (formData === null || formData === void 0 ? void 0 : (_formData$subtype = formData.subtype) === null || _formData$subtype === void 0 ? void 0 : _formData$subtype.code) || (typeof (formData === null || formData === void 0 ? void 0 : formData.subtype) === "string" ? formData === null || formData === void 0 ? void 0 : formData.subtype : null);
240
+ const parentPropTypeCode = (formData === null || formData === void 0 ? void 0 : (_formData$propertyTyp = formData.propertyType) === null || _formData$propertyTyp === void 0 ? void 0 : _formData$propertyTyp.code) || (typeof (formData === null || formData === void 0 ? void 0 : formData.propertyType) === "string" ? formData === null || formData === void 0 ? void 0 : formData.propertyType : null);
241
+ const cacheKey = `${targetTenant}_${capacity}_${subtypeCode || ""}_${parentPropTypeCode || ""}_${slum}`;
242
+ if (billingSlabCache.has(cacheKey)) {
243
+ return Promise.resolve(billingSlabCache.get(cacheKey));
244
+ }
245
+ if (inFlightRequests.has(cacheKey)) {
246
+ return Promise.resolve(inFlightRequests.get(cacheKey));
247
+ }
248
+ const searchAttempts = [subtypeCode ? {
249
+ tenant: targetTenant,
250
+ filters: {
251
+ propertyType: subtypeCode,
252
+ capacity,
253
+ slum
254
+ }
255
+ } : null, parentPropTypeCode && parentPropTypeCode !== subtypeCode ? {
256
+ tenant: targetTenant,
257
+ filters: {
258
+ propertyType: parentPropTypeCode,
259
+ capacity,
260
+ slum
261
+ }
262
+ } : null, subtypeCode && slum === "YES" ? {
263
+ tenant: targetTenant,
264
+ filters: {
265
+ propertyType: subtypeCode,
266
+ capacity,
267
+ slum: "NO"
268
+ }
269
+ } : null, {
270
+ tenant: targetTenant,
271
+ filters: {
272
+ capacity
273
+ }
274
+ }].filter(Boolean);
275
+ const seenAttempts = new Set();
276
+ const uniqueAttempts = searchAttempts.filter(att => {
277
+ const key = `${att.tenant}_${JSON.stringify(att.filters)}`;
278
+ if (seenAttempts.has(key)) return false;
279
+ seenAttempts.add(key);
280
+ return true;
281
+ });
282
+ const fetchPromise = function () {
283
+ try {
284
+ let _exit = false;
285
+ function _temp2(_result2) {
286
+ if (_exit) return _result2;
287
+ billingSlabCache.set(cacheKey, null);
288
+ return null;
289
+ }
290
+ const _temp = _forOf(uniqueAttempts, function (attempt) {
291
+ return _catch(function () {
292
+ return Promise.resolve(digitObj.FSMService.billingSlabSearch(attempt.tenant, attempt.filters)).then(function (res) {
293
+ if (res !== null && res !== void 0 && res.billingSlab && res.billingSlab.length > 0) {
294
+ billingSlabCache.set(cacheKey, res.billingSlab[0]);
295
+ const _res$billingSlab$ = res.billingSlab[0];
296
+ _exit = true;
297
+ return _res$billingSlab$;
298
+ }
299
+ });
300
+ }, function (err) {
301
+ console.warn("FSM billingSlabSearch attempt failed:", attempt, err);
302
+ });
303
+ }, function () {
304
+ return _exit;
305
+ });
306
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
307
+ } catch (e) {
308
+ return Promise.reject(e);
309
+ }
310
+ }().finally(() => {
311
+ inFlightRequests.delete(cacheKey);
312
+ });
313
+ inFlightRequests.set(cacheKey, fetchPromise);
314
+ return Promise.resolve(fetchPromise);
315
+ } catch (e) {
316
+ return Promise.reject(e);
317
+ }
318
+ };
39
319
 
40
320
  const FSMCard = () => {
41
321
  const {
@@ -112,40 +392,47 @@ const FSMCard = () => {
112
392
  setTotal(total);
113
393
  }
114
394
  }, [inbox]);
395
+ const isSuperUser = Digit.UserService.hasAccess(["SUPERUSER", "ADMIN"]) || false;
396
+ const isFsmAdmin = Digit.UserService.hasAccess(["FSM_ADMIN", "ES_FSM_ADMIN", "FSM_CEMP"]) || isSuperUser;
397
+ const isCreator = Digit.UserService.hasAccess(["FSM_CREATOR_EMP", "FSM_CEMP"]) || isSuperUser;
398
+ const isEditor = Digit.UserService.hasAccess(["FSM_EDITOR_EMP"]) || isSuperUser;
399
+ const isViewer = Digit.UserService.hasAccess(["FSM_VIEW_EMP"]) || isSuperUser;
400
+ const isReportViewer = Digit.UserService.hasAccess(["FSM_REPORT_VIEWER"]) || isSuperUser;
401
+ const isGenericEmployee = !isFSTPOperator && !isCreator && !isEditor && !isViewer && !isReportViewer && !COLLECTOR && !DSO && !isFsmAdmin;
115
402
  const allFSMLinks = [{
116
403
  count: total,
117
404
  label: t("ES_COMMON_INBOX"),
118
405
  link: `/digit-ui/employee/fsm/inbox`
119
- }, {
406
+ }, (isCreator || isFsmAdmin || isGenericEmployee || !isFSTPOperator) && {
120
407
  label: t("ES_TITLE_NEW_DESULDGING_APPLICATION"),
121
408
  link: `/digit-ui/employee/fsm/new-application`
122
409
  }, {
123
410
  label: t("ES_TITILE_SEARCH_APPLICATION"),
124
411
  link: `/digit-ui/employee/fsm/search`
125
- }, {
412
+ }, (isFsmAdmin || isGenericEmployee) && {
126
413
  label: t("ES_TITLE_FSM_REGISTRY"),
127
414
  link: `/digit-ui/employee/fsm/registry?selectedTabs=VENDOR`
128
- }, {
129
- label: t("ES_COMMON_FSTP_OPERATION"),
130
- link: `/digit-ui/employee/fsm/fstp-operations`
131
- }, {
415
+ }, (isFSTPOperator || isSuperUser || isGenericEmployee) && {
132
416
  label: t("ES_TITLE_VEHICLE_LOG"),
133
417
  link: `/digit-ui/employee/fsm/fstp-inbox`
134
- }, {
418
+ }, (isFSTPOperator || isSuperUser || isGenericEmployee) && {
419
+ label: t("ES_COMMON_FSTP_OPERATION"),
420
+ link: `/digit-ui/employee/fsm/fstp-operations`
421
+ }, (isFSTPOperator || isSuperUser || isGenericEmployee) && {
135
422
  label: t("ES_FSM_ADD_NEW_BUTTON"),
136
423
  link: `/digit-ui/employee/fsm/fstp-add-vehicle`
137
- }, {
424
+ }, (isReportViewer || isSuperUser || isGenericEmployee) && {
138
425
  label: t("ES_TITLE_REPORTS"),
139
426
  link: `/employee/report/fsm/FSMDailyDesludingReport`,
140
427
  hyperlink: true
141
- }, {
428
+ }, (isReportViewer || isFSTPOperator || isGenericEmployee) && {
142
429
  label: t("ES_FSM_VIEW_REPORTS_BUTTON"),
143
430
  link: `/employee/report/fsm/FSMFSTPPlantWithVehicleLogReport`,
144
431
  hyperlink: true
145
- }];
432
+ }].filter(Boolean);
146
433
  const propsForModuleCard = {
147
434
  Icon: /*#__PURE__*/React.createElement(ShippingTruck, null),
148
- moduleName: isFSTPOperator ? t("ES_TITLE_VEHICLE_LOG") : t("ES_TITLE_FAECAL_SLUDGE_MGMT"),
435
+ moduleName: isFSTPOperator && !isFsmAdmin && !isCreator && !isEditor ? t("ES_TITLE_VEHICLE_LOG") : t("ES_TITLE_FAECAL_SLUDGE_MGMT"),
149
436
  kpis: [{
150
437
  count: total,
151
438
  label: t("TOTAL_FSM"),
@@ -420,9 +707,16 @@ const FSMSelectAddress = _ref => {
420
707
  }
421
708
  if (userType === "employee") {
422
709
  var _formData$address7, _formData$address7$lo;
423
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
710
+ return /*#__PURE__*/React.createElement("div", {
711
+ style: {
712
+ display: "grid",
713
+ gridTemplateColumns: "1fr 1fr",
714
+ gap: "16px 24px",
715
+ width: "100%"
716
+ }
717
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
424
718
  className: "card-label-smaller"
425
- }, t("MYCITY_CODE_LABEL"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
719
+ }, t("MYCITY_CODE_LABEL"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown, {
426
720
  className: "form-field",
427
721
  isMandatory: true,
428
722
  selected: (cities === null || cities === void 0 ? void 0 : cities.length) === 1 ? cities[0] : selectedCity,
@@ -433,7 +727,7 @@ const FSMSelectAddress = _ref => {
433
727
  t: t
434
728
  })), !isUrcEnable || isNewVendor || isEditVendor ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
435
729
  className: "card-label-smaller"
436
- }, t("ES_NEW_APPLICATION_LOCATION_MOHALLA"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
730
+ }, t("ES_NEW_APPLICATION_LOCATION_MOHALLA"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown, {
437
731
  className: "form-field",
438
732
  isMandatory: true,
439
733
  selected: selectedLocality,
@@ -507,11 +801,24 @@ const SelectChannel = _ref => {
507
801
  data: channelMenu
508
802
  } = Digit.Hooks.fsm.useMDMS(tenantId, "FSM", "EmployeeApplicationChannel");
509
803
  const [channel, setChannel] = useState(formData === null || formData === void 0 ? void 0 : formData.channel);
804
+ useEffect(() => {
805
+ if (channelMenu && channelMenu.length > 0) {
806
+ const selectedOption = channelMenu.find(item => {
807
+ var _formData$channel;
808
+ return item.code === ((formData === null || formData === void 0 ? void 0 : (_formData$channel = formData.channel) === null || _formData$channel === void 0 ? void 0 : _formData$channel.code) || (formData === null || formData === void 0 ? void 0 : formData.channel) || (channel === null || channel === void 0 ? void 0 : channel.code));
809
+ });
810
+ const defaultOption = selectedOption || channelMenu.find(item => item.code === "COUNTER") || channelMenu[0];
811
+ if (!channel && defaultOption) {
812
+ setChannel(defaultOption);
813
+ onSelect(config.key, defaultOption);
814
+ }
815
+ }
816
+ }, [channelMenu, formData === null || formData === void 0 ? void 0 : formData.channel]);
510
817
  function selectChannel(value) {
511
818
  setChannel(value);
512
819
  onSelect(config.key, value);
513
820
  }
514
- return channelMenu ? /*#__PURE__*/React.createElement(Dropdown$1, {
821
+ return channelMenu ? /*#__PURE__*/React.createElement(Dropdown, {
515
822
  option: channelMenu,
516
823
  optionKey: "i18nKey",
517
824
  id: "channel",
@@ -570,7 +877,7 @@ const SelectGender = _ref => {
570
877
  })) || null;
571
878
  return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t(config.label), config.isMandatory ? /*#__PURE__*/React.createElement("span", {
572
879
  className: "check-page-link-button"
573
- }, " * ") : ""), /*#__PURE__*/React.createElement(Dropdown$1, {
880
+ }, " * ") : ""), /*#__PURE__*/React.createElement(Dropdown, {
574
881
  className: "payment-form-text-input-correction",
575
882
  isMandatory: config.isMandatory,
576
883
  selected: selectedValue,
@@ -585,7 +892,7 @@ const SelectGender = _ref => {
585
892
  }));
586
893
  }
587
894
  if (userType === "employee") {
588
- return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t(config.label)), /*#__PURE__*/React.createElement(Dropdown$1, {
895
+ return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t(config.label)), /*#__PURE__*/React.createElement(Dropdown, {
589
896
  className: "payment-form-text-input-correction",
590
897
  isMandatory: config.isMandatory,
591
898
  selected: genderType,
@@ -616,7 +923,6 @@ const SelectGender = _ref => {
616
923
  };
617
924
 
618
925
  const SelectPaymentType = _ref => {
619
- var _formData$paymentPref2;
620
926
  let {
621
927
  t,
622
928
  config,
@@ -636,31 +942,34 @@ const SelectPaymentType = _ref => {
636
942
  } = useLocation();
637
943
  const editScreen = url.includes("/modify-application/");
638
944
  const [paymentType, setPaymentType] = useState(null);
639
- const [isSlum, setIsSlum] = useState();
945
+ const defaultPaymentOptions = [{
946
+ code: "POST_PAY",
947
+ name: "Pay Later",
948
+ i18nKey: "CS_PAYMENT_POST_PAY"
949
+ }, {
950
+ code: "PRE_PAY",
951
+ name: "Pay Now",
952
+ i18nKey: "CS_PAYMENT_PRE_PAY"
953
+ }];
954
+ const paymentOptions = paymentData && paymentData.length > 0 ? paymentData : defaultPaymentOptions;
640
955
  const inputs = [{
641
- label: "Payment Preference",
956
+ label: "ES_FSM_PAYMENT_PREFERENCE_LABEL",
642
957
  type: "RadioButton",
643
958
  name: "paymentPreference",
644
- options: paymentData,
959
+ options: paymentOptions,
645
960
  isMandatory: false
646
961
  }];
647
962
  useEffect(() => {
648
- if (!isLoading && paymentData) {
649
- const preFilledPaymentType = paymentData.filter(paymentType => {
650
- var _formData$paymentPref;
651
- return paymentType.code === ((formData === null || formData === void 0 ? void 0 : (_formData$paymentPref = formData.paymentPreference) === null || _formData$paymentPref === void 0 ? void 0 : _formData$paymentPref.code) || (formData === null || formData === void 0 ? void 0 : formData.paymentPreference));
652
- })[0];
653
- preFilledPaymentType ? setPaymentType(preFilledPaymentType) : setPaymentType(paymentData.find(i => i.code === "POST_PAY"));
654
- }
655
- }, [formData, formData === null || formData === void 0 ? void 0 : (_formData$paymentPref2 = formData.paymentPreference) === null || _formData$paymentPref2 === void 0 ? void 0 : _formData$paymentPref2.code, formData === null || formData === void 0 ? void 0 : formData.paymentPreference, paymentData]);
656
- useEffect(() => {
657
- if (formData !== null && formData !== void 0 && formData.address) {
658
- const {
659
- slum: slumDetails
660
- } = formData.address;
661
- slumDetails ? setIsSlum(true) : setIsSlum(false);
662
- }
663
- }, [formData]);
963
+ var _formData$paymentPref;
964
+ const opts = paymentData && paymentData.length > 0 ? paymentData : defaultPaymentOptions;
965
+ const currentCode = (formData === null || formData === void 0 ? void 0 : (_formData$paymentPref = formData.paymentPreference) === null || _formData$paymentPref === void 0 ? void 0 : _formData$paymentPref.code) || (formData === null || formData === void 0 ? void 0 : formData.paymentPreference);
966
+ const preFilledPaymentType = opts.find(pt => pt.code === currentCode);
967
+ const defaultOption = preFilledPaymentType || opts.find(i => i.code === "POST_PAY") || opts[0];
968
+ setPaymentType(defaultOption);
969
+ if (!currentCode && defaultOption) {
970
+ onSelect(config.key, defaultOption.code);
971
+ }
972
+ }, [formData === null || formData === void 0 ? void 0 : formData.paymentPreference, paymentData]);
664
973
  function selectPaymentType(value) {
665
974
  setPaymentType(value);
666
975
  onSelect(config.key, value.code);
@@ -671,7 +980,7 @@ const SelectPaymentType = _ref => {
671
980
  key: index
672
981
  }, (formData === null || formData === void 0 ? void 0 : (_formData$tripData = formData.tripData) === null || _formData$tripData === void 0 ? void 0 : _formData$tripData.amountPerTrip) !== 0 && input.type === "RadioButton" && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
673
982
  className: "card-label-smaller"
674
- }, t(input.label), input.isMandatory ? " * " : null), /*#__PURE__*/React.createElement("div", {
983
+ }, t(input.label) || "Payment Preference", input.isMandatory ? " * " : null), /*#__PURE__*/React.createElement("div", {
675
984
  className: "field"
676
985
  }, /*#__PURE__*/React.createElement(RadioButtons, {
677
986
  selectedOption: paymentType,
@@ -840,9 +1149,27 @@ const SelectName = _ref => {
840
1149
  pathname: url
841
1150
  } = useLocation();
842
1151
  const editScreen = url.includes("/modify-application/");
843
- const [dropdownValue, setDropdownValue] = useState("");
844
1152
  const [genderTypes, setGenderTypes] = useState([]);
845
- const [error, setError] = useState("");
1153
+ const defaultGenderOptions = [{
1154
+ code: "MALE",
1155
+ name: "Male",
1156
+ i18nKey: "COMMON_GENDER_MALE"
1157
+ }, {
1158
+ code: "FEMALE",
1159
+ name: "Female",
1160
+ i18nKey: "COMMON_GENDER_FEMALE"
1161
+ }, {
1162
+ code: "TRANSGENDER",
1163
+ name: "Transgender",
1164
+ i18nKey: "COMMON_GENDER_TRANSGENDER"
1165
+ }];
1166
+ useEffect(() => {
1167
+ if (!isLoading && GenderData && GenderData.length > 0) {
1168
+ setGenderTypes(GenderData);
1169
+ } else {
1170
+ setGenderTypes(defaultGenderOptions);
1171
+ }
1172
+ }, [GenderData, isLoading]);
846
1173
  const inputs = [{
847
1174
  label: "ES_NEW_APPLICATION_APPLICANT_NAME",
848
1175
  type: "text",
@@ -868,66 +1195,59 @@ const SelectName = _ref => {
868
1195
  }, "+91"),
869
1196
  isMandatory: true
870
1197
  }, {
871
- label: "ES_NEW_APPLICATION_MAIL_ID",
872
- type: "text",
873
- name: "emailId",
874
- validation: {
875
- pattern: "/^[a-zA-Z0-9._%+-]+@[a-z.-]+\.(com|org|in)$/",
876
- title: t("CORE_COMMON_EMAIL_ID_INVALID")
877
- },
1198
+ label: "ES_NEW_APPLICATION_GENDER",
1199
+ type: "dropdown",
1200
+ name: "applicantGender",
1201
+ options: genderTypes.length > 0 ? genderTypes : defaultGenderOptions,
878
1202
  isMandatory: false
879
1203
  }];
880
- useEffect(() => {
881
- if (!isLoading && GenderData) {
882
- setGenderTypes(GenderData);
883
- }
884
- }, [GenderData]);
885
1204
  const setValue = (value, input) => {
886
- if (input === "emailId") {
887
- const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-z.-]+\.(com|org|in)$/;
888
- if (!emailRegex.test(value)) {
889
- setError(t("CORE_INVALID_EMAIL_ID_PATTERN"));
890
- } else {
891
- setError("");
892
- }
893
- }
894
1205
  onSelect(config.key, {
895
1206
  ...formData[config.key],
896
1207
  [input]: value
897
1208
  });
898
1209
  };
899
- function selectDropdown(value) {
900
- setDropdownValue(value);
1210
+ const selectDropdown = value => {
901
1211
  onSelect(config.key, {
902
1212
  ...formData[config.key],
903
1213
  applicantGender: value.code
904
1214
  });
905
- }
906
- return /*#__PURE__*/React.createElement("div", null, inputs === null || inputs === void 0 ? void 0 : inputs.map((input, index) => {
1215
+ };
1216
+ return /*#__PURE__*/React.createElement("div", {
1217
+ style: {
1218
+ display: "grid",
1219
+ gridTemplateColumns: "1fr 1fr",
1220
+ gap: "16px 24px",
1221
+ width: "100%"
1222
+ }
1223
+ }, inputs === null || inputs === void 0 ? void 0 : inputs.map((input, index) => {
907
1224
  var _input$options;
908
- return /*#__PURE__*/React.createElement(React.Fragment, {
909
- key: index
1225
+ return /*#__PURE__*/React.createElement("div", {
1226
+ key: index,
1227
+ style: {
1228
+ width: "100%"
1229
+ }
910
1230
  }, input.type === "text" && /*#__PURE__*/React.createElement(React.Fragment, null, errors[input.name] && /*#__PURE__*/React.createElement(CardLabelError$1, null, t(input.error)), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
911
1231
  className: "card-label-smaller"
912
1232
  }, t(input.label), input.isMandatory ? " * " : null), /*#__PURE__*/React.createElement("div", {
913
1233
  className: "field",
914
1234
  style: {
915
- display: "flex"
1235
+ display: "flex",
1236
+ width: "100%"
916
1237
  }
917
1238
  }, input.componentInFront ? input.componentInFront : null, /*#__PURE__*/React.createElement(TextInput$1, _extends({
918
1239
  key: input.name,
919
1240
  value: formData && formData[config.key] ? formData[config.key][input.name] : null,
920
1241
  onChange: e => setValue(e.target.value, input.name),
921
1242
  disable: editScreen
922
- }, input.validation)))), input.name === "emailId" && error && /*#__PURE__*/React.createElement(CardLabelError$1, {
923
- style: {
924
- color: "red"
925
- }
926
- }, error)), input.type === "dropdown" && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
1243
+ }, input.validation))))), input.type === "dropdown" && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
927
1244
  className: "card-label-smaller"
928
1245
  }, t(input.label), input.isMandatory ? " * " : null), /*#__PURE__*/React.createElement("div", {
929
- className: "field"
930
- }, /*#__PURE__*/React.createElement(Dropdown$1, {
1246
+ className: "field",
1247
+ style: {
1248
+ width: "100%"
1249
+ }
1250
+ }, /*#__PURE__*/React.createElement(Dropdown, {
931
1251
  option: (_input$options = input.options) === null || _input$options === void 0 ? void 0 : _input$options.sort((a, b) => a.code.localeCompare(b.code)),
932
1252
  optionKey: "i18nKey",
933
1253
  id: "dropdown",
@@ -1127,7 +1447,7 @@ const SelectPitType = _ref => {
1127
1447
  return /*#__PURE__*/React.createElement(Loader, null);
1128
1448
  }
1129
1449
  if (userType === "employee") {
1130
- return /*#__PURE__*/React.createElement(Dropdown$1, {
1450
+ return /*#__PURE__*/React.createElement(Dropdown, {
1131
1451
  isMandatory: true,
1132
1452
  option: sanitationMenu === null || sanitationMenu === void 0 ? void 0 : sanitationMenu.sort((a, b) => a.name.localeCompare(b.name)),
1133
1453
  optionKey: "i18nKey",
@@ -2442,7 +2762,6 @@ const FormStep = _ref => {
2442
2762
  }));
2443
2763
  if (input.type === "date") {
2444
2764
  var _input$validation3, _input$validation4;
2445
- console.log("datedatedate");
2446
2765
  return /*#__PURE__*/React.createElement(React.Fragment, {
2447
2766
  key: index
2448
2767
  }, /*#__PURE__*/React.createElement(CardLabel, null, t(input.label), " ", input.labelChildren && input.labelChildren), errors[input.name] && /*#__PURE__*/React.createElement(CardLabelError, null, t(input.error)), /*#__PURE__*/React.createElement("div", {
@@ -8530,7 +8849,7 @@ const SelectPropertySubtype = _ref => {
8530
8849
  return /*#__PURE__*/React.createElement(Loader, null);
8531
8850
  }
8532
8851
  if (userType === "employee") {
8533
- return /*#__PURE__*/React.createElement(Dropdown$1, {
8852
+ return /*#__PURE__*/React.createElement(Dropdown, {
8534
8853
  option: subtypeOptions === null || subtypeOptions === void 0 ? void 0 : subtypeOptions.sort((a, b) => a.name.localeCompare(b.name)),
8535
8854
  optionKey: "i18nKey",
8536
8855
  id: "propertySubType",
@@ -8637,7 +8956,7 @@ const SelectPropertyType = _ref => {
8637
8956
  }
8638
8957
  if (userType === "employee") {
8639
8958
  var _propertyTypesData$da;
8640
- return /*#__PURE__*/React.createElement(Dropdown$1, {
8959
+ return /*#__PURE__*/React.createElement(Dropdown, {
8641
8960
  option: (_propertyTypesData$da = propertyTypesData.data) === null || _propertyTypesData$da === void 0 ? void 0 : _propertyTypesData$da.sort((a, b) => a.name.localeCompare(b.name)),
8642
8961
  optionKey: "i18nKey",
8643
8962
  id: "propertyType",
@@ -8992,7 +9311,7 @@ const SelectSlumName = _ref => {
8992
9311
  if (slumDataLoading) return /*#__PURE__*/React.createElement(Loader, null);
8993
9312
  return userType === "employee" ? (formData === null || formData === void 0 ? void 0 : (_formData$address0 = formData.address) === null || _formData$address0 === void 0 ? void 0 : _formData$address0.propertyLocation) !== "FROM_GRAM_PANCHAYAT" && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
8994
9313
  className: "card-label-smaller"
8995
- }, t("ES_NEW_APPLICATION_SLUM_NAME")), /*#__PURE__*/React.createElement(Dropdown$1, {
9314
+ }, t("ES_NEW_APPLICATION_SLUM_NAME")), /*#__PURE__*/React.createElement(Dropdown, {
8996
9315
  t: t,
8997
9316
  option: slumMenu,
8998
9317
  className: "form-field",
@@ -9008,7 +9327,7 @@ const SelectSlumName = _ref => {
9008
9327
  config: config,
9009
9328
  onSelect: goNext,
9010
9329
  onSkip: onSkip
9011
- }, /*#__PURE__*/React.createElement(Dropdown$1, {
9330
+ }, /*#__PURE__*/React.createElement(Dropdown, {
9012
9331
  t: t,
9013
9332
  option: slumMenu,
9014
9333
  optionKey: "i18nKey",
@@ -9187,7 +9506,14 @@ const FSMSelectStreet = _ref => {
9187
9506
  };
9188
9507
  if (userType === "employee") {
9189
9508
  var _inputs2;
9190
- return (_inputs2 = inputs) === null || _inputs2 === void 0 ? void 0 : _inputs2.map((input, index) => {
9509
+ return /*#__PURE__*/React.createElement("div", {
9510
+ style: {
9511
+ display: "grid",
9512
+ gridTemplateColumns: "1fr 1fr",
9513
+ gap: "16px 24px",
9514
+ width: "100%"
9515
+ }
9516
+ }, (_inputs2 = inputs) === null || _inputs2 === void 0 ? void 0 : _inputs2.map((input, index) => {
9191
9517
  var _formData$cpt0, _formData$cpt0$detail, _formData$cpt0$detail2, _formData$address7;
9192
9518
  return /*#__PURE__*/React.createElement(LabelFieldPair, {
9193
9519
  key: index
@@ -9251,7 +9577,7 @@ const FSMSelectStreet = _ref => {
9251
9577
  })));
9252
9578
  }
9253
9579
  })));
9254
- });
9580
+ }));
9255
9581
  }
9256
9582
  return /*#__PURE__*/React.createElement(React.Fragment, null, window.location.href.includes("/fsm") ? /*#__PURE__*/React.createElement(Timeline, {
9257
9583
  currentStep: 2
@@ -9380,7 +9706,7 @@ const SelectTankSize = _ref => {
9380
9706
  };
9381
9707
 
9382
9708
  const SelectTripData = _ref => {
9383
- var _formData$tripData, _formData$tripData2, _formData$address, _formData$address$pro, _formData$tripData3, _formData$address4, _formData$tripData8, _formData$tripData8$v, _formData$tripData9, _formData$address5, _formData$address5$pr;
9709
+ var _formData$tripData, _formData$tripData2, _formData$address, _formData$address$pro, _formData$tripData3, _formData$address4, _formData$address5, _formData$address5$ci, _formData$tripData16, _formData$tripData16$, _formData$tripData17, _formData$address6, _formData$address6$pr, _formData$tripData18, _formData$tripData19;
9384
9710
  let {
9385
9711
  t,
9386
9712
  config,
@@ -9388,7 +9714,7 @@ const SelectTripData = _ref => {
9388
9714
  formData = {},
9389
9715
  userType
9390
9716
  } = _ref;
9391
- const tenantId = Digit.ULBService.getCurrentTenantId();
9717
+ const tenantId = normalizeTenantId(Digit.ULBService.getCurrentTenantId());
9392
9718
  const state = Digit.ULBService.getStateId();
9393
9719
  const {
9394
9720
  pathname: url
@@ -9467,80 +9793,108 @@ const SelectTripData = _ref => {
9467
9793
  disable: true,
9468
9794
  isMandatory: true
9469
9795
  }];
9470
- function setTripNum(value) {
9471
- onSelect(config.key, {
9472
- ...formData[config.key],
9473
- noOfTrips: value
9474
- });
9475
- }
9476
9796
  function setAmount(value) {
9797
+ var _formData$tripData4;
9798
+ const numVal = value === "" ? "" : Number(value);
9799
+ const trips = Number(formData === null || formData === void 0 ? void 0 : (_formData$tripData4 = formData.tripData) === null || _formData$tripData4 === void 0 ? void 0 : _formData$tripData4.noOfTrips) || 1;
9800
+ const totalAmount = numVal === "" || isNaN(numVal) ? "" : numVal * trips;
9477
9801
  onSelect(config.key, {
9478
9802
  ...formData[config.key],
9479
9803
  amountPerTrip: value,
9480
- amount: value * formData.tripData.noOfTrips
9804
+ amount: totalAmount
9481
9805
  });
9806
+ if (value !== "" && !isNaN(numVal)) {
9807
+ setError(false);
9808
+ Digit.SessionStorage.set("total_amount", totalAmount);
9809
+ }
9482
9810
  }
9483
9811
  function setValue(object) {
9484
9812
  let a = {
9485
9813
  ...formData[config.key],
9486
9814
  ...object
9487
9815
  };
9488
- console.log("config.key", config.key, a);
9489
9816
  onSelect(config.key, a);
9490
9817
  }
9491
9818
  useEffect(() => {
9492
9819
  (function () {
9493
9820
  try {
9494
- var _formData$tripData4;
9495
- if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData4 = formData.tripData) === null || _formData$tripData4 === void 0 ? void 0 : _formData$tripData4.vehicleType) !== vehicle) {
9496
- var _formData$tripData5, _formData$tripData5$v;
9821
+ var _formData$tripData5, _formData$tripData7;
9822
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData5 = formData.tripData) === null || _formData$tripData5 === void 0 ? void 0 : _formData$tripData5.vehicleType) !== vehicle) {
9823
+ var _formData$tripData6, _formData$tripData6$v;
9497
9824
  setVehicle({
9498
- label: formData === null || formData === void 0 ? void 0 : (_formData$tripData5 = formData.tripData) === null || _formData$tripData5 === void 0 ? void 0 : (_formData$tripData5$v = _formData$tripData5.vehicleType) === null || _formData$tripData5$v === void 0 ? void 0 : _formData$tripData5$v.capacity
9825
+ label: formData === null || formData === void 0 ? void 0 : (_formData$tripData6 = formData.tripData) === null || _formData$tripData6 === void 0 ? void 0 : (_formData$tripData6$v = _formData$tripData6.vehicleType) === null || _formData$tripData6$v === void 0 ? void 0 : _formData$tripData6$v.capacity
9499
9826
  });
9500
9827
  }
9501
- const _temp = function (_formData$tripData6, _formData$tripData6$v, _formData$address2, _formData$address2$pr, _formData$address3, _formData$address3$pr) {
9502
- if (formData !== null && formData !== void 0 && formData.propertyType && formData !== null && formData !== void 0 && formData.subtype && formData !== null && formData !== void 0 && formData.address && formData !== null && formData !== void 0 && (_formData$tripData6 = formData.tripData) !== null && _formData$tripData6 !== void 0 && (_formData$tripData6$v = _formData$tripData6.vehicleType) !== null && _formData$tripData6$v !== void 0 && _formData$tripData6$v.capacity && (formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : (_formData$address2$pr = _formData$address2.propertyLocation) === null || _formData$address2$pr === void 0 ? void 0 : _formData$address2$pr.code) === "WITHIN_ULB_LIMITS") {
9503
- var _formData$tripData7;
9504
- const capacity = formData === null || formData === void 0 ? void 0 : (_formData$tripData7 = formData.tripData) === null || _formData$tripData7 === void 0 ? void 0 : _formData$tripData7.vehicleType.capacity;
9505
- const {
9506
- slum: slumDetails
9507
- } = formData.address;
9508
- const slum = slumDetails ? "YES" : "NO";
9509
- return Promise.resolve(Digit.FSMService.billingSlabSearch(tenantId, {
9510
- propertyType: formData === null || formData === void 0 ? void 0 : formData.subtype,
9511
- capacity,
9512
- slum
9513
- })).then(function (billingDetails) {
9514
- var _billingDetails$billi;
9515
- console.log("billingDetails", billingDetails);
9516
- const billSlab = (billingDetails === null || billingDetails === void 0 ? void 0 : (_billingDetails$billi = billingDetails.billingSlab) === null || _billingDetails$billi === void 0 ? void 0 : _billingDetails$billi.length) && (billingDetails === null || billingDetails === void 0 ? void 0 : billingDetails.billingSlab[0]);
9517
- if (billSlab !== null && billSlab !== void 0 && billSlab.price || (billSlab === null || billSlab === void 0 ? void 0 : billSlab.price) === 0) {
9518
- setValue({
9519
- amountPerTrip: billSlab.price,
9520
- amount: billSlab.price * formData.tripData.noOfTrips
9521
- });
9522
- setError(false);
9523
- } else {
9524
- setValue({
9525
- amountPerTrip: "",
9526
- amount: ""
9828
+ const trips = Number(formData === null || formData === void 0 ? void 0 : (_formData$tripData7 = formData.tripData) === null || _formData$tripData7 === void 0 ? void 0 : _formData$tripData7.noOfTrips) || 1;
9829
+ const _temp2 = function (_formData$address2, _formData$address2$pr) {
9830
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : (_formData$address2$pr = _formData$address2.propertyLocation) === null || _formData$address2$pr === void 0 ? void 0 : _formData$address2$pr.code) === "FROM_GRAM_PANCHAYAT") {
9831
+ var _formData$tripData8;
9832
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData8 = formData.tripData) === null || _formData$tripData8 === void 0 ? void 0 : _formData$tripData8.amount) !== totalAmt) {
9833
+ setValue({
9834
+ amount: totalAmt
9835
+ });
9836
+ }
9837
+ Digit.SessionStorage.set("total_amount", totalAmt);
9838
+ setError(false);
9839
+ } else {
9840
+ const _temp = function (_formData$tripData9, _formData$tripData9$v, _formData$address3, _formData$address3$pr) {
9841
+ if (formData !== null && formData !== void 0 && formData.propertyType && formData !== null && formData !== void 0 && formData.subtype && formData !== null && formData !== void 0 && formData.address && formData !== null && formData !== void 0 && (_formData$tripData9 = formData.tripData) !== null && _formData$tripData9 !== void 0 && (_formData$tripData9$v = _formData$tripData9.vehicleType) !== null && _formData$tripData9$v !== void 0 && _formData$tripData9$v.capacity && (formData === null || formData === void 0 ? void 0 : (_formData$address3 = formData.address) === null || _formData$address3 === void 0 ? void 0 : (_formData$address3$pr = _formData$address3.propertyLocation) === null || _formData$address3$pr === void 0 ? void 0 : _formData$address3$pr.code) === "WITHIN_ULB_LIMITS") {
9842
+ return Promise.resolve(fetchBillingSlabDetails(tenantId, formData)).then(function (billSlab) {
9843
+ if (billSlab && (billSlab !== null && billSlab !== void 0 && billSlab.price || (billSlab === null || billSlab === void 0 ? void 0 : billSlab.price) === 0)) {
9844
+ var _formData$tripData0, _formData$tripData1;
9845
+ const rate = billSlab.price;
9846
+ const totalAmt = rate * trips;
9847
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData0 = formData.tripData) === null || _formData$tripData0 === void 0 ? void 0 : _formData$tripData0.amountPerTrip) !== rate || (formData === null || formData === void 0 ? void 0 : (_formData$tripData1 = formData.tripData) === null || _formData$tripData1 === void 0 ? void 0 : _formData$tripData1.amount) !== totalAmt) {
9848
+ setValue({
9849
+ amountPerTrip: rate,
9850
+ amount: totalAmt
9851
+ });
9852
+ }
9853
+ Digit.SessionStorage.set("total_amount", totalAmt);
9854
+ setError(false);
9855
+ } else {
9856
+ var _formData$tripData10, _formData$tripData11, _formData$tripData12;
9857
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData10 = formData.tripData) === null || _formData$tripData10 === void 0 ? void 0 : _formData$tripData10.amountPerTrip) !== undefined && (formData === null || formData === void 0 ? void 0 : (_formData$tripData11 = formData.tripData) === null || _formData$tripData11 === void 0 ? void 0 : _formData$tripData11.amountPerTrip) !== null && (formData === null || formData === void 0 ? void 0 : (_formData$tripData12 = formData.tripData) === null || _formData$tripData12 === void 0 ? void 0 : _formData$tripData12.amountPerTrip) !== "") {
9858
+ var _formData$tripData13;
9859
+ const totalAmt = Number(formData.tripData.amountPerTrip) * trips;
9860
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData13 = formData.tripData) === null || _formData$tripData13 === void 0 ? void 0 : _formData$tripData13.amount) !== totalAmt) {
9861
+ setValue({
9862
+ amount: totalAmt
9863
+ });
9864
+ }
9865
+ Digit.SessionStorage.set("total_amount", totalAmt);
9866
+ setError(false);
9867
+ } else {
9868
+ var _formData$tripData14, _formData$tripData15;
9869
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData14 = formData.tripData) === null || _formData$tripData14 === void 0 ? void 0 : _formData$tripData14.amountPerTrip) !== "" || (formData === null || formData === void 0 ? void 0 : (_formData$tripData15 = formData.tripData) === null || _formData$tripData15 === void 0 ? void 0 : _formData$tripData15.amount) !== "") {
9870
+ setValue({
9871
+ amountPerTrip: "",
9872
+ amount: ""
9873
+ });
9874
+ }
9875
+ setError(true);
9876
+ }
9877
+ }
9527
9878
  });
9528
- setError(true);
9529
9879
  }
9530
- });
9531
- } else if ((formData === null || formData === void 0 ? void 0 : (_formData$address3 = formData.address) === null || _formData$address3 === void 0 ? void 0 : (_formData$address3$pr = _formData$address3.propertyLocation) === null || _formData$address3$pr === void 0 ? void 0 : _formData$address3$pr.code) === "FROM_GRAM_PANCHAYAT" && formData.tripData.noOfTrips && formData.tripData.amountPerTrip) {
9532
- setValue({
9533
- amount: formData.tripData.amountPerTrip * formData.tripData.noOfTrips
9534
- });
9880
+ }();
9881
+ if (_temp && _temp.then) return _temp.then(function () {});
9535
9882
  }
9536
9883
  }();
9537
- return _temp && _temp.then ? _temp.then(function () {}) : void 0;
9884
+ return _temp2 && _temp2.then ? _temp2.then(function () {}) : void 0;
9538
9885
  } catch (e) {
9539
9886
  Promise.reject(e);
9540
9887
  }
9541
9888
  })();
9542
- }, [formData === null || formData === void 0 ? void 0 : formData.propertyType, formData === null || formData === void 0 ? void 0 : formData.subtype, formData === null || formData === void 0 ? void 0 : (_formData$address4 = formData.address) === null || _formData$address4 === void 0 ? void 0 : _formData$address4.slum, formData === null || formData === void 0 ? void 0 : (_formData$tripData8 = formData.tripData) === null || _formData$tripData8 === void 0 ? void 0 : (_formData$tripData8$v = _formData$tripData8.vehicleType) === null || _formData$tripData8$v === void 0 ? void 0 : _formData$tripData8$v.capacity, (formData === null || formData === void 0 ? void 0 : (_formData$tripData9 = formData.tripData) === null || _formData$tripData9 === void 0 ? void 0 : _formData$tripData9.noOfTrips) && (formData === null || formData === void 0 ? void 0 : (_formData$address5 = formData.address) === null || _formData$address5 === void 0 ? void 0 : (_formData$address5$pr = _formData$address5.propertyLocation) === null || _formData$address5$pr === void 0 ? void 0 : _formData$address5$pr.code)]);
9543
- return isVehicleMenuLoading && isDsoLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", null, inputs === null || inputs === void 0 ? void 0 : inputs.map((input, index) => /*#__PURE__*/React.createElement(LabelFieldPair, {
9889
+ }, [formData === null || formData === void 0 ? void 0 : formData.propertyType, formData === null || formData === void 0 ? void 0 : formData.subtype, formData === null || formData === void 0 ? void 0 : (_formData$address4 = formData.address) === null || _formData$address4 === void 0 ? void 0 : _formData$address4.slum, formData === null || formData === void 0 ? void 0 : (_formData$address5 = formData.address) === null || _formData$address5 === void 0 ? void 0 : (_formData$address5$ci = _formData$address5.city) === null || _formData$address5$ci === void 0 ? void 0 : _formData$address5$ci.code, formData === null || formData === void 0 ? void 0 : (_formData$tripData16 = formData.tripData) === null || _formData$tripData16 === void 0 ? void 0 : (_formData$tripData16$ = _formData$tripData16.vehicleType) === null || _formData$tripData16$ === void 0 ? void 0 : _formData$tripData16$.capacity, formData === null || formData === void 0 ? void 0 : (_formData$tripData17 = formData.tripData) === null || _formData$tripData17 === void 0 ? void 0 : _formData$tripData17.noOfTrips, formData === null || formData === void 0 ? void 0 : (_formData$address6 = formData.address) === null || _formData$address6 === void 0 ? void 0 : (_formData$address6$pr = _formData$address6.propertyLocation) === null || _formData$address6$pr === void 0 ? void 0 : _formData$address6$pr.code]);
9890
+ return isVehicleMenuLoading && isDsoLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
9891
+ style: {
9892
+ display: "grid",
9893
+ gridTemplateColumns: "1fr 1fr",
9894
+ gap: "16px 24px",
9895
+ width: "100%"
9896
+ }
9897
+ }, inputs === null || inputs === void 0 ? void 0 : inputs.map((input, index) => /*#__PURE__*/React.createElement(LabelFieldPair, {
9544
9898
  key: index
9545
9899
  }, /*#__PURE__*/React.createElement(CardLabel$1, {
9546
9900
  className: "card-label-smaller"
@@ -9549,23 +9903,25 @@ const SelectTripData = _ref => {
9549
9903
  }, /*#__PURE__*/React.createElement(TextInput$1, _extends({
9550
9904
  type: input.type,
9551
9905
  onChange: e => {
9552
- var _formData$address$pro2;
9553
- return index === 0 && ((_formData$address$pro2 = formData.address.propertyLocation) === null || _formData$address$pro2 === void 0 ? void 0 : _formData$address$pro2.code) === "FROM_GRAM_PANCHAYAT" ? setAmount(e.target.value) : setTripNum(e.target.value);
9906
+ if (index === 0) {
9907
+ setAmount(e.target.value);
9908
+ }
9554
9909
  },
9555
9910
  key: input.name,
9556
9911
  value: input.default ? input.default : formData && formData[config.key] ? formData[config.key][input.name] : null
9557
9912
  }, input.validation, {
9558
9913
  disable: input.disable
9559
- }))))), billError ? /*#__PURE__*/React.createElement(CardLabelError$1, {
9914
+ }))))), billError && !(formData !== null && formData !== void 0 && (_formData$tripData18 = formData.tripData) !== null && _formData$tripData18 !== void 0 && _formData$tripData18.amountPerTrip) && (formData === null || formData === void 0 ? void 0 : (_formData$tripData19 = formData.tripData) === null || _formData$tripData19 === void 0 ? void 0 : _formData$tripData19.amountPerTrip) !== 0 ? /*#__PURE__*/React.createElement(CardLabelError$1, {
9560
9915
  style: {
9561
9916
  width: "100%",
9562
- textAlign: "center"
9917
+ textAlign: "center",
9918
+ gridColumn: "span 2"
9563
9919
  }
9564
9920
  }, t("ES_APPLICATION_BILL_SLAB_ERROR")) : null);
9565
9921
  };
9566
9922
 
9567
9923
  const SelectPaymentPreference = _ref => {
9568
- var _formData$selectPayme, _formData$selectTripN5, _formData$selectTripN6, _formData$selectTripN7, _formData$address6, _formData$address6$pr, _formData$address7, _formData$address7$pr;
9924
+ var _formData$selectPayme, _formData$selectTripN4, _formData$selectTripN5, _formData$selectTripN6, _formData$address3, _formData$address3$pr, _formData$address4, _formData$address4$pr;
9569
9925
  let {
9570
9926
  config,
9571
9927
  formData,
@@ -9608,25 +9964,14 @@ const SelectPaymentPreference = _ref => {
9608
9964
  try {
9609
9965
  const _temp2 = function (_formData$selectTripN, _formData$address, _formData$address$pro) {
9610
9966
  if (formData !== null && formData !== void 0 && formData.propertyType && formData !== null && formData !== void 0 && formData.subtype && formData !== null && formData !== void 0 && formData.address && formData !== null && formData !== void 0 && (_formData$selectTripN = formData.selectTripNo) !== null && _formData$selectTripN !== void 0 && _formData$selectTripN.vehicleCapacity.capacity && (formData === null || formData === void 0 ? void 0 : (_formData$address = formData.address) === null || _formData$address === void 0 ? void 0 : (_formData$address$pro = _formData$address.propertyLocation) === null || _formData$address$pro === void 0 ? void 0 : _formData$address$pro.code) === "WITHIN_ULB_LIMITS") {
9611
- var _formData$selectTripN2, _formData$address2, _formData$address2$ci, _formData$address3, _formData$address3$ci, _formData$subtype;
9612
- const capacity = formData === null || formData === void 0 ? void 0 : (_formData$selectTripN2 = formData.selectTripNo) === null || _formData$selectTripN2 === void 0 ? void 0 : _formData$selectTripN2.vehicleCapacity.capacity;
9613
- const {
9614
- slum: slumDetails
9615
- } = formData.address;
9616
- const slum = slumDetails ? "YES" : "NO";
9617
- return Promise.resolve(Digit.FSMService.billingSlabSearch(tenantId === (formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : (_formData$address2$ci = _formData$address2.city) === null || _formData$address2$ci === void 0 ? void 0 : _formData$address2$ci.code) ? tenantId : formData === null || formData === void 0 ? void 0 : (_formData$address3 = formData.address) === null || _formData$address3 === void 0 ? void 0 : (_formData$address3$ci = _formData$address3.city) === null || _formData$address3$ci === void 0 ? void 0 : _formData$address3$ci.code, {
9618
- propertyType: formData === null || formData === void 0 ? void 0 : (_formData$subtype = formData.subtype) === null || _formData$subtype === void 0 ? void 0 : _formData$subtype.code,
9619
- capacity,
9620
- slum
9621
- })).then(function (billingDetails) {
9622
- var _billingDetails$billi;
9623
- const billSlab = (billingDetails === null || billingDetails === void 0 ? void 0 : (_billingDetails$billi = billingDetails.billingSlab) === null || _billingDetails$billi === void 0 ? void 0 : _billingDetails$billi.length) && (billingDetails === null || billingDetails === void 0 ? void 0 : billingDetails.billingSlab[0]);
9624
- Digit.SessionStorage.set("amount_per_trip", billSlab.price);
9967
+ return Promise.resolve(fetchBillingSlabDetails(tenantId, formData)).then(function (billSlab) {
9968
+ Digit.SessionStorage.set("amount_per_trip", billSlab === null || billSlab === void 0 ? void 0 : billSlab.price);
9625
9969
  const _temp = function () {
9626
9970
  if (billSlab !== null && billSlab !== void 0 && billSlab.price) {
9627
- var _formData$selectTripN3, _formData$selectTripN4, _formData$address4, _formData$address4$ci, _formData$address5, _formData$address5$ci;
9628
- let totaltripAmount = billSlab.price * (formData === null || formData === void 0 ? void 0 : (_formData$selectTripN3 = formData.selectTripNo) === null || _formData$selectTripN3 === void 0 ? void 0 : (_formData$selectTripN4 = _formData$selectTripN3.tripNo) === null || _formData$selectTripN4 === void 0 ? void 0 : _formData$selectTripN4.code);
9629
- return Promise.resolve(Digit.FSMService.advanceBalanceCalculate(tenantId === (formData === null || formData === void 0 ? void 0 : (_formData$address4 = formData.address) === null || _formData$address4 === void 0 ? void 0 : (_formData$address4$ci = _formData$address4.city) === null || _formData$address4$ci === void 0 ? void 0 : _formData$address4$ci.code) ? tenantId : formData === null || formData === void 0 ? void 0 : (_formData$address5 = formData.address) === null || _formData$address5 === void 0 ? void 0 : (_formData$address5$ci = _formData$address5.city) === null || _formData$address5$ci === void 0 ? void 0 : _formData$address5$ci.code, {
9971
+ var _formData$selectTripN2, _formData$selectTripN3, _formData$address2, _formData$address2$ci;
9972
+ let totaltripAmount = billSlab.price * (formData === null || formData === void 0 ? void 0 : (_formData$selectTripN2 = formData.selectTripNo) === null || _formData$selectTripN2 === void 0 ? void 0 : (_formData$selectTripN3 = _formData$selectTripN2.tripNo) === null || _formData$selectTripN3 === void 0 ? void 0 : _formData$selectTripN3.code);
9973
+ const cleanTenant = normalizeTenantId(tenantId || (formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : (_formData$address2$ci = _formData$address2.city) === null || _formData$address2$ci === void 0 ? void 0 : _formData$address2$ci.code));
9974
+ return Promise.resolve(Digit.FSMService.advanceBalanceCalculate(cleanTenant, {
9630
9975
  totalTripAmount: totaltripAmount
9631
9976
  })).then(function (_ref2) {
9632
9977
  var _formData$selectPayme2, _formData$selectPayme3;
@@ -9662,7 +10007,7 @@ const SelectPaymentPreference = _ref => {
9662
10007
  Promise.reject(e);
9663
10008
  }
9664
10009
  })();
9665
- }, [formData === null || formData === void 0 ? void 0 : formData.propertyType, formData === null || formData === void 0 ? void 0 : formData.subtype, formData === null || formData === void 0 ? void 0 : formData.address, formData === null || formData === void 0 ? void 0 : (_formData$selectTripN5 = formData.selectTripNo) === null || _formData$selectTripN5 === void 0 ? void 0 : _formData$selectTripN5.vehicleCapacity.capacity, formData === null || formData === void 0 ? void 0 : (_formData$selectTripN6 = formData.selectTripNo) === null || _formData$selectTripN6 === void 0 ? void 0 : (_formData$selectTripN7 = _formData$selectTripN6.tripNo) === null || _formData$selectTripN7 === void 0 ? void 0 : _formData$selectTripN7.code]);
10010
+ }, [formData === null || formData === void 0 ? void 0 : formData.propertyType, formData === null || formData === void 0 ? void 0 : formData.subtype, formData === null || formData === void 0 ? void 0 : formData.address, formData === null || formData === void 0 ? void 0 : (_formData$selectTripN4 = formData.selectTripNo) === null || _formData$selectTripN4 === void 0 ? void 0 : _formData$selectTripN4.vehicleCapacity.capacity, formData === null || formData === void 0 ? void 0 : (_formData$selectTripN5 = formData.selectTripNo) === null || _formData$selectTripN5 === void 0 ? void 0 : (_formData$selectTripN6 = _formData$selectTripN5.tripNo) === null || _formData$selectTripN6 === void 0 ? void 0 : _formData$selectTripN6.code]);
9666
10011
  if (userType === "employee") {
9667
10012
  return null;
9668
10013
  }
@@ -9684,8 +10029,8 @@ const SelectPaymentPreference = _ref => {
9684
10029
  t: t
9685
10030
  }, /*#__PURE__*/React.createElement(KeyNote, {
9686
10031
  keyValue: t("ADV_TOTAL_AMOUNT") + " (₹)",
9687
- note: (formData === null || formData === void 0 ? void 0 : (_formData$address6 = formData.address) === null || _formData$address6 === void 0 ? void 0 : (_formData$address6$pr = _formData$address6.propertyLocation) === null || _formData$address6$pr === void 0 ? void 0 : _formData$address6$pr.code) === "FROM_GRAM_PANCHAYAT" ? "N/A" : max
9688
- }), (formData === null || formData === void 0 ? void 0 : (_formData$address7 = formData.address) === null || _formData$address7 === void 0 ? void 0 : (_formData$address7$pr = _formData$address7.propertyLocation) === null || _formData$address7$pr === void 0 ? void 0 : _formData$address7$pr.code) === "FROM_GRAM_PANCHAYAT" && /*#__PURE__*/React.createElement(CardLabelError$1, {
10032
+ note: (formData === null || formData === void 0 ? void 0 : (_formData$address3 = formData.address) === null || _formData$address3 === void 0 ? void 0 : (_formData$address3$pr = _formData$address3.propertyLocation) === null || _formData$address3$pr === void 0 ? void 0 : _formData$address3$pr.code) === "FROM_GRAM_PANCHAYAT" ? "N/A" : max
10033
+ }), (formData === null || formData === void 0 ? void 0 : (_formData$address4 = formData.address) === null || _formData$address4 === void 0 ? void 0 : (_formData$address4$pr = _formData$address4.propertyLocation) === null || _formData$address4$pr === void 0 ? void 0 : _formData$address4$pr.code) === "FROM_GRAM_PANCHAYAT" && /*#__PURE__*/React.createElement(CardLabelError$1, {
9689
10034
  style: {
9690
10035
  width: "100%",
9691
10036
  marginTop: "-15px",
@@ -9802,26 +10147,40 @@ const SelectVehicleType = _ref => {
9802
10147
  type: type
9803
10148
  });
9804
10149
  };
9805
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t("ES_FSM_REGISTRY_VEHICLE_MODEL"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
9806
- className: "form-field",
9807
- isMandatory: true,
10150
+ return /*#__PURE__*/React.createElement("div", {
10151
+ style: {
10152
+ display: "grid",
10153
+ gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))",
10154
+ gap: "16px",
10155
+ columnGap: "24px",
10156
+ width: "100%"
10157
+ }
10158
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t("ES_FSM_REGISTRY_VEHICLE_MODEL"), config.isMandatory ? /*#__PURE__*/React.createElement("span", {
10159
+ className: "check-page-link-button"
10160
+ }, " * ") : null), /*#__PURE__*/React.createElement(Dropdown, {
10161
+ className: "payment-form-text-input-correction",
10162
+ isMandatory: config.isMandatory,
9808
10163
  selected: selectedModal,
9809
10164
  disable: false,
9810
10165
  option: modals === null || modals === void 0 ? void 0 : modals.sort((a, b) => a.name.localeCompare(b.name)),
9811
10166
  select: selectModal,
9812
10167
  optionKey: "name",
9813
10168
  t: t
9814
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t("ES_FSM_REGISTRY_VEHICLE_TYPE"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
9815
- className: "form-field",
9816
- isMandatory: true,
10169
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t("ES_FSM_REGISTRY_VEHICLE_TYPE"), config.isMandatory ? /*#__PURE__*/React.createElement("span", {
10170
+ className: "check-page-link-button"
10171
+ }, " * ") : null), /*#__PURE__*/React.createElement(Dropdown, {
10172
+ className: "payment-form-text-input-correction",
10173
+ isMandatory: config.isMandatory,
9817
10174
  selected: selectedType,
9818
10175
  option: types === null || types === void 0 ? void 0 : types.sort((a, b) => a.name.localeCompare(b.name)),
9819
10176
  select: selectType,
9820
10177
  optionKey: "name",
9821
10178
  t: t
9822
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t("ES_FSM_REGISTRY_VEHICLE_CAPACITY"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(TextInput$1, {
9823
- className: "",
9824
- value: selectedCapacity,
10179
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t("ES_FSM_REGISTRY_VEHICLE_CAPACITY"), config.isMandatory ? /*#__PURE__*/React.createElement("span", {
10180
+ className: "check-page-link-button"
10181
+ }, " * ") : null), /*#__PURE__*/React.createElement(TextInput$1, {
10182
+ className: "payment-form-text-input-correction",
10183
+ value: selectedCapacity ? `${selectedCapacity} ${t("CS_COMMON_LITRES") || "KL"}` : "",
9825
10184
  onChange: () => {},
9826
10185
  disable: true
9827
10186
  })));
@@ -9874,17 +10233,15 @@ const CheckPage = _ref2 => {
9874
10233
  }, "");
9875
10234
  const getAddress = (address, t) => {
9876
10235
  var _address$gramPanchaya, _address$propertyLoca2;
9877
- console.log("address", address);
9878
10236
  if ((address === null || address === void 0 ? void 0 : (_address$gramPanchaya = address.gramPanchayat) === null || _address$gramPanchaya === void 0 ? void 0 : _address$gramPanchaya.code) === "OTH1") {
9879
10237
  var _address$doorNo, _address$doorNo2, _address$street, _address$street2, _address$propertyLoca, _address$locality, _address$village, _address$city;
9880
10238
  return `${address !== null && address !== void 0 && (_address$doorNo = address.doorNo) !== null && _address$doorNo !== void 0 && _address$doorNo.trim() ? `${address === null || address === void 0 ? void 0 : (_address$doorNo2 = address.doorNo) === null || _address$doorNo2 === void 0 ? void 0 : _address$doorNo2.trim()}, ` : ""} ${address !== null && address !== void 0 && (_address$street = address.street) !== null && _address$street !== void 0 && _address$street.trim() ? `${address === null || address === void 0 ? void 0 : (_address$street2 = address.street) === null || _address$street2 === void 0 ? void 0 : _address$street2.trim()}, ` : ""}${(address === null || address === void 0 ? void 0 : (_address$propertyLoca = address.propertyLocation) === null || _address$propertyLoca === void 0 ? void 0 : _address$propertyLoca.code) === "WITHIN_ULB_LIMITS" ? t(address === null || address === void 0 ? void 0 : (_address$locality = address.locality) === null || _address$locality === void 0 ? void 0 : _address$locality.i18nkey) : address === null || address === void 0 ? void 0 : address.newGramPanchayat},${t(address === null || address === void 0 ? void 0 : (_address$village = address.village) === null || _address$village === void 0 ? void 0 : _address$village.code)}, ${t((address === null || address === void 0 ? void 0 : (_address$city = address.city) === null || _address$city === void 0 ? void 0 : _address$city.code) || (address === null || address === void 0 ? void 0 : address.city) || "")}`;
9881
10239
  } else if ((address === null || address === void 0 ? void 0 : (_address$propertyLoca2 = address.propertyLocation) === null || _address$propertyLoca2 === void 0 ? void 0 : _address$propertyLoca2.code) === "WITHIN_ULB_LIMITS") {
9882
- var _address$locality2, _address$locality3;
9883
- console.log("trueee", `${t(address === null || address === void 0 ? void 0 : (_address$locality2 = address.locality) === null || _address$locality2 === void 0 ? void 0 : _address$locality2.code)}`);
9884
- return `${t(address === null || address === void 0 ? void 0 : (_address$locality3 = address.locality) === null || _address$locality3 === void 0 ? void 0 : _address$locality3.code)}`;
10240
+ var _address$locality2;
10241
+ return `${t(address === null || address === void 0 ? void 0 : (_address$locality2 = address.locality) === null || _address$locality2 === void 0 ? void 0 : _address$locality2.code)}`;
9885
10242
  } else {
9886
- var _address$doorNo3, _address$doorNo4, _address$street3, _address$street4, _address$propertyLoca3, _address$locality4, _address$gramPanchaya2, _address$village2, _address$city2;
9887
- return `${address !== null && address !== void 0 && (_address$doorNo3 = address.doorNo) !== null && _address$doorNo3 !== void 0 && _address$doorNo3.trim() ? `${address === null || address === void 0 ? void 0 : (_address$doorNo4 = address.doorNo) === null || _address$doorNo4 === void 0 ? void 0 : _address$doorNo4.trim()}, ` : ""} ${address !== null && address !== void 0 && (_address$street3 = address.street) !== null && _address$street3 !== void 0 && _address$street3.trim() ? `${address === null || address === void 0 ? void 0 : (_address$street4 = address.street) === null || _address$street4 === void 0 ? void 0 : _address$street4.trim()}, ` : ""}${(address === null || address === void 0 ? void 0 : (_address$propertyLoca3 = address.propertyLocation) === null || _address$propertyLoca3 === void 0 ? void 0 : _address$propertyLoca3.code) === "WITHIN_ULB_LIMITS" ? t(address === null || address === void 0 ? void 0 : (_address$locality4 = address.locality) === null || _address$locality4 === void 0 ? void 0 : _address$locality4.i18nkey) : address === null || address === void 0 ? void 0 : (_address$gramPanchaya2 = address.gramPanchayat) === null || _address$gramPanchaya2 === void 0 ? void 0 : _address$gramPanchaya2.i18nkey},${t(address === null || address === void 0 ? void 0 : (_address$village2 = address.village) === null || _address$village2 === void 0 ? void 0 : _address$village2.code)}, ${t((address === null || address === void 0 ? void 0 : (_address$city2 = address.city) === null || _address$city2 === void 0 ? void 0 : _address$city2.code) || (address === null || address === void 0 ? void 0 : address.city) || "")}`;
10243
+ var _address$doorNo3, _address$doorNo4, _address$street3, _address$street4, _address$propertyLoca3, _address$locality3, _address$gramPanchaya2, _address$village2, _address$city2;
10244
+ return `${address !== null && address !== void 0 && (_address$doorNo3 = address.doorNo) !== null && _address$doorNo3 !== void 0 && _address$doorNo3.trim() ? `${address === null || address === void 0 ? void 0 : (_address$doorNo4 = address.doorNo) === null || _address$doorNo4 === void 0 ? void 0 : _address$doorNo4.trim()}, ` : ""} ${address !== null && address !== void 0 && (_address$street3 = address.street) !== null && _address$street3 !== void 0 && _address$street3.trim() ? `${address === null || address === void 0 ? void 0 : (_address$street4 = address.street) === null || _address$street4 === void 0 ? void 0 : _address$street4.trim()}, ` : ""}${(address === null || address === void 0 ? void 0 : (_address$propertyLoca3 = address.propertyLocation) === null || _address$propertyLoca3 === void 0 ? void 0 : _address$propertyLoca3.code) === "WITHIN_ULB_LIMITS" ? t(address === null || address === void 0 ? void 0 : (_address$locality3 = address.locality) === null || _address$locality3 === void 0 ? void 0 : _address$locality3.i18nkey) : address === null || address === void 0 ? void 0 : (_address$gramPanchaya2 = address.gramPanchayat) === null || _address$gramPanchaya2 === void 0 ? void 0 : _address$gramPanchaya2.i18nkey},${t(address === null || address === void 0 ? void 0 : (_address$village2 = address.village) === null || _address$village2 === void 0 ? void 0 : _address$village2.code)}, ${t((address === null || address === void 0 ? void 0 : (_address$city2 = address.city) === null || _address$city2 === void 0 ? void 0 : _address$city2.code) || (address === null || address === void 0 ? void 0 : address.city) || "")}`;
9888
10245
  }
9889
10246
  };
9890
10247
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Timeline, {
@@ -11581,18 +11938,18 @@ const CitizenApp = _ref => {
11581
11938
  getBackPageNumber: () => -4
11582
11939
  }, t("CS_COMMON_BACK")) : /*#__PURE__*/React.createElement(BackButton, null, t("CS_COMMON_BACK")), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
11583
11940
  path: `${path}/inbox`,
11584
- component: () => Digit.UserService.hasAccess(["FSM_DSO"]) ? /*#__PURE__*/React.createElement(Inbox, {
11941
+ component: props => Digit.UserService.hasAccess(["FSM_DSO", "FSM_ADMIN", "ADMIN", "SUPERUSER"]) ? /*#__PURE__*/React.createElement(Inbox, _extends({}, props, {
11585
11942
  parentRoute: path,
11586
11943
  isInbox: true
11587
- }) : /*#__PURE__*/React.createElement(Redirect, {
11944
+ })) : /*#__PURE__*/React.createElement(Redirect, {
11588
11945
  to: "/digit-ui/citizen"
11589
11946
  })
11590
11947
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
11591
11948
  path: `${path}/search`,
11592
- component: () => Digit.UserService.hasAccess(["FSM_DSO"]) ? /*#__PURE__*/React.createElement(Inbox, {
11949
+ component: props => Digit.UserService.hasAccess(["FSM_DSO", "FSM_ADMIN", "ADMIN", "SUPERUSER"]) ? /*#__PURE__*/React.createElement(Inbox, _extends({}, props, {
11593
11950
  parentRoute: path,
11594
11951
  isSearch: true
11595
- }) : /*#__PURE__*/React.createElement(Redirect, {
11952
+ })) : /*#__PURE__*/React.createElement(Redirect, {
11596
11953
  to: "/digit-ui/citizen"
11597
11954
  })
11598
11955
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
@@ -11912,7 +12269,16 @@ const Filter = _ref => {
11912
12269
  });
11913
12270
  };
11914
12271
  const clearAll = () => {
11915
- if (isFstpOperator) return onFilterChange();
12272
+ var _props$onClose;
12273
+ onFilterChange({
12274
+ applicationStatus: [],
12275
+ locality: [],
12276
+ uuid: {
12277
+ code: DSO || isFstpOperator ? "ASSIGNED_TO_ME" : "ASSIGNED_TO_ALL",
12278
+ name: DSO || isFstpOperator ? t("ES_INBOX_ASSIGNED_TO_ME") : t("ES_INBOX_ASSIGNED_TO_ALL")
12279
+ }
12280
+ });
12281
+ props === null || props === void 0 ? void 0 : (_props$onClose = props.onClose) === null || _props$onClose === void 0 ? void 0 : _props$onClose.call(props);
11916
12282
  };
11917
12283
  return /*#__PURE__*/React.createElement(React.Fragment, null, (!DSO && !isFstpOperator && searchParams || (mergedRoleDetails === null || mergedRoleDetails === void 0 ? void 0 : (_mergedRoleDetails$st = mergedRoleDetails.statuses) === null || _mergedRoleDetails$st === void 0 ? void 0 : _mergedRoleDetails$st.length) > 0 || isFstpOperatorRequest) && /*#__PURE__*/React.createElement("div", {
11918
12284
  className: "filter",
@@ -11986,7 +12352,7 @@ const DropdownStatus = _ref => {
11986
12352
  applicationStatuses,
11987
12353
  areApplicationStatus
11988
12354
  } = _ref;
11989
- return areApplicationStatus ? /*#__PURE__*/React.createElement(Dropdown$1, {
12355
+ return areApplicationStatus ? /*#__PURE__*/React.createElement(Dropdown, {
11990
12356
  option: applicationStatuses,
11991
12357
  optionKey: "name",
11992
12358
  selected: value,
@@ -12069,7 +12435,7 @@ const SearchApplication = _ref => {
12069
12435
  switch (input.type) {
12070
12436
  case "date":
12071
12437
  return /*#__PURE__*/React.createElement(Controller, {
12072
- render: props => /*#__PURE__*/React.createElement(DatePicker$2, {
12438
+ render: props => /*#__PURE__*/React.createElement(DatePicker, {
12073
12439
  date: props.value,
12074
12440
  onChange: props.onChange
12075
12441
  }),
@@ -13177,6 +13543,7 @@ const EmployeeApp = _ref2 => {
13177
13543
  const DriverDetails = Digit.ComponentRegistryService.getComponent("DriverDetails");
13178
13544
  const AddDriver = Digit.ComponentRegistryService.getComponent("AddDriver");
13179
13545
  const EditDriver = Digit.ComponentRegistryService.getComponent("EditDriver");
13546
+ const DsoDashboard = Digit.ComponentRegistryService.getComponent("FSMDsoDashboard");
13180
13547
  const getDynamicBreadcrumbs = () => {
13181
13548
  const pathname = location.pathname;
13182
13549
  let crumbs = [{
@@ -13212,7 +13579,7 @@ const EmployeeApp = _ref2 => {
13212
13579
  path: `${path}/inbox`
13213
13580
  });
13214
13581
  crumbs.push({
13215
- label: t("CS_FSM_APPLICATION_DETAIL_TITLE")
13582
+ label: t("ES_TITLE_APPLICATION_DETAILS")
13216
13583
  });
13217
13584
  } else if (pathname.includes("/registry/new-vendor")) {
13218
13585
  crumbs.push({
@@ -13348,11 +13715,26 @@ const EmployeeApp = _ref2 => {
13348
13715
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
13349
13716
  path: `${path}/application-details/:id`,
13350
13717
  component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
13351
- layoutClass: "normal"
13718
+ layoutClass: "action"
13352
13719
  }, /*#__PURE__*/React.createElement(EmployeeApplicationDetails, _extends({}, props, {
13353
13720
  parentRoute: path,
13354
13721
  userType: "EMPLOYEE"
13355
13722
  })))
13723
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
13724
+ path: `${path}/dso-application-details/:id`,
13725
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
13726
+ layoutClass: "action"
13727
+ }, /*#__PURE__*/React.createElement(EmployeeApplicationDetails, _extends({}, props, {
13728
+ parentRoute: path,
13729
+ userType: "DSO"
13730
+ })))
13731
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
13732
+ path: `${path}/dso-dashboard`,
13733
+ component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
13734
+ layoutClass: "normal"
13735
+ }, DsoDashboard ? /*#__PURE__*/React.createElement(DsoDashboard, _extends({}, props, {
13736
+ parentRoute: path
13737
+ })) : null)
13356
13738
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
13357
13739
  path: `${path}/fstp-operator-details/:id`,
13358
13740
  component: props => /*#__PURE__*/React.createElement(LayoutWrapper, {
@@ -13604,7 +13986,7 @@ const configAssignDso = _ref => {
13604
13986
  label: t("ES_FSM_ACTION_DSO_NAME"),
13605
13987
  isMandatory: true,
13606
13988
  type: "dropdown",
13607
- populators: /*#__PURE__*/React.createElement(React.Fragment, null, getFilteredDsoData(dsoData, vehicle, vehicleCapacity) && !getFilteredDsoData(dsoData, vehicle, vehicleCapacity).length ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_COMMON_NO_DSO_AVAILABLE_WITH_SUCH_VEHICLE")) : null, /*#__PURE__*/React.createElement(Dropdown$1, {
13989
+ populators: /*#__PURE__*/React.createElement(React.Fragment, null, getFilteredDsoData(dsoData, vehicle, vehicleCapacity) && !getFilteredDsoData(dsoData, vehicle, vehicleCapacity).length ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_COMMON_NO_DSO_AVAILABLE_WITH_SUCH_VEHICLE")) : null, /*#__PURE__*/React.createElement(Dropdown, {
13608
13990
  option: getFilteredDsoData(dsoData, vehicle, vehicleCapacity),
13609
13991
  autoComplete: "off",
13610
13992
  optionKey: "displayName",
@@ -13638,7 +14020,7 @@ const configAssignDso = _ref => {
13638
14020
  max: Digit.Utils.date.getDate(Date.now() + 10 * 24 * 60 * 60 * 1000)
13639
14021
  },
13640
14022
  defaultValue: Digit.Utils.date.getDate(),
13641
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, _extends({
14023
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, _extends({
13642
14024
  onChange: props.onChange,
13643
14025
  date: props.value
13644
14026
  }, customProps))
@@ -13678,7 +14060,7 @@ const configCompleteApplication = _ref => {
13678
14060
  min: Digit.Utils.date.getDate(applicationCreatedTime),
13679
14061
  max: Digit.Utils.date.getDate()
13680
14062
  },
13681
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, _extends({
14063
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, _extends({
13682
14064
  disabled: true,
13683
14065
  onChange: props.onChange,
13684
14066
  date: props.value
@@ -13895,7 +14277,7 @@ const configReassignDSO = _ref => {
13895
14277
  label: t("ES_FSM_ACTION_REASSIGN_REASON"),
13896
14278
  type: "dropdown",
13897
14279
  isMandatory: true,
13898
- populators: /*#__PURE__*/React.createElement(Dropdown$1, {
14280
+ populators: /*#__PURE__*/React.createElement(Dropdown, {
13899
14281
  option: reassignReasonMenu,
13900
14282
  optionKey: "i18nKey",
13901
14283
  id: "reassign-reason",
@@ -13907,7 +14289,7 @@ const configReassignDSO = _ref => {
13907
14289
  label: t("ES_FSM_ACTION_DSO_NAME"),
13908
14290
  isMandatory: true,
13909
14291
  type: "dropdown",
13910
- populators: /*#__PURE__*/React.createElement(React.Fragment, null, getFilteredDsoData$1(dsoData, vehicle, vehicleCapacity) && !getFilteredDsoData$1(dsoData, vehicle, vehicleCapacity).length ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_COMMON_NO_DSO_AVAILABLE_WITH_SUCH_VEHICLE")) : null, /*#__PURE__*/React.createElement(Dropdown$1, {
14292
+ populators: /*#__PURE__*/React.createElement(React.Fragment, null, getFilteredDsoData$1(dsoData, vehicle, vehicleCapacity) && !getFilteredDsoData$1(dsoData, vehicle, vehicleCapacity).length ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_COMMON_NO_DSO_AVAILABLE_WITH_SUCH_VEHICLE")) : null, /*#__PURE__*/React.createElement(Dropdown, {
13911
14293
  option: getFilteredDsoData$1(dsoData, vehicle, vehicleCapacity),
13912
14294
  autoComplete: "off",
13913
14295
  optionKey: "displayName",
@@ -13938,7 +14320,7 @@ const configReassignDSO = _ref => {
13938
14320
  min: Digit.Utils.date.getDate()
13939
14321
  },
13940
14322
  defaultValue: Digit.Utils.date.getDate(),
13941
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, _extends({
14323
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, _extends({
13942
14324
  onChange: props.onChange,
13943
14325
  date: props.value
13944
14326
  }, customProps))
@@ -13966,7 +14348,7 @@ const configRejectApplication = _ref => {
13966
14348
  body: [{
13967
14349
  label: t(`ES_FSM_ACTION_${action.toUpperCase()}_REASON`),
13968
14350
  type: "dropdown",
13969
- populators: /*#__PURE__*/React.createElement(Dropdown$1, {
14351
+ populators: /*#__PURE__*/React.createElement(Dropdown, {
13970
14352
  t: t,
13971
14353
  option: rejectMenu === null || rejectMenu === void 0 ? void 0 : rejectMenu.sort((a, b) => a.name.localeCompare(b.name)),
13972
14354
  id: "reason",
@@ -14009,7 +14391,7 @@ const configAcceptDso = _ref => {
14009
14391
  label: t("ES_FSM_ACTION_VEHICLE_REGISTRATION_NO"),
14010
14392
  isMandatory: true,
14011
14393
  type: "dropdown",
14012
- populators: /*#__PURE__*/React.createElement(React.Fragment, null, !(vehicleNoList !== null && vehicleNoList !== void 0 && vehicleNoList.length) ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_FSM_NO_VEHICLE_AVAILABLE")) : null, /*#__PURE__*/React.createElement(Dropdown$1, {
14394
+ populators: /*#__PURE__*/React.createElement(React.Fragment, null, !(vehicleNoList !== null && vehicleNoList !== void 0 && vehicleNoList.length) ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_FSM_NO_VEHICLE_AVAILABLE")) : null, /*#__PURE__*/React.createElement(Dropdown, {
14013
14395
  option: vehicleNoList,
14014
14396
  autoComplete: "off",
14015
14397
  optionKey: "registrationNumber",
@@ -14065,7 +14447,7 @@ const configRejectFstpo = _ref => {
14065
14447
  label: t("ES_FSM_ACTION_DECLINE_REASON"),
14066
14448
  isMandatory: true,
14067
14449
  type: "dropdown",
14068
- populators: /*#__PURE__*/React.createElement(Dropdown$1, {
14450
+ populators: /*#__PURE__*/React.createElement(Dropdown, {
14069
14451
  option: rejectMenu === null || rejectMenu === void 0 ? void 0 : rejectMenu.sort((a, b) => a.name.localeCompare(b.name)),
14070
14452
  autoComplete: "off",
14071
14453
  optionKey: "i18nKey",
@@ -14224,6 +14606,8 @@ const ActionModal = _ref => {
14224
14606
  actionData,
14225
14607
  module
14226
14608
  } = _ref;
14609
+ const history = useHistory();
14610
+ const applicationNumber = id;
14227
14611
  const mobileView = Digit.Utils.browser.isMobile() ? true : false;
14228
14612
  const {
14229
14613
  data: dsoData,
@@ -14324,7 +14708,7 @@ const ActionModal = _ref => {
14324
14708
  const [defaultValues, setDefautValue] = useState({
14325
14709
  capacity: vehicle === null || vehicle === void 0 ? void 0 : vehicle.capacity,
14326
14710
  wasteCollected: vehicle === null || vehicle === void 0 ? void 0 : vehicle.capacity,
14327
- propertyType: applicationData === null || applicationData === void 0 ? void 0 : applicationData.propertyUsage.split('.')[0],
14711
+ propertyType: applicationData !== null && applicationData !== void 0 && applicationData.propertyUsage ? applicationData.propertyUsage.split('.')[0] : "",
14328
14712
  subtype: applicationData === null || applicationData === void 0 ? void 0 : applicationData.propertyUsage,
14329
14713
  pitType: applicationData === null || applicationData === void 0 ? void 0 : applicationData.sanitationtype,
14330
14714
  pitDetail: applicationData === null || applicationData === void 0 ? void 0 : applicationData.pitDetail,
@@ -14344,8 +14728,9 @@ const ActionModal = _ref => {
14344
14728
  }
14345
14729
  }, [isVehicleDataLoaded, isSuccess]);
14346
14730
  useEffect(() => {
14347
- if (isSuccess && isPropertyDataLoaded && applicationData) {
14348
- const [property] = propertyList.filter(item => item.code === applicationData.propertyUsage.split('.')[0]);
14731
+ if (isSuccess && isPropertyDataLoaded && applicationData && applicationData.propertyUsage) {
14732
+ const propertyCode = typeof applicationData.propertyUsage === "string" ? applicationData.propertyUsage.split('.')[0] : "";
14733
+ const [property] = propertyList.filter(item => item.code === propertyCode);
14349
14734
  let arrayList = defaultValues;
14350
14735
  arrayList.propertyType = property;
14351
14736
  setPropertyMenu([property]);
@@ -14388,7 +14773,7 @@ const ActionModal = _ref => {
14388
14773
  var _dso$vehicles2;
14389
14774
  const [dso] = dsoData.filter(dso => dso.id === applicationData.dsoId);
14390
14775
  const tempList = dso === null || dso === void 0 ? void 0 : (_dso$vehicles2 = dso.vehicles) === null || _dso$vehicles2 === void 0 ? void 0 : _dso$vehicles2.filter(vehicle => vehicle.capacity == (applicationData === null || applicationData === void 0 ? void 0 : applicationData.vehicleCapacity));
14391
- const vehicleNoList = tempList.sort((a, b) => a.registrationNumber > b.registrationNumber ? 1 : -1);
14776
+ const vehicleNoList = tempList ? tempList.sort((a, b) => a.registrationNumber > b.registrationNumber ? 1 : -1) : [];
14392
14777
  setVehicleNoList(vehicleNoList);
14393
14778
  }
14394
14779
  }, [isSuccess, isDsoSuccess]);
@@ -14709,34 +15094,164 @@ const ViewImages = props => {
14709
15094
  })));
14710
15095
  };
14711
15096
 
14712
- const ApplicationDetails$1 = props => {
14713
- var _applicationData$addi, _applicationData$pitD, _applicationData$pitD2, _applicationData$pitD3, _applicationData$pitD4, _applicationData$pitD5, _applicationData$pitD6, _applicationData$pitD7, _applicationData$pitD8, _applicationData$pitD9, _applicationData$pitD0, _applicationData$pitD1, _applicationData$pitD10, _applicationData$pitD11, _applicationData$pitD12, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data14, _workflowDetails$data15, _workflowDetails$data16, _workflowDetails$data18, _workflowDetails$data19, _workflowDetails$data20, _workflowDetails$data21;
14714
- const tenantId = Digit.ULBService.getCurrentTenantId();
14715
- const state = Digit.ULBService.getStateId();
15097
+ const CheckIcon = () => /*#__PURE__*/React.createElement("svg", {
15098
+ width: "14",
15099
+ height: "14",
15100
+ viewBox: "0 0 24 24",
15101
+ fill: "none",
15102
+ stroke: "currentColor",
15103
+ strokeWidth: "3",
15104
+ strokeLinecap: "round",
15105
+ strokeLinejoin: "round"
15106
+ }, /*#__PURE__*/React.createElement("polyline", {
15107
+ points: "20 6 9 17 4 12"
15108
+ }));
15109
+ const ClockIcon = () => /*#__PURE__*/React.createElement("svg", {
15110
+ width: "14",
15111
+ height: "14",
15112
+ viewBox: "0 0 24 24",
15113
+ fill: "none",
15114
+ stroke: "currentColor",
15115
+ strokeWidth: "2",
15116
+ strokeLinecap: "round",
15117
+ strokeLinejoin: "round"
15118
+ }, /*#__PURE__*/React.createElement("circle", {
15119
+ cx: "12",
15120
+ cy: "12",
15121
+ r: "10"
15122
+ }), /*#__PURE__*/React.createElement("polyline", {
15123
+ className: "clock-hands2",
15124
+ points: "12 6 12 12 16 14"
15125
+ }));
15126
+ const WorkflowTimeline = _ref => {
15127
+ var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4;
15128
+ let {
15129
+ workflowDetails,
15130
+ hideTimeline,
15131
+ setHideTimeline
15132
+ } = _ref;
14716
15133
  const {
14717
15134
  t
14718
15135
  } = useTranslation();
14719
- const history = useHistory();
14720
- const queryClient = useQueryClient();
14721
- let {
14722
- id: applicationNumber
14723
- } = useParams();
14724
- const [displayMenu, setDisplayMenu] = useState(false);
14725
- const [selectedAction, setSelectedAction] = useState(null);
14726
- const [showModal, setShowModal] = useState(false);
14727
- const [showToast, setShowToast] = useState(null);
14728
- const [imageZoom, setImageZoom] = useState(null);
14729
- const [showAllTimeline, setShowAllTimeline] = useState(false);
14730
- const {
14731
- isLoading,
14732
- data: applicationDetails
14733
- } = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, applicationNumber, {}, "EMPLOYEE");
14734
- const {
14735
- isLoading: isDataLoading,
14736
- data: applicationData
14737
- } = Digit.Hooks.fsm.useSearch(tenantId, {
14738
- applicationNos: applicationNumber
14739
- }, {
15136
+ const timeline = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : (_workflowDetails$data2 = _workflowDetails$data.processInstances) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.length) > 0 ? workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : _workflowDetails$data3.processInstances : workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data4 = workflowDetails.data) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.timeline;
15137
+ if (!timeline || timeline.length === 0) {
15138
+ return null;
15139
+ }
15140
+ const getStatusClass = (index, checkpoint) => {
15141
+ var _checkpoint$state, _checkpoint$state2;
15142
+ const state = (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$state = checkpoint.state) === null || _checkpoint$state === void 0 ? void 0 : _checkpoint$state.state) || (checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.status);
15143
+ const isTerminal = (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$state2 = checkpoint.state) === null || _checkpoint$state2 === void 0 ? void 0 : _checkpoint$state2.isTerminateState) || state === "COMPLETED" || state === "DISPOSED" || state === "CANCELED" || state === "REJECTED";
15144
+ if (index === 0 && !isTerminal) return "current2";
15145
+ return "completed2";
15146
+ };
15147
+ const convertEpochToDateTime = epoch => {
15148
+ if (!epoch) return "N/A";
15149
+ const date = new Date(epoch);
15150
+ if (isNaN(date.getTime())) return typeof epoch === "string" ? epoch : "N/A";
15151
+ const day = String(date.getDate()).padStart(2, "0");
15152
+ const month = String(date.getMonth() + 1).padStart(2, "0");
15153
+ const year = date.getFullYear().toString().slice(-2);
15154
+ const hours = String(date.getHours()).padStart(2, "0");
15155
+ const minutes = String(date.getMinutes()).padStart(2, "0");
15156
+ return `${day}/${month}/${year} ${hours}:${minutes}`;
15157
+ };
15158
+ return /*#__PURE__*/React.createElement(Card, {
15159
+ className: "workflow-timeline-card2 digit-form-composer",
15160
+ style: {
15161
+ background: "#fff",
15162
+ padding: "16px",
15163
+ height: hideTimeline ? "100%" : ""
15164
+ }
15165
+ }, /*#__PURE__*/React.createElement("div", {
15166
+ className: `timeline-header-wrapper ${hideTimeline ? "collapsed" : ""}`
15167
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
15168
+ style: {
15169
+ marginBottom: "0",
15170
+ fontSize: "16px",
15171
+ fontWeight: "700",
15172
+ color: "#374151"
15173
+ },
15174
+ className: hideTimeline ? "hidden-content" : ""
15175
+ }, t("WORKFLOW_TIMELINE"))), /*#__PURE__*/React.createElement("div", {
15176
+ className: hideTimeline ? "hidden-content" : "timeline-container2"
15177
+ }, timeline.map((checkpoint, index) => {
15178
+ var _checkpoint$auditDeta, _checkpoint$auditDeta2, _checkpoint$auditDeta3, _checkpoint$auditDeta4, _checkpoint$state3, _checkpoint$state4, _checkpoint$state5, _checkpoint$assigner, _checkpoint$assignes, _checkpoint$assignes$;
15179
+ const statusClass = getStatusClass(index, checkpoint);
15180
+ const showLine = index !== timeline.length - 1 && timeline.length > 1;
15181
+ const epochTime = (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta = checkpoint.auditDetails) === null || _checkpoint$auditDeta === void 0 ? void 0 : _checkpoint$auditDeta.lastModifiedTime) || (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta2 = checkpoint.auditDetails) === null || _checkpoint$auditDeta2 === void 0 ? void 0 : _checkpoint$auditDeta2.createdTime) || (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta3 = checkpoint.auditDetails) === null || _checkpoint$auditDeta3 === void 0 ? void 0 : _checkpoint$auditDeta3.lastModified) || (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta4 = checkpoint.auditDetails) === null || _checkpoint$auditDeta4 === void 0 ? void 0 : _checkpoint$auditDeta4.created);
15182
+ const stateCode = (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$state3 = checkpoint.state) === null || _checkpoint$state3 === void 0 ? void 0 : _checkpoint$state3.state) || (checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.status);
15183
+ const appStatus = (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$state4 = checkpoint.state) === null || _checkpoint$state4 === void 0 ? void 0 : _checkpoint$state4.applicationStatus) || (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$state5 = checkpoint.state) === null || _checkpoint$state5 === void 0 ? void 0 : _checkpoint$state5.state) || (checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.status);
15184
+ const title = t(`CS_COMMON_FSM_${(checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.performedAction) === "UPDATE" ? "UPDATE_" : ""}${stateCode}`) || t(`WF_${stateCode}`) || t(`CS_COMMON_${stateCode}`) || stateCode;
15185
+ const statusTag = t(`CS_COMMON_FSM_${appStatus}`) || t(`CS_COMMON_${appStatus}`) || t(`WF_${appStatus}`) || appStatus;
15186
+ let comment = checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.comment;
15187
+ if (comment && comment.includes("~")) {
15188
+ const [reason, reasonComment] = comment.split("~");
15189
+ comment = `${t(`ES_ACTION_REASON_${reason}`) || reason}${reasonComment ? `: ${reasonComment}` : ""}`;
15190
+ }
15191
+ const assigneeName = (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner = checkpoint.assigner) === null || _checkpoint$assigner === void 0 ? void 0 : _checkpoint$assigner.name) || (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assignes = checkpoint.assignes) === null || _checkpoint$assignes === void 0 ? void 0 : (_checkpoint$assignes$ = _checkpoint$assignes[0]) === null || _checkpoint$assignes$ === void 0 ? void 0 : _checkpoint$assignes$.name);
15192
+ return /*#__PURE__*/React.createElement("div", {
15193
+ key: index,
15194
+ className: `timeline-item2 ${statusClass}`
15195
+ }, /*#__PURE__*/React.createElement("div", {
15196
+ className: "timeline-marker2"
15197
+ }, /*#__PURE__*/React.createElement("div", {
15198
+ className: "timeline-circle2"
15199
+ }, statusClass === "completed2" ? /*#__PURE__*/React.createElement(CheckIcon, null) : /*#__PURE__*/React.createElement(ClockIcon, null)), showLine && /*#__PURE__*/React.createElement("div", {
15200
+ className: "timeline-line2"
15201
+ })), /*#__PURE__*/React.createElement("div", {
15202
+ className: "timeline-content2"
15203
+ }, /*#__PURE__*/React.createElement("div", {
15204
+ className: "timeline-header2"
15205
+ }, /*#__PURE__*/React.createElement("div", {
15206
+ className: "timeline-title2"
15207
+ }, title), /*#__PURE__*/React.createElement("span", {
15208
+ className: "timeline-date2"
15209
+ }, convertEpochToDateTime(epochTime))), /*#__PURE__*/React.createElement("div", {
15210
+ className: "timeline-body2"
15211
+ }, /*#__PURE__*/React.createElement("div", {
15212
+ className: `timeline-status-tag2 status-${statusClass}`
15213
+ }, statusTag), comment && /*#__PURE__*/React.createElement("div", {
15214
+ className: "timeline-comment2"
15215
+ }, comment), (checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.numberOfTrips) && /*#__PURE__*/React.createElement("div", {
15216
+ className: "timeline-comment2",
15217
+ style: {
15218
+ marginTop: "4px"
15219
+ }
15220
+ }, t("NUMBER_OF_TRIPS"), ": ", checkpoint.numberOfTrips)), assigneeName && /*#__PURE__*/React.createElement("div", {
15221
+ className: "timeline-footer2"
15222
+ }, /*#__PURE__*/React.createElement("span", null, t("ES_COMMON_ASSIGNED_TO"), ": ", /*#__PURE__*/React.createElement("strong", null, assigneeName)))));
15223
+ })));
15224
+ };
15225
+
15226
+ const ApplicationDetails$1 = props => {
15227
+ var _applicationData$addi, _applicationDetails$a, _applicationData$pitD, _applicationData$pitD2, _applicationData$pitD3, _applicationData$pitD4, _applicationData$pitD5, _applicationData$pitD6, _applicationData$pitD7, _applicationData$pitD8, _applicationData$pitD9, _applicationData$pitD0, _applicationData$pitD1, _applicationData$pitD10, _applicationData$pitD11, _applicationData$pitD12, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12;
15228
+ const tenantId = Digit.ULBService.getCurrentTenantId();
15229
+ const state = Digit.ULBService.getStateId();
15230
+ const {
15231
+ t
15232
+ } = useTranslation();
15233
+ const history = useHistory();
15234
+ const queryClient = useQueryClient();
15235
+ let {
15236
+ id: applicationNumber
15237
+ } = useParams();
15238
+ const [displayMenu, setDisplayMenu] = useState(false);
15239
+ const [selectedAction, setSelectedAction] = useState(null);
15240
+ const [showModal, setShowModal] = useState(false);
15241
+ const [showToast, setShowToast] = useState(null);
15242
+ const [imageZoom, setImageZoom] = useState(null);
15243
+ const [hideTimeline, setHideTimeline] = useState(typeof window !== "undefined" ? window.innerWidth < 768 : false);
15244
+ const userType = props.userType || "EMPLOYEE";
15245
+ const {
15246
+ isLoading,
15247
+ data: applicationDetails
15248
+ } = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, applicationNumber, {}, userType);
15249
+ const {
15250
+ isLoading: isDataLoading,
15251
+ data: applicationData
15252
+ } = Digit.Hooks.fsm.useSearch(tenantId, {
15253
+ applicationNos: applicationNumber
15254
+ }, {
14740
15255
  staleTime: Infinity
14741
15256
  });
14742
15257
  const {
@@ -14746,7 +15261,7 @@ const ApplicationDetails$1 = props => {
14746
15261
  tenantId: (applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.tenantId) || tenantId,
14747
15262
  id: applicationNumber,
14748
15263
  moduleCode: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.paymentPreference) === "POST_PAY" ? "FSM_POST_PAY_SERVICE" : (applicationData === null || applicationData === void 0 ? void 0 : applicationData.advanceAmount) === 0 ? "PAY_LATER_SERVICE" : (applicationData === null || applicationData === void 0 ? void 0 : applicationData.advanceAmount) > 0 ? "FSM_ADVANCE_PAY_SERVICE" : (applicationData === null || applicationData === void 0 ? void 0 : applicationData.paymentPreference) === null && (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$addi = applicationData.additionalDetails) === null || _applicationData$addi === void 0 ? void 0 : _applicationData$addi.tripAmount) === 0 && (applicationData === null || applicationData === void 0 ? void 0 : applicationData.advanceAmount) === null ? "FSM_ZERO_PAY_SERVICE" : "FSM",
14749
- role: "FSM_EMPLOYEE",
15264
+ role: userType === "DSO" ? "FSM_DSO" : "FSM_EMPLOYEE",
14750
15265
  serviceData: applicationDetails,
14751
15266
  getTripData: true
14752
15267
  });
@@ -14794,14 +15309,6 @@ const ApplicationDetails$1 = props => {
14794
15309
  const closeToast = () => {
14795
15310
  setShowToast(null);
14796
15311
  };
14797
- const handleViewTimeline = () => {
14798
- const timelineSection = document.getElementById("timeline");
14799
- if (timelineSection) {
14800
- timelineSection.scrollIntoView({
14801
- behavior: "smooth"
14802
- });
14803
- }
14804
- };
14805
15312
  const submitAction = data => {
14806
15313
  mutate(data, {
14807
15314
  onError: (error, variables) => {
@@ -14830,107 +15337,70 @@ const ApplicationDetails$1 = props => {
14830
15337
  function onCloseImageZoom() {
14831
15338
  setImageZoom(null);
14832
15339
  }
14833
- const getTimelineCaptions = checkpoint => {
14834
- var _checkpoint$comment;
14835
- const __comment = checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$comment = checkpoint.comment) === null || _checkpoint$comment === void 0 ? void 0 : _checkpoint$comment.split("~");
14836
- const reason = __comment ? __comment[0] : null;
14837
- const reason_comment = __comment ? __comment[1] : null;
14838
- if (checkpoint.status === "CREATED") {
14839
- var _checkpoint$auditDeta, _applicationData$citi, _applicationData$citi2;
14840
- const caption = {
14841
- date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta = checkpoint.auditDetails) === null || _checkpoint$auditDeta === void 0 ? void 0 : _checkpoint$auditDeta.created,
14842
- name: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.assigner,
14843
- mobileNumber: applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$citi = applicationData.citizen) === null || _applicationData$citi === void 0 ? void 0 : _applicationData$citi.mobileNumber,
14844
- emailId: applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$citi2 = applicationData.citizen) === null || _applicationData$citi2 === void 0 ? void 0 : _applicationData$citi2.emailId,
14845
- source: (applicationData === null || applicationData === void 0 ? void 0 : applicationData.source) || ""
14846
- };
14847
- return /*#__PURE__*/React.createElement(TLCaption, {
14848
- data: caption
14849
- });
14850
- } else if (checkpoint.status === "PENDING_APPL_FEE_PAYMENT" || checkpoint.status === "DSO_REJECTED" || checkpoint.status === "CANCELED" || checkpoint.status === "REJECTED") {
14851
- var _checkpoint$auditDeta2;
14852
- const caption = {
14853
- date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta2 = checkpoint.auditDetails) === null || _checkpoint$auditDeta2 === void 0 ? void 0 : _checkpoint$auditDeta2.created,
14854
- name: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.assigner,
14855
- comment: reason ? t(`ES_ACTION_REASON_${reason}`) : null,
14856
- otherComment: reason_comment ? reason_comment : null
14857
- };
14858
- return /*#__PURE__*/React.createElement(TLCaption, {
14859
- data: caption
14860
- });
14861
- } else if (checkpoint.status === "DSO_INPROGRESS") {
14862
- var _checkpoint$assigner;
14863
- const caption = {
14864
- name: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.assigner,
14865
- mobileNumber: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner = checkpoint.assigner) === null || _checkpoint$assigner === void 0 ? void 0 : _checkpoint$assigner.mobileNumber,
14866
- date: `${t("CS_FSM_EXPECTED_DATE")} ${Digit.DateUtils.ConvertTimestampToDate(applicationData === null || applicationData === void 0 ? void 0 : applicationData.possibleServiceDate)}`
14867
- };
14868
- return /*#__PURE__*/React.createElement(TLCaption, {
14869
- data: caption
14870
- });
14871
- } else if (checkpoint.status === "COMPLETED") {
14872
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Rating, {
14873
- withText: true,
14874
- text: t(`ES_FSM_YOU_RATED`),
14875
- currentRating: checkpoint.rating
14876
- }), /*#__PURE__*/React.createElement(Link, {
14877
- to: `/digit-ui/employee/fsm/rate-view/${applicationNumber}`
14878
- }, /*#__PURE__*/React.createElement(ActionLinks, null, t("CS_FSM_RATE_VIEW"))));
14879
- } else if (checkpoint.status === "WAITING_FOR_DISPOSAL" || checkpoint.status === "DISPOSAL_IN_PROGRESS" || checkpoint.status === "DISPOSED" || checkpoint.status === "CITIZEN_FEEDBACK_PENDING") {
14880
- var _checkpoint$auditDeta3, _checkpoint$assigner2;
14881
- const caption = {
14882
- date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta3 = checkpoint.auditDetails) === null || _checkpoint$auditDeta3 === void 0 ? void 0 : _checkpoint$auditDeta3.created,
14883
- name: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.assigner,
14884
- mobileNumber: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner2 = checkpoint.assigner) === null || _checkpoint$assigner2 === void 0 ? void 0 : _checkpoint$assigner2.mobileNumber
14885
- };
14886
- if (checkpoint !== null && checkpoint !== void 0 && checkpoint.numberOfTrips) caption.comment = `${t("NUMBER_OF_TRIPS")}: ${checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.numberOfTrips}`;
14887
- return /*#__PURE__*/React.createElement(TLCaption, {
14888
- data: caption
14889
- });
14890
- }
14891
- };
14892
- if (isLoading) {
15340
+ if (isLoading || isDataLoading) {
14893
15341
  return /*#__PURE__*/React.createElement(Loader, null);
14894
15342
  }
14895
- const toggleTimeline = () => {
14896
- setShowAllTimeline(prev => !prev);
14897
- };
14898
- return /*#__PURE__*/React.createElement(React.Fragment, null, !isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
15343
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
15344
+ className: "employee-main-application-details",
14899
15345
  style: {
14900
15346
  display: "flex",
14901
- justifyContent: "space-between"
14902
- }
14903
- }, /*#__PURE__*/React.createElement(Header, {
14904
- style: {
14905
- marginBottom: "16px"
15347
+ gap: "20px"
14906
15348
  }
14907
- }, t("ES_TITLE_APPLICATION_DETAILS")), /*#__PURE__*/React.createElement(LinkButton$1, {
14908
- label: t("VIEW_TIMELINE"),
15349
+ }, /*#__PURE__*/React.createElement("div", {
15350
+ className: `workflow-timeline-wrapper no-scrollbar ${hideTimeline ? "hide-workflow" : ""}`,
14909
15351
  style: {
14910
- color: "#A52A2A"
14911
- },
14912
- onClick: handleViewTimeline
14913
- })), /*#__PURE__*/React.createElement(Card, {
14914
- className: "fsm",
15352
+ flex: "1 1 300px",
15353
+ maxWidth: hideTimeline ? "fit-content" : "400px",
15354
+ transition: "max-width 0.3s"
15355
+ }
15356
+ }, /*#__PURE__*/React.createElement(WorkflowTimeline, {
15357
+ workflowDetails: workflowDetails,
15358
+ hideTimeline: hideTimeline,
15359
+ setHideTimeline: setHideTimeline
15360
+ })), /*#__PURE__*/React.createElement("div", {
14915
15361
  style: {
14916
- position: "relative"
15362
+ flex: "2 1 500px",
15363
+ minWidth: "300px"
14917
15364
  }
14918
- }, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.applicationDetails.map((detail, index) => {
14919
- var _detail$values;
15365
+ }, /*#__PURE__*/React.createElement(Card, {
15366
+ className: "employeeCard-override"
15367
+ }, applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a = applicationDetails.applicationDetails) === null || _applicationDetails$a === void 0 ? void 0 : _applicationDetails$a.map((detail, index) => {
15368
+ var _detail$title, _detail$values;
14920
15369
  return /*#__PURE__*/React.createElement(React.Fragment, {
14921
15370
  key: index
14922
- }, index === 0 ? null :
14923
- /*#__PURE__*/
14924
- React.createElement(CardSectionHeader, {
15371
+ }, /*#__PURE__*/React.createElement("div", {
15372
+ style: {
15373
+ lineHeight: "19px",
15374
+ maxWidth: "100%",
15375
+ minWidth: "280px"
15376
+ }
15377
+ }, (detail === null || detail === void 0 ? void 0 : (_detail$title = detail.title) === null || _detail$title === void 0 ? void 0 : _detail$title.trim()) && (index === 0 && !detail.asSectionHeader ? /*#__PURE__*/React.createElement(CardSubHeader, {
14925
15378
  style: {
14926
15379
  marginBottom: "16px",
14927
- marginTop: "32px"
15380
+ fontSize: "24px"
15381
+ }
15382
+ }, t(detail.title)) : /*#__PURE__*/React.createElement(CardSectionHeader, {
15383
+ style: {
15384
+ marginBottom: "16px",
15385
+ marginTop: "16px",
15386
+ fontSize: "24px"
15387
+ }
15388
+ }, t(detail.title), detail !== null && detail !== void 0 && detail.Component ? /*#__PURE__*/React.createElement(detail.Component, null) : null)), /*#__PURE__*/React.createElement(StatusTable, {
15389
+ style: {
15390
+ position: "relative",
15391
+ marginTop: "19px"
14928
15392
  }
14929
- }, t(detail.title)), /*#__PURE__*/React.createElement(StatusTable, null, detail === null || detail === void 0 ? void 0 : (_detail$values = detail.values) === null || _detail$values === void 0 ? void 0 : _detail$values.map((value, index) => {
14930
- var _detail$values2;
14931
- if (value === null) return null;
15393
+ }, detail === null || detail === void 0 ? void 0 : (_detail$values = detail.values) === null || _detail$values === void 0 ? void 0 : _detail$values.map((value, valIndex) => {
15394
+ var _detail$values3;
15395
+ if (value === null || value === undefined) return null;
14932
15396
  if (value.map === true && value.value !== "N/A") {
14933
15397
  return /*#__PURE__*/React.createElement(Row, {
15398
+ labelStyle: {
15399
+ wordBreak: "break-all"
15400
+ },
15401
+ textStyle: {
15402
+ wordBreak: "break-all"
15403
+ },
14934
15404
  key: t(value.title),
14935
15405
  label: t(value.title),
14936
15406
  text: /*#__PURE__*/React.createElement("img", {
@@ -14939,60 +15409,69 @@ const ApplicationDetails$1 = props => {
14939
15409
  })
14940
15410
  });
14941
15411
  }
15412
+ if ((value === null || value === void 0 ? void 0 : value.isLink) === true) {
15413
+ var _detail$values2;
15414
+ return /*#__PURE__*/React.createElement(Row, {
15415
+ key: t(value.title),
15416
+ label: t(value.title),
15417
+ text: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Link, {
15418
+ to: value === null || value === void 0 ? void 0 : value.to
15419
+ }, /*#__PURE__*/React.createElement("span", {
15420
+ className: "link",
15421
+ style: {
15422
+ color: "#a82227"
15423
+ }
15424
+ }, value === null || value === void 0 ? void 0 : value.value))),
15425
+ last: valIndex === (detail === null || detail === void 0 ? void 0 : (_detail$values2 = detail.values) === null || _detail$values2 === void 0 ? void 0 : _detail$values2.length) - 1,
15426
+ caption: value.caption,
15427
+ className: "border-none"
15428
+ });
15429
+ }
14942
15430
  return /*#__PURE__*/React.createElement(Row, {
15431
+ className: "border-none",
14943
15432
  key: t(value.title),
14944
15433
  label: t(value.title),
14945
- text: t(value.value) || "N/A",
14946
- last: index === (detail === null || detail === void 0 ? void 0 : (_detail$values2 = detail.values) === null || _detail$values2 === void 0 ? void 0 : _detail$values2.length) - 1,
14947
- caption: value.caption,
14948
- className: "border-none"
15434
+ text: t(value.value) || value.value || "N/A",
15435
+ last: valIndex === (detail === null || detail === void 0 ? void 0 : (_detail$values3 = detail.values) === null || _detail$values3 === void 0 ? void 0 : _detail$values3.length) - 1,
15436
+ caption: value.caption
14949
15437
  });
14950
- })));
14951
- }), (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$pitD = applicationData.pitDetail) === null || _applicationData$pitD === void 0 ? void 0 : (_applicationData$pitD2 = _applicationData$pitD.additionalDetails) === null || _applicationData$pitD2 === void 0 ? void 0 : (_applicationData$pitD3 = _applicationData$pitD2.fileStoreId) === null || _applicationData$pitD3 === void 0 ? void 0 : (_applicationData$pitD4 = _applicationData$pitD3.CITIZEN) === null || _applicationData$pitD4 === void 0 ? void 0 : _applicationData$pitD4.length) && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
15438
+ }))));
15439
+ }), applicationData !== null && applicationData !== void 0 && (_applicationData$pitD = applicationData.pitDetail) !== null && _applicationData$pitD !== void 0 && (_applicationData$pitD2 = _applicationData$pitD.additionalDetails) !== null && _applicationData$pitD2 !== void 0 && (_applicationData$pitD3 = _applicationData$pitD2.fileStoreId) !== null && _applicationData$pitD3 !== void 0 && (_applicationData$pitD4 = _applicationData$pitD3.CITIZEN) !== null && _applicationData$pitD4 !== void 0 && _applicationData$pitD4.length ? /*#__PURE__*/React.createElement("div", {
15440
+ style: {
15441
+ lineHeight: "19px",
15442
+ maxWidth: "100%",
15443
+ minWidth: "280px"
15444
+ }
15445
+ }, /*#__PURE__*/React.createElement(CardSectionHeader, {
14952
15446
  style: {
14953
15447
  marginBottom: "16px",
14954
- marginTop: "32px"
15448
+ marginTop: "16px",
15449
+ fontSize: "24px"
14955
15450
  }
14956
15451
  }, t("ES_FSM_SUB_HEADING_CITIZEN_UPLOADS")), /*#__PURE__*/React.createElement(ViewImages, {
14957
15452
  fileStoreIds: applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$pitD5 = applicationData.pitDetail) === null || _applicationData$pitD5 === void 0 ? void 0 : (_applicationData$pitD6 = _applicationData$pitD5.additionalDetails) === null || _applicationData$pitD6 === void 0 ? void 0 : (_applicationData$pitD7 = _applicationData$pitD6.fileStoreId) === null || _applicationData$pitD7 === void 0 ? void 0 : _applicationData$pitD7.CITIZEN,
14958
15453
  tenantId: state,
14959
15454
  onClick: (source, index) => zoomImageWrapper(source)
14960
- })), (applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$pitD8 = applicationData.pitDetail) === null || _applicationData$pitD8 === void 0 ? void 0 : (_applicationData$pitD9 = _applicationData$pitD8.additionalDetails) === null || _applicationData$pitD9 === void 0 ? void 0 : (_applicationData$pitD0 = _applicationData$pitD9.fileStoreId) === null || _applicationData$pitD0 === void 0 ? void 0 : (_applicationData$pitD1 = _applicationData$pitD0.FSM_DSO) === null || _applicationData$pitD1 === void 0 ? void 0 : _applicationData$pitD1.length) && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
15455
+ })) : null, applicationData !== null && applicationData !== void 0 && (_applicationData$pitD8 = applicationData.pitDetail) !== null && _applicationData$pitD8 !== void 0 && (_applicationData$pitD9 = _applicationData$pitD8.additionalDetails) !== null && _applicationData$pitD9 !== void 0 && (_applicationData$pitD0 = _applicationData$pitD9.fileStoreId) !== null && _applicationData$pitD0 !== void 0 && (_applicationData$pitD1 = _applicationData$pitD0.FSM_DSO) !== null && _applicationData$pitD1 !== void 0 && _applicationData$pitD1.length ? /*#__PURE__*/React.createElement("div", {
15456
+ style: {
15457
+ lineHeight: "19px",
15458
+ maxWidth: "100%",
15459
+ minWidth: "280px"
15460
+ }
15461
+ }, /*#__PURE__*/React.createElement(CardSectionHeader, {
14961
15462
  style: {
14962
15463
  marginBottom: "16px",
14963
- marginTop: "32px"
15464
+ marginTop: "16px",
15465
+ fontSize: "24px"
14964
15466
  }
14965
15467
  }, t("ES_FSM_SUB_HEADING_DSO_UPLOADS")), /*#__PURE__*/React.createElement(ViewImages, {
14966
15468
  fileStoreIds: applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$pitD10 = applicationData.pitDetail) === null || _applicationData$pitD10 === void 0 ? void 0 : (_applicationData$pitD11 = _applicationData$pitD10.additionalDetails) === null || _applicationData$pitD11 === void 0 ? void 0 : (_applicationData$pitD12 = _applicationData$pitD11.fileStoreId) === null || _applicationData$pitD12 === void 0 ? void 0 : _applicationData$pitD12.FSM_DSO,
14967
15469
  tenantId: tenantId,
14968
15470
  onClick: (source, index) => zoomImageWrapper(source)
14969
- })), imageZoom ? /*#__PURE__*/React.createElement(ImageViewer, {
15471
+ })) : null, imageZoom ? /*#__PURE__*/React.createElement(ImageViewer, {
14970
15472
  imageSrc: imageZoom,
14971
15473
  onClose: onCloseImageZoom
14972
- }) : null, /*#__PURE__*/React.createElement(BreakLine, null), ((workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.isLoading) || isDataLoading) && /*#__PURE__*/React.createElement(Loader, null), !(workflowDetails !== null && workflowDetails !== void 0 && workflowDetails.isLoading) && !isDataLoading && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", {
14973
- id: "timeline"
14974
- }, /*#__PURE__*/React.createElement(CardSectionHeader, {
14975
- style: {
14976
- marginBottom: "16px",
14977
- marginTop: "32px"
14978
- }
14979
- }, t("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")), workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data = workflowDetails.data) !== null && _workflowDetails$data !== void 0 && _workflowDetails$data.timeline && (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : (_workflowDetails$data3 = _workflowDetails$data2.timeline) === null || _workflowDetails$data3 === void 0 ? void 0 : _workflowDetails$data3.length) === 1 ? /*#__PURE__*/React.createElement(CheckPoint, {
14980
- isCompleted: true,
14981
- label: t("CS_COMMON_" + (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data4 = workflowDetails.data) === null || _workflowDetails$data4 === void 0 ? void 0 : (_workflowDetails$data5 = _workflowDetails$data4.timeline[0]) === null || _workflowDetails$data5 === void 0 ? void 0 : _workflowDetails$data5.status)),
14982
- customChild: getTimelineCaptions(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data6 = workflowDetails.data) === null || _workflowDetails$data6 === void 0 ? void 0 : _workflowDetails$data6.timeline[0])
14983
- }) : /*#__PURE__*/React.createElement(ConnectingCheckPoints, null, (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data7 = workflowDetails.data) === null || _workflowDetails$data7 === void 0 ? void 0 : _workflowDetails$data7.timeline) && (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data8 = workflowDetails.data) === null || _workflowDetails$data8 === void 0 ? void 0 : _workflowDetails$data8.timeline.slice(0, showAllTimeline ? workflowDetails.data.timeline.length : 2).map((checkpoint, index, arr) => {
14984
- return /*#__PURE__*/React.createElement(React.Fragment, {
14985
- key: index
14986
- }, /*#__PURE__*/React.createElement(CheckPoint, {
14987
- keyValue: index,
14988
- isCompleted: index === 0,
14989
- label: t(`CS_COMMON_FSM_${checkpoint.performedAction === "UPDATE" ? "UPDATE_" : ""}${checkpoint.status}`),
14990
- customChild: getTimelineCaptions(checkpoint)
14991
- }));
14992
- }))), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data9 = workflowDetails.data) === null || _workflowDetails$data9 === void 0 ? void 0 : (_workflowDetails$data0 = _workflowDetails$data9.timeline) === null || _workflowDetails$data0 === void 0 ? void 0 : _workflowDetails$data0.length) > 2 && /*#__PURE__*/React.createElement(LinkButton$1, {
14993
- label: showAllTimeline ? t("COLLAPSE") : t("VIEW_TIMELINE"),
14994
- onClick: toggleTimeline
14995
- })))), showModal ? /*#__PURE__*/React.createElement(ActionModal, {
15474
+ }) : null), showModal ? /*#__PURE__*/React.createElement(ActionModal, {
14996
15475
  t: t,
14997
15476
  action: selectedAction,
14998
15477
  tenantId: tenantId,
@@ -15000,43 +15479,49 @@ const ApplicationDetails$1 = props => {
15000
15479
  id: applicationNumber,
15001
15480
  closeModal: closeModal,
15002
15481
  submitAction: submitAction,
15003
- actionData: workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data1 = workflowDetails.data) === null || _workflowDetails$data1 === void 0 ? void 0 : _workflowDetails$data1.timeline,
15004
- module: workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data10 = workflowDetails.data) === null || _workflowDetails$data10 === void 0 ? void 0 : _workflowDetails$data10.applicationBusinessService
15482
+ actionData: workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : _workflowDetails$data.timeline,
15483
+ module: workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.applicationBusinessService
15005
15484
  }) : null, showToast && /*#__PURE__*/React.createElement(Toast, {
15006
15485
  error: showToast.key === "error" ? true : false,
15007
15486
  label: t(showToast.key === "success" ? `ES_FSM_${showToast.action}_UPDATE_SUCCESS` : showToast.action),
15008
15487
  onClose: closeToast
15009
- }), !(workflowDetails !== null && workflowDetails !== void 0 && workflowDetails.isLoading) && (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data11 = workflowDetails.data) === null || _workflowDetails$data11 === void 0 ? void 0 : (_workflowDetails$data12 = _workflowDetails$data11.nextActions) === null || _workflowDetails$data12 === void 0 ? void 0 : _workflowDetails$data12.length) === 1 && (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data13 = workflowDetails.data) === null || _workflowDetails$data13 === void 0 ? void 0 : (_workflowDetails$data14 = _workflowDetails$data13.nextActions) === null || _workflowDetails$data14 === void 0 ? void 0 : (_workflowDetails$data15 = _workflowDetails$data14[0]) === null || _workflowDetails$data15 === void 0 ? void 0 : _workflowDetails$data15.action) !== "RATE" && /*#__PURE__*/React.createElement(ActionBar, {
15488
+ }), !(workflowDetails !== null && workflowDetails !== void 0 && workflowDetails.isLoading) && (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3.nextActions) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.length) === 1 && (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data5 = workflowDetails.data) === null || _workflowDetails$data5 === void 0 ? void 0 : (_workflowDetails$data6 = _workflowDetails$data5.nextActions) === null || _workflowDetails$data6 === void 0 ? void 0 : (_workflowDetails$data7 = _workflowDetails$data6[0]) === null || _workflowDetails$data7 === void 0 ? void 0 : _workflowDetails$data7.action) !== "RATE" && /*#__PURE__*/React.createElement(ActionBar, {
15010
15489
  style: {
15011
15490
  zIndex: "19"
15012
15491
  }
15013
15492
  }, /*#__PURE__*/React.createElement(SubmitBar$1, {
15014
- label: t(`ES_FSM_${workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data16 = workflowDetails.data) === null || _workflowDetails$data16 === void 0 ? void 0 : _workflowDetails$data16.nextActions[0].action}`),
15493
+ label: t(`ES_FSM_${workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data8 = workflowDetails.data) === null || _workflowDetails$data8 === void 0 ? void 0 : _workflowDetails$data8.nextActions[0].action}`) || t(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data9 = workflowDetails.data) === null || _workflowDetails$data9 === void 0 ? void 0 : _workflowDetails$data9.nextActions[0].action),
15015
15494
  onSubmit: () => {
15016
- var _workflowDetails$data17;
15017
- return onActionSelect(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data17 = workflowDetails.data) === null || _workflowDetails$data17 === void 0 ? void 0 : _workflowDetails$data17.nextActions[0].action);
15495
+ var _workflowDetails$data0;
15496
+ return onActionSelect(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data0 = workflowDetails.data) === null || _workflowDetails$data0 === void 0 ? void 0 : _workflowDetails$data0.nextActions[0].action);
15018
15497
  }
15019
- })), !(workflowDetails !== null && workflowDetails !== void 0 && workflowDetails.isLoading) && (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data18 = workflowDetails.data) === null || _workflowDetails$data18 === void 0 ? void 0 : (_workflowDetails$data19 = _workflowDetails$data18.nextActions) === null || _workflowDetails$data19 === void 0 ? void 0 : _workflowDetails$data19.length) > 1 && /*#__PURE__*/React.createElement(ActionBar, {
15498
+ })), !(workflowDetails !== null && workflowDetails !== void 0 && workflowDetails.isLoading) && (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data1 = workflowDetails.data) === null || _workflowDetails$data1 === void 0 ? void 0 : (_workflowDetails$data10 = _workflowDetails$data1.nextActions) === null || _workflowDetails$data10 === void 0 ? void 0 : _workflowDetails$data10.length) > 1 && /*#__PURE__*/React.createElement(ActionBar, {
15020
15499
  style: {
15021
15500
  zIndex: "19"
15022
15501
  }
15023
- }, displayMenu && workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data20 = workflowDetails.data) !== null && _workflowDetails$data20 !== void 0 && _workflowDetails$data20.nextActions ? /*#__PURE__*/React.createElement(Menu, {
15502
+ }, displayMenu && workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data11 = workflowDetails.data) !== null && _workflowDetails$data11 !== void 0 && _workflowDetails$data11.nextActions ? /*#__PURE__*/React.createElement(Menu, {
15024
15503
  localeKeyPrefix: "ES_FSM",
15025
- options: workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data21 = workflowDetails.data) === null || _workflowDetails$data21 === void 0 ? void 0 : _workflowDetails$data21.nextActions.map(action => action.action),
15504
+ options: workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data12 = workflowDetails.data) === null || _workflowDetails$data12 === void 0 ? void 0 : _workflowDetails$data12.nextActions.map(action => action.action),
15026
15505
  t: t,
15027
15506
  onSelect: onActionSelect
15028
15507
  }) : null, /*#__PURE__*/React.createElement(SubmitBar$1, {
15029
15508
  label: t("ES_COMMON_TAKE_ACTION"),
15030
15509
  onSubmit: () => setDisplayMenu(!displayMenu)
15031
- }))) : /*#__PURE__*/React.createElement(Loader, null));
15510
+ })))));
15032
15511
  };
15033
15512
 
15034
15513
  const DsoDashboard = () => {
15035
- var _inbox$statuses$filte5, _inbox$statuses$filte6;
15514
+ var _inbox$statuses$find, _inbox$statuses$find2;
15036
15515
  const tenantId = Digit.ULBService.getCurrentTenantId();
15037
15516
  const {
15038
15517
  t
15039
15518
  } = useTranslation();
15519
+ const history = useHistory();
15520
+ const {
15521
+ pathname
15522
+ } = useLocation();
15523
+ const isEmployee = pathname.includes("/employee/");
15524
+ const inboxLink = isEmployee ? "/digit-ui/employee/fsm/inbox" : "/digit-ui/citizen/fsm/inbox";
15040
15525
  const [total, setTotal] = useState("-");
15041
15526
  const [loader, setLoader] = useState(true);
15042
15527
  const [isDsoLoaded, setIsDsoLoaded] = useState(false);
@@ -15056,12 +15541,16 @@ const DsoDashboard = () => {
15056
15541
  isFetching: vendorDetailsFetching
15057
15542
  } = Digit.Hooks.fsm.useVendorDetail();
15058
15543
  useEffect(() => {
15059
- if (vendorDetails !== null && vendorDetails !== void 0 && vendorDetails.vendor) {
15544
+ var _vendorDetails$vendor;
15545
+ if (vendorDetails !== null && vendorDetails !== void 0 && vendorDetails.vendor && vendorDetails.vendor.length > 0) {
15060
15546
  const {
15061
15547
  vendor
15062
15548
  } = vendorDetails;
15063
15549
  Digit.UserService.setExtraRoleDetails(vendor[0]);
15064
15550
  setIsDsoLoaded(true);
15551
+ } else if (vendorDetails && (!(vendorDetails !== null && vendorDetails !== void 0 && vendorDetails.vendor) || (vendorDetails === null || vendorDetails === void 0 ? void 0 : (_vendorDetails$vendor = vendorDetails.vendor) === null || _vendorDetails$vendor === void 0 ? void 0 : _vendorDetails$vendor.length) === 0)) {
15552
+ setIsDsoLoaded(true);
15553
+ setLoader(false);
15065
15554
  }
15066
15555
  }, [vendorDetails]);
15067
15556
  const {
@@ -15072,26 +15561,24 @@ const DsoDashboard = () => {
15072
15561
  }, {
15073
15562
  enabled: isDsoLoaded
15074
15563
  }, true);
15075
- const info = useMemo(() => {
15076
- var _inbox$statuses$filte, _inbox$statuses$filte2;
15077
- return {
15078
- [t("ES_COMPLETION_PENDING")]: (inbox === null || inbox === void 0 ? void 0 : (_inbox$statuses$filte = inbox.statuses.filter(e => e.applicationstatus === "DSO_INPROGRESS")[0]) === null || _inbox$statuses$filte === void 0 ? void 0 : _inbox$statuses$filte.count) || 0,
15079
- [t("ES_VEHICLE_ASSIGNMENT_PENDING")]: (inbox === null || inbox === void 0 ? void 0 : (_inbox$statuses$filte2 = inbox.statuses.filter(e => e.applicationstatus === "PENDING_DSO_APPROVAL")[0]) === null || _inbox$statuses$filte2 === void 0 ? void 0 : _inbox$statuses$filte2.count) || 0
15080
- };
15081
- }, [inbox === null || inbox === void 0 ? void 0 : inbox.totalCount]);
15564
+ const inprogressCount = Array.isArray(inbox === null || inbox === void 0 ? void 0 : inbox.statuses) ? ((_inbox$statuses$find = inbox.statuses.find(e => e.applicationstatus === "DSO_INPROGRESS")) === null || _inbox$statuses$find === void 0 ? void 0 : _inbox$statuses$find.count) || 0 : 0;
15565
+ const pendingApprovalCount = Array.isArray(inbox === null || inbox === void 0 ? void 0 : inbox.statuses) ? ((_inbox$statuses$find2 = inbox.statuses.find(e => e.applicationstatus === "PENDING_DSO_APPROVAL")) === null || _inbox$statuses$find2 === void 0 ? void 0 : _inbox$statuses$find2.count) || 0 : 0;
15082
15566
  const links = useMemo(() => [{
15083
- link: "/digit-ui/citizen/fsm/inbox",
15567
+ link: inboxLink,
15084
15568
  label: t("ES_TITLE_INBOX"),
15085
15569
  count: total
15086
- }], [total]);
15570
+ }], [total, t, inboxLink]);
15087
15571
  useEffect(() => {
15088
15572
  if (inbox) {
15089
- var _inbox$statuses$filte3, _inbox$statuses$filte4;
15090
- const total = (inbox === null || inbox === void 0 ? void 0 : (_inbox$statuses$filte3 = inbox.statuses.filter(e => e.applicationstatus === "DSO_INPROGRESS")[0]) === null || _inbox$statuses$filte3 === void 0 ? void 0 : _inbox$statuses$filte3.count) + (inbox === null || inbox === void 0 ? void 0 : (_inbox$statuses$filte4 = inbox.statuses.filter(e => e.applicationstatus === "PENDING_DSO_APPROVAL")[0]) === null || _inbox$statuses$filte4 === void 0 ? void 0 : _inbox$statuses$filte4.count);
15091
- setTotal(total);
15092
- if (Object.keys(info).length) setLoader(false);
15093
- }
15094
- }, [info, inbox]);
15573
+ setTotal(inprogressCount + pendingApprovalCount);
15574
+ setLoader(false);
15575
+ } else if (!inboxFetching && isDsoLoaded) {
15576
+ setLoader(false);
15577
+ }
15578
+ }, [inbox, inboxFetching, isDsoLoaded, inprogressCount, pendingApprovalCount]);
15579
+ const handleCardClick = () => {
15580
+ history.push(inboxLink);
15581
+ };
15095
15582
  if (loader) {
15096
15583
  return /*#__PURE__*/React.createElement(Loader, null);
15097
15584
  }
@@ -15099,19 +15586,22 @@ const DsoDashboard = () => {
15099
15586
  Icon: /*#__PURE__*/React.createElement(ShippingTruck, null),
15100
15587
  moduleName: t("ES_TITLE_FAECAL_SLUDGE_MGMT"),
15101
15588
  kpis: [{
15102
- count: (inbox === null || inbox === void 0 ? void 0 : (_inbox$statuses$filte5 = inbox.statuses.filter(e => e.applicationstatus === "DSO_INPROGRESS")[0]) === null || _inbox$statuses$filte5 === void 0 ? void 0 : _inbox$statuses$filte5.count) || 0,
15589
+ count: inprogressCount,
15103
15590
  label: t("ES_COMPLETION_PENDING"),
15104
- link: `/digit-ui/citizen/fsm/inbox`
15591
+ link: inboxLink
15105
15592
  }, {
15106
- count: (inbox === null || inbox === void 0 ? void 0 : (_inbox$statuses$filte6 = inbox.statuses.filter(e => e.applicationstatus === "PENDING_DSO_APPROVAL")[0]) === null || _inbox$statuses$filte6 === void 0 ? void 0 : _inbox$statuses$filte6.count) || 0,
15593
+ count: pendingApprovalCount,
15107
15594
  label: t("ES_VEHICLE_ASSIGNMENT_PENDING"),
15108
- link: `/digit-ui/citizen/fsm/inbox`
15595
+ link: inboxLink
15109
15596
  }],
15110
- links
15597
+ links,
15598
+ onDetailsClick: handleCardClick
15111
15599
  };
15112
15600
  return /*#__PURE__*/React.createElement("div", {
15113
15601
  className: "ground-container moduleCardWrapper"
15114
- }, /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard));
15602
+ }, /*#__PURE__*/React.createElement(EmployeeModuleCard, _extends({}, propsForModuleCard, {
15603
+ onDetailsClick: handleCardClick
15604
+ })));
15115
15605
  };
15116
15606
 
15117
15607
  const isConventionalSpecticTank$1 = tankDimension => tankDimension === "lbd";
@@ -15350,6 +15840,7 @@ const EditForm = _ref => {
15350
15840
  "withoutLabel": true,
15351
15841
  "key": "cpt",
15352
15842
  "type": "component",
15843
+ "colSpan": "span 2",
15353
15844
  "hideInCitizen": true
15354
15845
  }, {
15355
15846
  "label": "ES_NEW_APPLICATION_PROPERTY_TYPE",
@@ -15357,6 +15848,7 @@ const EditForm = _ref => {
15357
15848
  "type": "component",
15358
15849
  "route": "property-type",
15359
15850
  "key": "propertyType",
15851
+ "colSpan": "span 1",
15360
15852
  "component": "SelectPropertyType",
15361
15853
  "texts": {
15362
15854
  "headerCaption": "",
@@ -15371,6 +15863,7 @@ const EditForm = _ref => {
15371
15863
  "type": "component",
15372
15864
  "route": "property-subtype",
15373
15865
  "key": "subtype",
15866
+ "colSpan": "span 1",
15374
15867
  "component": "SelectPropertySubtype",
15375
15868
  "texts": {
15376
15869
  "headerCaption": "",
@@ -15387,12 +15880,14 @@ const EditForm = _ref => {
15387
15880
  "isMandatory": true,
15388
15881
  "type": "component",
15389
15882
  "key": "channel",
15883
+ "colSpan": "span 1",
15390
15884
  "component": "SelectChannel",
15391
15885
  "nextStep": "applicantName"
15392
15886
  }, {
15393
15887
  "type": "component",
15394
15888
  "key": "applicationData",
15395
15889
  "withoutLabel": true,
15890
+ "colSpan": "span 2",
15396
15891
  "component": "SelectName"
15397
15892
  }]
15398
15893
  }, {
@@ -15408,6 +15903,7 @@ const EditForm = _ref => {
15408
15903
  "submitBarLabel": "CS_COMMON_NEXT"
15409
15904
  },
15410
15905
  "key": "address",
15906
+ "colSpan": "span 2",
15411
15907
  "nextStep": "locality-gramPanchayat",
15412
15908
  "isMandatory": true,
15413
15909
  "type": "component"
@@ -15437,6 +15933,7 @@ const EditForm = _ref => {
15437
15933
  },
15438
15934
  "withoutLabel": true,
15439
15935
  "key": "address",
15936
+ "colSpan": "span 1",
15440
15937
  "nextStep": "check-slum",
15441
15938
  "type": "component"
15442
15939
  }, {
@@ -15452,24 +15949,12 @@ const EditForm = _ref => {
15452
15949
  "withoutLabel": true,
15453
15950
  "nextStep": "slum-details",
15454
15951
  "hideInEmployee": true
15455
- }, {
15456
- "type": "component",
15457
- "route": "slum-details",
15458
- "isMandatory": true,
15459
- "component": "SelectSlumName",
15460
- "texts": {
15461
- "header": "CS_NEW_APPLICATION_SLUM_NAME",
15462
- "cardText": "CS_NEW_APPLICATION_SLUM_TEXT",
15463
- "submitBarLabel": "CS_COMMON_NEXT"
15464
- },
15465
- "withoutLabel": true,
15466
- "key": "address",
15467
- "nextStep": "street"
15468
15952
  }, {
15469
15953
  "type": "component",
15470
15954
  "route": "street",
15471
15955
  "component": "FSMSelectStreet",
15472
15956
  "key": "address",
15957
+ "colSpan": "span 2",
15473
15958
  "withoutLabel": true,
15474
15959
  "texts": {
15475
15960
  "headerCaption": "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
@@ -15479,11 +15964,26 @@ const EditForm = _ref => {
15479
15964
  "skipText": "CORE_COMMON_SKIP_CONTINUE"
15480
15965
  },
15481
15966
  "nextStep": "landmark"
15967
+ }, {
15968
+ "type": "component",
15969
+ "route": "slum-details",
15970
+ "isMandatory": true,
15971
+ "component": "SelectSlumName",
15972
+ "texts": {
15973
+ "header": "CS_NEW_APPLICATION_SLUM_NAME",
15974
+ "cardText": "CS_NEW_APPLICATION_SLUM_TEXT",
15975
+ "submitBarLabel": "CS_COMMON_NEXT"
15976
+ },
15977
+ "withoutLabel": true,
15978
+ "colSpan": "span 2",
15979
+ "key": "address",
15980
+ "nextStep": "street"
15482
15981
  }, {
15483
15982
  "type": "component",
15484
15983
  "route": "landmark",
15485
15984
  "component": "FSMSelectLandmark",
15486
15985
  "withoutLabel": true,
15986
+ "colSpan": "span 1",
15487
15987
  "texts": {
15488
15988
  "headerCaption": "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
15489
15989
  "header": "CS_FILE_APPLICATION_PROPERTY_LOCATION_PROVIDE_LANDMARK_TITLE",
@@ -15517,6 +16017,7 @@ const EditForm = _ref => {
15517
16017
  "type": "component",
15518
16018
  "route": "pit-type",
15519
16019
  "key": "pitType",
16020
+ "colSpan": "span 2",
15520
16021
  "component": "SelectPitType",
15521
16022
  "texts": {
15522
16023
  "header": "CS_FILE_PROPERTY_PIT_TYPE",
@@ -15528,6 +16029,7 @@ const EditForm = _ref => {
15528
16029
  "route": "tank-size",
15529
16030
  "component": "SelectTankSize",
15530
16031
  "isMandatory": false,
16032
+ "colSpan": "span 2",
15531
16033
  "texts": {
15532
16034
  "headerCaption": "",
15533
16035
  "header": "CS_FILE_APPLICATION_PIT_SEPTIC_TANK_SIZE_TITLE",
@@ -15543,6 +16045,7 @@ const EditForm = _ref => {
15543
16045
  "type": "component",
15544
16046
  "key": "tripData",
15545
16047
  "withoutLabel": true,
16048
+ "colSpan": "span 2",
15546
16049
  "component": "SelectTrips"
15547
16050
  }]
15548
16051
  }, {
@@ -15604,11 +16107,13 @@ const EditForm = _ref => {
15604
16107
  "type": "component",
15605
16108
  "key": "tripData",
15606
16109
  "withoutLabel": true,
16110
+ "colSpan": "span 2",
15607
16111
  "component": "SelectTripData"
15608
16112
  }, {
15609
16113
  "type": "component",
15610
16114
  "key": "advancepaymentPreference",
15611
16115
  "withoutLabel": true,
16116
+ "colSpan": "span 2",
15612
16117
  "component": "AdvanceCollection"
15613
16118
  }]
15614
16119
  }];
@@ -16489,7 +16994,7 @@ const FstpOperatorDetails = () => {
16489
16994
  } : {},
16490
16995
  key: t("CS_GRAM_PANCHAYAT"),
16491
16996
  label: `${t("CS_GRAM_PANCHAYAT")} * `,
16492
- text: tripDetails && tripDetails.length > 0 ? (_tripDetails$5 = tripDetails[0]) === null || _tripDetails$5 === void 0 ? void 0 : (_tripDetails$5$addres = _tripDetails$5.address) === null || _tripDetails$5$addres === void 0 ? void 0 : (_tripDetails$5$addres2 = _tripDetails$5$addres.additionalDetails) === null || _tripDetails$5$addres2 === void 0 ? void 0 : (_tripDetails$5$addres3 = _tripDetails$5$addres2.gramPanchayat) === null || _tripDetails$5$addres3 === void 0 ? void 0 : _tripDetails$5$addres3.name : /*#__PURE__*/React.createElement(Dropdown$1, {
16997
+ text: tripDetails && tripDetails.length > 0 ? (_tripDetails$5 = tripDetails[0]) === null || _tripDetails$5 === void 0 ? void 0 : (_tripDetails$5$addres = _tripDetails$5.address) === null || _tripDetails$5$addres === void 0 ? void 0 : (_tripDetails$5$addres2 = _tripDetails$5$addres.additionalDetails) === null || _tripDetails$5$addres2 === void 0 ? void 0 : (_tripDetails$5$addres3 = _tripDetails$5$addres2.gramPanchayat) === null || _tripDetails$5$addres3 === void 0 ? void 0 : _tripDetails$5$addres3.name : /*#__PURE__*/React.createElement(Dropdown, {
16493
16998
  className: "form-field",
16494
16999
  isMandatory: true,
16495
17000
  selected: selectedGp,
@@ -16554,7 +17059,7 @@ const FstpOperatorDetails = () => {
16554
17059
  } : {},
16555
17060
  key: t("CS_VILLAGE_NAME"),
16556
17061
  label: `${t("CS_VILLAGE_NAME")}`,
16557
- text: tripDetails && tripDetails.length > 0 ? (_tripDetails$8 = tripDetails[0]) !== null && _tripDetails$8 !== void 0 && (_tripDetails$8$addres = _tripDetails$8.address) !== null && _tripDetails$8$addres !== void 0 && (_tripDetails$8$addres2 = _tripDetails$8$addres.additionalDetails) !== null && _tripDetails$8$addres2 !== void 0 && (_tripDetails$8$addres3 = _tripDetails$8$addres2.village) !== null && _tripDetails$8$addres3 !== void 0 && _tripDetails$8$addres3.name ? (_tripDetails$9 = tripDetails[0]) === null || _tripDetails$9 === void 0 ? void 0 : (_tripDetails$9$addres = _tripDetails$9.address) === null || _tripDetails$9$addres === void 0 ? void 0 : (_tripDetails$9$addres2 = _tripDetails$9$addres.additionalDetails) === null || _tripDetails$9$addres2 === void 0 ? void 0 : (_tripDetails$9$addres3 = _tripDetails$9$addres2.village) === null || _tripDetails$9$addres3 === void 0 ? void 0 : _tripDetails$9$addres3.name : "N/A" : villages.length > 0 ? /*#__PURE__*/React.createElement(Dropdown$1, {
17062
+ text: tripDetails && tripDetails.length > 0 ? (_tripDetails$8 = tripDetails[0]) !== null && _tripDetails$8 !== void 0 && (_tripDetails$8$addres = _tripDetails$8.address) !== null && _tripDetails$8$addres !== void 0 && (_tripDetails$8$addres2 = _tripDetails$8$addres.additionalDetails) !== null && _tripDetails$8$addres2 !== void 0 && (_tripDetails$8$addres3 = _tripDetails$8$addres2.village) !== null && _tripDetails$8$addres3 !== void 0 && _tripDetails$8$addres3.name ? (_tripDetails$9 = tripDetails[0]) === null || _tripDetails$9 === void 0 ? void 0 : (_tripDetails$9$addres = _tripDetails$9.address) === null || _tripDetails$9$addres === void 0 ? void 0 : (_tripDetails$9$addres2 = _tripDetails$9$addres.additionalDetails) === null || _tripDetails$9$addres2 === void 0 ? void 0 : (_tripDetails$9$addres3 = _tripDetails$9$addres2.village) === null || _tripDetails$9$addres3 === void 0 ? void 0 : _tripDetails$9$addres3.name : "N/A" : villages.length > 0 ? /*#__PURE__*/React.createElement(Dropdown, {
16558
17063
  className: "form-field",
16559
17064
  isMandatory: true,
16560
17065
  selected: selectedVillage,
@@ -16603,7 +17108,7 @@ const FstpOperatorDetails = () => {
16603
17108
  } : {},
16604
17109
  key: t("ES_INBOX_LOCALITY"),
16605
17110
  label: `${t("ES_INBOX_LOCALITY")} * `,
16606
- text: tripDetails && tripDetails.length > 0 ? (_tripDetails$10 = tripDetails[0]) === null || _tripDetails$10 === void 0 ? void 0 : (_tripDetails$10$addre = _tripDetails$10.address) === null || _tripDetails$10$addre === void 0 ? void 0 : (_tripDetails$10$addre2 = _tripDetails$10$addre.locality) === null || _tripDetails$10$addre2 === void 0 ? void 0 : _tripDetails$10$addre2.name : /*#__PURE__*/React.createElement(Dropdown$1, {
17111
+ text: tripDetails && tripDetails.length > 0 ? (_tripDetails$10 = tripDetails[0]) === null || _tripDetails$10 === void 0 ? void 0 : (_tripDetails$10$addre = _tripDetails$10.address) === null || _tripDetails$10$addre === void 0 ? void 0 : (_tripDetails$10$addre2 = _tripDetails$10$addre.locality) === null || _tripDetails$10$addre2 === void 0 ? void 0 : _tripDetails$10$addre2.name : /*#__PURE__*/React.createElement(Dropdown, {
16607
17112
  className: "form-field",
16608
17113
  isMandatory: true,
16609
17114
  selected: selectedLocality,
@@ -16918,15 +17423,20 @@ const Inbox = _ref => {
16918
17423
  const fetchPrevPage = () => {
16919
17424
  setPageOffset(prevState => prevState - pageSize);
16920
17425
  };
16921
- const handleFilterChange = filterParam => {
16922
- let keys_to_delete = filterParam.delete;
17426
+ const handleFilterChange = function (filterParam) {
17427
+ if (filterParam === void 0) {
17428
+ filterParam = {};
17429
+ }
17430
+ const safeFilterParam = filterParam || {};
17431
+ let keys_to_delete = safeFilterParam === null || safeFilterParam === void 0 ? void 0 : safeFilterParam.delete;
16923
17432
  let _new = {
16924
17433
  ...searchParams
16925
17434
  };
16926
17435
  if (keys_to_delete) keys_to_delete.forEach(key => delete _new[key]);
17436
+ safeFilterParam === null || safeFilterParam === void 0 ? true : delete safeFilterParam.delete;
16927
17437
  setSearchParams({
16928
17438
  ..._new,
16929
- ...filterParam
17439
+ ...safeFilterParam
16930
17440
  });
16931
17441
  };
16932
17442
  const handleSort = useCallback(args => {
@@ -17107,8 +17617,12 @@ const NewApplication = _ref => {
17107
17617
  t
17108
17618
  } = useTranslation();
17109
17619
  const history = useHistory();
17110
- const [canSubmit, setSubmitValve] = useState(false);
17620
+ const [canSubmit, setSubmitValve] = useState(true);
17111
17621
  const defaultValues = {
17622
+ paymentPreference: "POST_PAY",
17623
+ channel: {
17624
+ code: "COUNTER"
17625
+ },
17112
17626
  tripData: {
17113
17627
  noOfTrips: 1,
17114
17628
  amountPerTrip: null,
@@ -17116,15 +17630,10 @@ const NewApplication = _ref => {
17116
17630
  }
17117
17631
  };
17118
17632
  const onFormValueChange = (setValue, formData) => {
17119
- var _formData$tripData, _formData$tripData2, _formData$tripData3, _formData$address, _formData$address$loc, _formData$cpt, _formData$cpt$details, _formData$cpt$details2, _formData$cpt$details3, _formData$tripData4, _formData$tripData5, _formData$tripData6, _formData$address2, _formData$address3, _formData$tripData7, _formData$tripData8;
17120
- console.log("ProID", formData);
17121
- if ((formData === null || formData === void 0 ? void 0 : formData.pitType) !== undefined && formData !== null && formData !== void 0 && (_formData$tripData = formData.tripData) !== null && _formData$tripData !== void 0 && _formData$tripData.vehicleType && (formData === null || formData === void 0 ? void 0 : (_formData$tripData2 = formData.tripData) === null || _formData$tripData2 === void 0 ? void 0 : _formData$tripData2.roadWidth) !== undefined && (formData === null || formData === void 0 ? void 0 : (_formData$tripData3 = formData.tripData) === null || _formData$tripData3 === void 0 ? void 0 : _formData$tripData3.distancefromroad) !== undefined && formData !== null && formData !== void 0 && formData.propertyType && formData !== null && formData !== void 0 && formData.subtype && formData !== null && formData !== void 0 && (_formData$address = formData.address) !== null && _formData$address !== void 0 && (_formData$address$loc = _formData$address.locality) !== null && _formData$address$loc !== void 0 && _formData$address$loc.code || formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && (_formData$cpt$details = _formData$cpt.details) !== null && _formData$cpt$details !== void 0 && (_formData$cpt$details2 = _formData$cpt$details.address) !== null && _formData$cpt$details2 !== void 0 && (_formData$cpt$details3 = _formData$cpt$details2.locality) !== null && _formData$cpt$details3 !== void 0 && _formData$cpt$details3.code && formData !== null && formData !== void 0 && (_formData$tripData4 = formData.tripData) !== null && _formData$tripData4 !== void 0 && _formData$tripData4.vehicleType && formData !== null && formData !== void 0 && formData.channel && formData !== null && formData !== void 0 && formData.pitType && formData !== null && formData !== void 0 && (_formData$tripData5 = formData.tripData) !== null && _formData$tripData5 !== void 0 && _formData$tripData5.roadWidth && formData !== null && formData !== void 0 && (_formData$tripData6 = formData.tripData) !== null && _formData$tripData6 !== void 0 && _formData$tripData6.distancefromroad && formData !== null && formData !== void 0 && (_formData$address2 = formData.address) !== null && _formData$address2 !== void 0 && _formData$address2.street && formData !== null && formData !== void 0 && (_formData$address3 = formData.address) !== null && _formData$address3 !== void 0 && _formData$address3.doorNo && (formData !== null && formData !== void 0 && (_formData$tripData7 = formData.tripData) !== null && _formData$tripData7 !== void 0 && _formData$tripData7.amountPerTrip || (formData === null || formData === void 0 ? void 0 : (_formData$tripData8 = formData.tripData) === null || _formData$tripData8 === void 0 ? void 0 : _formData$tripData8.amountPerTrip) === 0)) {
17122
- var _formData$tripData9, _formData$advancepaym, _formData$advancepaym2, _formData$advancepaym3;
17123
- console.log("formDataformData", formData);
17633
+ var _formData$address, _formData$address$loc, _formData$address2, _formData$address2$ci, _formData$address3, _formData$address4, _formData$tripData, _formData$tripData2, _formData$tripData3, _formData$tripData4;
17634
+ if (formData !== null && formData !== void 0 && formData.channel && formData !== null && formData !== void 0 && formData.propertyType && formData !== null && formData !== void 0 && formData.subtype && (formData !== null && formData !== void 0 && (_formData$address = formData.address) !== null && _formData$address !== void 0 && (_formData$address$loc = _formData$address.locality) !== null && _formData$address$loc !== void 0 && _formData$address$loc.code || formData !== null && formData !== void 0 && (_formData$address2 = formData.address) !== null && _formData$address2 !== void 0 && (_formData$address2$ci = _formData$address2.city) !== null && _formData$address2$ci !== void 0 && _formData$address2$ci.code) && formData !== null && formData !== void 0 && (_formData$address3 = formData.address) !== null && _formData$address3 !== void 0 && _formData$address3.street && formData !== null && formData !== void 0 && (_formData$address4 = formData.address) !== null && _formData$address4 !== void 0 && _formData$address4.doorNo && formData !== null && formData !== void 0 && formData.pitType && formData !== null && formData !== void 0 && (_formData$tripData = formData.tripData) !== null && _formData$tripData !== void 0 && _formData$tripData.vehicleType && formData !== null && formData !== void 0 && (_formData$tripData2 = formData.tripData) !== null && _formData$tripData2 !== void 0 && _formData$tripData2.noOfTrips && (formData !== null && formData !== void 0 && (_formData$tripData3 = formData.tripData) !== null && _formData$tripData3 !== void 0 && _formData$tripData3.amountPerTrip || (formData === null || formData === void 0 ? void 0 : (_formData$tripData4 = formData.tripData) === null || _formData$tripData4 === void 0 ? void 0 : _formData$tripData4.amountPerTrip) === 0)) {
17124
17635
  setSubmitValve(true);
17125
17636
  const pitDetailValues = formData !== null && formData !== void 0 && formData.pitDetail ? Object.values(formData === null || formData === void 0 ? void 0 : formData.pitDetail).filter(value => value > 0) : null;
17126
- let max = Digit.SessionStorage.get("total_amount");
17127
- let min = Digit.SessionStorage.get("advance_amount");
17128
17637
  if (formData !== null && formData !== void 0 && formData.pitType) {
17129
17638
  var _formData$pitType, _formData$pitType2;
17130
17639
  if (pitDetailValues === null || (pitDetailValues === null || pitDetailValues === void 0 ? void 0 : pitDetailValues.length) === 0) {
@@ -17135,45 +17644,43 @@ const NewApplication = _ref => {
17135
17644
  setSubmitValve(true);
17136
17645
  } else setSubmitValve(false);
17137
17646
  }
17138
- if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData9 = formData.tripData) === null || _formData$tripData9 === void 0 ? void 0 : _formData$tripData9.amountPerTrip) !== 0 && ((formData === null || formData === void 0 ? void 0 : (_formData$advancepaym = formData.advancepaymentPreference) === null || _formData$advancepaym === void 0 ? void 0 : _formData$advancepaym.advanceAmount) < min || (formData === null || formData === void 0 ? void 0 : (_formData$advancepaym2 = formData.advancepaymentPreference) === null || _formData$advancepaym2 === void 0 ? void 0 : _formData$advancepaym2.advanceAmount) > max || (formData === null || formData === void 0 ? void 0 : (_formData$advancepaym3 = formData.advancepaymentPreference) === null || _formData$advancepaym3 === void 0 ? void 0 : _formData$advancepaym3.advanceAmount) === "")) {
17139
- setSubmitValve(false);
17140
- }
17141
17647
  } else {
17142
17648
  setSubmitValve(false);
17143
17649
  }
17144
17650
  };
17145
17651
  const onSubmit = data => {
17146
- var _data$pitType, _data$address, _data$address2, _data$address2$street, _data$address3, _data$address3$doorNo, _data$address4, _data$address5, _data$address5$landma, _data$tripData, _data$tripData2, _data$tripData2$undef, _data$address6, _data$address6$city, _data$address7, _data$address7$city, _data$address8, _data$address8$city, _data$cpt, _data$cpt$details, _data$cpt$details$add, _data$cpt$details$add2, _data$address9, _data$address9$locali, _data$cpt2, _data$cpt2$details, _data$cpt2$details$ad, _data$cpt2$details$ad2, _data$address0, _data$address0$locali, _data$advancepaymentP, _data$advancepaymentP2, _data$tripData3, _data$tripData4, _data$address1, _data$address1$proper, _data$address10, _data$address11, _data$address12, _data$cpt3, _data$cpt3$details, _data$tripData5, _data$tripData5$vehic, _data$address13, _data$address14;
17147
- console.log("data", data);
17148
- const applicationChannel = data.channel;
17652
+ var _data$pitType, _data$applicationData, _data$applicationData2, _data$applicationData3, _data$address, _data$address2, _data$address2$street, _data$address3, _data$address3$doorNo, _data$address4, _data$address5, _data$address5$landma, _data$propertyID, _data$cpt, _data$cpt$details, _data$tripData, _data$tripData2, _data$tripData3, _data$tripData4, _data$tripData4$undef, _data$address6, _data$address6$city, _data$address7, _data$address7$city, _data$address8, _data$address8$city, _data$cpt2, _data$cpt2$details, _data$cpt2$details$ad, _data$cpt2$details$ad2, _data$address9, _data$address9$locali, _data$cpt3, _data$cpt3$details, _data$cpt3$details$ad, _data$cpt3$details$ad2, _data$address0, _data$address0$locali, _data$applicationData4, _data$paymentPreferen, _data$tripData5, _data$tripData6, _data$address1, _data$address10, _data$address11, _data$address11$prope, _data$address12, _data$address13, _data$address14, _data$tripData7, _data$tripData7$vehic, _data$address15, _data$address16;
17653
+ const applicationChannel = (data === null || data === void 0 ? void 0 : data.channel) || {
17654
+ code: "COUNTER"
17655
+ };
17149
17656
  const sanitationtype = data === null || data === void 0 ? void 0 : (_data$pitType = data.pitType) === null || _data$pitType === void 0 ? void 0 : _data$pitType.code;
17150
17657
  const pitDimension = data === null || data === void 0 ? void 0 : data.pitDetail;
17151
- const applicantName = data.applicationData.applicantName;
17152
- const mobileNumber = data.applicationData.mobileNumber;
17153
- const emailId = data.applicationData.emailId;
17658
+ const applicantName = data === null || data === void 0 ? void 0 : (_data$applicationData = data.applicationData) === null || _data$applicationData === void 0 ? void 0 : _data$applicationData.applicantName;
17659
+ const mobileNumber = data === null || data === void 0 ? void 0 : (_data$applicationData2 = data.applicationData) === null || _data$applicationData2 === void 0 ? void 0 : _data$applicationData2.mobileNumber;
17660
+ const emailId = data === null || data === void 0 ? void 0 : (_data$applicationData3 = data.applicationData) === null || _data$applicationData3 === void 0 ? void 0 : _data$applicationData3.emailId;
17154
17661
  const pincode = data === null || data === void 0 ? void 0 : (_data$address = data.address) === null || _data$address === void 0 ? void 0 : _data$address.pincode;
17155
17662
  const street = data === null || data === void 0 ? void 0 : (_data$address2 = data.address) === null || _data$address2 === void 0 ? void 0 : (_data$address2$street = _data$address2.street) === null || _data$address2$street === void 0 ? void 0 : _data$address2$street.trim();
17156
17663
  const doorNo = data === null || data === void 0 ? void 0 : (_data$address3 = data.address) === null || _data$address3 === void 0 ? void 0 : (_data$address3$doorNo = _data$address3.doorNo) === null || _data$address3$doorNo === void 0 ? void 0 : _data$address3$doorNo.trim();
17157
17664
  const slum = data === null || data === void 0 ? void 0 : (_data$address4 = data.address) === null || _data$address4 === void 0 ? void 0 : _data$address4.slum;
17158
17665
  const landmark = data === null || data === void 0 ? void 0 : (_data$address5 = data.address) === null || _data$address5 === void 0 ? void 0 : (_data$address5$landma = _data$address5.landmark) === null || _data$address5$landma === void 0 ? void 0 : _data$address5$landma.trim();
17666
+ const propertyID = (data === null || data === void 0 ? void 0 : (_data$propertyID = data.propertyID) === null || _data$propertyID === void 0 ? void 0 : _data$propertyID.propertyID) || (data === null || data === void 0 ? void 0 : (_data$cpt = data.cpt) === null || _data$cpt === void 0 ? void 0 : (_data$cpt$details = _data$cpt.details) === null || _data$cpt$details === void 0 ? void 0 : _data$cpt$details.propertyId) || "";
17159
17667
  const noOfTrips = data === null || data === void 0 ? void 0 : (_data$tripData = data.tripData) === null || _data$tripData === void 0 ? void 0 : _data$tripData.noOfTrips;
17160
- const amount = data.tripData.amount || (data === null || data === void 0 ? void 0 : (_data$tripData2 = data.tripData) === null || _data$tripData2 === void 0 ? void 0 : (_data$tripData2$undef = _data$tripData2.undefined) === null || _data$tripData2$undef === void 0 ? void 0 : _data$tripData2$undef.amount);
17668
+ const amount = (data === null || data === void 0 ? void 0 : (_data$tripData2 = data.tripData) === null || _data$tripData2 === void 0 ? void 0 : _data$tripData2.amount) !== undefined ? data === null || data === void 0 ? void 0 : (_data$tripData3 = data.tripData) === null || _data$tripData3 === void 0 ? void 0 : _data$tripData3.amount : data === null || data === void 0 ? void 0 : (_data$tripData4 = data.tripData) === null || _data$tripData4 === void 0 ? void 0 : (_data$tripData4$undef = _data$tripData4.undefined) === null || _data$tripData4$undef === void 0 ? void 0 : _data$tripData4$undef.amount;
17161
17669
  const cityCode = data === null || data === void 0 ? void 0 : (_data$address6 = data.address) === null || _data$address6 === void 0 ? void 0 : (_data$address6$city = _data$address6.city) === null || _data$address6$city === void 0 ? void 0 : _data$address6$city.code;
17162
17670
  const city = data === null || data === void 0 ? void 0 : (_data$address7 = data.address) === null || _data$address7 === void 0 ? void 0 : (_data$address7$city = _data$address7.city) === null || _data$address7$city === void 0 ? void 0 : _data$address7$city.name;
17163
17671
  const state = data === null || data === void 0 ? void 0 : (_data$address8 = data.address) === null || _data$address8 === void 0 ? void 0 : (_data$address8$city = _data$address8.city) === null || _data$address8$city === void 0 ? void 0 : _data$address8$city.state;
17164
- const localityCode = ((_data$cpt = data.cpt) === null || _data$cpt === void 0 ? void 0 : (_data$cpt$details = _data$cpt.details) === null || _data$cpt$details === void 0 ? void 0 : (_data$cpt$details$add = _data$cpt$details.address) === null || _data$cpt$details$add === void 0 ? void 0 : (_data$cpt$details$add2 = _data$cpt$details$add.locality) === null || _data$cpt$details$add2 === void 0 ? void 0 : _data$cpt$details$add2.code) || (data === null || data === void 0 ? void 0 : (_data$address9 = data.address) === null || _data$address9 === void 0 ? void 0 : (_data$address9$locali = _data$address9.locality) === null || _data$address9$locali === void 0 ? void 0 : _data$address9$locali.code);
17165
- const localityName = ((_data$cpt2 = data.cpt) === null || _data$cpt2 === void 0 ? void 0 : (_data$cpt2$details = _data$cpt2.details) === null || _data$cpt2$details === void 0 ? void 0 : (_data$cpt2$details$ad = _data$cpt2$details.address) === null || _data$cpt2$details$ad === void 0 ? void 0 : (_data$cpt2$details$ad2 = _data$cpt2$details$ad.locality) === null || _data$cpt2$details$ad2 === void 0 ? void 0 : _data$cpt2$details$ad2.name) || (data === null || data === void 0 ? void 0 : (_data$address0 = data.address) === null || _data$address0 === void 0 ? void 0 : (_data$address0$locali = _data$address0.locality) === null || _data$address0$locali === void 0 ? void 0 : _data$address0$locali.name);
17166
- const gender = data.applicationData.applicantGender;
17167
- const paymentPreference = amount === 0 ? null : data !== null && data !== void 0 && data.paymentPreference ? data === null || data === void 0 ? void 0 : data.paymentPreference : null;
17168
- const advanceAmount = amount === 0 ? null : (data === null || data === void 0 ? void 0 : (_data$advancepaymentP = data.advancepaymentPreference) === null || _data$advancepaymentP === void 0 ? void 0 : _data$advancepaymentP.advanceAmount) === null ? 0 : data === null || data === void 0 ? void 0 : (_data$advancepaymentP2 = data.advancepaymentPreference) === null || _data$advancepaymentP2 === void 0 ? void 0 : _data$advancepaymentP2.advanceAmount;
17169
- const distancefromroad = data === null || data === void 0 ? void 0 : (_data$tripData3 = data.tripData) === null || _data$tripData3 === void 0 ? void 0 : _data$tripData3.distancefromroad;
17170
- const roadWidth = data === null || data === void 0 ? void 0 : (_data$tripData4 = data.tripData) === null || _data$tripData4 === void 0 ? void 0 : _data$tripData4.roadWidth;
17171
- const gramPanchayat = data === null || data === void 0 ? void 0 : data.address.gramPanchayat;
17172
- const village = data === null || data === void 0 ? void 0 : data.address.village;
17173
- const propertyLocation = data === null || data === void 0 ? void 0 : (_data$address1 = data.address) === null || _data$address1 === void 0 ? void 0 : (_data$address1$proper = _data$address1.propertyLocation) === null || _data$address1$proper === void 0 ? void 0 : _data$address1$proper.code;
17174
- const newLocality = data === null || data === void 0 ? void 0 : (_data$address10 = data.address) === null || _data$address10 === void 0 ? void 0 : _data$address10.newLocality;
17175
- const newGp = data === null || data === void 0 ? void 0 : (_data$address11 = data.address) === null || _data$address11 === void 0 ? void 0 : _data$address11.newGp;
17176
- const newVillage = data === null || data === void 0 ? void 0 : (_data$address12 = data.address) === null || _data$address12 === void 0 ? void 0 : _data$address12.newVillage;
17672
+ const localityCode = (data === null || data === void 0 ? void 0 : (_data$cpt2 = data.cpt) === null || _data$cpt2 === void 0 ? void 0 : (_data$cpt2$details = _data$cpt2.details) === null || _data$cpt2$details === void 0 ? void 0 : (_data$cpt2$details$ad = _data$cpt2$details.address) === null || _data$cpt2$details$ad === void 0 ? void 0 : (_data$cpt2$details$ad2 = _data$cpt2$details$ad.locality) === null || _data$cpt2$details$ad2 === void 0 ? void 0 : _data$cpt2$details$ad2.code) || (data === null || data === void 0 ? void 0 : (_data$address9 = data.address) === null || _data$address9 === void 0 ? void 0 : (_data$address9$locali = _data$address9.locality) === null || _data$address9$locali === void 0 ? void 0 : _data$address9$locali.code);
17673
+ const localityName = (data === null || data === void 0 ? void 0 : (_data$cpt3 = data.cpt) === null || _data$cpt3 === void 0 ? void 0 : (_data$cpt3$details = _data$cpt3.details) === null || _data$cpt3$details === void 0 ? void 0 : (_data$cpt3$details$ad = _data$cpt3$details.address) === null || _data$cpt3$details$ad === void 0 ? void 0 : (_data$cpt3$details$ad2 = _data$cpt3$details$ad.locality) === null || _data$cpt3$details$ad2 === void 0 ? void 0 : _data$cpt3$details$ad2.name) || (data === null || data === void 0 ? void 0 : (_data$address0 = data.address) === null || _data$address0 === void 0 ? void 0 : (_data$address0$locali = _data$address0.locality) === null || _data$address0$locali === void 0 ? void 0 : _data$address0$locali.name);
17674
+ const gender = data === null || data === void 0 ? void 0 : (_data$applicationData4 = data.applicationData) === null || _data$applicationData4 === void 0 ? void 0 : _data$applicationData4.applicantGender;
17675
+ const paymentPreference = data !== null && data !== void 0 && data.paymentPreference ? (data === null || data === void 0 ? void 0 : (_data$paymentPreferen = data.paymentPreference) === null || _data$paymentPreferen === void 0 ? void 0 : _data$paymentPreferen.code) || (data === null || data === void 0 ? void 0 : data.paymentPreference) : "POST_PAY";
17676
+ const distancefromroad = (data === null || data === void 0 ? void 0 : (_data$tripData5 = data.tripData) === null || _data$tripData5 === void 0 ? void 0 : _data$tripData5.distancefromroad) || "";
17677
+ const roadWidth = (data === null || data === void 0 ? void 0 : (_data$tripData6 = data.tripData) === null || _data$tripData6 === void 0 ? void 0 : _data$tripData6.roadWidth) || "";
17678
+ const gramPanchayat = data === null || data === void 0 ? void 0 : (_data$address1 = data.address) === null || _data$address1 === void 0 ? void 0 : _data$address1.gramPanchayat;
17679
+ const village = data === null || data === void 0 ? void 0 : (_data$address10 = data.address) === null || _data$address10 === void 0 ? void 0 : _data$address10.village;
17680
+ const propertyLocation = data === null || data === void 0 ? void 0 : (_data$address11 = data.address) === null || _data$address11 === void 0 ? void 0 : (_data$address11$prope = _data$address11.propertyLocation) === null || _data$address11$prope === void 0 ? void 0 : _data$address11$prope.code;
17681
+ const newLocality = data === null || data === void 0 ? void 0 : (_data$address12 = data.address) === null || _data$address12 === void 0 ? void 0 : _data$address12.newLocality;
17682
+ const newGp = data === null || data === void 0 ? void 0 : (_data$address13 = data.address) === null || _data$address13 === void 0 ? void 0 : _data$address13.newGp;
17683
+ const newVillage = data === null || data === void 0 ? void 0 : (_data$address14 = data.address) === null || _data$address14 === void 0 ? void 0 : _data$address14.newVillage;
17177
17684
  const formData = {
17178
17685
  fsm: {
17179
17686
  citizen: {
@@ -17184,15 +17691,15 @@ const NewApplication = _ref => {
17184
17691
  },
17185
17692
  tenantId: tenantId,
17186
17693
  sanitationtype: sanitationtype,
17187
- source: applicationChannel.code,
17694
+ source: (applicationChannel === null || applicationChannel === void 0 ? void 0 : applicationChannel.code) || "COUNTER",
17188
17695
  additionalDetails: {
17189
17696
  tripAmount: typeof amount === "number" ? JSON.stringify(amount) : amount,
17190
17697
  distancefromroad: distancefromroad,
17191
17698
  roadWidth: roadWidth,
17192
- propertyID: data === null || data === void 0 ? void 0 : (_data$cpt3 = data.cpt) === null || _data$cpt3 === void 0 ? void 0 : (_data$cpt3$details = _data$cpt3.details) === null || _data$cpt3$details === void 0 ? void 0 : _data$cpt3$details.propertyId
17699
+ propertyID: propertyID
17193
17700
  },
17194
17701
  propertyUsage: data === null || data === void 0 ? void 0 : data.subtype,
17195
- vehicleCapacity: data === null || data === void 0 ? void 0 : (_data$tripData5 = data.tripData) === null || _data$tripData5 === void 0 ? void 0 : (_data$tripData5$vehic = _data$tripData5.vehicleType) === null || _data$tripData5$vehic === void 0 ? void 0 : _data$tripData5$vehic.capacity,
17702
+ vehicleCapacity: data === null || data === void 0 ? void 0 : (_data$tripData7 = data.tripData) === null || _data$tripData7 === void 0 ? void 0 : (_data$tripData7$vehic = _data$tripData7.vehicleType) === null || _data$tripData7$vehic === void 0 ? void 0 : _data$tripData7$vehic.capacity,
17196
17703
  pitDetail: {
17197
17704
  ...pitDimension,
17198
17705
  distanceFromRoad: data === null || data === void 0 ? void 0 : data.distanceFromRoad
@@ -17211,8 +17718,8 @@ const NewApplication = _ref => {
17211
17718
  name: propertyLocation === "FROM_GRAM_PANCHAYAT" ? gramPanchayat === null || gramPanchayat === void 0 ? void 0 : gramPanchayat.name : localityName
17212
17719
  },
17213
17720
  geoLocation: {
17214
- latitude: data === null || data === void 0 ? void 0 : (_data$address13 = data.address) === null || _data$address13 === void 0 ? void 0 : _data$address13.latitude,
17215
- longitude: data === null || data === void 0 ? void 0 : (_data$address14 = data.address) === null || _data$address14 === void 0 ? void 0 : _data$address14.longitude
17721
+ latitude: data === null || data === void 0 ? void 0 : (_data$address15 = data.address) === null || _data$address15 === void 0 ? void 0 : _data$address15.latitude,
17722
+ longitude: data === null || data === void 0 ? void 0 : (_data$address16 = data.address) === null || _data$address16 === void 0 ? void 0 : _data$address16.longitude
17216
17723
  },
17217
17724
  additionalDetails: {
17218
17725
  boundaryType: propertyLocation === "FROM_GRAM_PANCHAYAT" ? "GP" : "Locality",
@@ -17230,7 +17737,7 @@ const NewApplication = _ref => {
17230
17737
  },
17231
17738
  noOfTrips,
17232
17739
  paymentPreference,
17233
- advanceAmount: typeof advanceAmount === "number" ? JSON.stringify(advanceAmount) : advanceAmount
17740
+ advanceAmount: "0"
17234
17741
  },
17235
17742
  workflow: null
17236
17743
  };
@@ -17245,274 +17752,200 @@ const NewApplication = _ref => {
17245
17752
  return /*#__PURE__*/React.createElement(Loader, null);
17246
17753
  }
17247
17754
  let conf = [{
17248
- "head": "ES_NEW_APPLICATION_PROPERTY_DETAILS",
17249
- "body": [{
17250
- "label": "ES_NEW_APPLICATION_PROPERTY_ID",
17251
- "isMandatory": true,
17252
- "component": "CPTPropertySearchNSummary",
17253
- "withoutLabel": true,
17254
- "key": "cpt",
17255
- "type": "component",
17256
- "hideInCitizen": true
17257
- }, {
17258
- "label": "ES_NEW_APPLICATION_PROPERTY_TYPE",
17259
- "isMandatory": true,
17260
- "type": "component",
17261
- "route": "property-type",
17262
- "key": "propertyType",
17263
- "component": "SelectPropertyType",
17264
- "texts": {
17265
- "headerCaption": "",
17266
- "header": "CS_FILE_APPLICATION_PROPERTY_LABEL",
17267
- "cardText": "CS_FILE_APPLICATION_PROPERTY_TEXT",
17268
- "submitBarLabel": "CS_COMMON_NEXT"
17269
- },
17270
- "nextStep": "property-subtype"
17755
+ head: "ES_TITLE_APPLICANT_DETAILS",
17756
+ body: [{
17757
+ label: "ES_NEW_APPLICATION_APPLICATION_CHANNEL",
17758
+ isMandatory: true,
17759
+ type: "component",
17760
+ key: "channel",
17761
+ colSpan: "span 1",
17762
+ component: "SelectChannel",
17763
+ nextStep: "applicantName"
17271
17764
  }, {
17272
- "label": "ES_NEW_APPLICATION_PROPERTY_SUB-TYPE",
17273
- "isMandatory": true,
17274
- "type": "component",
17275
- "route": "property-subtype",
17276
- "key": "subtype",
17277
- "component": "SelectPropertySubtype",
17278
- "texts": {
17279
- "headerCaption": "",
17280
- "header": "CS_FILE_APPLICATION_PROPERTY_SUBTYPE_LABEL",
17281
- "cardText": "CS_FILE_APPLICATION_PROPERTY_SUBTYPE_TEXT",
17282
- "submitBarLabel": "CS_COMMON_NEXT"
17283
- },
17284
- "nextStep": "map"
17285
- }]
17286
- }, {
17287
- "head": "ES_TITLE_APPLICANT_DETAILS",
17288
- "body": [{
17289
- "label": "ES_NEW_APPLICATION_APPLICATION_CHANNEL",
17290
- "isMandatory": true,
17291
- "type": "component",
17292
- "key": "channel",
17293
- "component": "SelectChannel",
17294
- "nextStep": "applicantName"
17765
+ type: "component",
17766
+ key: "applicationData",
17767
+ withoutLabel: true,
17768
+ colSpan: "span 2",
17769
+ component: "SelectName"
17295
17770
  }, {
17296
- "type": "component",
17297
- "key": "applicationData",
17298
- "withoutLabel": true,
17299
- "component": "SelectName"
17771
+ type: "component",
17772
+ key: "paymentPreference",
17773
+ withoutLabel: true,
17774
+ colSpan: "span 2",
17775
+ component: "SelectPaymentType"
17300
17776
  }]
17301
17777
  }, {
17302
- "head": "ES_NEW_APPLICATION_LOCATION_DETAILS",
17303
- "body": [{
17304
- "route": "address",
17305
- "component": "FSMSelectAddress",
17306
- "withoutLabel": true,
17307
- "texts": {
17308
- "headerCaption": "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
17309
- "header": "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT",
17310
- "cardText": "CS_FILE_APPLICATION_PROPERTY_LOCATION_CITY_MOHALLA_TEXT",
17311
- "submitBarLabel": "CS_COMMON_NEXT"
17312
- },
17313
- "key": "address",
17314
- "nextStep": "locality-gramPanchayat",
17315
- "isMandatory": true,
17316
- "type": "component"
17317
- }, {
17318
- "route": "locality-gramPanchayat",
17319
- "component": "SelectLocalityOrGramPanchayat",
17320
- "withoutLabel": true,
17321
- "texts": {
17322
- "headerCaption": "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
17323
- "header": "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT",
17324
- "cardText": "CS_FILE_APPLICATION_PROPERTY_LOCATION_CITY_MOHALLA_TEXT",
17325
- "submitBarLabel": "CS_COMMON_NEXT"
17326
- },
17327
- "key": "address",
17328
- "nextStep": "select-trip-number",
17329
- "isMandatory": true,
17330
- "type": "component"
17331
- }, {
17332
- "route": "pincode",
17333
- "component": "FSMSelectPincode",
17334
- "texts": {
17335
- "headerCaption": "",
17336
- "header": "CS_FILE_APPLICATION_PINCODE_LABEL",
17337
- "cardText": "CS_FILE_APPLICATION_PINCODE_TEXT",
17338
- "submitBarLabel": "CS_COMMON_NEXT",
17339
- "skipText": "CORE_COMMON_SKIP_CONTINUE"
17340
- },
17341
- "withoutLabel": true,
17342
- "key": "address",
17343
- "nextStep": "check-slum",
17344
- "type": "component"
17345
- }, {
17346
- "type": "component",
17347
- "route": "check-slum",
17348
- "isMandatory": true,
17349
- "component": "CheckSlum",
17350
- "texts": {
17351
- "header": "ES_NEW_APPLICATION_SLUM_CHECK",
17352
- "submitBarLabel": "CS_COMMON_NEXT"
17353
- },
17354
- "key": "address",
17355
- "withoutLabel": true,
17356
- "nextStep": "slum-details",
17357
- "hideInEmployee": true
17358
- }, {
17359
- "type": "component",
17360
- "route": "slum-details",
17361
- "isMandatory": true,
17362
- "component": "SelectSlumName",
17363
- "texts": {
17364
- "header": "CS_NEW_APPLICATION_SLUM_NAME",
17365
- "cardText": "CS_NEW_APPLICATION_SLUM_TEXT",
17366
- "submitBarLabel": "CS_COMMON_NEXT"
17367
- },
17368
- "withoutLabel": true,
17369
- "key": "address",
17370
- "nextStep": "street"
17371
- }, {
17372
- "type": "component",
17373
- "route": "street",
17374
- "component": "FSMSelectStreet",
17375
- "key": "address",
17376
- "withoutLabel": true,
17377
- "texts": {
17378
- "headerCaption": "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
17379
- "header": "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT",
17380
- "cardText": "CS_FILE_APPLICATION_PROPERTY_LOCATION_STREET_DOOR_NO_LABEL",
17381
- "submitBarLabel": "CS_COMMON_NEXT",
17382
- "skipText": "CORE_COMMON_SKIP_CONTINUE"
17778
+ head: "ES_NEW_APPLICATION_PROPERTY_DETAILS",
17779
+ body: [{
17780
+ label: "ES_NEW_APPLICATION_PROPERTY_TYPE",
17781
+ isMandatory: true,
17782
+ type: "component",
17783
+ route: "property-type",
17784
+ key: "propertyType",
17785
+ colSpan: "span 1",
17786
+ component: "SelectPropertyType",
17787
+ texts: {
17788
+ headerCaption: "",
17789
+ header: "CS_FILE_APPLICATION_PROPERTY_LABEL",
17790
+ cardText: "CS_FILE_APPLICATION_PROPERTY_TEXT",
17791
+ submitBarLabel: "CS_COMMON_NEXT"
17383
17792
  },
17384
- "nextStep": "landmark"
17793
+ nextStep: "property-subtype"
17385
17794
  }, {
17386
- "type": "component",
17387
- "route": "landmark",
17388
- "component": "FSMSelectLandmark",
17389
- "withoutLabel": true,
17390
- "texts": {
17391
- "headerCaption": "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
17392
- "header": "CS_FILE_APPLICATION_PROPERTY_LOCATION_PROVIDE_LANDMARK_TITLE",
17393
- "cardText": "CS_FILE_APPLICATION_PROPERTY_LOCATION_PROVIDE_LANDMARK_TEXT",
17394
- "submitBarLabel": "CS_COMMON_NEXT",
17395
- "skipText": "CORE_COMMON_SKIP_CONTINUE"
17795
+ label: "ES_NEW_APPLICATION_PROPERTY_SUB-TYPE",
17796
+ isMandatory: true,
17797
+ type: "component",
17798
+ route: "property-subtype",
17799
+ key: "subtype",
17800
+ colSpan: "span 1",
17801
+ component: "SelectPropertySubtype",
17802
+ texts: {
17803
+ headerCaption: "",
17804
+ header: "CS_FILE_APPLICATION_PROPERTY_SUBTYPE_LABEL",
17805
+ cardText: "CS_FILE_APPLICATION_PROPERTY_SUBTYPE_TEXT",
17806
+ submitBarLabel: "CS_COMMON_NEXT"
17396
17807
  },
17397
- "key": "address",
17398
- "nextStep": "pit-type"
17808
+ nextStep: "map"
17399
17809
  }]
17400
17810
  }, {
17401
- "head": "CS_CHECK_PIT_SEPTIC_TANK_DETAILS",
17402
- "body": [{
17403
- "label": "ES_NEW_APPLICATION_ROAD_WIDTH",
17404
- "isMandatory": true,
17405
- "type": "component",
17406
- "route": "road-details",
17407
- "key": "roadWidth",
17408
- "hideInEmployee": true,
17409
- "component": "SelectRoadDetails",
17410
- "texts": {
17411
- "header": "CS_FILE_PROPERTY_ROAD_WIDTH",
17412
- "cardText": "CS_FILE_PROPERTY_ROAD_WIDTH_TEXT",
17413
- "submitBarLabel": "CS_COMMON_NEXT",
17414
- "skipText": "CORE_COMMON_SKIP_CONTINUE"
17811
+ head: "ES_NEW_APPLICATION_LOCATION_DETAILS",
17812
+ body: [{
17813
+ route: "pincode",
17814
+ component: "FSMSelectPincode",
17815
+ texts: {
17816
+ headerCaption: "",
17817
+ header: "CS_FILE_APPLICATION_PINCODE_LABEL",
17818
+ cardText: "CS_FILE_APPLICATION_PINCODE_TEXT",
17819
+ submitBarLabel: "CS_COMMON_NEXT",
17820
+ skipText: "CORE_COMMON_SKIP_CONTINUE"
17415
17821
  },
17416
- "nextStep": "tank-size"
17822
+ withoutLabel: true,
17823
+ key: "address",
17824
+ colSpan: "span 1",
17825
+ nextStep: "check-slum",
17826
+ type: "component"
17417
17827
  }, {
17418
- "label": "ES_NEW_APPLICATION_PIT_TYPE",
17419
- "isMandatory": true,
17420
- "type": "component",
17421
- "route": "pit-type",
17422
- "key": "pitType",
17423
- "component": "SelectPitType",
17424
- "texts": {
17425
- "header": "CS_FILE_PROPERTY_PIT_TYPE",
17426
- "cardText": "CS_FILE_PROPERTY_PIT_TYPE_TEXT",
17427
- "submitBarLabel": "CS_COMMON_NEXT"
17828
+ route: "address",
17829
+ component: "FSMSelectAddress",
17830
+ withoutLabel: true,
17831
+ texts: {
17832
+ headerCaption: "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
17833
+ header: "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT",
17834
+ cardText: "CS_FILE_APPLICATION_PROPERTY_LOCATION_CITY_MOHALLA_TEXT",
17835
+ submitBarLabel: "CS_COMMON_NEXT"
17428
17836
  },
17429
- "nextStep": "road-details"
17837
+ key: "address",
17838
+ colSpan: "span 1",
17839
+ nextStep: "locality-gramPanchayat",
17840
+ isMandatory: true,
17841
+ type: "component"
17430
17842
  }, {
17431
- "route": "tank-size",
17432
- "component": "SelectTankSize",
17433
- "isMandatory": false,
17434
- "texts": {
17435
- "headerCaption": "",
17436
- "header": "CS_FILE_APPLICATION_PIT_SEPTIC_TANK_SIZE_TITLE",
17437
- "cardText": "CS_FILE_APPLICATION_PIT_SEPTIC_TANK_SIZE_TEXT",
17438
- "submitBarLabel": "CS_COMMON_NEXT",
17439
- "skipText": "CORE_COMMON_SKIP_CONTINUE"
17843
+ route: "locality-gramPanchayat",
17844
+ component: "SelectLocalityOrGramPanchayat",
17845
+ withoutLabel: true,
17846
+ texts: {
17847
+ headerCaption: "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
17848
+ header: "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT",
17849
+ cardText: "CS_FILE_APPLICATION_PROPERTY_LOCATION_CITY_MOHALLA_TEXT",
17850
+ submitBarLabel: "CS_COMMON_NEXT"
17440
17851
  },
17441
- "type": "component",
17442
- "key": "pitDetail",
17443
- "nextStep": "select-payment-preference",
17444
- "label": "ES_NEW_APPLICATION_PIT_DIMENSION"
17852
+ key: "address",
17853
+ colSpan: "span 1",
17854
+ nextStep: "select-trip-number",
17855
+ isMandatory: true,
17856
+ type: "component"
17445
17857
  }, {
17446
- "type": "component",
17447
- "key": "tripData",
17448
- "withoutLabel": true,
17449
- "component": "SelectTrips"
17450
- }]
17451
- }, {
17452
- "head": "CS_FILE_ADDITIONAL_DETAILS",
17453
- "hideInEmployee": true,
17454
- "body": [{
17455
- "label": "a",
17456
- "isMandatory": true,
17457
- "type": "component",
17458
- "route": "select-trip-number",
17459
- "key": "selectTripNo",
17460
- "component": "SelectTripNo",
17461
- "hideInEmployee": true,
17462
- "texts": {
17463
- "headerCaption": "",
17464
- "header": "ES_FSM_SERVICE_REQUEST",
17465
- "cardText": "ES_FSM_SERVICE_REQUEST_TEXT",
17466
- "skipText": "CORE_COMMON_SKIP_CONTINUE",
17467
- "submitBarLabel": "CS_COMMON_NEXT",
17468
- "skipLabel": "CS_COMMON_SERVICE_SKIP_INFO"
17858
+ type: "component",
17859
+ route: "slum-details",
17860
+ isMandatory: true,
17861
+ component: "SelectSlumName",
17862
+ colSpan: "span 2",
17863
+ texts: {
17864
+ header: "CS_NEW_APPLICATION_SLUM_NAME",
17865
+ cardText: "CS_NEW_APPLICATION_SLUM_TEXT",
17866
+ submitBarLabel: "CS_COMMON_NEXT"
17469
17867
  },
17470
- "nextStep": "property-id"
17868
+ withoutLabel: true,
17869
+ key: "address",
17870
+ nextStep: "street"
17471
17871
  }, {
17472
- "label": "a",
17473
- "isMandatory": false,
17474
- "type": "component",
17475
- "route": "select-gender",
17476
- "hideInEmployee": true,
17477
- "key": "selectGender",
17478
- "component": "SelectGender",
17479
- "texts": {
17480
- "headerCaption": "",
17481
- "header": "CS_COMMON_CHOOSE_GENDER",
17482
- "cardText": "CS_COMMON_SELECT_GENDER",
17483
- "submitBarLabel": "CS_COMMON_NEXT",
17484
- "skipText": "CORE_COMMON_SKIP_CONTINUE"
17872
+ type: "component",
17873
+ route: "street",
17874
+ component: "FSMSelectStreet",
17875
+ key: "address",
17876
+ colSpan: "span 2",
17877
+ withoutLabel: true,
17878
+ texts: {
17879
+ headerCaption: "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
17880
+ header: "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT",
17881
+ cardText: "CS_FILE_APPLICATION_PROPERTY_LOCATION_STREET_DOOR_NO_LABEL",
17882
+ submitBarLabel: "CS_COMMON_NEXT",
17883
+ skipText: "CORE_COMMON_SKIP_CONTINUE"
17485
17884
  },
17486
- "nextStep": "select-payment-preference"
17885
+ nextStep: "landmark"
17487
17886
  }, {
17488
- "label": "a",
17489
- "isMandatory": false,
17490
- "type": "component",
17491
- "route": "select-payment-preference",
17492
- "key": "selectPaymentPreference",
17493
- "hideInEmployee": true,
17494
- "component": "SelectPaymentPreference",
17495
- "texts": {
17496
- "headerCaption": "",
17497
- "header": "ES_FSM_PAYMENT_PREFERENCE_LABEL",
17498
- "cardText": "ES_FSM_PAYMENT_PREFERENCE_TEXT",
17499
- "submitBarLabel": "CS_COMMON_NEXT",
17500
- "skipText": "CORE_COMMON_SKIP_CONTINUE"
17887
+ type: "component",
17888
+ route: "landmark",
17889
+ component: "FSMSelectLandmark",
17890
+ withoutLabel: true,
17891
+ colSpan: "span 1",
17892
+ texts: {
17893
+ headerCaption: "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
17894
+ header: "CS_FILE_APPLICATION_PROPERTY_LOCATION_PROVIDE_LANDMARK_TITLE",
17895
+ cardText: "CS_FILE_APPLICATION_PROPERTY_LOCATION_PROVIDE_LANDMARK_TEXT",
17896
+ submitBarLabel: "CS_COMMON_NEXT",
17897
+ skipText: "CORE_COMMON_SKIP_CONTINUE"
17501
17898
  },
17502
- "nextStep": null
17899
+ key: "address",
17900
+ nextStep: "pit-type"
17503
17901
  }]
17504
17902
  }, {
17505
- "head": "ES_TITLE_PAYMENT_DETAILS",
17506
- "body": [{
17507
- "type": "component",
17508
- "key": "tripData",
17509
- "withoutLabel": true,
17510
- "component": "SelectTripData"
17903
+ head: "CS_CHECK_PIT_SEPTIC_TANK_DETAILS",
17904
+ body: [{
17905
+ label: "ES_NEW_APPLICATION_PIT_TYPE",
17906
+ isMandatory: true,
17907
+ type: "component",
17908
+ route: "pit-type",
17909
+ key: "pitType",
17910
+ colSpan: "span 1",
17911
+ component: "SelectPitType",
17912
+ texts: {
17913
+ header: "CS_FILE_PROPERTY_PIT_TYPE",
17914
+ cardText: "CS_FILE_PROPERTY_PIT_TYPE_TEXT",
17915
+ submitBarLabel: "CS_COMMON_NEXT"
17916
+ },
17917
+ nextStep: "tank-size"
17511
17918
  }, {
17512
- "type": "component",
17513
- "key": "advancepaymentPreference",
17514
- "withoutLabel": true,
17515
- "component": "AdvanceCollection"
17919
+ route: "tank-size",
17920
+ component: "SelectTankSize",
17921
+ isMandatory: false,
17922
+ colSpan: "span 1",
17923
+ texts: {
17924
+ headerCaption: "",
17925
+ header: "CS_FILE_APPLICATION_PIT_SEPTIC_TANK_SIZE_TITLE",
17926
+ cardText: "CS_FILE_APPLICATION_PIT_SEPTIC_TANK_SIZE_TEXT",
17927
+ submitBarLabel: "CS_COMMON_NEXT",
17928
+ skipText: "CORE_COMMON_SKIP_CONTINUE"
17929
+ },
17930
+ type: "component",
17931
+ key: "pitDetail",
17932
+ nextStep: "select-payment-preference",
17933
+ label: "ES_NEW_APPLICATION_PIT_DIMENSION"
17934
+ }]
17935
+ }, {
17936
+ head: "ES_TITLE_PAYMENT_DETAILS",
17937
+ body: [{
17938
+ type: "component",
17939
+ key: "tripData",
17940
+ withoutLabel: true,
17941
+ colSpan: "span 2",
17942
+ component: "SelectTrips"
17943
+ }, {
17944
+ type: "component",
17945
+ key: "tripData",
17946
+ withoutLabel: true,
17947
+ colSpan: "span 2",
17948
+ component: "SelectTripData"
17516
17949
  }]
17517
17950
  }];
17518
17951
  console.log(conf, "confffffffff");
@@ -17621,7 +18054,7 @@ const SearchApplication$1 = _ref => {
17621
18054
  switch (input.type) {
17622
18055
  case "date":
17623
18056
  return /*#__PURE__*/React.createElement(Controller, {
17624
- render: props => /*#__PURE__*/React.createElement(DatePicker$2, {
18057
+ render: props => /*#__PURE__*/React.createElement(DatePicker, {
17625
18058
  date: props.value,
17626
18059
  onChange: props.onChange
17627
18060
  }),
@@ -18228,7 +18661,7 @@ const RegisryInbox = props => {
18228
18661
  let {
18229
18662
  row
18230
18663
  } = _ref12;
18231
- return /*#__PURE__*/React.createElement(Dropdown$1, {
18664
+ return /*#__PURE__*/React.createElement(Dropdown, {
18232
18665
  className: "fsm-registry-dropdown",
18233
18666
  selected: row.original.vendor,
18234
18667
  option: vendors,
@@ -18906,7 +19339,7 @@ const VehicleDetails = props => {
18906
19339
  });
18907
19340
  }
18908
19341
  if (selectedAction === "ADD_VENDOR" || selectedAction === "EDIT_VENDOR") {
18909
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$1, {
19342
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown, {
18910
19343
  t: t,
18911
19344
  option: vendors,
18912
19345
  value: selectedOption,
@@ -19023,10 +19456,6 @@ const VehicleDetails = props => {
19023
19456
  }))) : /*#__PURE__*/React.createElement(Loader, null);
19024
19457
  };
19025
19458
 
19026
- const {
19027
- DatePicker,
19028
- Dropdown
19029
- } = require("@djb25/digit-ui-react-components");
19030
19459
  const VehicleConfig = function (t, disabled) {
19031
19460
  if (disabled === void 0) {
19032
19461
  disabled = false;
@@ -19038,6 +19467,7 @@ const VehicleConfig = function (t, disabled) {
19038
19467
  isMandatory: true,
19039
19468
  type: "text",
19040
19469
  disable: disabled,
19470
+ colSpan: "span 2",
19041
19471
  populators: {
19042
19472
  name: "registrationNumber",
19043
19473
  ValidationRequired: true,
@@ -19055,7 +19485,8 @@ const VehicleConfig = function (t, disabled) {
19055
19485
  withoutLabel: true,
19056
19486
  key: "vehicle",
19057
19487
  isMandatory: true,
19058
- type: "component"
19488
+ type: "component",
19489
+ colSpan: "span 2"
19059
19490
  }, {
19060
19491
  label: "ES_FSM_REGISTRY_VEHICLE_POLLUTION_CERT",
19061
19492
  isMandatory: false,
@@ -19116,7 +19547,10 @@ const VehicleConfig = function (t, disabled) {
19116
19547
  date: props.value
19117
19548
  }, customProps))
19118
19549
  }
19119
- }, {
19550
+ }]
19551
+ }, {
19552
+ head: "ES_FSM_REGISTRY_PERSONAL_DETAILS",
19553
+ body: [{
19120
19554
  label: "ES_FSM_REGISTRY_NEW_VEHICLE_OWNER_NAME",
19121
19555
  isMandatory: true,
19122
19556
  type: "text",
@@ -19145,11 +19579,7 @@ const VehicleConfig = function (t, disabled) {
19145
19579
  },
19146
19580
  error: t("FSM_REGISTRY_INVALID_PHONE"),
19147
19581
  defaultValue: "",
19148
- className: "payment-form-text-input-correction",
19149
- labelStyle: {
19150
- border: "1px solid black",
19151
- borderRight: "none"
19152
- }
19582
+ className: "payment-form-text-input-correction"
19153
19583
  }
19154
19584
  }, {
19155
19585
  label: "ES_FSM_REGISTRY_NEW_GENDER",
@@ -19158,23 +19588,37 @@ const VehicleConfig = function (t, disabled) {
19158
19588
  route: "select-gender",
19159
19589
  hideInEmployee: false,
19160
19590
  key: "selectGender",
19161
- component: "SelectGender"
19591
+ component: SelectGender,
19592
+ withoutLabel: true,
19593
+ colSpan: "span 1"
19162
19594
  }, {
19163
- label: t("ES_FSM_REGISTRY_NEW_DOB"),
19595
+ label: "ES_FSM_REGISTRY_NEW_DOB",
19164
19596
  isMandatory: false,
19165
19597
  type: "custom",
19166
19598
  key: "dob",
19167
19599
  populators: {
19168
19600
  name: "dob",
19169
19601
  validation: {
19170
- required: true
19602
+ required: false
19171
19603
  },
19172
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, _extends({
19173
- onChange: props.onChange,
19174
- date: props.value
19175
- }, customProps, {
19176
- max: convertEpochToDate(new Date().setFullYear(new Date().getFullYear()))
19177
- }))
19604
+ component: (props, customProps) => {
19605
+ var _window, _window$Digit, _window$Digit$Compone;
19606
+ const Picker = DatePicker || ((_window = window) === null || _window === void 0 ? void 0 : (_window$Digit = _window.Digit) === null || _window$Digit === void 0 ? void 0 : (_window$Digit$Compone = _window$Digit.ComponentRegistryService) === null || _window$Digit$Compone === void 0 ? void 0 : _window$Digit$Compone.getComponent("DatePicker"));
19607
+ if (!Picker) {
19608
+ return /*#__PURE__*/React.createElement("input", {
19609
+ type: "date",
19610
+ className: "payment-form-text-input-correction employee-card-input",
19611
+ value: props.value || "",
19612
+ onChange: e => props.onChange(e.target.value)
19613
+ });
19614
+ }
19615
+ return /*#__PURE__*/React.createElement(Picker, _extends({
19616
+ onChange: props.onChange,
19617
+ date: props.value
19618
+ }, customProps, {
19619
+ max: convertEpochToDate(new Date().setFullYear(new Date().getFullYear()))
19620
+ }));
19621
+ }
19178
19622
  }
19179
19623
  }, {
19180
19624
  label: "ES_FSM_REGISTRY_NEW_EMAIL",
@@ -19196,6 +19640,7 @@ const VehicleConfig = function (t, disabled) {
19196
19640
  isMandatory: false,
19197
19641
  type: "textarea",
19198
19642
  key: "additionalDetails",
19643
+ colSpan: "span 2",
19199
19644
  populators: {
19200
19645
  name: "additionalDetails",
19201
19646
  className: "payment-form-text-input-correction"
@@ -19301,9 +19746,9 @@ const AddVehicle = _ref => {
19301
19746
  name: ownerName,
19302
19747
  fatherOrHusbandName: ownerName,
19303
19748
  relationship: "OTHER",
19304
- gender: "OTHERS",
19749
+ gender: gender || "OTHERS",
19305
19750
  dob: dob,
19306
- emailId: "abc@egov.com",
19751
+ emailId: emailId || "abc@egov.com",
19307
19752
  correspondenceAddress: "",
19308
19753
  mobileNumber: phone,
19309
19754
  gender: gender,
@@ -19337,12 +19782,8 @@ const AddVehicle = _ref => {
19337
19782
  }
19338
19783
  });
19339
19784
  };
19340
- const isMobile = window.Digit.Utils.browser.isMobile();
19341
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, null, t("ES_FSM_REGISTRY_TITLE_NEW_VEHICLE"))), /*#__PURE__*/React.createElement("div", {
19342
- style: !isMobile ? {
19343
- marginLeft: "-15px"
19344
- } : {}
19345
- }, /*#__PURE__*/React.createElement(FormComposer, {
19785
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormComposer, {
19786
+ heading: t("ES_FSM_REGISTRY_TITLE_NEW_VEHICLE"),
19346
19787
  isDisabled: !canSubmit,
19347
19788
  label: t("ES_COMMON_APPLICATION_SUBMIT"),
19348
19789
  config: Config.filter(i => !i.hideInEmployee).map(config => {
@@ -19357,12 +19798,13 @@ const AddVehicle = _ref => {
19357
19798
  onSubmit: onSubmit,
19358
19799
  defaultValues: defaultValues,
19359
19800
  onFormValueChange: onFormValueChange,
19360
- noBreakLine: true
19801
+ noBreakLine: true,
19802
+ formClassName: "vehicle-details-card"
19361
19803
  }), showToast && /*#__PURE__*/React.createElement(Toast, {
19362
19804
  error: showToast.key === "error" ? true : false,
19363
19805
  label: t(showToast.key === "success" ? `ES_FSM_REGISTRY_${showToast.action}_SUCCESS` : showToast.action),
19364
19806
  onClose: closeToast
19365
- })));
19807
+ }));
19366
19808
  };
19367
19809
 
19368
19810
  const EditVehicle = _ref => {
@@ -19863,7 +20305,7 @@ const DriverDetails = props => {
19863
20305
  });
19864
20306
  }
19865
20307
  if (selectedAction === "ADD_VENDOR") {
19866
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$1, {
20308
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown, {
19867
20309
  t: t,
19868
20310
  option: vendors,
19869
20311
  value: selectedOption,
@@ -19873,7 +20315,7 @@ const DriverDetails = props => {
19873
20315
  }));
19874
20316
  }
19875
20317
  if (selectedAction === "EDIT_VENDOR") {
19876
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$1, {
20318
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown, {
19877
20319
  t: t,
19878
20320
  option: vendors,
19879
20321
  value: selectedOption,
@@ -19990,9 +20432,6 @@ const DriverDetails = props => {
19990
20432
  }))) : /*#__PURE__*/React.createElement(Loader, null);
19991
20433
  };
19992
20434
 
19993
- const {
19994
- DatePicker: DatePicker$1
19995
- } = require("@djb25/digit-ui-react-components");
19996
20435
  const DriverConfig = function (t, disabled) {
19997
20436
  if (disabled === void 0) {
19998
20437
  disabled = false;
@@ -20026,7 +20465,6 @@ const DriverConfig = function (t, disabled) {
20026
20465
  pattern: /^[a-zA-Z-]{0,}[- ]{0,1}[ 0-9]{1,}/
20027
20466
  },
20028
20467
  error: t("FSM_REGISTRY_INVALID_DRIVER_LICENSE"),
20029
- required: false,
20030
20468
  defaultValue: "",
20031
20469
  className: "payment-form-text-input-correction"
20032
20470
  }
@@ -20034,13 +20472,35 @@ const DriverConfig = function (t, disabled) {
20034
20472
  }, {
20035
20473
  head: "ES_FSM_REGISTRY_PERSONAL_DETAILS",
20036
20474
  body: [{
20475
+ label: "ES_FSM_REGISTRY_DRIVER_MOBILE",
20476
+ isMandatory: true,
20477
+ type: "mobileNumber",
20478
+ key: "mobileNumber",
20479
+ disable: disabled,
20480
+ populators: {
20481
+ name: "mobileNumber",
20482
+ validation: {
20483
+ required: true,
20484
+ pattern: /^[6-9]\d{9}$/
20485
+ },
20486
+ labelStyle: {
20487
+ border: "1px solid black",
20488
+ borderRight: "none"
20489
+ },
20490
+ error: t("ES_FSM_REGISTRY_INVALID_MOBILE_NO"),
20491
+ defaultValue: "",
20492
+ className: "payment-form-text-input-correction"
20493
+ }
20494
+ }, {
20037
20495
  label: "ES_FSM_REGISTRY_NEW_GENDER",
20038
20496
  isMandatory: true,
20039
20497
  type: "component",
20040
20498
  route: "select-gender",
20041
20499
  hideInEmployee: false,
20042
20500
  key: "selectGender",
20043
- component: "SelectGender",
20501
+ component: SelectGender,
20502
+ withoutLabel: true,
20503
+ colSpan: "span 1",
20044
20504
  texts: {
20045
20505
  headerCaption: "",
20046
20506
  header: "CS_COMMON_CHOOSE_GENDER",
@@ -20049,27 +20509,41 @@ const DriverConfig = function (t, disabled) {
20049
20509
  skipText: "CORE_COMMON_SKIP_CONTINUE"
20050
20510
  }
20051
20511
  }, {
20052
- label: t("ES_FSM_REGISTRY_NEW_DOB"),
20512
+ label: "ES_FSM_REGISTRY_NEW_DOB",
20053
20513
  isMandatory: false,
20054
20514
  type: "custom",
20055
20515
  key: "dob",
20056
20516
  populators: {
20057
20517
  name: "dob",
20058
20518
  validation: {
20059
- required: true
20519
+ required: false
20060
20520
  },
20061
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$1, _extends({
20062
- onChange: props.onChange,
20063
- date: props.value
20064
- }, customProps, {
20065
- max: convertEpochToDate(new Date().setFullYear(new Date().getFullYear()))
20066
- }))
20521
+ component: (props, customProps) => {
20522
+ var _window, _window$Digit, _window$Digit$Compone;
20523
+ const Picker = DatePicker || ((_window = window) === null || _window === void 0 ? void 0 : (_window$Digit = _window.Digit) === null || _window$Digit === void 0 ? void 0 : (_window$Digit$Compone = _window$Digit.ComponentRegistryService) === null || _window$Digit$Compone === void 0 ? void 0 : _window$Digit$Compone.getComponent("DatePicker"));
20524
+ if (!Picker) {
20525
+ return /*#__PURE__*/React.createElement("input", {
20526
+ type: "date",
20527
+ className: "payment-form-text-input-correction employee-card-input",
20528
+ value: props.value || "",
20529
+ onChange: e => props.onChange(e.target.value)
20530
+ });
20531
+ }
20532
+ return /*#__PURE__*/React.createElement(Picker, _extends({
20533
+ onChange: props.onChange,
20534
+ date: props.value,
20535
+ isDOB: true
20536
+ }, customProps, {
20537
+ max: convertEpochToDate(new Date().setFullYear(new Date().getFullYear()))
20538
+ }));
20539
+ }
20067
20540
  }
20068
20541
  }, {
20069
20542
  label: "ES_FSM_REGISTRY_NEW_EMAIL",
20070
20543
  isMandatory: false,
20071
20544
  type: "text",
20072
20545
  key: "emailId",
20546
+ colSpan: "span 2",
20073
20547
  populators: {
20074
20548
  name: "emailId",
20075
20549
  validation: {
@@ -20080,6 +20554,16 @@ const DriverConfig = function (t, disabled) {
20080
20554
  defaultValue: "",
20081
20555
  className: "payment-form-text-input-correction"
20082
20556
  }
20557
+ }, {
20558
+ label: "ES_FSM_REGISTRY_NEW_VENDOR_ADDITIONAL_DETAILS",
20559
+ isMandatory: false,
20560
+ type: "textarea",
20561
+ key: "additionalDetails",
20562
+ colSpan: "span 2",
20563
+ populators: {
20564
+ name: "additionalDetails",
20565
+ className: "payment-form-text-input-correction"
20566
+ }
20083
20567
  }]
20084
20568
  }];
20085
20569
  };
@@ -20118,7 +20602,8 @@ const AddDriver = _ref => {
20118
20602
  }
20119
20603
  };
20120
20604
  const onFormValueChange = (setValue, formData) => {
20121
- if (formData !== null && formData !== void 0 && formData.driverName && formData !== null && formData !== void 0 && formData.selectGender) {
20605
+ var _formData$selectGende;
20606
+ if (formData !== null && formData !== void 0 && formData.driverName && formData !== null && formData !== void 0 && formData.license && (formData !== null && formData !== void 0 && formData.mobileNumber || formData !== null && formData !== void 0 && formData.phone) && (formData !== null && formData !== void 0 && (_formData$selectGende = formData.selectGender) !== null && _formData$selectGende !== void 0 && _formData$selectGende.code || formData !== null && formData !== void 0 && formData.selectGender)) {
20122
20607
  setSubmitValve(true);
20123
20608
  } else {
20124
20609
  setSubmitValve(false);
@@ -20131,15 +20616,17 @@ const AddDriver = _ref => {
20131
20616
  var _data$selectGender;
20132
20617
  const name = data === null || data === void 0 ? void 0 : data.driverName;
20133
20618
  const license = data === null || data === void 0 ? void 0 : data.license;
20134
- const gender = data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code;
20619
+ const gender = (data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code) || (data === null || data === void 0 ? void 0 : data.selectGender);
20135
20620
  const emailId = data === null || data === void 0 ? void 0 : data.emailId;
20136
- const dob = new Date(`${data.dob}`).getTime() || new Date(`1/1/1970`).getTime();
20621
+ const mobileNumber = (data === null || data === void 0 ? void 0 : data.mobileNumber) || (data === null || data === void 0 ? void 0 : data.phone);
20622
+ const dob = data !== null && data !== void 0 && data.dob ? new Date(`${data.dob}`).getTime() : new Date(`1/1/1970`).getTime();
20137
20623
  const additionalDetails = data === null || data === void 0 ? void 0 : data.additionalDetails;
20138
20624
  const formData = {
20139
20625
  driver: {
20140
20626
  tenantId: tenantId,
20141
20627
  name: name,
20142
20628
  licenseNumber: license,
20629
+ mobileNumber: mobileNumber,
20143
20630
  additionalDetails: additionalDetails,
20144
20631
  status: "ACTIVE",
20145
20632
  owner: {
@@ -20147,9 +20634,10 @@ const AddDriver = _ref => {
20147
20634
  name: name,
20148
20635
  fatherOrHusbandName: name,
20149
20636
  relationship: "OTHER",
20150
- gender: gender,
20637
+ gender: gender || "OTHER",
20151
20638
  dob: dob,
20152
- emailId: emailId || "abc@egov.com"
20639
+ emailId: emailId || "abc@egov.com",
20640
+ mobileNumber: mobileNumber
20153
20641
  },
20154
20642
  vendorDriverStatus: "INACTIVE"
20155
20643
  }
@@ -20176,12 +20664,8 @@ const AddDriver = _ref => {
20176
20664
  }
20177
20665
  });
20178
20666
  };
20179
- const isMobile = window.Digit.Utils.browser.isMobile();
20180
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, null, t("ES_FSM_REGISTRY_TITLE_NEW_DRIVER"))), /*#__PURE__*/React.createElement("div", {
20181
- style: !isMobile ? {
20182
- marginLeft: "-15px"
20183
- } : {}
20184
- }, /*#__PURE__*/React.createElement(FormComposer, {
20667
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormComposer, {
20668
+ heading: t("ES_FSM_REGISTRY_TITLE_NEW_DRIVER"),
20185
20669
  isDisabled: !canSubmit,
20186
20670
  label: t("ES_COMMON_APPLICATION_SUBMIT"),
20187
20671
  config: Config.filter(i => !i.hideInEmployee).map(config => {
@@ -20196,12 +20680,13 @@ const AddDriver = _ref => {
20196
20680
  onSubmit: onSubmit,
20197
20681
  defaultValues: defaultValues,
20198
20682
  onFormValueChange: onFormValueChange,
20199
- noBreakLine: true
20683
+ noBreakLine: true,
20684
+ formClassName: "vehicle-details-card"
20200
20685
  }), showToast && /*#__PURE__*/React.createElement(Toast, {
20201
20686
  error: showToast.key === "error" ? true : false,
20202
20687
  label: t(showToast.key === "success" ? `ES_FSM_${showToast.action}_SUCCESS` : showToast.action),
20203
20688
  onClose: closeToast
20204
- })));
20689
+ }));
20205
20690
  };
20206
20691
 
20207
20692
  const EditDriver = _ref => {
@@ -20242,7 +20727,7 @@ const EditDriver = _ref => {
20242
20727
  }, []);
20243
20728
  useEffect(() => {
20244
20729
  if (driverData && driverData[0]) {
20245
- var _driverDetails$driver, _driverDetails$driver2, _driverDetails$driver3, _driverDetails$driver4, _driverDetails$driver5, _driverDetails$driver6, _driverDetails$driver7, _driverDetails$driver8, _driverDetails$driver9, _driverDetails$driver0, _driverDetails$driver1, _driverDetails$driver10, _driverDetails$driver11, _driverDetails$driver12;
20730
+ var _driverDetails$driver, _driverDetails$driver2, _driverDetails$driver3, _driverDetails$driver4, _driverDetails$driver5, _driverDetails$driver6, _driverDetails$driver7, _driverDetails$driver8, _driverDetails$driver9, _driverDetails$driver0, _driverDetails$driver1, _driverDetails$driver10, _driverDetails$driver11, _driverDetails$driver12, _driverDetails$driver13, _driverDetails$driver14, _driverDetails$driver15;
20246
20731
  let driverDetails = driverData[0];
20247
20732
  setDriverDetails(driverDetails === null || driverDetails === void 0 ? void 0 : driverDetails.driverData);
20248
20733
  let values = {
@@ -20251,7 +20736,8 @@ const EditDriver = _ref => {
20251
20736
  selectGender: driverDetails === null || driverDetails === void 0 ? void 0 : (_driverDetails$driver3 = driverDetails.driverData) === null || _driverDetails$driver3 === void 0 ? void 0 : (_driverDetails$driver4 = _driverDetails$driver3.owner) === null || _driverDetails$driver4 === void 0 ? void 0 : _driverDetails$driver4.gender,
20252
20737
  dob: (driverDetails === null || driverDetails === void 0 ? void 0 : (_driverDetails$driver5 = driverDetails.driverData) === null || _driverDetails$driver5 === void 0 ? void 0 : (_driverDetails$driver6 = _driverDetails$driver5.owner) === null || _driverDetails$driver6 === void 0 ? void 0 : _driverDetails$driver6.dob) && Digit.DateUtils.ConvertTimestampToDate(driverDetails === null || driverDetails === void 0 ? void 0 : (_driverDetails$driver7 = driverDetails.driverData) === null || _driverDetails$driver7 === void 0 ? void 0 : (_driverDetails$driver8 = _driverDetails$driver7.owner) === null || _driverDetails$driver8 === void 0 ? void 0 : _driverDetails$driver8.dob, "yyyy-MM-dd"),
20253
20738
  emailId: (driverDetails === null || driverDetails === void 0 ? void 0 : (_driverDetails$driver9 = driverDetails.driverData) === null || _driverDetails$driver9 === void 0 ? void 0 : (_driverDetails$driver0 = _driverDetails$driver9.owner) === null || _driverDetails$driver0 === void 0 ? void 0 : _driverDetails$driver0.emailId) === "abc@egov.com" ? "" : driverDetails === null || driverDetails === void 0 ? void 0 : (_driverDetails$driver1 = driverDetails.driverData) === null || _driverDetails$driver1 === void 0 ? void 0 : (_driverDetails$driver10 = _driverDetails$driver1.owner) === null || _driverDetails$driver10 === void 0 ? void 0 : _driverDetails$driver10.emailId,
20254
- additionalDetails: driverDetails === null || driverDetails === void 0 ? void 0 : (_driverDetails$driver11 = driverDetails.driverData) === null || _driverDetails$driver11 === void 0 ? void 0 : (_driverDetails$driver12 = _driverDetails$driver11.additionalDetails) === null || _driverDetails$driver12 === void 0 ? void 0 : _driverDetails$driver12.description
20739
+ mobileNumber: (driverDetails === null || driverDetails === void 0 ? void 0 : (_driverDetails$driver11 = driverDetails.driverData) === null || _driverDetails$driver11 === void 0 ? void 0 : (_driverDetails$driver12 = _driverDetails$driver11.owner) === null || _driverDetails$driver12 === void 0 ? void 0 : _driverDetails$driver12.mobileNumber) || (driverDetails === null || driverDetails === void 0 ? void 0 : (_driverDetails$driver13 = driverDetails.driverData) === null || _driverDetails$driver13 === void 0 ? void 0 : _driverDetails$driver13.mobileNumber),
20740
+ additionalDetails: driverDetails === null || driverDetails === void 0 ? void 0 : (_driverDetails$driver14 = driverDetails.driverData) === null || _driverDetails$driver14 === void 0 ? void 0 : (_driverDetails$driver15 = _driverDetails$driver14.additionalDetails) === null || _driverDetails$driver15 === void 0 ? void 0 : _driverDetails$driver15.description
20255
20741
  };
20256
20742
  setDefaultValues(values);
20257
20743
  }
@@ -20272,23 +20758,26 @@ const EditDriver = _ref => {
20272
20758
  setShowToast(null);
20273
20759
  };
20274
20760
  const onSubmit = data => {
20275
- var _data$selectGender, _driverDetails$owner;
20761
+ var _data$selectGender, _driverDetails$owner, _driverDetails$owner2;
20276
20762
  const license = data === null || data === void 0 ? void 0 : data.license;
20277
20763
  const gender = data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code;
20278
20764
  const emailId = data === null || data === void 0 ? void 0 : data.emailId;
20279
20765
  const dob = new Date(`${data.dob}`).getTime();
20280
20766
  const additionalDetails = data === null || data === void 0 ? void 0 : data.additionalDetails;
20767
+ const mobileNumber = (data === null || data === void 0 ? void 0 : data.mobileNumber) || (driverDetails === null || driverDetails === void 0 ? void 0 : (_driverDetails$owner = driverDetails.owner) === null || _driverDetails$owner === void 0 ? void 0 : _driverDetails$owner.mobileNumber) || (driverDetails === null || driverDetails === void 0 ? void 0 : driverDetails.mobileNumber);
20281
20768
  const formData = {
20282
20769
  driver: {
20283
20770
  ...driverDetails,
20284
20771
  licenseNumber: license,
20772
+ mobileNumber: mobileNumber,
20285
20773
  additionalDetails: additionalDetails,
20286
20774
  owner: {
20287
20775
  ...driverDetails.owner,
20288
- relationship: ((_driverDetails$owner = driverDetails.owner) === null || _driverDetails$owner === void 0 ? void 0 : _driverDetails$owner.relationship) || "OTHER",
20776
+ relationship: ((_driverDetails$owner2 = driverDetails.owner) === null || _driverDetails$owner2 === void 0 ? void 0 : _driverDetails$owner2.relationship) || "OTHER",
20289
20777
  gender: gender || driverDetails.owner.gender || "OTHER",
20290
20778
  dob: dob,
20291
- emailId: emailId || "abc@egov.com"
20779
+ emailId: emailId || "abc@egov.com",
20780
+ mobileNumber: mobileNumber
20292
20781
  }
20293
20782
  }
20294
20783
  };
@@ -20343,7 +20832,7 @@ const EditDriver = _ref => {
20343
20832
  };
20344
20833
 
20345
20834
  const AdvanceCollection = _ref => {
20346
- var _formData$tripData, _formData$address2, _formData$tripData6, _formData$tripData6$v, _formData$tripData7, _formData$tripData8;
20835
+ var _formData$tripData, _formData$address3, _formData$address4, _formData$address4$ci, _formData$tripData7, _formData$tripData7$v, _formData$tripData8, _formData$tripData9, _formData$address5, _formData$address5$pr, _formData$tripData0;
20347
20836
  let {
20348
20837
  t,
20349
20838
  config,
@@ -20352,7 +20841,7 @@ const AdvanceCollection = _ref => {
20352
20841
  userType,
20353
20842
  FSMTextFieldStyle
20354
20843
  } = _ref;
20355
- const tenantId = Digit.ULBService.getCurrentTenantId();
20844
+ const tenantId = normalizeTenantId(Digit.ULBService.getCurrentTenantId());
20356
20845
  const state = Digit.ULBService.getStateId();
20357
20846
  const {
20358
20847
  pathname: url
@@ -20421,98 +20910,86 @@ const AdvanceCollection = _ref => {
20421
20910
  useEffect(() => {
20422
20911
  (function () {
20423
20912
  try {
20424
- var _formData$tripData2;
20425
- if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData2 = formData.tripData) === null || _formData$tripData2 === void 0 ? void 0 : _formData$tripData2.vehicleType) !== vehicle) {
20426
- var _formData$tripData3, _formData$tripData3$v;
20427
- setVehicle({
20428
- label: formData === null || formData === void 0 ? void 0 : (_formData$tripData3 = formData.tripData) === null || _formData$tripData3 === void 0 ? void 0 : (_formData$tripData3$v = _formData$tripData3.vehicleType) === null || _formData$tripData3$v === void 0 ? void 0 : _formData$tripData3$v.capacity
20429
- });
20430
- }
20431
- const _temp2 = function (_formData$tripData4, _formData$tripData4$v, _formData$address, _formData$address$pro) {
20432
- if (formData !== null && formData !== void 0 && formData.propertyType && formData !== null && formData !== void 0 && formData.subtype && formData !== null && formData !== void 0 && formData.address && formData !== null && formData !== void 0 && (_formData$tripData4 = formData.tripData) !== null && _formData$tripData4 !== void 0 && (_formData$tripData4$v = _formData$tripData4.vehicleType) !== null && _formData$tripData4$v !== void 0 && _formData$tripData4$v.capacity && (formData === null || formData === void 0 ? void 0 : (_formData$address = formData.address) === null || _formData$address === void 0 ? void 0 : (_formData$address$pro = _formData$address.propertyLocation) === null || _formData$address$pro === void 0 ? void 0 : _formData$address$pro.code) === "WITHIN_ULB_LIMITS") {
20433
- var _formData$tripData5;
20434
- const capacity = formData === null || formData === void 0 ? void 0 : (_formData$tripData5 = formData.tripData) === null || _formData$tripData5 === void 0 ? void 0 : _formData$tripData5.vehicleType.capacity;
20435
- const {
20436
- slum: slumDetails
20437
- } = formData.address;
20438
- const slum = slumDetails ? "YES" : "NO";
20439
- return Promise.resolve(Digit.FSMService.billingSlabSearch(tenantId, {
20440
- propertyType: formData === null || formData === void 0 ? void 0 : formData.subtype,
20441
- capacity,
20442
- slum
20443
- })).then(function (billingDetails) {
20444
- var _billingDetails$billi;
20445
- const billSlab = (billingDetails === null || billingDetails === void 0 ? void 0 : (_billingDetails$billi = billingDetails.billingSlab) === null || _billingDetails$billi === void 0 ? void 0 : _billingDetails$billi.length) && (billingDetails === null || billingDetails === void 0 ? void 0 : billingDetails.billingSlab[0]);
20446
- const _temp = function () {
20447
- if (billSlab !== null && billSlab !== void 0 && billSlab.price || (billSlab === null || billSlab === void 0 ? void 0 : billSlab.price) === 0) {
20448
- const totaltripAmount = billSlab.price * formData.tripData.noOfTrips;
20449
- return Promise.resolve(Digit.FSMService.advanceBalanceCalculate(tenantId, {
20450
- totalTripAmount: totaltripAmount
20451
- })).then(function (_ref2) {
20452
- var _formData$advancepaym;
20453
- let {
20454
- advanceAmount: advanceBalanceAmount
20455
- } = _ref2;
20456
- Digit.SessionStorage.set("total_amount", totaltripAmount);
20457
- Digit.SessionStorage.set("advance_amount", advanceBalanceAmount);
20458
- setTotalAmount(totaltripAmount);
20459
- setAdvanceAmounts(advanceBalanceAmount);
20460
- if (!url.includes("modify") || url.includes("modify") && advanceBalanceAmount > (formData === null || formData === void 0 ? void 0 : (_formData$advancepaym = formData.advancepaymentPreference) === null || _formData$advancepaym === void 0 ? void 0 : _formData$advancepaym.advanceAmount)) {
20913
+ var _formData$tripData2, _formData$tripData4, _formData$address, _formData$address$cit, _formData$tripData5;
20914
+ function _temp4() {
20915
+ const _temp2 = function () {
20916
+ if (rate !== undefined && rate !== null && rate !== "") {
20917
+ const totaltripAmount = Number(rate) * trips;
20918
+ const _temp = _catch(function () {
20919
+ return Promise.resolve(Digit.FSMService.advanceBalanceCalculate(targetTenant, {
20920
+ totalTripAmount: totaltripAmount
20921
+ })).then(function (res) {
20922
+ var _formData$advancepaym;
20923
+ const advanceBalanceAmount = (res === null || res === void 0 ? void 0 : res.advanceAmount) !== undefined ? res.advanceAmount : 0;
20924
+ Digit.SessionStorage.set("total_amount", totaltripAmount);
20925
+ Digit.SessionStorage.set("advance_amount", advanceBalanceAmount);
20926
+ setTotalAmount(totaltripAmount);
20927
+ setAdvanceAmounts(advanceBalanceAmount);
20928
+ if (!url.includes("modify") || url.includes("modify") && advanceBalanceAmount > (formData === null || formData === void 0 ? void 0 : (_formData$advancepaym = formData.advancepaymentPreference) === null || _formData$advancepaym === void 0 ? void 0 : _formData$advancepaym.advanceAmount)) {
20929
+ var _formData$advancepaym2;
20930
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$advancepaym2 = formData.advancepaymentPreference) === null || _formData$advancepaym2 === void 0 ? void 0 : _formData$advancepaym2.advanceAmount) !== advanceBalanceAmount) {
20461
20931
  setValue({
20462
20932
  advanceAmount: advanceBalanceAmount
20463
20933
  });
20464
20934
  }
20465
- setError(false);
20935
+ }
20936
+ setError(false);
20937
+ });
20938
+ }, function (calcErr) {
20939
+ var _formData$advancepaym3;
20940
+ console.warn("advanceBalanceCalculate failed, using fallback:", calcErr);
20941
+ Digit.SessionStorage.set("total_amount", totaltripAmount);
20942
+ Digit.SessionStorage.set("advance_amount", 0);
20943
+ setTotalAmount(totaltripAmount);
20944
+ setAdvanceAmounts(0);
20945
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$advancepaym3 = formData.advancepaymentPreference) === null || _formData$advancepaym3 === void 0 ? void 0 : _formData$advancepaym3.advanceAmount) !== 0) {
20946
+ setValue({
20947
+ advanceAmount: advanceBalanceAmount
20466
20948
  });
20467
- } else {
20468
- sessionStorage.removeItem("Digit.total_amount");
20469
- sessionStorage.removeItem("Digit.advance_amount");
20470
- setError(true);
20471
20949
  }
20472
- }();
20950
+ setError(false);
20951
+ });
20473
20952
  if (_temp && _temp.then) return _temp.then(function () {});
20474
- });
20475
- }
20476
- }();
20477
- return _temp2 && _temp2.then ? _temp2.then(function () {}) : void 0;
20478
- } catch (e) {
20479
- Promise.reject(e);
20480
- }
20481
- })();
20482
- }, [formData === null || formData === void 0 ? void 0 : formData.propertyType, formData === null || formData === void 0 ? void 0 : formData.subtype, formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : _formData$address2.slum, formData === null || formData === void 0 ? void 0 : (_formData$tripData6 = formData.tripData) === null || _formData$tripData6 === void 0 ? void 0 : (_formData$tripData6$v = _formData$tripData6.vehicleType) === null || _formData$tripData6$v === void 0 ? void 0 : _formData$tripData6$v.capacity, formData === null || formData === void 0 ? void 0 : (_formData$tripData7 = formData.tripData) === null || _formData$tripData7 === void 0 ? void 0 : _formData$tripData7.noOfTrips]);
20483
- useEffect(() => {
20484
- (function () {
20485
- try {
20486
- const _temp3 = function (_formData$address3, _formData$address3$pr) {
20487
- if ((formData === null || formData === void 0 ? void 0 : (_formData$address3 = formData.address) === null || _formData$address3 === void 0 ? void 0 : (_formData$address3$pr = _formData$address3.propertyLocation) === null || _formData$address3$pr === void 0 ? void 0 : _formData$address3$pr.code) === "FROM_GRAM_PANCHAYAT" && formData.tripData.noOfTrips && formData.tripData.amountPerTrip) {
20488
- const totaltripAmount = formData.tripData.amountPerTrip * formData.tripData.noOfTrips;
20489
- return Promise.resolve(Digit.FSMService.advanceBalanceCalculate(tenantId, {
20490
- totalTripAmount: totaltripAmount
20491
- })).then(function (_ref3) {
20492
- var _formData$advancepaym2;
20493
- let {
20494
- advanceAmount: advanceBalanceAmount
20495
- } = _ref3;
20496
- Digit.SessionStorage.set("total_amount", totaltripAmount);
20497
- Digit.SessionStorage.set("advance_amount", advanceBalanceAmount);
20498
- setTotalAmount(totaltripAmount);
20499
- setAdvanceAmounts(advanceBalanceAmount);
20500
- if (!url.includes("modify") || url.includes("modify") && advanceBalanceAmount > (formData === null || formData === void 0 ? void 0 : (_formData$advancepaym2 = formData.advancepaymentPreference) === null || _formData$advancepaym2 === void 0 ? void 0 : _formData$advancepaym2.advanceAmount)) {
20501
- setValue({
20502
- advanceAmount: advanceBalanceAmount
20503
- });
20953
+ } else {
20954
+ sessionStorage.removeItem("Digit.total_amount");
20955
+ sessionStorage.removeItem("Digit.advance_amount");
20956
+ setError(true);
20957
+ }
20958
+ }();
20959
+ if (_temp2 && _temp2.then) return _temp2.then(function () {});
20960
+ }
20961
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData2 = formData.tripData) === null || _formData$tripData2 === void 0 ? void 0 : _formData$tripData2.vehicleType) !== vehicle) {
20962
+ var _formData$tripData3, _formData$tripData3$v;
20963
+ setVehicle({
20964
+ label: formData === null || formData === void 0 ? void 0 : (_formData$tripData3 = formData.tripData) === null || _formData$tripData3 === void 0 ? void 0 : (_formData$tripData3$v = _formData$tripData3.vehicleType) === null || _formData$tripData3$v === void 0 ? void 0 : _formData$tripData3$v.capacity
20965
+ });
20966
+ }
20967
+ const trips = Number(formData === null || formData === void 0 ? void 0 : (_formData$tripData4 = formData.tripData) === null || _formData$tripData4 === void 0 ? void 0 : _formData$tripData4.noOfTrips) || 1;
20968
+ const targetTenant = normalizeTenantId((formData === null || formData === void 0 ? void 0 : (_formData$address = formData.address) === null || _formData$address === void 0 ? void 0 : (_formData$address$cit = _formData$address.city) === null || _formData$address$cit === void 0 ? void 0 : _formData$address$cit.code) || tenantId);
20969
+ let rate = formData === null || formData === void 0 ? void 0 : (_formData$tripData5 = formData.tripData) === null || _formData$tripData5 === void 0 ? void 0 : _formData$tripData5.amountPerTrip;
20970
+ const _temp3 = function (_formData$tripData6, _formData$tripData6$v, _formData$address2, _formData$address2$pr) {
20971
+ if ((rate === undefined || rate === null || rate === "") && formData !== null && formData !== void 0 && formData.propertyType && formData !== null && formData !== void 0 && formData.subtype && formData !== null && formData !== void 0 && formData.address && formData !== null && formData !== void 0 && (_formData$tripData6 = formData.tripData) !== null && _formData$tripData6 !== void 0 && (_formData$tripData6$v = _formData$tripData6.vehicleType) !== null && _formData$tripData6$v !== void 0 && _formData$tripData6$v.capacity && (formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : (_formData$address2$pr = _formData$address2.propertyLocation) === null || _formData$address2$pr === void 0 ? void 0 : _formData$address2$pr.code) === "WITHIN_ULB_LIMITS") {
20972
+ return Promise.resolve(fetchBillingSlabDetails(tenantId, formData)).then(function (billSlab) {
20973
+ if (billSlab && (billSlab !== null && billSlab !== void 0 && billSlab.price || (billSlab === null || billSlab === void 0 ? void 0 : billSlab.price) === 0)) {
20974
+ rate = billSlab.price;
20504
20975
  }
20505
- setError(false);
20506
20976
  });
20507
20977
  }
20508
20978
  }();
20509
- return _temp3 && _temp3.then ? _temp3.then(function () {}) : void 0;
20979
+ return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
20510
20980
  } catch (e) {
20511
20981
  Promise.reject(e);
20512
20982
  }
20513
20983
  })();
20514
- }, [formData.tripData.noOfTrips, formData.tripData.amountPerTrip]);
20515
- return isVehicleMenuLoading && isDsoLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", null, (formData === null || formData === void 0 ? void 0 : (_formData$tripData8 = formData.tripData) === null || _formData$tripData8 === void 0 ? void 0 : _formData$tripData8.amountPerTrip) !== 0 && (inputs === null || inputs === void 0 ? void 0 : inputs.map((input, index) => {
20984
+ }, [formData === null || formData === void 0 ? void 0 : formData.propertyType, formData === null || formData === void 0 ? void 0 : formData.subtype, formData === null || formData === void 0 ? void 0 : (_formData$address3 = formData.address) === null || _formData$address3 === void 0 ? void 0 : _formData$address3.slum, formData === null || formData === void 0 ? void 0 : (_formData$address4 = formData.address) === null || _formData$address4 === void 0 ? void 0 : (_formData$address4$ci = _formData$address4.city) === null || _formData$address4$ci === void 0 ? void 0 : _formData$address4$ci.code, formData === null || formData === void 0 ? void 0 : (_formData$tripData7 = formData.tripData) === null || _formData$tripData7 === void 0 ? void 0 : (_formData$tripData7$v = _formData$tripData7.vehicleType) === null || _formData$tripData7$v === void 0 ? void 0 : _formData$tripData7$v.capacity, formData === null || formData === void 0 ? void 0 : (_formData$tripData8 = formData.tripData) === null || _formData$tripData8 === void 0 ? void 0 : _formData$tripData8.noOfTrips, formData === null || formData === void 0 ? void 0 : (_formData$tripData9 = formData.tripData) === null || _formData$tripData9 === void 0 ? void 0 : _formData$tripData9.amountPerTrip, formData === null || formData === void 0 ? void 0 : (_formData$address5 = formData.address) === null || _formData$address5 === void 0 ? void 0 : (_formData$address5$pr = _formData$address5.propertyLocation) === null || _formData$address5$pr === void 0 ? void 0 : _formData$address5$pr.code]);
20985
+ return isVehicleMenuLoading && isDsoLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
20986
+ style: {
20987
+ display: "grid",
20988
+ gridTemplateColumns: "1fr 1fr",
20989
+ gap: "16px 24px",
20990
+ width: "100%"
20991
+ }
20992
+ }, (formData === null || formData === void 0 ? void 0 : (_formData$tripData0 = formData.tripData) === null || _formData$tripData0 === void 0 ? void 0 : _formData$tripData0.amountPerTrip) !== 0 && (inputs === null || inputs === void 0 ? void 0 : inputs.map((input, index) => {
20516
20993
  let currentValue = formData && formData[config.key] && formData[config.key][input.name];
20517
20994
  return /*#__PURE__*/React.createElement(React.Fragment, {
20518
20995
  key: index
@@ -20555,7 +21032,7 @@ const AdvanceCollection = _ref => {
20555
21032
  };
20556
21033
 
20557
21034
  const SelectTrips = _ref => {
20558
- var _formData$tripData, _formData$tripData2, _formData$tripData3, _formData$tripData4, _formData$tripData9, _formData$tripData9$v, _formData$tripData0, _formData$address3, _formData$address3$pr;
21035
+ var _formData$tripData, _formData$tripData2, _formData$address3, _formData$address4, _formData$address4$ci, _formData$tripData13, _formData$tripData13$, _formData$tripData14, _formData$address5, _formData$address5$pr;
20559
21036
  let {
20560
21037
  t,
20561
21038
  config,
@@ -20565,7 +21042,7 @@ const SelectTrips = _ref => {
20565
21042
  styles,
20566
21043
  FSMTextFieldStyle
20567
21044
  } = _ref;
20568
- const tenantId = Digit.ULBService.getCurrentTenantId();
21045
+ const tenantId = normalizeTenantId(Digit.ULBService.getCurrentTenantId());
20569
21046
  const state = Digit.ULBService.getStateId();
20570
21047
  const {
20571
21048
  pathname: url
@@ -20629,18 +21106,6 @@ const SelectTrips = _ref => {
20629
21106
  default: formData === null || formData === void 0 ? void 0 : (_formData$tripData2 = formData.tripData) === null || _formData$tripData2 === void 0 ? void 0 : _formData$tripData2.noOfTrips,
20630
21107
  disable: false,
20631
21108
  isMandatory: true
20632
- }, {
20633
- label: "ES_NEW_APPLICATION_DISTANCE_FROM_ROAD",
20634
- type: "text",
20635
- name: "distancefromroad",
20636
- default: formData === null || formData === void 0 ? void 0 : (_formData$tripData3 = formData.tripData) === null || _formData$tripData3 === void 0 ? void 0 : _formData$tripData3.distancefromroad,
20637
- isMandatory: true
20638
- }, {
20639
- label: "ES_NEW_APPLICATION_ROAD_WIDTH",
20640
- type: "text",
20641
- name: "roadWidth",
20642
- default: formData === null || formData === void 0 ? void 0 : (_formData$tripData4 = formData.tripData) === null || _formData$tripData4 === void 0 ? void 0 : _formData$tripData4.roadWidth,
20643
- isMandatory: true
20644
21109
  }];
20645
21110
  function selectVehicle(value) {
20646
21111
  setVehicle({
@@ -20652,52 +21117,65 @@ const SelectTrips = _ref => {
20652
21117
  });
20653
21118
  }
20654
21119
  function setValue(value, input) {
20655
- value && input && onSelect(config.key, {
20656
- ...formData[config.key],
20657
- [input]: value
20658
- });
21120
+ if (input !== undefined && input !== null) {
21121
+ var _formData$tripData3, _formData$tripData4, _formData$tripData5;
21122
+ const trips = input === "noOfTrips" ? Number(value) : Number(formData === null || formData === void 0 ? void 0 : (_formData$tripData3 = formData.tripData) === null || _formData$tripData3 === void 0 ? void 0 : _formData$tripData3.noOfTrips) || 1;
21123
+ const rate = Number(formData === null || formData === void 0 ? void 0 : (_formData$tripData4 = formData.tripData) === null || _formData$tripData4 === void 0 ? void 0 : _formData$tripData4.amountPerTrip);
21124
+ const totalAmount = !isNaN(trips) && !isNaN(rate) && rate > 0 ? trips * rate : formData === null || formData === void 0 ? void 0 : (_formData$tripData5 = formData.tripData) === null || _formData$tripData5 === void 0 ? void 0 : _formData$tripData5.amount;
21125
+ onSelect(config.key, {
21126
+ ...formData[config.key],
21127
+ [input]: value,
21128
+ ...(totalAmount !== undefined && totalAmount !== null ? {
21129
+ amount: totalAmount
21130
+ } : {})
21131
+ });
21132
+ }
20659
21133
  }
20660
21134
  useEffect(() => {
20661
21135
  (function () {
20662
21136
  try {
20663
- var _formData$tripData5;
20664
- if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData5 = formData.tripData) === null || _formData$tripData5 === void 0 ? void 0 : _formData$tripData5.vehicleType) !== vehicle) {
20665
- var _formData$tripData6, _formData$tripData6$v;
21137
+ var _formData$tripData6, _formData$tripData8;
21138
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData6 = formData.tripData) === null || _formData$tripData6 === void 0 ? void 0 : _formData$tripData6.vehicleType) !== vehicle) {
21139
+ var _formData$tripData7, _formData$tripData7$v;
20666
21140
  setVehicle({
20667
- label: formData === null || formData === void 0 ? void 0 : (_formData$tripData6 = formData.tripData) === null || _formData$tripData6 === void 0 ? void 0 : (_formData$tripData6$v = _formData$tripData6.vehicleType) === null || _formData$tripData6$v === void 0 ? void 0 : _formData$tripData6$v.capacity
21141
+ label: formData === null || formData === void 0 ? void 0 : (_formData$tripData7 = formData.tripData) === null || _formData$tripData7 === void 0 ? void 0 : (_formData$tripData7$v = _formData$tripData7.vehicleType) === null || _formData$tripData7$v === void 0 ? void 0 : _formData$tripData7$v.capacity
20668
21142
  });
20669
21143
  }
20670
- const _temp2 = function (_formData$address, _formData$address$pro) {
20671
- if ((formData === null || formData === void 0 ? void 0 : (_formData$address = formData.address) === null || _formData$address === void 0 ? void 0 : (_formData$address$pro = _formData$address.propertyLocation) === null || _formData$address$pro === void 0 ? void 0 : _formData$address$pro.code) === "FROM_GRAM_PANCHAYAT" && formData.tripData.noOfTrips && formData.tripData.amountPerTrip) {
20672
- setValue({
20673
- amount: formData.tripData.amountPerTrip * formData.tripData.noOfTrips
20674
- });
21144
+ const trips = Number(formData === null || formData === void 0 ? void 0 : (_formData$tripData8 = formData.tripData) === null || _formData$tripData8 === void 0 ? void 0 : _formData$tripData8.noOfTrips) || 1;
21145
+ const _temp2 = function (_formData$address, _formData$address$pro, _formData$tripData9, _formData$tripData0) {
21146
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$address = formData.address) === null || _formData$address === void 0 ? void 0 : (_formData$address$pro = _formData$address.propertyLocation) === null || _formData$address$pro === void 0 ? void 0 : _formData$address$pro.code) === "FROM_GRAM_PANCHAYAT" && (_formData$tripData9 = formData.tripData) !== null && _formData$tripData9 !== void 0 && _formData$tripData9.noOfTrips && (_formData$tripData0 = formData.tripData) !== null && _formData$tripData0 !== void 0 && _formData$tripData0.amountPerTrip) {
21147
+ var _formData$config$key;
21148
+ const calculatedAmt = Number(formData.tripData.amountPerTrip) * trips;
21149
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$config$key = formData[config.key]) === null || _formData$config$key === void 0 ? void 0 : _formData$config$key.amount) !== calculatedAmt) {
21150
+ onSelect(config.key, {
21151
+ ...formData[config.key],
21152
+ amount: calculatedAmt
21153
+ });
21154
+ }
20675
21155
  } else {
20676
- const _temp = function (_formData$tripData7, _formData$tripData7$v, _formData$address2, _formData$address2$pr) {
20677
- if (formData !== null && formData !== void 0 && formData.propertyType && formData !== null && formData !== void 0 && formData.subtype && formData !== null && formData !== void 0 && formData.address && formData !== null && formData !== void 0 && (_formData$tripData7 = formData.tripData) !== null && _formData$tripData7 !== void 0 && (_formData$tripData7$v = _formData$tripData7.vehicleType) !== null && _formData$tripData7$v !== void 0 && _formData$tripData7$v.capacity && (formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : (_formData$address2$pr = _formData$address2.propertyLocation) === null || _formData$address2$pr === void 0 ? void 0 : _formData$address2$pr.code) === "WITHIN_ULB_LIMITS") {
20678
- var _formData$tripData8;
20679
- const capacity = formData === null || formData === void 0 ? void 0 : (_formData$tripData8 = formData.tripData) === null || _formData$tripData8 === void 0 ? void 0 : _formData$tripData8.vehicleType.capacity;
20680
- const {
20681
- slum: slumDetails
20682
- } = formData.address;
20683
- const slum = slumDetails ? "YES" : "NO";
20684
- return Promise.resolve(Digit.FSMService.billingSlabSearch(tenantId, {
20685
- propertyType: formData === null || formData === void 0 ? void 0 : formData.subtype,
20686
- capacity,
20687
- slum
20688
- })).then(function (billingDetails) {
20689
- var _billingDetails$billi;
20690
- const billSlab = (billingDetails === null || billingDetails === void 0 ? void 0 : (_billingDetails$billi = billingDetails.billingSlab) === null || _billingDetails$billi === void 0 ? void 0 : _billingDetails$billi.length) && (billingDetails === null || billingDetails === void 0 ? void 0 : billingDetails.billingSlab[0]);
20691
- if (billSlab !== null && billSlab !== void 0 && billSlab.price || (billSlab === null || billSlab === void 0 ? void 0 : billSlab.price) === 0) {
20692
- setValue(billSlab.price, "amountPerTrip");
20693
- setValue(billSlab.price * formData.tripData.noOfTrips, "amount");
21156
+ const _temp = function (_formData$tripData1, _formData$tripData1$v, _formData$address2, _formData$address2$pr) {
21157
+ if (formData !== null && formData !== void 0 && formData.propertyType && formData !== null && formData !== void 0 && formData.subtype && formData !== null && formData !== void 0 && formData.address && formData !== null && formData !== void 0 && (_formData$tripData1 = formData.tripData) !== null && _formData$tripData1 !== void 0 && (_formData$tripData1$v = _formData$tripData1.vehicleType) !== null && _formData$tripData1$v !== void 0 && _formData$tripData1$v.capacity && (formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : (_formData$address2$pr = _formData$address2.propertyLocation) === null || _formData$address2$pr === void 0 ? void 0 : _formData$address2$pr.code) === "WITHIN_ULB_LIMITS") {
21158
+ return Promise.resolve(fetchBillingSlabDetails(tenantId, formData)).then(function (billSlab) {
21159
+ if (billSlab && (billSlab !== null && billSlab !== void 0 && billSlab.price || (billSlab === null || billSlab === void 0 ? void 0 : billSlab.price) === 0)) {
21160
+ var _formData$config$key2, _formData$config$key3;
21161
+ const rate = billSlab.price;
21162
+ const totalAmt = rate * trips;
21163
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$config$key2 = formData[config.key]) === null || _formData$config$key2 === void 0 ? void 0 : _formData$config$key2.amountPerTrip) !== rate || (formData === null || formData === void 0 ? void 0 : (_formData$config$key3 = formData[config.key]) === null || _formData$config$key3 === void 0 ? void 0 : _formData$config$key3.amount) !== totalAmt) {
21164
+ onSelect(config.key, {
21165
+ ...formData[config.key],
21166
+ amountPerTrip: rate,
21167
+ amount: totalAmt
21168
+ });
21169
+ Digit.SessionStorage.set("total_amount", totalAmt);
21170
+ }
20694
21171
  setError(false);
20695
21172
  } else {
20696
- setValue({
20697
- amountPerTrip: "",
20698
- amount: ""
20699
- });
20700
- setError(true);
21173
+ var _formData$tripData10, _formData$tripData11, _formData$tripData12;
21174
+ if ((formData === null || formData === void 0 ? void 0 : (_formData$tripData10 = formData.tripData) === null || _formData$tripData10 === void 0 ? void 0 : _formData$tripData10.amountPerTrip) !== undefined && (formData === null || formData === void 0 ? void 0 : (_formData$tripData11 = formData.tripData) === null || _formData$tripData11 === void 0 ? void 0 : _formData$tripData11.amountPerTrip) !== null && (formData === null || formData === void 0 ? void 0 : (_formData$tripData12 = formData.tripData) === null || _formData$tripData12 === void 0 ? void 0 : _formData$tripData12.amountPerTrip) !== "") {
21175
+ setError(false);
21176
+ } else {
21177
+ setError(false);
21178
+ }
20701
21179
  }
20702
21180
  });
20703
21181
  }
@@ -20710,10 +21188,17 @@ const SelectTrips = _ref => {
20710
21188
  Promise.reject(e);
20711
21189
  }
20712
21190
  })();
20713
- }, [formData === null || formData === void 0 ? void 0 : formData.propertyType, formData === null || formData === void 0 ? void 0 : formData.subtype, formData === null || formData === void 0 ? void 0 : formData.address, formData === null || formData === void 0 ? void 0 : (_formData$tripData9 = formData.tripData) === null || _formData$tripData9 === void 0 ? void 0 : (_formData$tripData9$v = _formData$tripData9.vehicleType) === null || _formData$tripData9$v === void 0 ? void 0 : _formData$tripData9$v.capacity, formData === null || formData === void 0 ? void 0 : (_formData$tripData0 = formData.tripData) === null || _formData$tripData0 === void 0 ? void 0 : _formData$tripData0.noOfTrips, formData === null || formData === void 0 ? void 0 : (_formData$address3 = formData.address) === null || _formData$address3 === void 0 ? void 0 : (_formData$address3$pr = _formData$address3.propertyLocation) === null || _formData$address3$pr === void 0 ? void 0 : _formData$address3$pr.code]);
20714
- return isVehicleMenuLoading && isDsoLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
21191
+ }, [formData === null || formData === void 0 ? void 0 : formData.propertyType, formData === null || formData === void 0 ? void 0 : formData.subtype, formData === null || formData === void 0 ? void 0 : (_formData$address3 = formData.address) === null || _formData$address3 === void 0 ? void 0 : _formData$address3.slum, formData === null || formData === void 0 ? void 0 : (_formData$address4 = formData.address) === null || _formData$address4 === void 0 ? void 0 : (_formData$address4$ci = _formData$address4.city) === null || _formData$address4$ci === void 0 ? void 0 : _formData$address4$ci.code, formData === null || formData === void 0 ? void 0 : (_formData$tripData13 = formData.tripData) === null || _formData$tripData13 === void 0 ? void 0 : (_formData$tripData13$ = _formData$tripData13.vehicleType) === null || _formData$tripData13$ === void 0 ? void 0 : _formData$tripData13$.capacity, formData === null || formData === void 0 ? void 0 : (_formData$tripData14 = formData.tripData) === null || _formData$tripData14 === void 0 ? void 0 : _formData$tripData14.noOfTrips, formData === null || formData === void 0 ? void 0 : (_formData$address5 = formData.address) === null || _formData$address5 === void 0 ? void 0 : (_formData$address5$pr = _formData$address5.propertyLocation) === null || _formData$address5$pr === void 0 ? void 0 : _formData$address5$pr.code]);
21192
+ return isVehicleMenuLoading && isDsoLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
21193
+ style: {
21194
+ display: "grid",
21195
+ gridTemplateColumns: "1fr 1fr",
21196
+ gap: "16px 24px",
21197
+ width: "100%"
21198
+ }
21199
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
20715
21200
  className: "card-label-smaller"
20716
- }, t("ES_NEW_APPLICATION_LOCATION_VEHICLE_REQUESTED") + " * "), /*#__PURE__*/React.createElement(Dropdown$1, {
21201
+ }, t("ES_NEW_APPLICATION_LOCATION_VEHICLE_REQUESTED") + " * "), /*#__PURE__*/React.createElement(Dropdown, {
20717
21202
  className: "form-field",
20718
21203
  style: styles,
20719
21204
  isMandatory: true,
@@ -20744,12 +21229,7 @@ const SelectTrips = _ref => {
20744
21229
  value: formData && formData[config.key] ? formData[config.key][input.name] : null
20745
21230
  }, input.validation, {
20746
21231
  disable: input.disable
20747
- }))))), billError ? /*#__PURE__*/React.createElement(CardLabelError$1, {
20748
- style: {
20749
- width: "100%",
20750
- textAlign: "center"
20751
- }
20752
- }, t("ES_APPLICATION_BILL_SLAB_ERROR")) : null);
21232
+ }))))));
20753
21233
  };
20754
21234
 
20755
21235
  const SelectLocalityOrGramPanchayat = _ref => {
@@ -20982,7 +21462,7 @@ const SelectLocalityOrGramPanchayat = _ref => {
20982
21462
  var _formData$address18, _formData$address18$l;
20983
21463
  return /*#__PURE__*/React.createElement("div", null, (propertyLocation === null || propertyLocation === void 0 ? void 0 : propertyLocation.code) === "FROM_GRAM_PANCHAYAT" ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
20984
21464
  className: "card-label-smaller"
20985
- }, t("CS_GRAM_PANCHAYAT"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
21465
+ }, t("CS_GRAM_PANCHAYAT"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown, {
20986
21466
  className: "form-field",
20987
21467
  isMandatory: true,
20988
21468
  selected: selectedGp,
@@ -21001,7 +21481,7 @@ const SelectLocalityOrGramPanchayat = _ref => {
21001
21481
  onChange: e => onNewGpChange(e.target.value)
21002
21482
  }))), villages.length > 0 && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
21003
21483
  className: "card-label-smaller"
21004
- }, t("CS_VILLAGE_NAME")), /*#__PURE__*/React.createElement(Dropdown$1, {
21484
+ }, t("CS_VILLAGE_NAME")), /*#__PURE__*/React.createElement(Dropdown, {
21005
21485
  className: "form-field",
21006
21486
  isMandatory: true,
21007
21487
  selected: selectedVillage,
@@ -21020,7 +21500,7 @@ const SelectLocalityOrGramPanchayat = _ref => {
21020
21500
  onChange: e => onChangeVillage(e.target.value)
21021
21501
  })))) : isUrcEnable && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
21022
21502
  className: "card-label-smaller"
21023
- }, t("CS_CREATECOMPLAINT_MOHALLA"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
21503
+ }, t("CS_CREATECOMPLAINT_MOHALLA"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown, {
21024
21504
  className: "form-field",
21025
21505
  isMandatory: true,
21026
21506
  selected: selectedLocality,
@@ -21049,7 +21529,7 @@ const SelectLocalityOrGramPanchayat = _ref => {
21049
21529
  t: t
21050
21530
  }, (propertyLocation === null || propertyLocation === void 0 ? void 0 : propertyLocation.code) === "WITHIN_ULB_LIMITS" ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
21051
21531
  className: "card-label-smaller"
21052
- }, `${t("CS_CREATECOMPLAINT_MOHALLA")} *`), /*#__PURE__*/React.createElement(Dropdown$1, {
21532
+ }, `${t("CS_CREATECOMPLAINT_MOHALLA")} *`), /*#__PURE__*/React.createElement(Dropdown, {
21053
21533
  className: "form-field",
21054
21534
  isMandatory: true,
21055
21535
  selected: selectedLocality,
@@ -21070,7 +21550,7 @@ const SelectLocalityOrGramPanchayat = _ref => {
21070
21550
  onChange: e => onNewLocality(e.target.value)
21071
21551
  }))) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
21072
21552
  className: "card-label-smaller"
21073
- }, `${t("CS_GRAM_PANCHAYAT")} *`), /*#__PURE__*/React.createElement(Dropdown$1, {
21553
+ }, `${t("CS_GRAM_PANCHAYAT")} *`), /*#__PURE__*/React.createElement(Dropdown, {
21074
21554
  className: "form-field",
21075
21555
  isMandatory: true,
21076
21556
  selected: selectedGp,
@@ -21091,7 +21571,7 @@ const SelectLocalityOrGramPanchayat = _ref => {
21091
21571
  onChange: e => onNewGpChange(e.target.value)
21092
21572
  })), villages.length > 0 && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
21093
21573
  className: "card-label-smaller"
21094
- }, t("CS_VILLAGE_NAME")), /*#__PURE__*/React.createElement(Dropdown$1, {
21574
+ }, t("CS_VILLAGE_NAME")), /*#__PURE__*/React.createElement(Dropdown, {
21095
21575
  className: "form-field",
21096
21576
  isMandatory: true,
21097
21577
  selected: selectedVillage,
@@ -21216,7 +21696,7 @@ const VendorConfig = function (t, module, genderMenu, update, addressHeader) {
21216
21696
  validation: {
21217
21697
  required: true
21218
21698
  },
21219
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, _extends({
21699
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, _extends({
21220
21700
  onChange: props.onChange,
21221
21701
  date: props.value
21222
21702
  }, customProps))
@@ -21231,7 +21711,7 @@ const VendorConfig = function (t, module, genderMenu, update, addressHeader) {
21231
21711
  validation: {
21232
21712
  required: true
21233
21713
  },
21234
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, _extends({
21714
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, _extends({
21235
21715
  onChange: props.onChange,
21236
21716
  date: props.value
21237
21717
  }, customProps))
@@ -21287,7 +21767,7 @@ const VendorConfig = function (t, module, genderMenu, update, addressHeader) {
21287
21767
  return age >= 18 || t("ES_VENDOR_DOB_MIN_AGE_ERROR") || "Vendor must be 18 years or older";
21288
21768
  }
21289
21769
  },
21290
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, _extends({
21770
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker, _extends({
21291
21771
  onChange: props.onChange,
21292
21772
  date: props.value
21293
21773
  }, customProps, {
@@ -21357,8 +21837,13 @@ const AddVendor = () => {
21357
21837
  clearSuccessData();
21358
21838
  clearError();
21359
21839
  }, []);
21840
+ const isFsmRoute = window.location.pathname.includes("/fsm/");
21360
21841
  const defaultValues = {
21361
- serviceType: {
21842
+ serviceType: isFsmRoute ? {
21843
+ code: "FSM",
21844
+ name: "FSM",
21845
+ i18nKey: "FSM"
21846
+ } : {
21362
21847
  code: "WT",
21363
21848
  name: "WT",
21364
21849
  i18nKey: "WT"
@@ -21731,6 +22216,16 @@ const FSMLinks = _ref2 => {
21731
22216
  Icon: CitizenTruck
21732
22217
  });
21733
22218
  } else {
22219
+ const isSuperUser = Digit.UserService.hasAccess(["SUPERUSER", "ADMIN"]) || false;
22220
+ const isFsmAdmin = Digit.UserService.hasAccess(["FSM_ADMIN", "ES_FSM_ADMIN", "FSM_CEMP"]) || isSuperUser;
22221
+ const isCreator = Digit.UserService.hasAccess(["FSM_CREATOR_EMP", "FSM_CEMP"]) || isSuperUser;
22222
+ const isEditor = Digit.UserService.hasAccess(["FSM_EDITOR_EMP"]) || isSuperUser;
22223
+ const isViewer = Digit.UserService.hasAccess(["FSM_VIEW_EMP"]) || isSuperUser;
22224
+ const isFSTPOperator = Digit.UserService.hasAccess(["FSM_EMP_FSTPO"]) || isSuperUser;
22225
+ const isReportViewer = Digit.UserService.hasAccess(["FSM_REPORT_VIEWER"]) || isSuperUser;
22226
+ const DSO = Digit.UserService.hasAccess(["FSM_DSO"]) || false;
22227
+ const COLLECTOR = Digit.UserService.hasAccess(["FSM_COLLECTOR"]) || false;
22228
+ const isGenericEmployee = !isFSTPOperator && !isCreator && !isEditor && !isViewer && !isReportViewer && !COLLECTOR && !DSO && !isFsmAdmin;
21734
22229
  return /*#__PURE__*/React.createElement("div", {
21735
22230
  className: "employee-app-container"
21736
22231
  }, /*#__PURE__*/React.createElement("div", {
@@ -21762,7 +22257,7 @@ const FSMLinks = _ref2 => {
21762
22257
  className: "link"
21763
22258
  }, /*#__PURE__*/React.createElement(Link, {
21764
22259
  to: `${matchPath}/inbox`
21765
- }, t("ES_TITLE_INBOX"))), /*#__PURE__*/React.createElement("span", {
22260
+ }, t("ES_TITLE_INBOX"))), (isCreator || isFsmAdmin || isGenericEmployee || !isFSTPOperator) && /*#__PURE__*/React.createElement("span", {
21766
22261
  className: "link"
21767
22262
  }, /*#__PURE__*/React.createElement(Link, {
21768
22263
  to: `${matchPath}/new-application/`
@@ -21770,23 +22265,27 @@ const FSMLinks = _ref2 => {
21770
22265
  className: "link"
21771
22266
  }, /*#__PURE__*/React.createElement(Link, {
21772
22267
  to: `${matchPath}/search`
21773
- }, t("ES_TITILE_SEARCH_APPLICATION"))), /*#__PURE__*/React.createElement("span", {
22268
+ }, t("ES_TITILE_SEARCH_APPLICATION"))), (isFsmAdmin || isGenericEmployee) && /*#__PURE__*/React.createElement("span", {
21774
22269
  className: "link"
21775
22270
  }, /*#__PURE__*/React.createElement(Link, {
21776
22271
  to: `${matchPath}/registry?selectedTabs=VENDOR`
21777
- }, t("ES_TITLE_FSM_REGISTRY"))), /*#__PURE__*/React.createElement("span", {
22272
+ }, t("ES_TITLE_FSM_REGISTRY"))), (isFSTPOperator || isGenericEmployee) && /*#__PURE__*/React.createElement("span", {
21778
22273
  className: "link"
21779
22274
  }, /*#__PURE__*/React.createElement(Link, {
21780
- to: `${matchPath}/fstp-operations`
21781
- }, t("ES_COMMON_FSTP_OPERATION"))), /*#__PURE__*/React.createElement("span", {
22275
+ to: `${matchPath}/fstp-inbox`
22276
+ }, t("ES_TITLE_VEHICLE_LOG"))), (isFSTPOperator || isGenericEmployee) && /*#__PURE__*/React.createElement("span", {
21782
22277
  className: "link"
21783
22278
  }, /*#__PURE__*/React.createElement(Link, {
21784
- to: `${matchPath}/fstp-inbox`
21785
- }, t("ES_TITLE_VEHICLE_LOG"))), /*#__PURE__*/React.createElement("span", {
22279
+ to: `${matchPath}/fstp-operations`
22280
+ }, t("ES_COMMON_FSTP_OPERATION"))), (isFSTPOperator || isGenericEmployee) && /*#__PURE__*/React.createElement("span", {
21786
22281
  className: "link"
21787
22282
  }, /*#__PURE__*/React.createElement(Link, {
21788
22283
  to: `${matchPath}/fstp-add-vehicle`
21789
- }, t("ES_FSM_ADD_NEW_BUTTON"))))))));
22284
+ }, t("ES_FSM_ADD_NEW_BUTTON"))), (isReportViewer || isSuperUser || isGenericEmployee) && /*#__PURE__*/React.createElement("span", {
22285
+ className: "link"
22286
+ }, /*#__PURE__*/React.createElement("a", {
22287
+ href: "/employee/report/fsm/FSMDailyDesludingReport"
22288
+ }, t("ES_TITLE_REPORTS"))))))));
21790
22289
  }
21791
22290
  };
21792
22291
  const componentsToRegister = {