@egovernments/digit-ui-libraries 1.5.0-beta.7 → 1.5.1

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.
package/dist/index.js CHANGED
@@ -35904,23 +35904,50 @@ function cloneDeep(value) {
35904
35904
 
35905
35905
  var cloneDeep_1 = cloneDeep;
35906
35906
 
35907
- var getThumbnails = function getThumbnails(ids, tenantId) {
35907
+ var getThumbnails = function getThumbnails(ids, tenantId, documents) {
35908
+ if (documents === void 0) {
35909
+ documents = [];
35910
+ }
35911
+
35908
35912
  try {
35909
35913
  tenantId = window.location.href.includes("/obps/") ? Digit.ULBService.getStateId() : tenantId;
35910
- return Promise.resolve(Digit.UploadServices.Filefetch(ids, tenantId)).then(function (res) {
35911
- if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) {
35912
- return {
35913
- thumbs: res.data.fileStoreIds.map(function (o) {
35914
- return o.url.split(",")[3] || o.url.split(",")[0];
35915
- }),
35916
- images: res.data.fileStoreIds.map(function (o) {
35917
- return Digit.Utils.getFileUrl(o.url);
35918
- })
35919
- };
35914
+
35915
+ if (window.location.href.includes("/obps/")) {
35916
+ var _documents;
35917
+
35918
+ if (((_documents = documents) === null || _documents === void 0 ? void 0 : _documents.length) > 0) {
35919
+ var _documents2;
35920
+
35921
+ var workflowsDocs = [];
35922
+ (_documents2 = documents) === null || _documents2 === void 0 ? void 0 : _documents2.map(function (doc) {
35923
+ if (doc !== null && doc !== void 0 && doc.url) {
35924
+ var thumbs = doc.url.split(",")[3] || doc.url.split(",")[0];
35925
+ workflowsDocs.push({
35926
+ thumbs: [thumbs],
35927
+ images: [Digit.Utils.getFileUrl(doc.url)]
35928
+ });
35929
+ }
35930
+ });
35931
+ return Promise.resolve(workflowsDocs === null || workflowsDocs === void 0 ? void 0 : workflowsDocs[0]);
35920
35932
  } else {
35921
- return null;
35933
+ return Promise.resolve(null);
35922
35934
  }
35923
- });
35935
+ } else {
35936
+ return Promise.resolve(Digit.UploadServices.Filefetch(ids, tenantId)).then(function (res) {
35937
+ if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) {
35938
+ return {
35939
+ thumbs: res.data.fileStoreIds.map(function (o) {
35940
+ return o.url.split(",")[3] || o.url.split(",")[0];
35941
+ }),
35942
+ images: res.data.fileStoreIds.map(function (o) {
35943
+ return Digit.Utils.getFileUrl(o.url);
35944
+ })
35945
+ };
35946
+ } else {
35947
+ return null;
35948
+ }
35949
+ });
35950
+ }
35924
35951
  } catch (e) {
35925
35952
  return Promise.reject(e);
35926
35953
  }
@@ -35928,45 +35955,86 @@ var getThumbnails = function getThumbnails(ids, tenantId) {
35928
35955
 
35929
35956
  var makeCommentsSubsidariesOfPreviousActions = function makeCommentsSubsidariesOfPreviousActions(wf) {
35930
35957
  try {
35931
- var _temp5 = function _temp5() {
35932
- var response = TimelineMap.get("tlActions");
35933
- return response;
35934
- };
35958
+ var _wf$;
35935
35959
 
35936
- var TimelineMap = new Map();
35960
+ var _temp9 = function _temp9() {
35961
+ function _temp6() {
35962
+ var response = TimelineMap.get("tlActions");
35963
+ return response;
35964
+ }
35937
35965
 
35938
- var _temp6 = _forOf(wf, function (eventHappened) {
35939
- function _temp2() {
35940
- if (eventHappened.action === "COMMENT") {
35941
- var commentAccumulator = TimelineMap.get("tlCommentStack") || [];
35942
- TimelineMap.set("tlCommentStack", [].concat(commentAccumulator, [eventHappened]));
35943
- } else {
35944
- var eventAccumulator = TimelineMap.get("tlActions") || [];
35966
+ var _temp5 = _forOf(wf, function (eventHappened) {
35967
+ function _temp4() {
35968
+ if (eventHappened.action === "COMMENT") {
35969
+ var commentAccumulator = TimelineMap.get("tlCommentStack") || [];
35970
+ TimelineMap.set("tlCommentStack", [].concat(commentAccumulator, [eventHappened]));
35971
+ } else {
35972
+ var eventAccumulator = TimelineMap.get("tlActions") || [];
35945
35973
 
35946
- var _commentAccumulator = TimelineMap.get("tlCommentStack") || [];
35974
+ var _commentAccumulator = TimelineMap.get("tlCommentStack") || [];
35947
35975
 
35948
- eventHappened.wfComments = [].concat(_commentAccumulator, eventHappened.comment ? [eventHappened] : []);
35949
- TimelineMap.set("tlActions", [].concat(eventAccumulator, [eventHappened]));
35950
- TimelineMap.delete("tlCommentStack");
35976
+ eventHappened.wfComments = [].concat(_commentAccumulator, eventHappened.comment ? [eventHappened] : []);
35977
+ TimelineMap.set("tlActions", [].concat(eventAccumulator, [eventHappened]));
35978
+ TimelineMap.delete("tlCommentStack");
35979
+ }
35951
35980
  }
35952
- }
35953
35981
 
35954
- var _temp = function () {
35955
- if (eventHappened !== null && eventHappened !== void 0 && eventHappened.documents) {
35956
- var _eventHappened$docume;
35982
+ var _temp3 = function () {
35983
+ if (eventHappened !== null && eventHappened !== void 0 && eventHappened.documents) {
35984
+ var _eventHappened$docume;
35985
+
35986
+ return Promise.resolve(getThumbnails(eventHappened === null || eventHappened === void 0 ? void 0 : (_eventHappened$docume = eventHappened.documents) === null || _eventHappened$docume === void 0 ? void 0 : _eventHappened$docume.map(function (e) {
35987
+ return e === null || e === void 0 ? void 0 : e.fileStoreId;
35988
+ }), eventHappened === null || eventHappened === void 0 ? void 0 : eventHappened.tenantId, eventHappened === null || eventHappened === void 0 ? void 0 : eventHappened.documents)).then(function (_getThumbnails) {
35989
+ eventHappened.thumbnailsToShow = _getThumbnails;
35990
+ });
35991
+ }
35992
+ }();
35993
+
35994
+ return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
35995
+ });
35996
+
35997
+ return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
35998
+ };
35999
+
36000
+ var TimelineMap = new Map();
36001
+ var tenantId = window.location.href.includes("/obps/") ? Digit.ULBService.getStateId() : wf === null || wf === void 0 ? void 0 : (_wf$ = wf[0]) === null || _wf$ === void 0 ? void 0 : _wf$.tenantId;
36002
+ var fileStoreIdsList = [];
36003
+ var res = {};
36004
+
36005
+ var _temp10 = function () {
36006
+ if (window.location.href.includes("/obps/")) {
36007
+ var _temp11 = function _temp11() {
36008
+ wf === null || wf === void 0 ? void 0 : wf.forEach(function (wfData) {
36009
+ var _wfData$documents;
36010
+
36011
+ wfData === null || wfData === void 0 ? void 0 : (_wfData$documents = wfData.documents) === null || _wfData$documents === void 0 ? void 0 : _wfData$documents.forEach(function (wfDoc) {
36012
+ if (wfDoc !== null && wfDoc !== void 0 && wfDoc.fileStoreId) wfDoc.url = res.data[wfDoc === null || wfDoc === void 0 ? void 0 : wfDoc.fileStoreId];
36013
+ });
36014
+ });
36015
+ };
36016
+
36017
+ wf === null || wf === void 0 ? void 0 : wf.map(function (wfData) {
36018
+ var _wfData$documents2;
35957
36019
 
35958
- return Promise.resolve(getThumbnails(eventHappened === null || eventHappened === void 0 ? void 0 : (_eventHappened$docume = eventHappened.documents) === null || _eventHappened$docume === void 0 ? void 0 : _eventHappened$docume.map(function (e) {
35959
- return e === null || e === void 0 ? void 0 : e.fileStoreId;
35960
- }), eventHappened === null || eventHappened === void 0 ? void 0 : eventHappened.tenantId)).then(function (_getThumbnails) {
35961
- eventHappened.thumbnailsToShow = _getThumbnails;
36020
+ wfData === null || wfData === void 0 ? void 0 : (_wfData$documents2 = wfData.documents) === null || _wfData$documents2 === void 0 ? void 0 : _wfData$documents2.map(function (wfDoc) {
36021
+ if (wfDoc !== null && wfDoc !== void 0 && wfDoc.fileStoreId) fileStoreIdsList.push(wfDoc === null || wfDoc === void 0 ? void 0 : wfDoc.fileStoreId);
35962
36022
  });
35963
- }
35964
- }();
36023
+ });
35965
36024
 
35966
- return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
35967
- });
36025
+ var _temp12 = function () {
36026
+ if ((fileStoreIdsList === null || fileStoreIdsList === void 0 ? void 0 : fileStoreIdsList.length) > 0) {
36027
+ return Promise.resolve(Digit.UploadServices.Filefetch(fileStoreIdsList, tenantId)).then(function (_Digit$UploadServices) {
36028
+ res = _Digit$UploadServices;
36029
+ });
36030
+ }
36031
+ }();
36032
+
36033
+ return _temp12 && _temp12.then ? _temp12.then(_temp11) : _temp11(_temp12);
36034
+ }
36035
+ }();
35968
36036
 
35969
- return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp5) : _temp5(_temp6));
36037
+ return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(_temp9) : _temp9(_temp10));
35970
36038
  } catch (e) {
35971
36039
  return Promise.reject(e);
35972
36040
  }
@@ -36026,13 +36094,13 @@ var WorkflowService = {
36026
36094
 
36027
36095
  var _exit = false;
36028
36096
 
36029
- function _temp14(_result2) {
36097
+ function _temp20(_result2) {
36030
36098
  return _exit ? _result2 : {};
36031
36099
  }
36032
36100
 
36033
36101
  var businessServiceResponse = _Digit$WorkflowServic === null || _Digit$WorkflowServic === void 0 ? void 0 : (_Digit$WorkflowServic2 = _Digit$WorkflowServic.BusinessServices[0]) === null || _Digit$WorkflowServic2 === void 0 ? void 0 : _Digit$WorkflowServic2.states;
36034
36102
 
36035
- var _temp13 = function () {
36103
+ var _temp19 = function () {
36036
36104
  if (workflow && workflow.ProcessInstances) {
36037
36105
  var _processInstances$, _businessServiceRespo;
36038
36106
 
@@ -36113,7 +36181,7 @@ var WorkflowService = {
36113
36181
  return function () {
36114
36182
  if (processInstances.length > 0) {
36115
36183
  return Promise.resolve(makeCommentsSubsidariesOfPreviousActions(processInstances)).then(function (TLEnrichedWithWorflowData) {
36116
- function _temp12() {
36184
+ function _temp18() {
36117
36185
  var _workflow$ProcessInst, _workflow$ProcessInst2;
36118
36186
 
36119
36187
  var nextActions = actionRolePair;
@@ -36181,17 +36249,17 @@ var WorkflowService = {
36181
36249
  return checkPoint;
36182
36250
  });
36183
36251
 
36184
- var _temp11 = function () {
36252
+ var _temp17 = function () {
36185
36253
  if (getTripData) {
36186
- var _temp15 = _catch(function () {
36254
+ var _temp21 = _catch(function () {
36187
36255
  var filters = {
36188
36256
  businessService: 'FSM_VEHICLE_TRIP',
36189
36257
  refernceNos: id
36190
36258
  };
36191
36259
  return Promise.resolve(Digit.FSMService.vehicleSearch(tenantId, filters)).then(function (tripSearchResp) {
36192
- var _temp9 = function () {
36260
+ var _temp15 = function () {
36193
36261
  if (tripSearchResp && tripSearchResp.vehicleTrip && tripSearchResp.vehicleTrip.length) {
36194
- var _temp16 = function _temp16() {
36262
+ var _temp22 = function _temp22() {
36195
36263
  var tripTimeline = [];
36196
36264
  var disposalInProgressPosition = timeline.findIndex(function (data) {
36197
36265
  return data.status === "DISPOSAL_IN_PROGRESS";
@@ -36230,7 +36298,7 @@ var WorkflowService = {
36230
36298
  var _waitingForDisposedAction = [];
36231
36299
  var _disposedAction = [];
36232
36300
 
36233
- var _temp17 = _forOf(tripSearchResp.vehicleTrip, function (data) {
36301
+ var _temp23 = _forOf(tripSearchResp.vehicleTrip, function (data) {
36234
36302
  return Promise.resolve(Digit.WorkflowService.getByBusinessId(tenantId, data.applicationNo)).then(function (resp) {
36235
36303
  var _resp$ProcessInstance;
36236
36304
 
@@ -36300,19 +36368,19 @@ var WorkflowService = {
36300
36368
  });
36301
36369
  });
36302
36370
 
36303
- return _temp17 && _temp17.then ? _temp17.then(_temp16) : _temp16(_temp17);
36371
+ return _temp23 && _temp23.then ? _temp23.then(_temp22) : _temp22(_temp23);
36304
36372
  }
36305
36373
  }();
36306
36374
 
36307
- if (_temp9 && _temp9.then) return _temp9.then(function () {});
36375
+ if (_temp15 && _temp15.then) return _temp15.then(function () {});
36308
36376
  });
36309
36377
  }, function () {});
36310
36378
 
36311
- if (_temp15 && _temp15.then) return _temp15.then(function () {});
36379
+ if (_temp21 && _temp21.then) return _temp21.then(function () {});
36312
36380
  }
36313
36381
  }();
36314
36382
 
36315
- return _temp11 && _temp11.then ? _temp11.then(_temp12) : _temp12(_temp11);
36383
+ return _temp17 && _temp17.then ? _temp17.then(_temp18) : _temp18(_temp17);
36316
36384
  });
36317
36385
  }
36318
36386
  }();
@@ -36321,7 +36389,7 @@ var WorkflowService = {
36321
36389
  }
36322
36390
  }();
36323
36391
 
36324
- return _temp13 && _temp13.then ? _temp13.then(_temp14) : _temp14(_temp13);
36392
+ return _temp19 && _temp19.then ? _temp19.then(_temp20) : _temp20(_temp19);
36325
36393
  });
36326
36394
  });
36327
36395
  } catch (e) {
@@ -37574,200 +37642,1260 @@ var useQueryParams = function useQueryParams() {
37574
37642
  return params;
37575
37643
  };
37576
37644
 
37577
- var useOnClickOutside = function useOnClickOutside(ref, handler, isActive, eventParam) {
37578
- if (eventParam === void 0) {
37579
- eventParam = false;
37580
- }
37645
+ var b$1 = "function" === typeof Symbol && Symbol.for,
37646
+ c = b$1 ? Symbol.for("react.element") : 60103,
37647
+ d = b$1 ? Symbol.for("react.portal") : 60106,
37648
+ e = b$1 ? Symbol.for("react.fragment") : 60107,
37649
+ f = b$1 ? Symbol.for("react.strict_mode") : 60108,
37650
+ g = b$1 ? Symbol.for("react.profiler") : 60114,
37651
+ h = b$1 ? Symbol.for("react.provider") : 60109,
37652
+ k$1 = b$1 ? Symbol.for("react.context") : 60110,
37653
+ l = b$1 ? Symbol.for("react.async_mode") : 60111,
37654
+ m = b$1 ? Symbol.for("react.concurrent_mode") : 60111,
37655
+ n = b$1 ? Symbol.for("react.forward_ref") : 60112,
37656
+ p = b$1 ? Symbol.for("react.suspense") : 60113,
37657
+ q = b$1 ? Symbol.for("react.suspense_list") : 60120,
37658
+ r = b$1 ? Symbol.for("react.memo") : 60115,
37659
+ t = b$1 ? Symbol.for("react.lazy") : 60116,
37660
+ v = b$1 ? Symbol.for("react.block") : 60121,
37661
+ w = b$1 ? Symbol.for("react.fundamental") : 60117,
37662
+ x = b$1 ? Symbol.for("react.responder") : 60118,
37663
+ y$1 = b$1 ? Symbol.for("react.scope") : 60119;
37664
+
37665
+ function z(a) {
37666
+ if ("object" === typeof a && null !== a) {
37667
+ var u = a.$$typeof;
37668
+
37669
+ switch (u) {
37670
+ case c:
37671
+ switch (a = a.type, a) {
37672
+ case l:
37673
+ case m:
37674
+ case e:
37675
+ case g:
37676
+ case f:
37677
+ case p:
37678
+ return a;
37581
37679
 
37582
- React.useEffect(function () {
37583
- if (isActive) {
37584
- document.addEventListener("click", handleClickOutSide, eventParam);
37585
- } else {
37586
- document.removeEventListener("click", handleClickOutSide, eventParam);
37587
- }
37680
+ default:
37681
+ switch (a = a && a.$$typeof, a) {
37682
+ case k$1:
37683
+ case n:
37684
+ case t:
37685
+ case r:
37686
+ case h:
37687
+ return a;
37588
37688
 
37589
- return function () {
37590
- document.removeEventListener("click", handleClickOutSide, eventParam);
37591
- };
37592
- }, [isActive]);
37689
+ default:
37690
+ return u;
37691
+ }
37593
37692
 
37594
- var handleClickOutSide = function handleClickOutSide(event) {
37595
- if (ref.current && ref.current.contains(event.target)) {
37596
- return;
37693
+ }
37694
+
37695
+ case d:
37696
+ return u;
37597
37697
  }
37698
+ }
37699
+ }
37598
37700
 
37599
- handler(event);
37600
- };
37601
- };
37701
+ function A(a) {
37702
+ return z(a) === m;
37703
+ }
37602
37704
 
37603
- var _excluded = ["businessService"],
37604
- _excluded2 = ["tenantId", "businessService"],
37605
- _excluded3 = ["tenantId", "businessService"];
37606
- var useFetchCitizenBillsForBuissnessService = function useFetchCitizenBillsForBuissnessService(_ref, config) {
37607
- var _Digit$UserService$ge;
37705
+ var AsyncMode = l;
37706
+ var ConcurrentMode = m;
37707
+ var ContextConsumer = k$1;
37708
+ var ContextProvider = h;
37709
+ var Element = c;
37710
+ var ForwardRef = n;
37711
+ var Fragment = e;
37712
+ var Lazy = t;
37713
+ var Memo = r;
37714
+ var Portal = d;
37715
+ var Profiler = g;
37716
+ var StrictMode = f;
37717
+ var Suspense = p;
37608
37718
 
37609
- var businessService = _ref.businessService,
37610
- filters = _objectWithoutPropertiesLoose(_ref, _excluded);
37719
+ var isAsyncMode = function isAsyncMode(a) {
37720
+ return A(a) || z(a) === l;
37721
+ };
37611
37722
 
37612
- if (config === void 0) {
37613
- config = {};
37614
- }
37723
+ var isConcurrentMode = A;
37615
37724
 
37616
- var queryClient = reactQuery.useQueryClient();
37725
+ var isContextConsumer = function isContextConsumer(a) {
37726
+ return z(a) === k$1;
37727
+ };
37617
37728
 
37618
- var _ref2 = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {},
37619
- mobileNumber = _ref2.mobileNumber,
37620
- tenantId = _ref2.tenantId;
37729
+ var isContextProvider = function isContextProvider(a) {
37730
+ return z(a) === h;
37731
+ };
37621
37732
 
37622
- var params = _extends({
37623
- mobileNumber: mobileNumber,
37624
- businessService: businessService
37625
- }, filters);
37733
+ var isElement = function isElement(a) {
37734
+ return "object" === typeof a && null !== a && a.$$typeof === c;
37735
+ };
37626
37736
 
37627
- if (!params["mobileNumber"]) delete params["mobileNumber"];
37737
+ var isForwardRef = function isForwardRef(a) {
37738
+ return z(a) === n;
37739
+ };
37628
37740
 
37629
- var _useQuery = reactQuery.useQuery(["citizenBillsForBuisnessService", businessService, _extends({}, params)], function () {
37630
- return Digit.PaymentService.fetchBill(tenantId, _extends({}, params));
37631
- }, _extends({
37632
- refetchOnMount: true,
37633
- retry: false
37634
- }, config)),
37635
- isLoading = _useQuery.isLoading,
37636
- error = _useQuery.error,
37637
- isError = _useQuery.isError,
37638
- data = _useQuery.data,
37639
- status = _useQuery.status;
37741
+ var isFragment = function isFragment(a) {
37742
+ return z(a) === e;
37743
+ };
37640
37744
 
37641
- return {
37642
- isLoading: isLoading,
37643
- error: error,
37644
- isError: isError,
37645
- data: data,
37646
- status: status,
37647
- revalidate: function revalidate() {
37648
- return queryClient.invalidateQueries(["citizenBillsForBuisnessService", businessService]);
37649
- }
37650
- };
37745
+ var isLazy = function isLazy(a) {
37746
+ return z(a) === t;
37651
37747
  };
37652
- var useFetchBillsForBuissnessService = function useFetchBillsForBuissnessService(_ref3, config) {
37653
- var _Digit$UserService$ge2, _Digit$UserService$ge3;
37654
37748
 
37655
- var tenantId = _ref3.tenantId,
37656
- businessService = _ref3.businessService,
37657
- filters = _objectWithoutPropertiesLoose(_ref3, _excluded2);
37749
+ var isMemo = function isMemo(a) {
37750
+ return z(a) === r;
37751
+ };
37658
37752
 
37659
- if (config === void 0) {
37660
- config = {};
37661
- }
37753
+ var isPortal = function isPortal(a) {
37754
+ return z(a) === d;
37755
+ };
37662
37756
 
37663
- var queryClient = reactQuery.useQueryClient();
37664
- var isPTAccessDone = sessionStorage.getItem("IsPTAccessDone");
37757
+ var isProfiler = function isProfiler(a) {
37758
+ return z(a) === g;
37759
+ };
37665
37760
 
37666
- var params = _extends({
37667
- businessService: businessService
37668
- }, filters);
37761
+ var isStrictMode = function isStrictMode(a) {
37762
+ return z(a) === f;
37763
+ };
37669
37764
 
37670
- var _tenantId = tenantId || ((_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : (_Digit$UserService$ge3 = _Digit$UserService$ge2.info) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.tenantId);
37765
+ var isSuspense = function isSuspense(a) {
37766
+ return z(a) === p;
37767
+ };
37671
37768
 
37672
- var _useQuery2 = reactQuery.useQuery(["billsForBuisnessService", businessService, _extends({}, filters), config, isPTAccessDone], function () {
37673
- return Digit.PaymentService.fetchBill(_tenantId, params);
37674
- }, _extends({
37675
- retry: function retry(count, err) {
37676
- return false;
37677
- }
37678
- }, config)),
37679
- isLoading = _useQuery2.isLoading,
37680
- error = _useQuery2.error,
37681
- isError = _useQuery2.isError,
37682
- data = _useQuery2.data,
37683
- status = _useQuery2.status;
37769
+ var isValidElementType = function isValidElementType(a) {
37770
+ return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k$1 || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y$1 || a.$$typeof === v);
37771
+ };
37684
37772
 
37685
- return {
37686
- isLoading: isLoading,
37687
- error: error,
37688
- isError: isError,
37689
- data: data,
37690
- status: status,
37691
- revalidate: function revalidate() {
37692
- return queryClient.invalidateQueries(["billsForBuisnessService", businessService]);
37693
- }
37694
- };
37773
+ var typeOf = z;
37774
+ var reactIs_production_min = {
37775
+ AsyncMode: AsyncMode,
37776
+ ConcurrentMode: ConcurrentMode,
37777
+ ContextConsumer: ContextConsumer,
37778
+ ContextProvider: ContextProvider,
37779
+ Element: Element,
37780
+ ForwardRef: ForwardRef,
37781
+ Fragment: Fragment,
37782
+ Lazy: Lazy,
37783
+ Memo: Memo,
37784
+ Portal: Portal,
37785
+ Profiler: Profiler,
37786
+ StrictMode: StrictMode,
37787
+ Suspense: Suspense,
37788
+ isAsyncMode: isAsyncMode,
37789
+ isConcurrentMode: isConcurrentMode,
37790
+ isContextConsumer: isContextConsumer,
37791
+ isContextProvider: isContextProvider,
37792
+ isElement: isElement,
37793
+ isForwardRef: isForwardRef,
37794
+ isFragment: isFragment,
37795
+ isLazy: isLazy,
37796
+ isMemo: isMemo,
37797
+ isPortal: isPortal,
37798
+ isProfiler: isProfiler,
37799
+ isStrictMode: isStrictMode,
37800
+ isSuspense: isSuspense,
37801
+ isValidElementType: isValidElementType,
37802
+ typeOf: typeOf
37695
37803
  };
37696
- var useFetchPayment = function useFetchPayment(_ref4, config) {
37697
- var tenantId = _ref4.tenantId,
37698
- consumerCode = _ref4.consumerCode,
37699
- businessService = _ref4.businessService;
37700
- var queryClient = reactQuery.useQueryClient();
37701
37804
 
37702
- var fetchBill = function fetchBill() {
37703
- try {
37704
- if (businessService !== null && businessService !== void 0 && businessService.includes("PT")) {
37705
- return Promise.resolve(Digit.PaymentService.fetchBill(tenantId, {
37706
- consumerCode: consumerCode,
37707
- businessService: businessService
37708
- })).then(function (fetchedBill) {
37709
- var _fetchedBill$Bill, _fetchedBill$Bill$, _fetchedBill$Bill$$bi, _fetchedBill$Bill$$bi2, _fetchedBill$Bill3, _fetchedBill$Bill3$, _fetchedBill$Bill3$$b;
37805
+ var reactIs_development = createCommonjsModule(function (module, exports) {
37710
37806
 
37711
- var billdetail = (fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill = fetchedBill.Bill) === null || _fetchedBill$Bill === void 0 ? void 0 : (_fetchedBill$Bill$ = _fetchedBill$Bill[0]) === null || _fetchedBill$Bill$ === void 0 ? void 0 : (_fetchedBill$Bill$$bi = _fetchedBill$Bill$.billDetails) === null || _fetchedBill$Bill$$bi === void 0 ? void 0 : (_fetchedBill$Bill$$bi2 = _fetchedBill$Bill$$bi.sort(function (a, b) {
37712
- return b.fromPeriod - a.fromPeriod;
37713
- })) === null || _fetchedBill$Bill$$bi2 === void 0 ? void 0 : _fetchedBill$Bill$$bi2[0]) || {};
37714
- fetchedBill.Bill[0].billDetails = fetchedBill.Bill[0].billDetails.map(function (ele) {
37715
- var _fetchedBill$Bill2, _fetchedBill$Bill2$;
37807
+ if (process.env.NODE_ENV !== "production") {
37808
+ (function () {
37716
37809
 
37717
- return _extends({}, ele, {
37718
- currentBillNo: fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill2 = fetchedBill.Bill) === null || _fetchedBill$Bill2 === void 0 ? void 0 : (_fetchedBill$Bill2$ = _fetchedBill$Bill2[0]) === null || _fetchedBill$Bill2$ === void 0 ? void 0 : _fetchedBill$Bill2$.billNumber,
37719
- currentExpiryDate: billdetail === null || billdetail === void 0 ? void 0 : billdetail.expiryDate
37720
- });
37721
- });
37810
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
37811
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
37812
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
37813
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
37814
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
37815
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
37816
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
37817
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
37818
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
37819
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
37820
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
37821
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
37822
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
37823
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
37824
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
37825
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
37826
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
37827
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
37828
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
37829
+
37830
+ function isValidElementType(type) {
37831
+ return typeof type === 'string' || typeof type === 'function' || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
37832
+ }
37833
+
37834
+ function typeOf(object) {
37835
+ if (typeof object === 'object' && object !== null) {
37836
+ var $$typeof = object.$$typeof;
37837
+
37838
+ switch ($$typeof) {
37839
+ case REACT_ELEMENT_TYPE:
37840
+ var type = object.type;
37841
+
37842
+ switch (type) {
37843
+ case REACT_ASYNC_MODE_TYPE:
37844
+ case REACT_CONCURRENT_MODE_TYPE:
37845
+ case REACT_FRAGMENT_TYPE:
37846
+ case REACT_PROFILER_TYPE:
37847
+ case REACT_STRICT_MODE_TYPE:
37848
+ case REACT_SUSPENSE_TYPE:
37849
+ return type;
37722
37850
 
37723
- if (fetchedBill && (fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill3 = fetchedBill.Bill) === null || _fetchedBill$Bill3 === void 0 ? void 0 : (_fetchedBill$Bill3$ = _fetchedBill$Bill3[0]) === null || _fetchedBill$Bill3$ === void 0 ? void 0 : (_fetchedBill$Bill3$$b = _fetchedBill$Bill3$.billDetails) === null || _fetchedBill$Bill3$$b === void 0 ? void 0 : _fetchedBill$Bill3$$b.length) > 1) {
37724
- var _fetchedBill$Bill4, _fetchedBill$Bill4$, _fetchedBill$Bill4$$b;
37851
+ default:
37852
+ var $$typeofType = type && type.$$typeof;
37725
37853
 
37726
- fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill4 = fetchedBill.Bill) === null || _fetchedBill$Bill4 === void 0 ? void 0 : (_fetchedBill$Bill4$ = _fetchedBill$Bill4[0]) === null || _fetchedBill$Bill4$ === void 0 ? void 0 : (_fetchedBill$Bill4$$b = _fetchedBill$Bill4$.billDetails) === null || _fetchedBill$Bill4$$b === void 0 ? void 0 : _fetchedBill$Bill4$$b.map(function (billdet) {
37727
- try {
37728
- return Promise.resolve(Digit.PaymentService.searchBill(tenantId, {
37729
- consumerCode: consumerCode,
37730
- fromPeriod: billdet === null || billdet === void 0 ? void 0 : billdet.fromPeriod,
37731
- toPeriod: billdet === null || billdet === void 0 ? void 0 : billdet.toPeriod,
37732
- service: businessService,
37733
- retrieveOldest: true
37734
- })).then(function (searchBill) {
37735
- var _searchBill$Bill, _searchBill$Bill$, _searchBill$Bill$$bil, _searchBill$Bill$$bil2, _searchBill$Bill2, _searchBill$Bill2$;
37854
+ switch ($$typeofType) {
37855
+ case REACT_CONTEXT_TYPE:
37856
+ case REACT_FORWARD_REF_TYPE:
37857
+ case REACT_LAZY_TYPE:
37858
+ case REACT_MEMO_TYPE:
37859
+ case REACT_PROVIDER_TYPE:
37860
+ return $$typeofType;
37861
+
37862
+ default:
37863
+ return $$typeof;
37864
+ }
37736
37865
 
37737
- billdet.expiryDate = searchBill === null || searchBill === void 0 ? void 0 : (_searchBill$Bill = searchBill.Bill) === null || _searchBill$Bill === void 0 ? void 0 : (_searchBill$Bill$ = _searchBill$Bill[0]) === null || _searchBill$Bill$ === void 0 ? void 0 : (_searchBill$Bill$$bil = _searchBill$Bill$.billDetails) === null || _searchBill$Bill$$bil === void 0 ? void 0 : (_searchBill$Bill$$bil2 = _searchBill$Bill$$bil[0]) === null || _searchBill$Bill$$bil2 === void 0 ? void 0 : _searchBill$Bill$$bil2.expiryDate;
37738
- billdet.billNumber = searchBill === null || searchBill === void 0 ? void 0 : (_searchBill$Bill2 = searchBill.Bill) === null || _searchBill$Bill2 === void 0 ? void 0 : (_searchBill$Bill2$ = _searchBill$Bill2[0]) === null || _searchBill$Bill2$ === void 0 ? void 0 : _searchBill$Bill2$.billNumber;
37739
- });
37740
- } catch (e) {
37741
- return Promise.reject(e);
37742
37866
  }
37743
- });
37867
+
37868
+ case REACT_PORTAL_TYPE:
37869
+ return $$typeof;
37744
37870
  }
37871
+ }
37745
37872
 
37746
- return fetchedBill;
37747
- });
37748
- } else {
37749
- return Promise.resolve(Digit.PaymentService.fetchBill(tenantId, {
37750
- consumerCode: consumerCode,
37751
- businessService: businessService
37752
- }));
37873
+ return undefined;
37753
37874
  }
37754
- } catch (e) {
37755
- return Promise.reject(e);
37756
- }
37757
- };
37758
37875
 
37759
- var retry = function retry(failureCount, error) {
37760
- var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
37876
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
37877
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
37878
+ var ContextConsumer = REACT_CONTEXT_TYPE;
37879
+ var ContextProvider = REACT_PROVIDER_TYPE;
37880
+ var Element = REACT_ELEMENT_TYPE;
37881
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
37882
+ var Fragment = REACT_FRAGMENT_TYPE;
37883
+ var Lazy = REACT_LAZY_TYPE;
37884
+ var Memo = REACT_MEMO_TYPE;
37885
+ var Portal = REACT_PORTAL_TYPE;
37886
+ var Profiler = REACT_PROFILER_TYPE;
37887
+ var StrictMode = REACT_STRICT_MODE_TYPE;
37888
+ var Suspense = REACT_SUSPENSE_TYPE;
37889
+ var hasWarnedAboutDeprecatedIsAsyncMode = false;
37761
37890
 
37762
- if ((error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.code) === "EG_BS_BILL_NO_DEMANDS_FOUND") return false;else return failureCount < 3;
37763
- };
37891
+ function isAsyncMode(object) {
37892
+ {
37893
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
37894
+ hasWarnedAboutDeprecatedIsAsyncMode = true;
37895
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
37896
+ }
37897
+ }
37898
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
37899
+ }
37764
37900
 
37765
- var queryData = reactQuery.useQuery(["paymentFetchDetails", tenantId, consumerCode, businessService], function () {
37766
- return fetchBill();
37767
- }, _extends({
37768
- retry: retry
37769
- }, config));
37770
- return _extends({}, queryData, {
37901
+ function isConcurrentMode(object) {
37902
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
37903
+ }
37904
+
37905
+ function isContextConsumer(object) {
37906
+ return typeOf(object) === REACT_CONTEXT_TYPE;
37907
+ }
37908
+
37909
+ function isContextProvider(object) {
37910
+ return typeOf(object) === REACT_PROVIDER_TYPE;
37911
+ }
37912
+
37913
+ function isElement(object) {
37914
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
37915
+ }
37916
+
37917
+ function isForwardRef(object) {
37918
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
37919
+ }
37920
+
37921
+ function isFragment(object) {
37922
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
37923
+ }
37924
+
37925
+ function isLazy(object) {
37926
+ return typeOf(object) === REACT_LAZY_TYPE;
37927
+ }
37928
+
37929
+ function isMemo(object) {
37930
+ return typeOf(object) === REACT_MEMO_TYPE;
37931
+ }
37932
+
37933
+ function isPortal(object) {
37934
+ return typeOf(object) === REACT_PORTAL_TYPE;
37935
+ }
37936
+
37937
+ function isProfiler(object) {
37938
+ return typeOf(object) === REACT_PROFILER_TYPE;
37939
+ }
37940
+
37941
+ function isStrictMode(object) {
37942
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
37943
+ }
37944
+
37945
+ function isSuspense(object) {
37946
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
37947
+ }
37948
+
37949
+ exports.AsyncMode = AsyncMode;
37950
+ exports.ConcurrentMode = ConcurrentMode;
37951
+ exports.ContextConsumer = ContextConsumer;
37952
+ exports.ContextProvider = ContextProvider;
37953
+ exports.Element = Element;
37954
+ exports.ForwardRef = ForwardRef;
37955
+ exports.Fragment = Fragment;
37956
+ exports.Lazy = Lazy;
37957
+ exports.Memo = Memo;
37958
+ exports.Portal = Portal;
37959
+ exports.Profiler = Profiler;
37960
+ exports.StrictMode = StrictMode;
37961
+ exports.Suspense = Suspense;
37962
+ exports.isAsyncMode = isAsyncMode;
37963
+ exports.isConcurrentMode = isConcurrentMode;
37964
+ exports.isContextConsumer = isContextConsumer;
37965
+ exports.isContextProvider = isContextProvider;
37966
+ exports.isElement = isElement;
37967
+ exports.isForwardRef = isForwardRef;
37968
+ exports.isFragment = isFragment;
37969
+ exports.isLazy = isLazy;
37970
+ exports.isMemo = isMemo;
37971
+ exports.isPortal = isPortal;
37972
+ exports.isProfiler = isProfiler;
37973
+ exports.isStrictMode = isStrictMode;
37974
+ exports.isSuspense = isSuspense;
37975
+ exports.isValidElementType = isValidElementType;
37976
+ exports.typeOf = typeOf;
37977
+ })();
37978
+ }
37979
+ });
37980
+
37981
+ var reactIs = createCommonjsModule(function (module) {
37982
+
37983
+ if (process.env.NODE_ENV === 'production') {
37984
+ module.exports = reactIs_production_min;
37985
+ } else {
37986
+ module.exports = reactIs_development;
37987
+ }
37988
+ });
37989
+
37990
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
37991
+ var ReactPropTypesSecret_1 = ReactPropTypesSecret;
37992
+
37993
+ var has = Function.call.bind(Object.prototype.hasOwnProperty);
37994
+
37995
+ var printWarning = function printWarning() {};
37996
+
37997
+ if (process.env.NODE_ENV !== 'production') {
37998
+ var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
37999
+ var loggedTypeFailures = {};
38000
+ var has$1 = has;
38001
+
38002
+ printWarning = function printWarning(text) {
38003
+ var message = 'Warning: ' + text;
38004
+
38005
+ if (typeof console !== 'undefined') {
38006
+ console.error(message);
38007
+ }
38008
+
38009
+ try {
38010
+ throw new Error(message);
38011
+ } catch (x) {}
38012
+ };
38013
+ }
38014
+
38015
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
38016
+ if (process.env.NODE_ENV !== 'production') {
38017
+ for (var typeSpecName in typeSpecs) {
38018
+ if (has$1(typeSpecs, typeSpecName)) {
38019
+ var error;
38020
+
38021
+ try {
38022
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
38023
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
38024
+ err.name = 'Invariant Violation';
38025
+ throw err;
38026
+ }
38027
+
38028
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
38029
+ } catch (ex) {
38030
+ error = ex;
38031
+ }
38032
+
38033
+ if (error && !(error instanceof Error)) {
38034
+ printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
38035
+ }
38036
+
38037
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
38038
+ loggedTypeFailures[error.message] = true;
38039
+ var stack = getStack ? getStack() : '';
38040
+ printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
38041
+ }
38042
+ }
38043
+ }
38044
+ }
38045
+ }
38046
+
38047
+ checkPropTypes.resetWarningCache = function () {
38048
+ if (process.env.NODE_ENV !== 'production') {
38049
+ loggedTypeFailures = {};
38050
+ }
38051
+ };
38052
+
38053
+ var checkPropTypes_1 = checkPropTypes;
38054
+
38055
+ var printWarning$1 = function printWarning() {};
38056
+
38057
+ if (process.env.NODE_ENV !== 'production') {
38058
+ printWarning$1 = function printWarning(text) {
38059
+ var message = 'Warning: ' + text;
38060
+
38061
+ if (typeof console !== 'undefined') {
38062
+ console.error(message);
38063
+ }
38064
+
38065
+ try {
38066
+ throw new Error(message);
38067
+ } catch (x) {}
38068
+ };
38069
+ }
38070
+
38071
+ function emptyFunctionThatReturnsNull() {
38072
+ return null;
38073
+ }
38074
+
38075
+ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) {
38076
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
38077
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
38078
+
38079
+ function getIteratorFn(maybeIterable) {
38080
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
38081
+
38082
+ if (typeof iteratorFn === 'function') {
38083
+ return iteratorFn;
38084
+ }
38085
+ }
38086
+
38087
+ var ANONYMOUS = '<<anonymous>>';
38088
+ var ReactPropTypes = {
38089
+ array: createPrimitiveTypeChecker('array'),
38090
+ bigint: createPrimitiveTypeChecker('bigint'),
38091
+ bool: createPrimitiveTypeChecker('boolean'),
38092
+ func: createPrimitiveTypeChecker('function'),
38093
+ number: createPrimitiveTypeChecker('number'),
38094
+ object: createPrimitiveTypeChecker('object'),
38095
+ string: createPrimitiveTypeChecker('string'),
38096
+ symbol: createPrimitiveTypeChecker('symbol'),
38097
+ any: createAnyTypeChecker(),
38098
+ arrayOf: createArrayOfTypeChecker,
38099
+ element: createElementTypeChecker(),
38100
+ elementType: createElementTypeTypeChecker(),
38101
+ instanceOf: createInstanceTypeChecker,
38102
+ node: createNodeChecker(),
38103
+ objectOf: createObjectOfTypeChecker,
38104
+ oneOf: createEnumTypeChecker,
38105
+ oneOfType: createUnionTypeChecker,
38106
+ shape: createShapeTypeChecker,
38107
+ exact: createStrictShapeTypeChecker
38108
+ };
38109
+
38110
+ function is(x, y) {
38111
+ if (x === y) {
38112
+ return x !== 0 || 1 / x === 1 / y;
38113
+ } else {
38114
+ return x !== x && y !== y;
38115
+ }
38116
+ }
38117
+
38118
+ function PropTypeError(message, data) {
38119
+ this.message = message;
38120
+ this.data = data && typeof data === 'object' ? data : {};
38121
+ this.stack = '';
38122
+ }
38123
+
38124
+ PropTypeError.prototype = Error.prototype;
38125
+
38126
+ function createChainableTypeChecker(validate) {
38127
+ if (process.env.NODE_ENV !== 'production') {
38128
+ var manualPropTypeCallCache = {};
38129
+ var manualPropTypeWarningCount = 0;
38130
+ }
38131
+
38132
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
38133
+ componentName = componentName || ANONYMOUS;
38134
+ propFullName = propFullName || propName;
38135
+
38136
+ if (secret !== ReactPropTypesSecret_1) {
38137
+ if (throwOnDirectAccess) {
38138
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
38139
+ err.name = 'Invariant Violation';
38140
+ throw err;
38141
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
38142
+ var cacheKey = componentName + ':' + propName;
38143
+
38144
+ if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) {
38145
+ printWarning$1('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
38146
+ manualPropTypeCallCache[cacheKey] = true;
38147
+ manualPropTypeWarningCount++;
38148
+ }
38149
+ }
38150
+ }
38151
+
38152
+ if (props[propName] == null) {
38153
+ if (isRequired) {
38154
+ if (props[propName] === null) {
38155
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
38156
+ }
38157
+
38158
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
38159
+ }
38160
+
38161
+ return null;
38162
+ } else {
38163
+ return validate(props, propName, componentName, location, propFullName);
38164
+ }
38165
+ }
38166
+
38167
+ var chainedCheckType = checkType.bind(null, false);
38168
+ chainedCheckType.isRequired = checkType.bind(null, true);
38169
+ return chainedCheckType;
38170
+ }
38171
+
38172
+ function createPrimitiveTypeChecker(expectedType) {
38173
+ function validate(props, propName, componentName, location, propFullName, secret) {
38174
+ var propValue = props[propName];
38175
+ var propType = getPropType(propValue);
38176
+
38177
+ if (propType !== expectedType) {
38178
+ var preciseType = getPreciseType(propValue);
38179
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
38180
+ expectedType: expectedType
38181
+ });
38182
+ }
38183
+
38184
+ return null;
38185
+ }
38186
+
38187
+ return createChainableTypeChecker(validate);
38188
+ }
38189
+
38190
+ function createAnyTypeChecker() {
38191
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
38192
+ }
38193
+
38194
+ function createArrayOfTypeChecker(typeChecker) {
38195
+ function validate(props, propName, componentName, location, propFullName) {
38196
+ if (typeof typeChecker !== 'function') {
38197
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
38198
+ }
38199
+
38200
+ var propValue = props[propName];
38201
+
38202
+ if (!Array.isArray(propValue)) {
38203
+ var propType = getPropType(propValue);
38204
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
38205
+ }
38206
+
38207
+ for (var i = 0; i < propValue.length; i++) {
38208
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
38209
+
38210
+ if (error instanceof Error) {
38211
+ return error;
38212
+ }
38213
+ }
38214
+
38215
+ return null;
38216
+ }
38217
+
38218
+ return createChainableTypeChecker(validate);
38219
+ }
38220
+
38221
+ function createElementTypeChecker() {
38222
+ function validate(props, propName, componentName, location, propFullName) {
38223
+ var propValue = props[propName];
38224
+
38225
+ if (!isValidElement(propValue)) {
38226
+ var propType = getPropType(propValue);
38227
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
38228
+ }
38229
+
38230
+ return null;
38231
+ }
38232
+
38233
+ return createChainableTypeChecker(validate);
38234
+ }
38235
+
38236
+ function createElementTypeTypeChecker() {
38237
+ function validate(props, propName, componentName, location, propFullName) {
38238
+ var propValue = props[propName];
38239
+
38240
+ if (!reactIs.isValidElementType(propValue)) {
38241
+ var propType = getPropType(propValue);
38242
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
38243
+ }
38244
+
38245
+ return null;
38246
+ }
38247
+
38248
+ return createChainableTypeChecker(validate);
38249
+ }
38250
+
38251
+ function createInstanceTypeChecker(expectedClass) {
38252
+ function validate(props, propName, componentName, location, propFullName) {
38253
+ if (!(props[propName] instanceof expectedClass)) {
38254
+ var expectedClassName = expectedClass.name || ANONYMOUS;
38255
+ var actualClassName = getClassName(props[propName]);
38256
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
38257
+ }
38258
+
38259
+ return null;
38260
+ }
38261
+
38262
+ return createChainableTypeChecker(validate);
38263
+ }
38264
+
38265
+ function createEnumTypeChecker(expectedValues) {
38266
+ if (!Array.isArray(expectedValues)) {
38267
+ if (process.env.NODE_ENV !== 'production') {
38268
+ if (arguments.length > 1) {
38269
+ printWarning$1('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
38270
+ } else {
38271
+ printWarning$1('Invalid argument supplied to oneOf, expected an array.');
38272
+ }
38273
+ }
38274
+
38275
+ return emptyFunctionThatReturnsNull;
38276
+ }
38277
+
38278
+ function validate(props, propName, componentName, location, propFullName) {
38279
+ var propValue = props[propName];
38280
+
38281
+ for (var i = 0; i < expectedValues.length; i++) {
38282
+ if (is(propValue, expectedValues[i])) {
38283
+ return null;
38284
+ }
38285
+ }
38286
+
38287
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
38288
+ var type = getPreciseType(value);
38289
+
38290
+ if (type === 'symbol') {
38291
+ return String(value);
38292
+ }
38293
+
38294
+ return value;
38295
+ });
38296
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
38297
+ }
38298
+
38299
+ return createChainableTypeChecker(validate);
38300
+ }
38301
+
38302
+ function createObjectOfTypeChecker(typeChecker) {
38303
+ function validate(props, propName, componentName, location, propFullName) {
38304
+ if (typeof typeChecker !== 'function') {
38305
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
38306
+ }
38307
+
38308
+ var propValue = props[propName];
38309
+ var propType = getPropType(propValue);
38310
+
38311
+ if (propType !== 'object') {
38312
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
38313
+ }
38314
+
38315
+ for (var key in propValue) {
38316
+ if (has(propValue, key)) {
38317
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
38318
+
38319
+ if (error instanceof Error) {
38320
+ return error;
38321
+ }
38322
+ }
38323
+ }
38324
+
38325
+ return null;
38326
+ }
38327
+
38328
+ return createChainableTypeChecker(validate);
38329
+ }
38330
+
38331
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
38332
+ if (!Array.isArray(arrayOfTypeCheckers)) {
38333
+ process.env.NODE_ENV !== 'production' ? printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
38334
+ return emptyFunctionThatReturnsNull;
38335
+ }
38336
+
38337
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
38338
+ var checker = arrayOfTypeCheckers[i];
38339
+
38340
+ if (typeof checker !== 'function') {
38341
+ printWarning$1('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
38342
+ return emptyFunctionThatReturnsNull;
38343
+ }
38344
+ }
38345
+
38346
+ function validate(props, propName, componentName, location, propFullName) {
38347
+ var expectedTypes = [];
38348
+
38349
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
38350
+ var checker = arrayOfTypeCheckers[i];
38351
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1);
38352
+
38353
+ if (checkerResult == null) {
38354
+ return null;
38355
+ }
38356
+
38357
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
38358
+ expectedTypes.push(checkerResult.data.expectedType);
38359
+ }
38360
+ }
38361
+
38362
+ var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
38363
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
38364
+ }
38365
+
38366
+ return createChainableTypeChecker(validate);
38367
+ }
38368
+
38369
+ function createNodeChecker() {
38370
+ function validate(props, propName, componentName, location, propFullName) {
38371
+ if (!isNode(props[propName])) {
38372
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
38373
+ }
38374
+
38375
+ return null;
38376
+ }
38377
+
38378
+ return createChainableTypeChecker(validate);
38379
+ }
38380
+
38381
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
38382
+ return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
38383
+ }
38384
+
38385
+ function createShapeTypeChecker(shapeTypes) {
38386
+ function validate(props, propName, componentName, location, propFullName) {
38387
+ var propValue = props[propName];
38388
+ var propType = getPropType(propValue);
38389
+
38390
+ if (propType !== 'object') {
38391
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
38392
+ }
38393
+
38394
+ for (var key in shapeTypes) {
38395
+ var checker = shapeTypes[key];
38396
+
38397
+ if (typeof checker !== 'function') {
38398
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
38399
+ }
38400
+
38401
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
38402
+
38403
+ if (error) {
38404
+ return error;
38405
+ }
38406
+ }
38407
+
38408
+ return null;
38409
+ }
38410
+
38411
+ return createChainableTypeChecker(validate);
38412
+ }
38413
+
38414
+ function createStrictShapeTypeChecker(shapeTypes) {
38415
+ function validate(props, propName, componentName, location, propFullName) {
38416
+ var propValue = props[propName];
38417
+ var propType = getPropType(propValue);
38418
+
38419
+ if (propType !== 'object') {
38420
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
38421
+ }
38422
+
38423
+ var allKeys = objectAssign({}, props[propName], shapeTypes);
38424
+
38425
+ for (var key in allKeys) {
38426
+ var checker = shapeTypes[key];
38427
+
38428
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
38429
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
38430
+ }
38431
+
38432
+ if (!checker) {
38433
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
38434
+ }
38435
+
38436
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
38437
+
38438
+ if (error) {
38439
+ return error;
38440
+ }
38441
+ }
38442
+
38443
+ return null;
38444
+ }
38445
+
38446
+ return createChainableTypeChecker(validate);
38447
+ }
38448
+
38449
+ function isNode(propValue) {
38450
+ switch (typeof propValue) {
38451
+ case 'number':
38452
+ case 'string':
38453
+ case 'undefined':
38454
+ return true;
38455
+
38456
+ case 'boolean':
38457
+ return !propValue;
38458
+
38459
+ case 'object':
38460
+ if (Array.isArray(propValue)) {
38461
+ return propValue.every(isNode);
38462
+ }
38463
+
38464
+ if (propValue === null || isValidElement(propValue)) {
38465
+ return true;
38466
+ }
38467
+
38468
+ var iteratorFn = getIteratorFn(propValue);
38469
+
38470
+ if (iteratorFn) {
38471
+ var iterator = iteratorFn.call(propValue);
38472
+ var step;
38473
+
38474
+ if (iteratorFn !== propValue.entries) {
38475
+ while (!(step = iterator.next()).done) {
38476
+ if (!isNode(step.value)) {
38477
+ return false;
38478
+ }
38479
+ }
38480
+ } else {
38481
+ while (!(step = iterator.next()).done) {
38482
+ var entry = step.value;
38483
+
38484
+ if (entry) {
38485
+ if (!isNode(entry[1])) {
38486
+ return false;
38487
+ }
38488
+ }
38489
+ }
38490
+ }
38491
+ } else {
38492
+ return false;
38493
+ }
38494
+
38495
+ return true;
38496
+
38497
+ default:
38498
+ return false;
38499
+ }
38500
+ }
38501
+
38502
+ function isSymbol(propType, propValue) {
38503
+ if (propType === 'symbol') {
38504
+ return true;
38505
+ }
38506
+
38507
+ if (!propValue) {
38508
+ return false;
38509
+ }
38510
+
38511
+ if (propValue['@@toStringTag'] === 'Symbol') {
38512
+ return true;
38513
+ }
38514
+
38515
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
38516
+ return true;
38517
+ }
38518
+
38519
+ return false;
38520
+ }
38521
+
38522
+ function getPropType(propValue) {
38523
+ var propType = typeof propValue;
38524
+
38525
+ if (Array.isArray(propValue)) {
38526
+ return 'array';
38527
+ }
38528
+
38529
+ if (propValue instanceof RegExp) {
38530
+ return 'object';
38531
+ }
38532
+
38533
+ if (isSymbol(propType, propValue)) {
38534
+ return 'symbol';
38535
+ }
38536
+
38537
+ return propType;
38538
+ }
38539
+
38540
+ function getPreciseType(propValue) {
38541
+ if (typeof propValue === 'undefined' || propValue === null) {
38542
+ return '' + propValue;
38543
+ }
38544
+
38545
+ var propType = getPropType(propValue);
38546
+
38547
+ if (propType === 'object') {
38548
+ if (propValue instanceof Date) {
38549
+ return 'date';
38550
+ } else if (propValue instanceof RegExp) {
38551
+ return 'regexp';
38552
+ }
38553
+ }
38554
+
38555
+ return propType;
38556
+ }
38557
+
38558
+ function getPostfixForTypeWarning(value) {
38559
+ var type = getPreciseType(value);
38560
+
38561
+ switch (type) {
38562
+ case 'array':
38563
+ case 'object':
38564
+ return 'an ' + type;
38565
+
38566
+ case 'boolean':
38567
+ case 'date':
38568
+ case 'regexp':
38569
+ return 'a ' + type;
38570
+
38571
+ default:
38572
+ return type;
38573
+ }
38574
+ }
38575
+
38576
+ function getClassName(propValue) {
38577
+ if (!propValue.constructor || !propValue.constructor.name) {
38578
+ return ANONYMOUS;
38579
+ }
38580
+
38581
+ return propValue.constructor.name;
38582
+ }
38583
+
38584
+ ReactPropTypes.checkPropTypes = checkPropTypes_1;
38585
+ ReactPropTypes.resetWarningCache = checkPropTypes_1.resetWarningCache;
38586
+ ReactPropTypes.PropTypes = ReactPropTypes;
38587
+ return ReactPropTypes;
38588
+ };
38589
+
38590
+ function emptyFunction() {}
38591
+
38592
+ function emptyFunctionWithReset() {}
38593
+
38594
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
38595
+
38596
+ var factoryWithThrowingShims = function factoryWithThrowingShims() {
38597
+ function shim(props, propName, componentName, location, propFullName, secret) {
38598
+ if (secret === ReactPropTypesSecret_1) {
38599
+ return;
38600
+ }
38601
+
38602
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
38603
+ err.name = 'Invariant Violation';
38604
+ throw err;
38605
+ }
38606
+ shim.isRequired = shim;
38607
+
38608
+ function getShim() {
38609
+ return shim;
38610
+ }
38611
+ var ReactPropTypes = {
38612
+ array: shim,
38613
+ bigint: shim,
38614
+ bool: shim,
38615
+ func: shim,
38616
+ number: shim,
38617
+ object: shim,
38618
+ string: shim,
38619
+ symbol: shim,
38620
+ any: shim,
38621
+ arrayOf: getShim,
38622
+ element: shim,
38623
+ elementType: shim,
38624
+ instanceOf: getShim,
38625
+ node: shim,
38626
+ objectOf: getShim,
38627
+ oneOf: getShim,
38628
+ oneOfType: getShim,
38629
+ shape: getShim,
38630
+ exact: getShim,
38631
+ checkPropTypes: emptyFunctionWithReset,
38632
+ resetWarningCache: emptyFunction
38633
+ };
38634
+ ReactPropTypes.PropTypes = ReactPropTypes;
38635
+ return ReactPropTypes;
38636
+ };
38637
+
38638
+ var propTypes = createCommonjsModule(function (module) {
38639
+ if (process.env.NODE_ENV !== 'production') {
38640
+ var ReactIs = reactIs;
38641
+ var throwOnDirectAccess = true;
38642
+ module.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
38643
+ } else {
38644
+ module.exports = factoryWithThrowingShims();
38645
+ }
38646
+ });
38647
+
38648
+ var useDocumentSearch = function useDocumentSearch(documents, config) {
38649
+ var _documents;
38650
+
38651
+ if (documents === void 0) {
38652
+ documents = [];
38653
+ }
38654
+
38655
+ if (config === void 0) {
38656
+ config = {};
38657
+ }
38658
+
38659
+ var client = reactQuery.useQueryClient();
38660
+ var tenant = Digit.ULBService.getStateId();
38661
+ var filesArray = (_documents = documents) === null || _documents === void 0 ? void 0 : _documents.map(function (value) {
38662
+ return value === null || value === void 0 ? void 0 : value.fileStoreId;
38663
+ });
38664
+
38665
+ var _useQuery = reactQuery.useQuery([filesArray.join('')], function () {
38666
+ return Digit.UploadServices.Filefetch(filesArray, tenant);
38667
+ }, _extends({
38668
+ enabled: filesArray && filesArray.length > 0,
38669
+ select: function select(data) {
38670
+ return documents.map(function (document) {
38671
+ var _data$data, _data$data2, _data$data3;
38672
+
38673
+ return _extends({}, document, {
38674
+ fileURL: (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data[document === null || document === void 0 ? void 0 : document.fileStoreId]) && Digit.Utils.getFileUrl(data.data[document === null || document === void 0 ? void 0 : document.fileStoreId]),
38675
+ url: (data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2[document === null || document === void 0 ? void 0 : document.fileStoreId]) && Digit.Utils.getFileUrl(data.data[document === null || document === void 0 ? void 0 : document.fileStoreId]),
38676
+ fileResponse: (data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3[document === null || document === void 0 ? void 0 : document.fileStoreId]) || ""
38677
+ });
38678
+ });
38679
+ }
38680
+ }, config)),
38681
+ isLoading = _useQuery.isLoading,
38682
+ error = _useQuery.error,
38683
+ data = _useQuery.data;
38684
+
38685
+ return {
38686
+ isLoading: isLoading,
38687
+ error: error,
38688
+ data: {
38689
+ pdfFiles: data
38690
+ },
38691
+ revalidate: function revalidate() {
38692
+ return client.invalidateQueries([filesArray.join('')]);
38693
+ }
38694
+ };
38695
+ };
38696
+ useDocumentSearch.propTypes = {
38697
+ documents: propTypes.array,
38698
+ config: propTypes.object
38699
+ };
38700
+ useDocumentSearch.defaultProps = {
38701
+ documents: [],
38702
+ config: {}
38703
+ };
38704
+
38705
+ var useOnClickOutside = function useOnClickOutside(ref, handler, isActive, eventParam) {
38706
+ if (eventParam === void 0) {
38707
+ eventParam = false;
38708
+ }
38709
+
38710
+ React.useEffect(function () {
38711
+ if (isActive) {
38712
+ document.addEventListener("click", handleClickOutSide, eventParam);
38713
+ } else {
38714
+ document.removeEventListener("click", handleClickOutSide, eventParam);
38715
+ }
38716
+
38717
+ return function () {
38718
+ document.removeEventListener("click", handleClickOutSide, eventParam);
38719
+ };
38720
+ }, [isActive]);
38721
+
38722
+ var handleClickOutSide = function handleClickOutSide(event) {
38723
+ if (ref.current && ref.current.contains(event.target)) {
38724
+ return;
38725
+ }
38726
+
38727
+ handler(event);
38728
+ };
38729
+ };
38730
+
38731
+ var _excluded = ["businessService"],
38732
+ _excluded2 = ["tenantId", "businessService"],
38733
+ _excluded3 = ["tenantId", "businessService"];
38734
+ var useFetchCitizenBillsForBuissnessService = function useFetchCitizenBillsForBuissnessService(_ref, config) {
38735
+ var _Digit$UserService$ge;
38736
+
38737
+ var businessService = _ref.businessService,
38738
+ filters = _objectWithoutPropertiesLoose(_ref, _excluded);
38739
+
38740
+ if (config === void 0) {
38741
+ config = {};
38742
+ }
38743
+
38744
+ var queryClient = reactQuery.useQueryClient();
38745
+
38746
+ var _ref2 = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {},
38747
+ mobileNumber = _ref2.mobileNumber,
38748
+ tenantId = _ref2.tenantId;
38749
+
38750
+ var params = _extends({
38751
+ mobileNumber: mobileNumber,
38752
+ businessService: businessService
38753
+ }, filters);
38754
+
38755
+ if (!params["mobileNumber"]) delete params["mobileNumber"];
38756
+
38757
+ var _useQuery = reactQuery.useQuery(["citizenBillsForBuisnessService", businessService, _extends({}, params)], function () {
38758
+ return Digit.PaymentService.fetchBill(tenantId, _extends({}, params));
38759
+ }, _extends({
38760
+ refetchOnMount: true,
38761
+ retry: false
38762
+ }, config)),
38763
+ isLoading = _useQuery.isLoading,
38764
+ error = _useQuery.error,
38765
+ isError = _useQuery.isError,
38766
+ data = _useQuery.data,
38767
+ status = _useQuery.status;
38768
+
38769
+ return {
38770
+ isLoading: isLoading,
38771
+ error: error,
38772
+ isError: isError,
38773
+ data: data,
38774
+ status: status,
38775
+ revalidate: function revalidate() {
38776
+ return queryClient.invalidateQueries(["citizenBillsForBuisnessService", businessService]);
38777
+ }
38778
+ };
38779
+ };
38780
+ var useFetchBillsForBuissnessService = function useFetchBillsForBuissnessService(_ref3, config) {
38781
+ var _Digit$UserService$ge2, _Digit$UserService$ge3;
38782
+
38783
+ var tenantId = _ref3.tenantId,
38784
+ businessService = _ref3.businessService,
38785
+ filters = _objectWithoutPropertiesLoose(_ref3, _excluded2);
38786
+
38787
+ if (config === void 0) {
38788
+ config = {};
38789
+ }
38790
+
38791
+ var queryClient = reactQuery.useQueryClient();
38792
+ var isPTAccessDone = sessionStorage.getItem("IsPTAccessDone");
38793
+
38794
+ var params = _extends({
38795
+ businessService: businessService
38796
+ }, filters);
38797
+
38798
+ var _tenantId = tenantId || ((_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : (_Digit$UserService$ge3 = _Digit$UserService$ge2.info) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.tenantId);
38799
+
38800
+ var _useQuery2 = reactQuery.useQuery(["billsForBuisnessService", businessService, _extends({}, filters), config, isPTAccessDone], function () {
38801
+ return Digit.PaymentService.fetchBill(_tenantId, params);
38802
+ }, _extends({
38803
+ retry: function retry(count, err) {
38804
+ return false;
38805
+ }
38806
+ }, config)),
38807
+ isLoading = _useQuery2.isLoading,
38808
+ error = _useQuery2.error,
38809
+ isError = _useQuery2.isError,
38810
+ data = _useQuery2.data,
38811
+ status = _useQuery2.status;
38812
+
38813
+ return {
38814
+ isLoading: isLoading,
38815
+ error: error,
38816
+ isError: isError,
38817
+ data: data,
38818
+ status: status,
38819
+ revalidate: function revalidate() {
38820
+ return queryClient.invalidateQueries(["billsForBuisnessService", businessService]);
38821
+ }
38822
+ };
38823
+ };
38824
+ var useFetchPayment = function useFetchPayment(_ref4, config) {
38825
+ var tenantId = _ref4.tenantId,
38826
+ consumerCode = _ref4.consumerCode,
38827
+ businessService = _ref4.businessService;
38828
+ var queryClient = reactQuery.useQueryClient();
38829
+
38830
+ var fetchBill = function fetchBill() {
38831
+ try {
38832
+ if (businessService !== null && businessService !== void 0 && businessService.includes("PT")) {
38833
+ return Promise.resolve(Digit.PaymentService.fetchBill(tenantId, {
38834
+ consumerCode: consumerCode,
38835
+ businessService: businessService
38836
+ })).then(function (fetchedBill) {
38837
+ var _fetchedBill$Bill, _fetchedBill$Bill$, _fetchedBill$Bill$$bi, _fetchedBill$Bill$$bi2, _fetchedBill$Bill3, _fetchedBill$Bill3$, _fetchedBill$Bill3$$b;
38838
+
38839
+ var billdetail = (fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill = fetchedBill.Bill) === null || _fetchedBill$Bill === void 0 ? void 0 : (_fetchedBill$Bill$ = _fetchedBill$Bill[0]) === null || _fetchedBill$Bill$ === void 0 ? void 0 : (_fetchedBill$Bill$$bi = _fetchedBill$Bill$.billDetails) === null || _fetchedBill$Bill$$bi === void 0 ? void 0 : (_fetchedBill$Bill$$bi2 = _fetchedBill$Bill$$bi.sort(function (a, b) {
38840
+ return b.fromPeriod - a.fromPeriod;
38841
+ })) === null || _fetchedBill$Bill$$bi2 === void 0 ? void 0 : _fetchedBill$Bill$$bi2[0]) || {};
38842
+ fetchedBill.Bill[0].billDetails = fetchedBill.Bill[0].billDetails.map(function (ele) {
38843
+ var _fetchedBill$Bill2, _fetchedBill$Bill2$;
38844
+
38845
+ return _extends({}, ele, {
38846
+ currentBillNo: fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill2 = fetchedBill.Bill) === null || _fetchedBill$Bill2 === void 0 ? void 0 : (_fetchedBill$Bill2$ = _fetchedBill$Bill2[0]) === null || _fetchedBill$Bill2$ === void 0 ? void 0 : _fetchedBill$Bill2$.billNumber,
38847
+ currentExpiryDate: billdetail === null || billdetail === void 0 ? void 0 : billdetail.expiryDate
38848
+ });
38849
+ });
38850
+
38851
+ if (fetchedBill && (fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill3 = fetchedBill.Bill) === null || _fetchedBill$Bill3 === void 0 ? void 0 : (_fetchedBill$Bill3$ = _fetchedBill$Bill3[0]) === null || _fetchedBill$Bill3$ === void 0 ? void 0 : (_fetchedBill$Bill3$$b = _fetchedBill$Bill3$.billDetails) === null || _fetchedBill$Bill3$$b === void 0 ? void 0 : _fetchedBill$Bill3$$b.length) > 1) {
38852
+ var _fetchedBill$Bill4, _fetchedBill$Bill4$, _fetchedBill$Bill4$$b;
38853
+
38854
+ fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill4 = fetchedBill.Bill) === null || _fetchedBill$Bill4 === void 0 ? void 0 : (_fetchedBill$Bill4$ = _fetchedBill$Bill4[0]) === null || _fetchedBill$Bill4$ === void 0 ? void 0 : (_fetchedBill$Bill4$$b = _fetchedBill$Bill4$.billDetails) === null || _fetchedBill$Bill4$$b === void 0 ? void 0 : _fetchedBill$Bill4$$b.map(function (billdet) {
38855
+ try {
38856
+ return Promise.resolve(Digit.PaymentService.searchBill(tenantId, {
38857
+ consumerCode: consumerCode,
38858
+ fromPeriod: billdet === null || billdet === void 0 ? void 0 : billdet.fromPeriod,
38859
+ toPeriod: billdet === null || billdet === void 0 ? void 0 : billdet.toPeriod,
38860
+ service: businessService,
38861
+ retrieveOldest: true
38862
+ })).then(function (searchBill) {
38863
+ var _searchBill$Bill, _searchBill$Bill$, _searchBill$Bill$$bil, _searchBill$Bill$$bil2, _searchBill$Bill2, _searchBill$Bill2$;
38864
+
38865
+ billdet.expiryDate = searchBill === null || searchBill === void 0 ? void 0 : (_searchBill$Bill = searchBill.Bill) === null || _searchBill$Bill === void 0 ? void 0 : (_searchBill$Bill$ = _searchBill$Bill[0]) === null || _searchBill$Bill$ === void 0 ? void 0 : (_searchBill$Bill$$bil = _searchBill$Bill$.billDetails) === null || _searchBill$Bill$$bil === void 0 ? void 0 : (_searchBill$Bill$$bil2 = _searchBill$Bill$$bil[0]) === null || _searchBill$Bill$$bil2 === void 0 ? void 0 : _searchBill$Bill$$bil2.expiryDate;
38866
+ billdet.billNumber = searchBill === null || searchBill === void 0 ? void 0 : (_searchBill$Bill2 = searchBill.Bill) === null || _searchBill$Bill2 === void 0 ? void 0 : (_searchBill$Bill2$ = _searchBill$Bill2[0]) === null || _searchBill$Bill2$ === void 0 ? void 0 : _searchBill$Bill2$.billNumber;
38867
+ });
38868
+ } catch (e) {
38869
+ return Promise.reject(e);
38870
+ }
38871
+ });
38872
+ }
38873
+
38874
+ return fetchedBill;
38875
+ });
38876
+ } else {
38877
+ return Promise.resolve(Digit.PaymentService.fetchBill(tenantId, {
38878
+ consumerCode: consumerCode,
38879
+ businessService: businessService
38880
+ }));
38881
+ }
38882
+ } catch (e) {
38883
+ return Promise.reject(e);
38884
+ }
38885
+ };
38886
+
38887
+ var retry = function retry(failureCount, error) {
38888
+ var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
38889
+
38890
+ if ((error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.code) === "EG_BS_BILL_NO_DEMANDS_FOUND") return false;else return failureCount < 3;
38891
+ };
38892
+
38893
+ var queryData = reactQuery.useQuery(["paymentFetchDetails", tenantId, consumerCode, businessService], function () {
38894
+ return fetchBill();
38895
+ }, _extends({
38896
+ retry: retry
38897
+ }, config));
38898
+ return _extends({}, queryData, {
37771
38899
  revalidate: function revalidate() {
37772
38900
  return queryClient.invalidateQueries(["paymentFetchDetails", tenantId, consumerCode, businessService]);
37773
38901
  }
@@ -41350,7 +42478,7 @@ var PTSearch = {
41350
42478
  value: owner === null || owner === void 0 ? void 0 : owner.emailId
41351
42479
  }, {
41352
42480
  title: "PT_OWNERSHIP_INFO_CORR_ADDR",
41353
- value: owner === null || owner === void 0 ? void 0 : owner.correspondenceAddress
42481
+ value: owner === null || owner === void 0 ? void 0 : owner.permanentAddress
41354
42482
  }]
41355
42483
  };
41356
42484
  })
@@ -42267,7 +43395,7 @@ var useTradeLicenseMDMS = function useTradeLicenseMDMS(tenantId, moduleCode, typ
42267
43395
  };
42268
43396
 
42269
43397
  var useTLDocumentSearch = function useTLDocumentSearch(data1, config) {
42270
- var _data, _data$value, _data$value$owners, _data$value$owners$do, _data2, _data2$value, _data2$value$owners, _data2$value$owners$d, _data3, _data3$value, _data3$value$owners, _data3$value$owners$d;
43398
+ var _data, _data$value, _data$value$tradeLice, _data2, _data2$value, _data3, _data3$value, _data3$value$workflow, _data4, _data4$value, _data4$value$owners, _data4$value$owners$d, _data5, _data5$value, _data5$value$owners, _data5$value$owners$d, _data6, _data6$value, _data6$value$owners, _data6$value$owners$d;
42271
43399
 
42272
43400
  if (data1 === void 0) {
42273
43401
  data1 = {};
@@ -42276,10 +43404,15 @@ var useTLDocumentSearch = function useTLDocumentSearch(data1, config) {
42276
43404
  var client = reactQuery.useQueryClient();
42277
43405
  var tenantId = Digit.ULBService.getCurrentTenantId();
42278
43406
  var tenant = Digit.ULBService.getStateId();
42279
- var filesArray = [];
42280
- if ((_data = data1) !== null && _data !== void 0 && (_data$value = _data.value) !== null && _data$value !== void 0 && (_data$value$owners = _data$value.owners) !== null && _data$value$owners !== void 0 && (_data$value$owners$do = _data$value$owners.documents["OwnerPhotoProof"]) !== null && _data$value$owners$do !== void 0 && _data$value$owners$do.fileStoreId) filesArray.push(data1.value.owners.documents["OwnerPhotoProof"].fileStoreId);
42281
- if ((_data2 = data1) !== null && _data2 !== void 0 && (_data2$value = _data2.value) !== null && _data2$value !== void 0 && (_data2$value$owners = _data2$value.owners) !== null && _data2$value$owners !== void 0 && (_data2$value$owners$d = _data2$value$owners.documents["ProofOfIdentity"]) !== null && _data2$value$owners$d !== void 0 && _data2$value$owners$d.fileStoreId) filesArray.push(data1.value.owners.documents["ProofOfIdentity"].fileStoreId);
42282
- if ((_data3 = data1) !== null && _data3 !== void 0 && (_data3$value = _data3.value) !== null && _data3$value !== void 0 && (_data3$value$owners = _data3$value.owners) !== null && _data3$value$owners !== void 0 && (_data3$value$owners$d = _data3$value$owners.documents["ProofOfOwnership"]) !== null && _data3$value$owners$d !== void 0 && _data3$value$owners$d.fileStoreId) filesArray.push(data1.value.owners.documents["ProofOfOwnership"].fileStoreId);
43407
+ var filesArray = window.location.href.includes("/tl/tradelicence/application/") ? (_data = data1) === null || _data === void 0 ? void 0 : (_data$value = _data.value) === null || _data$value === void 0 ? void 0 : (_data$value$tradeLice = _data$value.tradeLicenseDetail) === null || _data$value$tradeLice === void 0 ? void 0 : _data$value$tradeLice.applicationDocuments.map(function (ob) {
43408
+ return ob === null || ob === void 0 ? void 0 : ob.fileStoreId;
43409
+ }) : [];
43410
+ if ((_data2 = data1) !== null && _data2 !== void 0 && (_data2$value = _data2.value) !== null && _data2$value !== void 0 && _data2$value.workflowDocs) filesArray = (_data3 = data1) === null || _data3 === void 0 ? void 0 : (_data3$value = _data3.value) === null || _data3$value === void 0 ? void 0 : (_data3$value$workflow = _data3$value.workflowDocs) === null || _data3$value$workflow === void 0 ? void 0 : _data3$value$workflow.map(function (ob) {
43411
+ return ob === null || ob === void 0 ? void 0 : ob.fileStoreId;
43412
+ });
43413
+ if ((_data4 = data1) !== null && _data4 !== void 0 && (_data4$value = _data4.value) !== null && _data4$value !== void 0 && (_data4$value$owners = _data4$value.owners) !== null && _data4$value$owners !== void 0 && (_data4$value$owners$d = _data4$value$owners.documents["OwnerPhotoProof"]) !== null && _data4$value$owners$d !== void 0 && _data4$value$owners$d.fileStoreId) filesArray.push(data1.value.owners.documents["OwnerPhotoProof"].fileStoreId);
43414
+ if ((_data5 = data1) !== null && _data5 !== void 0 && (_data5$value = _data5.value) !== null && _data5$value !== void 0 && (_data5$value$owners = _data5$value.owners) !== null && _data5$value$owners !== void 0 && (_data5$value$owners$d = _data5$value$owners.documents["ProofOfIdentity"]) !== null && _data5$value$owners$d !== void 0 && _data5$value$owners$d.fileStoreId) filesArray.push(data1.value.owners.documents["ProofOfIdentity"].fileStoreId);
43415
+ if ((_data6 = data1) !== null && _data6 !== void 0 && (_data6$value = _data6.value) !== null && _data6$value !== void 0 && (_data6$value$owners = _data6$value.owners) !== null && _data6$value$owners !== void 0 && (_data6$value$owners$d = _data6$value$owners.documents["ProofOfOwnership"]) !== null && _data6$value$owners$d !== void 0 && _data6$value$owners$d.fileStoreId) filesArray.push(data1.value.owners.documents["ProofOfOwnership"].fileStoreId);
42283
43416
 
42284
43417
  var _useQuery = reactQuery.useQuery(["tlDocuments-" + 1, filesArray], function () {
42285
43418
  return Digit.UploadServices.Filefetch(filesArray, tenant);
@@ -42589,7 +43722,7 @@ var TLSearch = {
42589
43722
  value: response !== null && response !== void 0 && (_response$tradeLicens2 = response.tradeLicenseDetail) !== null && _response$tradeLicens2 !== void 0 && _response$tradeLicens2.structureType ? "COMMON_MASTERS_STRUCTURETYPE_" + (response === null || response === void 0 ? void 0 : (_response$tradeLicens3 = response.tradeLicenseDetail) === null || _response$tradeLicens3 === void 0 ? void 0 : (_response$tradeLicens4 = _response$tradeLicens3.structureType) === null || _response$tradeLicens4 === void 0 ? void 0 : _response$tradeLicens4.split(".")[0]) : "NA"
42590
43723
  }, {
42591
43724
  title: "TL_NEW_TRADE_DETAILS_STRUCT_SUB_TYPE_LABEL",
42592
- value: response !== null && response !== void 0 && (_response$tradeLicens5 = response.tradeLicenseDetail) !== null && _response$tradeLicens5 !== void 0 && _response$tradeLicens5.structureType ? "COMMON_MASTERS_STRUCTURETYPE_" + stringReplaceAll$2(response === null || response === void 0 ? void 0 : (_response$tradeLicens6 = response.tradeLicenseDetail) === null || _response$tradeLicens6 === void 0 ? void 0 : _response$tradeLicens6.structureType, ".", "_") : "NA"
43725
+ value: response !== null && response !== void 0 && (_response$tradeLicens5 = response.tradeLicenseDetail) !== null && _response$tradeLicens5 !== void 0 && _response$tradeLicens5.structureType ? "TL_" + (response === null || response === void 0 ? void 0 : (_response$tradeLicens6 = response.tradeLicenseDetail) === null || _response$tradeLicens6 === void 0 ? void 0 : _response$tradeLicens6.tradeType) : "NA"
42593
43726
  }, {
42594
43727
  title: "TL_NEW_TRADE_DETAILS_TRADE_COMM_DATE_LABEL",
42595
43728
  value: response !== null && response !== void 0 && response.commencementDate ? convertEpochToDate(response === null || response === void 0 ? void 0 : response.commencementDate) : "NA"
@@ -43534,13 +44667,14 @@ var SearchMdmsTypes = {
43534
44667
  var _data$BPA3, _data$BPA3$BPAAppicat;
43535
44668
 
43536
44669
  return [].concat(data === null || data === void 0 ? void 0 : (_data$BPA3 = data.BPA) === null || _data$BPA3 === void 0 ? void 0 : (_data$BPA3$BPAAppicat = _data$BPA3.BPAAppicationMapping) === null || _data$BPA3$BPAAppicat === void 0 ? void 0 : _data$BPA3$BPAAppicat.filter(function (currentObject) {
43537
- var _currentObject$roles;
44670
+ var _userInfo$value, _currentObject$roles;
43538
44671
 
44672
+ var userInfos = sessionStorage.getItem("Digit.citizen.userRequestObject");
44673
+ var userInfo = userInfos ? JSON.parse(userInfos) : {};
44674
+ var userInformation = userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$value = userInfo.value) === null || _userInfo$value === void 0 ? void 0 : _userInfo$value.info;
43539
44675
  var flag = 0;
43540
44676
  currentObject === null || currentObject === void 0 ? void 0 : (_currentObject$roles = currentObject.roles) === null || _currentObject$roles === void 0 ? void 0 : _currentObject$roles.map(function (bpaRole) {
43541
- var _Digit$UserService$ge, _Digit$UserService$ge2;
43542
-
43543
- var found = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.roles.some(function (role) {
44677
+ var found = userInformation === null || userInformation === void 0 ? void 0 : userInformation.roles.some(function (role) {
43544
44678
  return (role === null || role === void 0 ? void 0 : role.code) === bpaRole;
43545
44679
  });
43546
44680
  if (found == true) flag = 1;
@@ -43858,21 +44992,124 @@ var OBPSService = {
43858
44992
  isEmployee: true
43859
44993
  })).then(function (paymentRes) {
43860
44994
  return Promise.resolve(MdmsService.getMultipleTypes(License === null || License === void 0 ? void 0 : License.tenantId, "StakeholderRegistraition", ["TradeTypetoRoleMapping"])).then(function (mdmsRes) {
43861
- var _License$tradeLicense, _License$tradeLicense2, _mdmsRes$StakeholderR, _mdmsRes$StakeholderR2, _License$tradeLicense8, _License$tradeLicense9, _License$tradeLicense10, _License$tradeLicense11, _License$tradeLicense12, _License$tradeLicense13, _License$tradeLicense14, _License$tradeLicense15, _License$tradeLicense16, _License$tradeLicense17, _License$tradeLicense18, _License$tradeLicense19, _License$tradeLicense20, _License$tradeLicense21, _License$tradeLicense22, _License$tradeLicense23, _License$tradeLicense24, _License$tradeLicense25, _License$tradeLicense26, _License$tradeLicense27, _License$tradeLicense28, _License$tradeLicense29, _License$tradeLicense30, _License$tradeLicense31, _License$tradeLicense32, _License$tradeLicense33, _License$tradeLicense34, _License$tradeLicense35, _License$tradeLicense36, _License$tradeLicense37, _License$tradeLicense38, _License$tradeLicense39, _License$tradeLicense40, _License$tradeLicense41, _License$tradeLicense42, _License$tradeLicense43, _paymentRes$Payments, _paymentRes$Payments2, _paymentRes$Payments3, _paymentRes$Payments4, _paymentRes$Payments5, _ref;
44995
+ var _License$tradeLicense37, _License$tradeLicense38, _mdmsRes$StakeholderR, _mdmsRes$StakeholderR2, _License$tradeLicense44, _License$tradeLicense45;
44996
+
44997
+ function _temp2() {
44998
+ var _License$tradeLicense, _License$tradeLicense2, _License$tradeLicense3, _License$tradeLicense4, _License$tradeLicense5, _License$tradeLicense6, _License$tradeLicense7, _License$tradeLicense8, _License$tradeLicense9, _License$tradeLicense10, _License$tradeLicense11, _License$tradeLicense12, _License$tradeLicense13, _License$tradeLicense14, _License$tradeLicense15, _License$tradeLicense16, _License$tradeLicense17, _License$tradeLicense18, _License$tradeLicense19, _License$tradeLicense20, _License$tradeLicense21, _License$tradeLicense22, _License$tradeLicense23, _License$tradeLicense24, _License$tradeLicense25, _License$tradeLicense26, _License$tradeLicense27, _License$tradeLicense28, _License$tradeLicense29, _License$tradeLicense30, _License$tradeLicense31, _License$tradeLicense32, _License$tradeLicense33, _License$tradeLicense34, _License$tradeLicense35, _License$tradeLicense36, _paymentRes$Payments, _paymentRes$Payments2, _paymentRes$Payments3, _paymentRes$Payments4, _paymentRes$Payments5, _ref;
44999
+
45000
+ var details = [{
45001
+ title: " ",
45002
+ values: [{
45003
+ title: "BPA_APPLICATION_NUMBER_LABEL",
45004
+ value: (License === null || License === void 0 ? void 0 : License.applicationNumber) || "NA"
45005
+ }]
45006
+ }, License !== null && License !== void 0 && (_License$tradeLicense = License.tradeLicenseDetail) !== null && _License$tradeLicense !== void 0 && (_License$tradeLicense2 = _License$tradeLicense.tradeUnits) !== null && _License$tradeLicense2 !== void 0 && (_License$tradeLicense3 = _License$tradeLicense2[0]) !== null && _License$tradeLicense3 !== void 0 && _License$tradeLicense3.tradeType.includes("ARCHITECT") ? {
45007
+ title: "BPA_LICENSE_DETAILS_LABEL",
45008
+ asSectionHeader: true,
45009
+ values: [{
45010
+ title: "BPA_LICENSE_TYPE",
45011
+ value: "TRADELICENSE_TRADETYPE_" + (License === null || License === void 0 ? void 0 : (_License$tradeLicense4 = License.tradeLicenseDetail) === null || _License$tradeLicense4 === void 0 ? void 0 : (_License$tradeLicense5 = _License$tradeLicense4.tradeUnits) === null || _License$tradeLicense5 === void 0 ? void 0 : (_License$tradeLicense6 = _License$tradeLicense5[0]) === null || _License$tradeLicense6 === void 0 ? void 0 : (_License$tradeLicense7 = _License$tradeLicense6.tradeType) === null || _License$tradeLicense7 === void 0 ? void 0 : _License$tradeLicense7.split(".")[0]) || "NA"
45012
+ }, {
45013
+ title: "BPA_COUNCIL_OF_ARCH_NO_LABEL",
45014
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense8 = License.tradeLicenseDetail) === null || _License$tradeLicense8 === void 0 ? void 0 : (_License$tradeLicense9 = _License$tradeLicense8.additionalDetail) === null || _License$tradeLicense9 === void 0 ? void 0 : _License$tradeLicense9.counsilForArchNo) || "NA"
45015
+ }]
45016
+ } : {
45017
+ title: "BPA_LICENSE_DETAILS_LABEL",
45018
+ asSectionHeader: true,
45019
+ values: [{
45020
+ title: "BPA_LICENSE_TYPE",
45021
+ value: "TRADELICENSE_TRADETYPE_" + (License === null || License === void 0 ? void 0 : (_License$tradeLicense10 = License.tradeLicenseDetail) === null || _License$tradeLicense10 === void 0 ? void 0 : (_License$tradeLicense11 = _License$tradeLicense10.tradeUnits) === null || _License$tradeLicense11 === void 0 ? void 0 : (_License$tradeLicense12 = _License$tradeLicense11[0]) === null || _License$tradeLicense12 === void 0 ? void 0 : (_License$tradeLicense13 = _License$tradeLicense12.tradeType) === null || _License$tradeLicense13 === void 0 ? void 0 : _License$tradeLicense13.split(".")[0]) || "NA"
45022
+ }]
45023
+ }, {
45024
+ title: "BPA_LICENSEE_DETAILS_HEADER_OWNER_INFO",
45025
+ asSectionHeader: true,
45026
+ values: [{
45027
+ title: "BPA_APPLICANT_NAME_LABEL",
45028
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense14 = License.tradeLicenseDetail) === null || _License$tradeLicense14 === void 0 ? void 0 : (_License$tradeLicense15 = _License$tradeLicense14.owners) === null || _License$tradeLicense15 === void 0 ? void 0 : (_License$tradeLicense16 = _License$tradeLicense15[0]) === null || _License$tradeLicense16 === void 0 ? void 0 : _License$tradeLicense16.name) || "NA"
45029
+ }, {
45030
+ title: "BPA_APPLICANT_GENDER_LABEL",
45031
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense17 = License.tradeLicenseDetail) === null || _License$tradeLicense17 === void 0 ? void 0 : (_License$tradeLicense18 = _License$tradeLicense17.owners) === null || _License$tradeLicense18 === void 0 ? void 0 : (_License$tradeLicense19 = _License$tradeLicense18[0]) === null || _License$tradeLicense19 === void 0 ? void 0 : _License$tradeLicense19.gender) || "NA"
45032
+ }, {
45033
+ title: "BPA_OWNER_MOBILE_NO_LABEL",
45034
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense20 = License.tradeLicenseDetail) === null || _License$tradeLicense20 === void 0 ? void 0 : (_License$tradeLicense21 = _License$tradeLicense20.owners) === null || _License$tradeLicense21 === void 0 ? void 0 : (_License$tradeLicense22 = _License$tradeLicense21[0]) === null || _License$tradeLicense22 === void 0 ? void 0 : _License$tradeLicense22.mobileNumber) || "NA"
45035
+ }, {
45036
+ title: "BPA_APPLICANT_EMAIL_LABEL",
45037
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense23 = License.tradeLicenseDetail) === null || _License$tradeLicense23 === void 0 ? void 0 : (_License$tradeLicense24 = _License$tradeLicense23.owners) === null || _License$tradeLicense24 === void 0 ? void 0 : (_License$tradeLicense25 = _License$tradeLicense24[0]) === null || _License$tradeLicense25 === void 0 ? void 0 : _License$tradeLicense25.emailId) || "NA"
45038
+ }, {
45039
+ title: "BPA_APPLICANT_PAN_NO",
45040
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense26 = License.tradeLicenseDetail) === null || _License$tradeLicense26 === void 0 ? void 0 : (_License$tradeLicense27 = _License$tradeLicense26.owners) === null || _License$tradeLicense27 === void 0 ? void 0 : (_License$tradeLicense28 = _License$tradeLicense27[0]) === null || _License$tradeLicense28 === void 0 ? void 0 : _License$tradeLicense28.pan) || "NA"
45041
+ }]
45042
+ }, {
45043
+ title: "BPA_PERMANANT_ADDRESS_LABEL",
45044
+ asSectionHeader: true,
45045
+ values: [{
45046
+ title: "BPA_PERMANANT_ADDRESS_LABEL",
45047
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense29 = License.tradeLicenseDetail) === null || _License$tradeLicense29 === void 0 ? void 0 : (_License$tradeLicense30 = _License$tradeLicense29.owners) === null || _License$tradeLicense30 === void 0 ? void 0 : (_License$tradeLicense31 = _License$tradeLicense30[0]) === null || _License$tradeLicense31 === void 0 ? void 0 : _License$tradeLicense31.permanentAddress) || "NA"
45048
+ }]
45049
+ }, {
45050
+ title: "BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL",
45051
+ asSectionHeader: true,
45052
+ values: [{
45053
+ title: "BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL",
45054
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense32 = License.tradeLicenseDetail) === null || _License$tradeLicense32 === void 0 ? void 0 : (_License$tradeLicense33 = _License$tradeLicense32.owners) === null || _License$tradeLicense33 === void 0 ? void 0 : (_License$tradeLicense34 = _License$tradeLicense33[0]) === null || _License$tradeLicense34 === void 0 ? void 0 : _License$tradeLicense34.correspondenceAddress) || "NA"
45055
+ }]
45056
+ }, {
45057
+ title: "BPA_DOCUMENT_DETAILS_LABEL",
45058
+ asSectionHeader: true,
45059
+ additionalDetails: {
45060
+ documentsWithUrl: [{
45061
+ title: "",
45062
+ values: License === null || License === void 0 ? void 0 : (_License$tradeLicense35 = License.tradeLicenseDetail) === null || _License$tradeLicense35 === void 0 ? void 0 : (_License$tradeLicense36 = _License$tradeLicense35.applicationDocuments) === null || _License$tradeLicense36 === void 0 ? void 0 : _License$tradeLicense36.map(function (doc) {
45063
+ var _doc$documentType, _fileDetails, _fileDetails2, _fileDetails2$data$do;
45064
+
45065
+ return {
45066
+ title: "BPAREG_HEADER_" + (doc === null || doc === void 0 ? void 0 : (_doc$documentType = doc.documentType) === null || _doc$documentType === void 0 ? void 0 : _doc$documentType.replaceAll('.', '_')),
45067
+ documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
45068
+ documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
45069
+ fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
45070
+ id: doc === null || doc === void 0 ? void 0 : doc.id,
45071
+ docInfo: doc === null || doc === void 0 ? void 0 : doc.info,
45072
+ url: (_fileDetails = fileDetails) !== null && _fileDetails !== void 0 && _fileDetails.data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId] ? (_fileDetails2 = fileDetails) === null || _fileDetails2 === void 0 ? void 0 : (_fileDetails2$data$do = _fileDetails2.data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId]) === null || _fileDetails2$data$do === void 0 ? void 0 : _fileDetails2$data$do.split(',')[0] : ""
45073
+ };
45074
+ })
45075
+ }]
45076
+ }
45077
+ }, (paymentRes === null || paymentRes === void 0 ? void 0 : (_paymentRes$Payments = paymentRes.Payments) === null || _paymentRes$Payments === void 0 ? void 0 : _paymentRes$Payments.length) > 0 && {
45078
+ title: "BPA_FEE_DETAILS_LABEL",
45079
+ additionalDetails: {
45080
+ inspectionReport: [],
45081
+ values: [{
45082
+ title: "BPAREG_FEES",
45083
+ value: /*#__PURE__*/React__default.createElement("span", null, "\u20B9", paymentRes === null || paymentRes === void 0 ? void 0 : (_paymentRes$Payments2 = paymentRes.Payments) === null || _paymentRes$Payments2 === void 0 ? void 0 : (_paymentRes$Payments3 = _paymentRes$Payments2[0]) === null || _paymentRes$Payments3 === void 0 ? void 0 : _paymentRes$Payments3.totalAmountPaid)
45084
+ }, (_ref = {
45085
+ title: "BPA_STATUS_LABEL",
45086
+ isTransLate: true,
45087
+ isStatus: true,
45088
+ value: paymentRes !== null && paymentRes !== void 0 && (_paymentRes$Payments4 = paymentRes.Payments) !== null && _paymentRes$Payments4 !== void 0 && (_paymentRes$Payments5 = _paymentRes$Payments4[0]) !== null && _paymentRes$Payments5 !== void 0 && _paymentRes$Payments5.totalAmountPaid ? "WF_BPA_PAID" : "NA"
45089
+ }, _ref["isTransLate"] = true, _ref)]
45090
+ }
45091
+ }];
45092
+ return {
45093
+ applicationData: License,
45094
+ applicationDetails: details,
45095
+ tenantId: License === null || License === void 0 ? void 0 : License.tenantId,
45096
+ payments: (paymentRes === null || paymentRes === void 0 ? void 0 : paymentRes.Payments) || []
45097
+ };
45098
+ }
43862
45099
 
43863
- if (License !== null && License !== void 0 && (_License$tradeLicense = License.tradeLicenseDetail) !== null && _License$tradeLicense !== void 0 && (_License$tradeLicense2 = _License$tradeLicense.applicationDocuments) !== null && _License$tradeLicense2 !== void 0 && _License$tradeLicense2.length && (mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$StakeholderR = mdmsRes.StakeholderRegistraition) === null || _mdmsRes$StakeholderR === void 0 ? void 0 : (_mdmsRes$StakeholderR2 = _mdmsRes$StakeholderR.TradeTypetoRoleMapping) === null || _mdmsRes$StakeholderR2 === void 0 ? void 0 : _mdmsRes$StakeholderR2.length) > 0) {
45100
+ if (License !== null && License !== void 0 && (_License$tradeLicense37 = License.tradeLicenseDetail) !== null && _License$tradeLicense37 !== void 0 && (_License$tradeLicense38 = _License$tradeLicense37.applicationDocuments) !== null && _License$tradeLicense38 !== void 0 && _License$tradeLicense38.length && (mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$StakeholderR = mdmsRes.StakeholderRegistraition) === null || _mdmsRes$StakeholderR === void 0 ? void 0 : (_mdmsRes$StakeholderR2 = _mdmsRes$StakeholderR.TradeTypetoRoleMapping) === null || _mdmsRes$StakeholderR2 === void 0 ? void 0 : _mdmsRes$StakeholderR2.length) > 0) {
43864
45101
  var _mdmsRes$StakeholderR3, _mdmsRes$StakeholderR4;
43865
45102
 
43866
45103
  mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$StakeholderR3 = mdmsRes.StakeholderRegistraition) === null || _mdmsRes$StakeholderR3 === void 0 ? void 0 : (_mdmsRes$StakeholderR4 = _mdmsRes$StakeholderR3.TradeTypetoRoleMapping) === null || _mdmsRes$StakeholderR4 === void 0 ? void 0 : _mdmsRes$StakeholderR4.map(function (doc) {
43867
- var _doc$docTypes, _License$tradeLicense3, _License$tradeLicense4, _License$tradeLicense5;
45104
+ var _doc$docTypes, _License$tradeLicense39, _License$tradeLicense40, _License$tradeLicense41;
43868
45105
 
43869
- if ((doc === null || doc === void 0 ? void 0 : (_doc$docTypes = doc.docTypes) === null || _doc$docTypes === void 0 ? void 0 : _doc$docTypes.length) > 0 && (doc === null || doc === void 0 ? void 0 : doc.tradeType) == (License === null || License === void 0 ? void 0 : (_License$tradeLicense3 = License.tradeLicenseDetail) === null || _License$tradeLicense3 === void 0 ? void 0 : (_License$tradeLicense4 = _License$tradeLicense3.tradeUnits) === null || _License$tradeLicense4 === void 0 ? void 0 : (_License$tradeLicense5 = _License$tradeLicense4[0]) === null || _License$tradeLicense5 === void 0 ? void 0 : _License$tradeLicense5.tradeType)) {
45106
+ if ((doc === null || doc === void 0 ? void 0 : (_doc$docTypes = doc.docTypes) === null || _doc$docTypes === void 0 ? void 0 : _doc$docTypes.length) > 0 && (doc === null || doc === void 0 ? void 0 : doc.tradeType) == (License === null || License === void 0 ? void 0 : (_License$tradeLicense39 = License.tradeLicenseDetail) === null || _License$tradeLicense39 === void 0 ? void 0 : (_License$tradeLicense40 = _License$tradeLicense39.tradeUnits) === null || _License$tradeLicense40 === void 0 ? void 0 : (_License$tradeLicense41 = _License$tradeLicense40[0]) === null || _License$tradeLicense41 === void 0 ? void 0 : _License$tradeLicense41.tradeType)) {
43870
45107
  var _doc$docTypes2;
43871
45108
 
43872
45109
  doc === null || doc === void 0 ? void 0 : (_doc$docTypes2 = doc.docTypes) === null || _doc$docTypes2 === void 0 ? void 0 : _doc$docTypes2.map(function (docType) {
43873
- var _License$tradeLicense6, _License$tradeLicense7;
45110
+ var _License$tradeLicense42, _License$tradeLicense43;
43874
45111
 
43875
- License === null || License === void 0 ? void 0 : (_License$tradeLicense6 = License.tradeLicenseDetail) === null || _License$tradeLicense6 === void 0 ? void 0 : (_License$tradeLicense7 = _License$tradeLicense6.applicationDocuments) === null || _License$tradeLicense7 === void 0 ? void 0 : _License$tradeLicense7.forEach(function (document) {
45112
+ License === null || License === void 0 ? void 0 : (_License$tradeLicense42 = License.tradeLicenseDetail) === null || _License$tradeLicense42 === void 0 ? void 0 : (_License$tradeLicense43 = _License$tradeLicense42.applicationDocuments) === null || _License$tradeLicense43 === void 0 ? void 0 : _License$tradeLicense43.forEach(function (document) {
43876
45113
  if ((docType === null || docType === void 0 ? void 0 : docType.code) == (document === null || document === void 0 ? void 0 : document.documentType) && docType !== null && docType !== void 0 && docType.info) document.info = docType === null || docType === void 0 ? void 0 : docType.info;
43877
45114
  });
43878
45115
  });
@@ -43880,103 +45117,20 @@ var OBPSService = {
43880
45117
  });
43881
45118
  }
43882
45119
 
43883
- var details = [{
43884
- title: " ",
43885
- values: [{
43886
- title: "BPA_APPLICATION_NUMBER_LABEL",
43887
- value: (License === null || License === void 0 ? void 0 : License.applicationNumber) || "NA"
43888
- }]
43889
- }, License !== null && License !== void 0 && (_License$tradeLicense8 = License.tradeLicenseDetail) !== null && _License$tradeLicense8 !== void 0 && (_License$tradeLicense9 = _License$tradeLicense8.tradeUnits) !== null && _License$tradeLicense9 !== void 0 && (_License$tradeLicense10 = _License$tradeLicense9[0]) !== null && _License$tradeLicense10 !== void 0 && _License$tradeLicense10.tradeType.includes("ARCHITECT") ? {
43890
- title: "BPA_LICENSE_DETAILS_LABEL",
43891
- asSectionHeader: true,
43892
- values: [{
43893
- title: "BPA_LICENSE_TYPE",
43894
- value: "TRADELICENSE_TRADETYPE_" + (License === null || License === void 0 ? void 0 : (_License$tradeLicense11 = License.tradeLicenseDetail) === null || _License$tradeLicense11 === void 0 ? void 0 : (_License$tradeLicense12 = _License$tradeLicense11.tradeUnits) === null || _License$tradeLicense12 === void 0 ? void 0 : (_License$tradeLicense13 = _License$tradeLicense12[0]) === null || _License$tradeLicense13 === void 0 ? void 0 : (_License$tradeLicense14 = _License$tradeLicense13.tradeType) === null || _License$tradeLicense14 === void 0 ? void 0 : _License$tradeLicense14.split(".")[0]) || "NA"
43895
- }, {
43896
- title: "BPA_COUNCIL_OF_ARCH_NO_LABEL",
43897
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense15 = License.tradeLicenseDetail) === null || _License$tradeLicense15 === void 0 ? void 0 : (_License$tradeLicense16 = _License$tradeLicense15.additionalDetail) === null || _License$tradeLicense16 === void 0 ? void 0 : _License$tradeLicense16.counsilForArchNo) || "NA"
43898
- }]
43899
- } : {
43900
- title: "BPA_LICENSE_DETAILS_LABEL",
43901
- asSectionHeader: true,
43902
- values: [{
43903
- title: "BPA_LICENSE_TYPE",
43904
- value: "TRADELICENSE_TRADETYPE_" + (License === null || License === void 0 ? void 0 : (_License$tradeLicense17 = License.tradeLicenseDetail) === null || _License$tradeLicense17 === void 0 ? void 0 : (_License$tradeLicense18 = _License$tradeLicense17.tradeUnits) === null || _License$tradeLicense18 === void 0 ? void 0 : (_License$tradeLicense19 = _License$tradeLicense18[0]) === null || _License$tradeLicense19 === void 0 ? void 0 : (_License$tradeLicense20 = _License$tradeLicense19.tradeType) === null || _License$tradeLicense20 === void 0 ? void 0 : _License$tradeLicense20.split(".")[0]) || "NA"
43905
- }]
43906
- }, {
43907
- title: "BPA_LICENSEE_DETAILS_HEADER_OWNER_INFO",
43908
- asSectionHeader: true,
43909
- values: [{
43910
- title: "BPA_APPLICANT_NAME_LABEL",
43911
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense21 = License.tradeLicenseDetail) === null || _License$tradeLicense21 === void 0 ? void 0 : (_License$tradeLicense22 = _License$tradeLicense21.owners) === null || _License$tradeLicense22 === void 0 ? void 0 : (_License$tradeLicense23 = _License$tradeLicense22[0]) === null || _License$tradeLicense23 === void 0 ? void 0 : _License$tradeLicense23.name) || "NA"
43912
- }, {
43913
- title: "BPA_APPLICANT_GENDER_LABEL",
43914
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense24 = License.tradeLicenseDetail) === null || _License$tradeLicense24 === void 0 ? void 0 : (_License$tradeLicense25 = _License$tradeLicense24.owners) === null || _License$tradeLicense25 === void 0 ? void 0 : (_License$tradeLicense26 = _License$tradeLicense25[0]) === null || _License$tradeLicense26 === void 0 ? void 0 : _License$tradeLicense26.gender) || "NA"
43915
- }, {
43916
- title: "BPA_OWNER_MOBILE_NO_LABEL",
43917
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense27 = License.tradeLicenseDetail) === null || _License$tradeLicense27 === void 0 ? void 0 : (_License$tradeLicense28 = _License$tradeLicense27.owners) === null || _License$tradeLicense28 === void 0 ? void 0 : (_License$tradeLicense29 = _License$tradeLicense28[0]) === null || _License$tradeLicense29 === void 0 ? void 0 : _License$tradeLicense29.mobileNumber) || "NA"
43918
- }, {
43919
- title: "BPA_APPLICANT_EMAIL_LABEL",
43920
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense30 = License.tradeLicenseDetail) === null || _License$tradeLicense30 === void 0 ? void 0 : (_License$tradeLicense31 = _License$tradeLicense30.owners) === null || _License$tradeLicense31 === void 0 ? void 0 : (_License$tradeLicense32 = _License$tradeLicense31[0]) === null || _License$tradeLicense32 === void 0 ? void 0 : _License$tradeLicense32.emailId) || "NA"
43921
- }, {
43922
- title: "BPA_APPLICANT_PAN_NO",
43923
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense33 = License.tradeLicenseDetail) === null || _License$tradeLicense33 === void 0 ? void 0 : (_License$tradeLicense34 = _License$tradeLicense33.owners) === null || _License$tradeLicense34 === void 0 ? void 0 : (_License$tradeLicense35 = _License$tradeLicense34[0]) === null || _License$tradeLicense35 === void 0 ? void 0 : _License$tradeLicense35.pan) || "NA"
43924
- }]
43925
- }, {
43926
- title: "BPA_PERMANANT_ADDRESS_LABEL",
43927
- asSectionHeader: true,
43928
- values: [{
43929
- title: "BPA_PERMANANT_ADDRESS_LABEL",
43930
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense36 = License.tradeLicenseDetail) === null || _License$tradeLicense36 === void 0 ? void 0 : (_License$tradeLicense37 = _License$tradeLicense36.owners) === null || _License$tradeLicense37 === void 0 ? void 0 : (_License$tradeLicense38 = _License$tradeLicense37[0]) === null || _License$tradeLicense38 === void 0 ? void 0 : _License$tradeLicense38.permanentAddress) || "NA"
43931
- }]
43932
- }, {
43933
- title: "BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL",
43934
- asSectionHeader: true,
43935
- values: [{
43936
- title: "BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL",
43937
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense39 = License.tradeLicenseDetail) === null || _License$tradeLicense39 === void 0 ? void 0 : (_License$tradeLicense40 = _License$tradeLicense39.owners) === null || _License$tradeLicense40 === void 0 ? void 0 : (_License$tradeLicense41 = _License$tradeLicense40[0]) === null || _License$tradeLicense41 === void 0 ? void 0 : _License$tradeLicense41.correspondenceAddress) || "NA"
43938
- }]
43939
- }, {
43940
- title: "BPA_DOCUMENT_DETAILS_LABEL",
43941
- asSectionHeader: true,
43942
- additionalDetails: {
43943
- documents: [{
43944
- title: "",
43945
- values: License === null || License === void 0 ? void 0 : (_License$tradeLicense42 = License.tradeLicenseDetail) === null || _License$tradeLicense42 === void 0 ? void 0 : (_License$tradeLicense43 = _License$tradeLicense42.applicationDocuments) === null || _License$tradeLicense43 === void 0 ? void 0 : _License$tradeLicense43.map(function (doc) {
43946
- var _doc$documentType;
45120
+ var appDocumentFileStoreIds = License === null || License === void 0 ? void 0 : (_License$tradeLicense44 = License.tradeLicenseDetail) === null || _License$tradeLicense44 === void 0 ? void 0 : (_License$tradeLicense45 = _License$tradeLicense44.applicationDocuments) === null || _License$tradeLicense45 === void 0 ? void 0 : _License$tradeLicense45.map(function (appDoc) {
45121
+ return appDoc === null || appDoc === void 0 ? void 0 : appDoc.fileStoreId;
45122
+ });
45123
+ var fileDetails = {};
43947
45124
 
43948
- return {
43949
- title: "BPAREG_HEADER_" + (doc === null || doc === void 0 ? void 0 : (_doc$documentType = doc.documentType) === null || _doc$documentType === void 0 ? void 0 : _doc$documentType.replaceAll('.', '_')),
43950
- documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
43951
- documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
43952
- fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
43953
- id: doc === null || doc === void 0 ? void 0 : doc.id,
43954
- docInfo: doc === null || doc === void 0 ? void 0 : doc.info
43955
- };
43956
- })
43957
- }]
45125
+ var _temp = function () {
45126
+ if ((appDocumentFileStoreIds === null || appDocumentFileStoreIds === void 0 ? void 0 : appDocumentFileStoreIds.length) > 0) {
45127
+ return Promise.resolve(UploadServices.Filefetch(appDocumentFileStoreIds, Digit.ULBService.getStateId())).then(function (_UploadServices$Filef) {
45128
+ fileDetails = _UploadServices$Filef;
45129
+ });
43958
45130
  }
43959
- }, (paymentRes === null || paymentRes === void 0 ? void 0 : (_paymentRes$Payments = paymentRes.Payments) === null || _paymentRes$Payments === void 0 ? void 0 : _paymentRes$Payments.length) > 0 && {
43960
- title: "BPA_FEE_DETAILS_LABEL",
43961
- additionalDetails: {
43962
- inspectionReport: [],
43963
- values: [{
43964
- title: "BPAREG_FEES",
43965
- value: /*#__PURE__*/React__default.createElement("span", null, "\u20B9", paymentRes === null || paymentRes === void 0 ? void 0 : (_paymentRes$Payments2 = paymentRes.Payments) === null || _paymentRes$Payments2 === void 0 ? void 0 : (_paymentRes$Payments3 = _paymentRes$Payments2[0]) === null || _paymentRes$Payments3 === void 0 ? void 0 : _paymentRes$Payments3.totalAmountPaid)
43966
- }, (_ref = {
43967
- title: "BPA_STATUS_LABEL",
43968
- isTransLate: true,
43969
- isStatus: true,
43970
- value: paymentRes !== null && paymentRes !== void 0 && (_paymentRes$Payments4 = paymentRes.Payments) !== null && _paymentRes$Payments4 !== void 0 && (_paymentRes$Payments5 = _paymentRes$Payments4[0]) !== null && _paymentRes$Payments5 !== void 0 && _paymentRes$Payments5.totalAmountPaid ? "WF_BPA_PAID" : "NA"
43971
- }, _ref["isTransLate"] = true, _ref)]
43972
- }
43973
- }];
43974
- return {
43975
- applicationData: License,
43976
- applicationDetails: details,
43977
- tenantId: License === null || License === void 0 ? void 0 : License.tenantId,
43978
- payments: (paymentRes === null || paymentRes === void 0 ? void 0 : paymentRes.Payments) || []
43979
- };
45131
+ }();
45132
+
45133
+ return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
43980
45134
  });
43981
45135
  });
43982
45136
  });
@@ -43987,16 +45141,28 @@ var OBPSService = {
43987
45141
  BPADetailsPage: function (tenantId, filters) {
43988
45142
  try {
43989
45143
  return Promise.resolve(OBPSService.BPASearch(tenantId, filters)).then(function (response) {
43990
- var _response$BPA, _response$BPA2, _response$BPA2$, _response$BPA2$$addit, _response$BPA3, _response$BPA3$, _response$BPA3$$addit;
45144
+ var _response$BPA, _response$BPA$, _response$BPA$$docume, _response$BPA2, _response$BPA2$, _response$BPA2$$addit, _response$BPA2$$addit2, _response$BPA3, _response$BPA4, _response$BPA4$, _response$BPA4$$addit, _response$BPA5, _response$BPA5$, _response$BPA5$$addit;
43991
45145
 
43992
- if (!(response !== null && response !== void 0 && (_response$BPA = response.BPA) !== null && _response$BPA !== void 0 && _response$BPA.length)) {
45146
+ var appDocumentFileStoreIds = response === null || response === void 0 ? void 0 : (_response$BPA = response.BPA) === null || _response$BPA === void 0 ? void 0 : (_response$BPA$ = _response$BPA[0]) === null || _response$BPA$ === void 0 ? void 0 : (_response$BPA$$docume = _response$BPA$.documents) === null || _response$BPA$$docume === void 0 ? void 0 : _response$BPA$$docume.map(function (docId) {
45147
+ return docId.fileStoreId;
45148
+ });
45149
+ if (!appDocumentFileStoreIds) appDocumentFileStoreIds = [];
45150
+ response === null || response === void 0 ? void 0 : (_response$BPA2 = response.BPA) === null || _response$BPA2 === void 0 ? void 0 : (_response$BPA2$ = _response$BPA2[0]) === null || _response$BPA2$ === void 0 ? void 0 : (_response$BPA2$$addit = _response$BPA2$.additionalDetails) === null || _response$BPA2$$addit === void 0 ? void 0 : (_response$BPA2$$addit2 = _response$BPA2$$addit.fieldinspection_pending) === null || _response$BPA2$$addit2 === void 0 ? void 0 : _response$BPA2$$addit2.map(function (fiData) {
45151
+ var _fiData$docs;
45152
+
45153
+ fiData === null || fiData === void 0 ? void 0 : (_fiData$docs = fiData.docs) === null || _fiData$docs === void 0 ? void 0 : _fiData$docs.map(function (fiDoc) {
45154
+ if (fiDoc !== null && fiDoc !== void 0 && fiDoc.fileStoreId) appDocumentFileStoreIds.push(fiDoc === null || fiDoc === void 0 ? void 0 : fiDoc.fileStoreId);
45155
+ });
45156
+ });
45157
+
45158
+ if (!(response !== null && response !== void 0 && (_response$BPA3 = response.BPA) !== null && _response$BPA3 !== void 0 && _response$BPA3.length)) {
43993
45159
  return;
43994
45160
  }
43995
45161
 
43996
- sessionStorage.setItem("BPA_ARCHITECT_NAME", JSON.stringify(response !== null && response !== void 0 && (_response$BPA2 = response.BPA) !== null && _response$BPA2 !== void 0 && (_response$BPA2$ = _response$BPA2[0]) !== null && _response$BPA2$ !== void 0 && (_response$BPA2$$addit = _response$BPA2$.additionalDetails) !== null && _response$BPA2$$addit !== void 0 && _response$BPA2$$addit.typeOfArchitect ? response === null || response === void 0 ? void 0 : (_response$BPA3 = response.BPA) === null || _response$BPA3 === void 0 ? void 0 : (_response$BPA3$ = _response$BPA3[0]) === null || _response$BPA3$ === void 0 ? void 0 : (_response$BPA3$$addit = _response$BPA3$.additionalDetails) === null || _response$BPA3$$addit === void 0 ? void 0 : _response$BPA3$$addit.typeOfArchitect : "ARCHITECT"));
45162
+ sessionStorage.setItem("BPA_ARCHITECT_NAME", JSON.stringify(response !== null && response !== void 0 && (_response$BPA4 = response.BPA) !== null && _response$BPA4 !== void 0 && (_response$BPA4$ = _response$BPA4[0]) !== null && _response$BPA4$ !== void 0 && (_response$BPA4$$addit = _response$BPA4$.additionalDetails) !== null && _response$BPA4$$addit !== void 0 && _response$BPA4$$addit.typeOfArchitect ? response === null || response === void 0 ? void 0 : (_response$BPA5 = response.BPA) === null || _response$BPA5 === void 0 ? void 0 : (_response$BPA5$ = _response$BPA5[0]) === null || _response$BPA5$ === void 0 ? void 0 : (_response$BPA5$$addit = _response$BPA5$.additionalDetails) === null || _response$BPA5$$addit === void 0 ? void 0 : _response$BPA5$$addit.typeOfArchitect : "ARCHITECT"));
43997
45163
 
43998
- var _response$BPA4 = response === null || response === void 0 ? void 0 : response.BPA,
43999
- BPA = _response$BPA4[0];
45164
+ var _response$BPA6 = response === null || response === void 0 ? void 0 : response.BPA,
45165
+ BPA = _response$BPA6[0];
44000
45166
 
44001
45167
  return Promise.resolve(OBPSService.scrutinyDetails(BPA === null || BPA === void 0 ? void 0 : BPA.tenantId, {
44002
45168
  edcrNumber: BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber
@@ -44007,507 +45173,541 @@ var OBPSService = {
44007
45173
  return Promise.resolve(MdmsService.getMultipleTypes(tenantId, "BPA", ["RiskTypeComputation", "CheckList"])).then(function (mdmsRes) {
44008
45174
  var _mdmsRes$BPA, _edcr$planDetail, _edcr$planDetail$plot, _edcr$planDetail2;
44009
45175
 
44010
- var riskType = Digit.Utils.obps.calculateRiskType(mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$BPA = mdmsRes.BPA) === null || _mdmsRes$BPA === void 0 ? void 0 : _mdmsRes$BPA.RiskTypeComputation, edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail = edcr.planDetail) === null || _edcr$planDetail === void 0 ? void 0 : (_edcr$planDetail$plot = _edcr$planDetail.plot) === null || _edcr$planDetail$plot === void 0 ? void 0 : _edcr$planDetail$plot.area, edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail2 = edcr.planDetail) === null || _edcr$planDetail2 === void 0 ? void 0 : _edcr$planDetail2.blocks);
44011
- BPA.riskType = riskType;
44012
- return Promise.resolve(OBPSService.NOCSearch(BPA === null || BPA === void 0 ? void 0 : BPA.tenantId, {
44013
- sourceRefId: BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo
44014
- })).then(function (nocResponse) {
44015
- var noc = nocResponse === null || nocResponse === void 0 ? void 0 : nocResponse.Noc;
44016
- var filter = {
44017
- approvalNo: edcr === null || edcr === void 0 ? void 0 : edcr.permitNumber
44018
- };
44019
- return Promise.resolve(OBPSService.BPASearch(tenantId, _extends({}, filter))).then(function (bpaResponse) {
44020
- var _bpaResponse$BPA, _bpaResponse$BPA$, _bpaResponse$BPA2, _bpaResponse$BPA2$, _bpaResponse$BPA3, _bpaResponse$BPA3$;
45176
+ var riskType = Digit.Utils.obps.calculateRiskType(mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$BPA = mdmsRes.BPA) === null || _mdmsRes$BPA === void 0 ? void 0 : _mdmsRes$BPA.RiskTypeComputation, edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail = edcr.planDetail) === null || _edcr$planDetail === void 0 ? void 0 : (_edcr$planDetail$plot = _edcr$planDetail.plot) === null || _edcr$planDetail$plot === void 0 ? void 0 : _edcr$planDetail$plot.area, edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail2 = edcr.planDetail) === null || _edcr$planDetail2 === void 0 ? void 0 : _edcr$planDetail2.blocks);
45177
+ BPA.riskType = riskType;
45178
+ return Promise.resolve(OBPSService.NOCSearch(BPA === null || BPA === void 0 ? void 0 : BPA.tenantId, {
45179
+ sourceRefId: BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo
45180
+ })).then(function (nocResponse) {
45181
+ var noc = nocResponse === null || nocResponse === void 0 ? void 0 : nocResponse.Noc;
45182
+ var filter = {
45183
+ approvalNo: edcr === null || edcr === void 0 ? void 0 : edcr.permitNumber
45184
+ };
45185
+ return Promise.resolve(OBPSService.BPASearch(tenantId, _extends({}, filter))).then(function (bpaResponse) {
45186
+ var _bpaResponse$BPA, _bpaResponse$BPA$, _bpaResponse$BPA2, _bpaResponse$BPA2$, _bpaResponse$BPA3, _bpaResponse$BPA3$;
45187
+
45188
+ var comparisionRep = {
45189
+ ocdcrNumber: BPA !== null && BPA !== void 0 && BPA.edcrNumber.includes("OCDCR") ? BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber : bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA = bpaResponse.BPA) === null || _bpaResponse$BPA === void 0 ? void 0 : (_bpaResponse$BPA$ = _bpaResponse$BPA[0]) === null || _bpaResponse$BPA$ === void 0 ? void 0 : _bpaResponse$BPA$.edcrNumber,
45190
+ edcrNumber: bpaResponse !== null && bpaResponse !== void 0 && (_bpaResponse$BPA2 = bpaResponse.BPA) !== null && _bpaResponse$BPA2 !== void 0 && (_bpaResponse$BPA2$ = _bpaResponse$BPA2[0]) !== null && _bpaResponse$BPA2$ !== void 0 && _bpaResponse$BPA2$.edcrNumber.includes("OCDCR") ? BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber : bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA3 = bpaResponse.BPA) === null || _bpaResponse$BPA3 === void 0 ? void 0 : (_bpaResponse$BPA3$ = _bpaResponse$BPA3[0]) === null || _bpaResponse$BPA3$ === void 0 ? void 0 : _bpaResponse$BPA3$.edcrNumber
45191
+ };
45192
+ return Promise.resolve(OBPSService.comparisionReport(BPA === null || BPA === void 0 ? void 0 : BPA.tenantId, _extends({}, comparisionRep))).then(function (comparisionReport) {
45193
+ function _temp4() {
45194
+ var _BPA$additionalDetail, _BPA$additionalDetail2, _BPA$additionalDetail3, _BPA$additionalDetail4, _BPA$additionalDetail5, _BPA$additionalDetail6, _BPA$additionalDetail7, _permitcondn, _permitcondn2, _BPA$auditDetails, _BPA$auditDetails2, _edcr$planDetail3, _edcr$planDetail3$pla, _edcr$planDetail4, _edcr$planDetail4$pla, _edcr$planDetail5, _edcr$planDetail5$pla, _edcr$planDetail6, _edcr$planDetail6$pla, _edcr$planDetail7, _edcr$planDetail7$pla, _BPA$additionalDetail11, _BPA$additionalDetail12, _edcr$planDetail8, _edcr$planDetail8$blo, _edcr$planDetail8$blo2, _edcr$planDetail8$blo3, _edcr$planDetail9, _edcr$planDetail9$blo, _edcr$planDetail9$blo2, _edcr$planDetail9$blo3, _edcr$planDetail10, _edcr$planDetail10$bl, _edcr$planDetail10$bl2, _edcr$planDetail10$bl3, _edcr$planDetail11, _edcr$planDetail11$pl, _BPA$landInfo, _BPA$landInfo$address, _BPA$landInfo2, _BPA$landInfo2$addres, _BPA$landInfo3, _BPA$landInfo3$addres, _BPA$landInfo3$addres2, _BPA$landInfo4, _BPA$landInfo4$addres, _BPA$landInfo5, _BPA$landInfo5$addres, _BPA$landInfo6, _BPA$landInfo6$owners, _BPA$landInfo7, _BPA$landInfo7$owners, _BPA$landInfo9, _BPA$landInfo9$owners, _BPA$documents, _BPA$additionalDetail13, _BPA$additionalDetail14, _BPA$additionalDetail15, _BPA$additionalDetail16, _BPA$additionalDetail17, _BPA$additionalDetail18, _BPA$additionalDetail19, _details;
45195
+
45196
+ function ConvertEpochToValidityDate(dateEpoch) {
45197
+ if (dateEpoch == null || dateEpoch == undefined || dateEpoch == '') {
45198
+ return "NA";
45199
+ }
45200
+
45201
+ var dateFromApi = new Date(dateEpoch);
45202
+ var month = dateFromApi.getMonth() + 1;
45203
+ var day = dateFromApi.getDate();
45204
+ var year = dateFromApi.getFullYear() - 3;
45205
+ month = (month > 9 ? "" : "0") + month;
45206
+ day = (day > 9 ? "" : "0") + day;
45207
+ return day + "/" + month + "/" + year;
45208
+ }
45209
+
45210
+ BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail = BPA.additionalDetails) === null || _BPA$additionalDetail === void 0 ? void 0 : (_BPA$additionalDetail2 = _BPA$additionalDetail.fieldinspection_pending) === null || _BPA$additionalDetail2 === void 0 ? void 0 : _BPA$additionalDetail2.forEach(function (fiData) {
45211
+ var _fiData$docs2;
45212
+
45213
+ fiData === null || fiData === void 0 ? void 0 : (_fiData$docs2 = fiData.docs) === null || _fiData$docs2 === void 0 ? void 0 : _fiData$docs2.forEach(function (fiDoc) {
45214
+ var _fileDetails3, _fileDetails4, _fileDetails4$data$fi;
45215
+
45216
+ if ((_fileDetails3 = fileDetails) !== null && _fileDetails3 !== void 0 && _fileDetails3.data[fiDoc === null || fiDoc === void 0 ? void 0 : fiDoc.fileStoreId]) fiDoc.url = (_fileDetails4 = fileDetails) === null || _fileDetails4 === void 0 ? void 0 : (_fileDetails4$data$fi = _fileDetails4.data[fiDoc === null || fiDoc === void 0 ? void 0 : fiDoc.fileStoreId]) === null || _fileDetails4$data$fi === void 0 ? void 0 : _fileDetails4$data$fi.split(',')[0];
45217
+ });
45218
+ });
45219
+ var nocDetails = noc === null || noc === void 0 ? void 0 : noc.map(function (nocDetails, index) {
45220
+ var _nocDetails$additiona, _nocDetails$additiona2, _nocDetails$additiona3, _nocDetails$auditDeta, _nocDetails$documents;
45221
+
45222
+ return {
45223
+ title: index === 0 ? "BPA_NOC_DETAILS_SUMMARY" : "",
45224
+ values: [{
45225
+ title: "BPA_" + (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocType) + "_LABEL",
45226
+ value: nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationNo,
45227
+ isNotTranslated: true
45228
+ }, {
45229
+ title: "BPA_NOC_STATUS",
45230
+ value: nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus,
45231
+ field: "STATUS"
45232
+ }, (nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$additiona = nocDetails.additionalDetails) === null || _nocDetails$additiona === void 0 ? void 0 : _nocDetails$additiona.SubmittedOn) && {
45233
+ title: "BPA_SUDMITTED_ON_LABEL",
45234
+ value: nocDetails !== null && nocDetails !== void 0 && (_nocDetails$additiona2 = nocDetails.additionalDetails) !== null && _nocDetails$additiona2 !== void 0 && _nocDetails$additiona2.SubmittedOn ? dateFns.format(new Date(Number(nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$additiona3 = nocDetails.additionalDetails) === null || _nocDetails$additiona3 === void 0 ? void 0 : _nocDetails$additiona3.SubmittedOn)), 'dd/MM/yyyy') : "NA",
45235
+ isNotTranslated: true
45236
+ }, (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) && {
45237
+ title: "BPA_APPROVAL_NUMBER_LABEL",
45238
+ value: (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) || "NA",
45239
+ isNotTranslated: true
45240
+ }, (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) && {
45241
+ title: "BPA_APPROVED_REJECTED_ON_LABEL",
45242
+ value: (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "APPROVED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "REJECTED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "AUTO_APPROVED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "AUTO_REJECTED" ? dateFns.format(new Date(Number(nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$auditDeta = nocDetails.auditDetails) === null || _nocDetails$auditDeta === void 0 ? void 0 : _nocDetails$auditDeta.lastModifiedTime)), 'dd/MM/yyyy') : "NA",
45243
+ isNotTranslated: true
45244
+ }],
45245
+ additionalDetails: {
45246
+ data: nocDetails,
45247
+ noc: [{
45248
+ title: "BPA_DOCUMENT_DETAILS_LABEL",
45249
+ values: nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$documents = nocDetails.documents) === null || _nocDetails$documents === void 0 ? void 0 : _nocDetails$documents.map(function (doc) {
45250
+ var _doc$documentType2, _fileDetails5, _fileDetails5$data, _fileDetails6, _fileDetails6$data, _fileDetails6$data$do;
45251
+
45252
+ return {
45253
+ title: doc === null || doc === void 0 ? void 0 : (_doc$documentType2 = doc.documentType) === null || _doc$documentType2 === void 0 ? void 0 : _doc$documentType2.replaceAll('.', '_'),
45254
+ documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
45255
+ documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
45256
+ fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
45257
+ id: doc === null || doc === void 0 ? void 0 : doc.id,
45258
+ url: (_fileDetails5 = fileDetails) !== null && _fileDetails5 !== void 0 && (_fileDetails5$data = _fileDetails5.data) !== null && _fileDetails5$data !== void 0 && _fileDetails5$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId] ? (_fileDetails6 = fileDetails) === null || _fileDetails6 === void 0 ? void 0 : (_fileDetails6$data = _fileDetails6.data) === null || _fileDetails6$data === void 0 ? void 0 : (_fileDetails6$data$do = _fileDetails6$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId]) === null || _fileDetails6$data$do === void 0 ? void 0 : _fileDetails6$data$do.split(',')[0] : ""
45259
+ };
45260
+ })
45261
+ }]
45262
+ }
45263
+ };
45264
+ });
45265
+ var inspectionReport = [];
45266
+ var checklist = [];
45267
+ BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail3 = BPA.additionalDetails) === null || _BPA$additionalDetail3 === void 0 ? void 0 : (_BPA$additionalDetail4 = _BPA$additionalDetail3.fieldinspection_pending) === null || _BPA$additionalDetail4 === void 0 ? void 0 : _BPA$additionalDetail4.filter(function (ob) {
45268
+ return ob.docs && ob.docs.length > 0;
45269
+ }).map(function (ob, ind) {
45270
+ var _ob$date, _ob$date2, _ob$date3, _ob$questions, _ob$docs;
45271
+
45272
+ checklist = [];
45273
+ inspectionReport.push({
45274
+ title: "BPA_FI_REPORT",
45275
+ asSectionHeader: true,
45276
+ values: [{
45277
+ title: "BPA_FI_DATE_LABEL",
45278
+ value: ob.date.includes("-") ? ((_ob$date = ob.date) === null || _ob$date === void 0 ? void 0 : _ob$date.split("-")[2]) + "/" + ((_ob$date2 = ob.date) === null || _ob$date2 === void 0 ? void 0 : _ob$date2.split("-")[1]) + "/" + ((_ob$date3 = ob.date) === null || _ob$date3 === void 0 ? void 0 : _ob$date3.split("-")[0]) : ob.date
45279
+ }, {
45280
+ title: "BPA_FI_TIME_LABEL",
45281
+ value: ob.time
45282
+ }]
45283
+ });
45284
+ ob === null || ob === void 0 ? void 0 : (_ob$questions = ob.questions) === null || _ob$questions === void 0 ? void 0 : _ob$questions.map(function (q, index) {
45285
+ checklist.push({
45286
+ title: q.question,
45287
+ value: q.value
45288
+ });
45289
+ checklist.push({
45290
+ title: "BPA_ENTER_REMARKS",
45291
+ value: q.remarks
45292
+ });
45293
+ });
45294
+ inspectionReport.push({
45295
+ title: "BPA_CHECK_LIST_DETAILS",
45296
+ asSectionHeader: true,
45297
+ values: checklist
45298
+ });
45299
+ inspectionReport.push({
45300
+ title: "BPA_DOCUMENT_DETAILS_LABEL",
45301
+ asSectionHeader: true,
45302
+ additionalDetails: {
45303
+ obpsDocuments: [{
45304
+ title: "",
45305
+ values: ob === null || ob === void 0 ? void 0 : (_ob$docs = ob.docs) === null || _ob$docs === void 0 ? void 0 : _ob$docs.map(function (doc) {
45306
+ var _doc$documentType3, _fileDetails7, _fileDetails7$data, _fileDetails8, _fileDetails8$data, _fileDetails8$data$do;
45307
+
45308
+ return {
45309
+ title: doc === null || doc === void 0 ? void 0 : (_doc$documentType3 = doc.documentType) === null || _doc$documentType3 === void 0 ? void 0 : _doc$documentType3.replaceAll('.', '_'),
45310
+ documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
45311
+ documentUid: doc === null || doc === void 0 ? void 0 : doc.fileStore,
45312
+ fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
45313
+ id: doc === null || doc === void 0 ? void 0 : doc.id,
45314
+ url: (_fileDetails7 = fileDetails) !== null && _fileDetails7 !== void 0 && (_fileDetails7$data = _fileDetails7.data) !== null && _fileDetails7$data !== void 0 && _fileDetails7$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId] ? (_fileDetails8 = fileDetails) === null || _fileDetails8 === void 0 ? void 0 : (_fileDetails8$data = _fileDetails8.data) === null || _fileDetails8$data === void 0 ? void 0 : (_fileDetails8$data$do = _fileDetails8$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId]) === null || _fileDetails8$data$do === void 0 ? void 0 : _fileDetails8$data$do.split(',')[0] : ""
45315
+ };
45316
+ })
45317
+ }]
45318
+ }
45319
+ });
45320
+ });
45321
+ var details = [];
45322
+ var applicationDetailsInfo = {
45323
+ title: " ",
45324
+ isCommon: true,
45325
+ values: [{
45326
+ title: "BPA_APPLICATION_NUMBER_LABEL",
45327
+ value: (BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo) || "NA"
45328
+ }]
45329
+ };
45330
+
45331
+ if (BPA !== null && BPA !== void 0 && BPA.businessService.includes("BPA_OC")) {
45332
+ var _bpaResponse$BPA4, _bpaResponse$BPA4$, _bpaResponse$BPA5, _bpaResponse$BPA5$;
44021
45333
 
44022
- var comparisionRep = {
44023
- ocdcrNumber: BPA !== null && BPA !== void 0 && BPA.edcrNumber.includes("OCDCR") ? BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber : bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA = bpaResponse.BPA) === null || _bpaResponse$BPA === void 0 ? void 0 : (_bpaResponse$BPA$ = _bpaResponse$BPA[0]) === null || _bpaResponse$BPA$ === void 0 ? void 0 : _bpaResponse$BPA$.edcrNumber,
44024
- edcrNumber: bpaResponse !== null && bpaResponse !== void 0 && (_bpaResponse$BPA2 = bpaResponse.BPA) !== null && _bpaResponse$BPA2 !== void 0 && (_bpaResponse$BPA2$ = _bpaResponse$BPA2[0]) !== null && _bpaResponse$BPA2$ !== void 0 && _bpaResponse$BPA2$.edcrNumber.includes("OCDCR") ? BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber : bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA3 = bpaResponse.BPA) === null || _bpaResponse$BPA3 === void 0 ? void 0 : (_bpaResponse$BPA3$ = _bpaResponse$BPA3[0]) === null || _bpaResponse$BPA3$ === void 0 ? void 0 : _bpaResponse$BPA3$.edcrNumber
44025
- };
45334
+ applicationDetailsInfo["values"] = [].concat(applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : applicationDetailsInfo.values, [{
45335
+ title: "BPA_PERMIT_APP_NUMBER",
45336
+ to: "/digit-ui/employee/obps/bpa/" + (bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA4 = bpaResponse.BPA) === null || _bpaResponse$BPA4 === void 0 ? void 0 : (_bpaResponse$BPA4$ = _bpaResponse$BPA4[0]) === null || _bpaResponse$BPA4$ === void 0 ? void 0 : _bpaResponse$BPA4$.applicationNo),
45337
+ value: bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA5 = bpaResponse.BPA) === null || _bpaResponse$BPA5 === void 0 ? void 0 : (_bpaResponse$BPA5$ = _bpaResponse$BPA5[0]) === null || _bpaResponse$BPA5$ === void 0 ? void 0 : _bpaResponse$BPA5$.applicationNo,
45338
+ isLink: true
45339
+ }]);
45340
+ }
44026
45341
 
44027
- function ConvertEpochToValidityDate(dateEpoch) {
44028
- if (dateEpoch == null || dateEpoch == undefined || dateEpoch == '') {
44029
- return "NA";
44030
- }
45342
+ var permitcondn = [];
45343
+ (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail5 = BPA.additionalDetails) === null || _BPA$additionalDetail5 === void 0 ? void 0 : _BPA$additionalDetail5.pendingapproval) && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail6 = BPA.additionalDetails) === null || _BPA$additionalDetail6 === void 0 ? void 0 : _BPA$additionalDetail6.pendingapproval.length) > 0 && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail7 = BPA.additionalDetails) === null || _BPA$additionalDetail7 === void 0 ? void 0 : _BPA$additionalDetail7.pendingapproval.map(function (ob, index) {
45344
+ permitcondn.push({
45345
+ title: index + 1 + ". " + ob,
45346
+ value: ""
45347
+ });
45348
+ }));
45349
+ var PermitConditions = {
45350
+ title: "BPA_PERMIT_CONDITIONS",
45351
+ isTitleVisible: ((_permitcondn = permitcondn) === null || _permitcondn === void 0 ? void 0 : _permitcondn.length) > 0 ? false : true,
45352
+ isNotAllowed: ((_permitcondn2 = permitcondn) === null || _permitcondn2 === void 0 ? void 0 : _permitcondn2.length) > 0 ? false : true,
45353
+ additionalDetails: {
45354
+ inspectionReport: [],
45355
+ permit: [].concat(permitcondn)
45356
+ }
45357
+ };
45358
+ if (permitcondn.length == 0) PermitConditions = {};
44031
45359
 
44032
- var dateFromApi = new Date(dateEpoch);
44033
- var month = dateFromApi.getMonth() + 1;
44034
- var day = dateFromApi.getDate();
44035
- var year = dateFromApi.getFullYear() - 3;
44036
- month = (month > 9 ? "" : "0") + month;
44037
- day = (day > 9 ? "" : "0") + day;
44038
- return day + "/" + month + "/" + year;
44039
- }
45360
+ if (riskType == "LOW" && permitcondn.length > 0) {
45361
+ permitcondn = [];
45362
+ PermitConditions = {};
45363
+ }
44040
45364
 
44041
- return Promise.resolve(OBPSService.comparisionReport(BPA === null || BPA === void 0 ? void 0 : BPA.tenantId, _extends({}, comparisionRep))).then(function (comparisionReport) {
44042
- var _BPA$additionalDetail, _BPA$additionalDetail2, _BPA$additionalDetail3, _BPA$additionalDetail4, _BPA$additionalDetail5, _permitcondn, _permitcondn2, _BPA$auditDetails, _BPA$auditDetails2, _edcr$planDetail3, _edcr$planDetail3$pla, _edcr$planDetail4, _edcr$planDetail4$pla, _edcr$planDetail5, _edcr$planDetail5$pla, _edcr$planDetail6, _edcr$planDetail6$pla, _edcr$planDetail7, _edcr$planDetail7$pla, _BPA$additionalDetail9, _BPA$additionalDetail10, _edcr$planDetail8, _edcr$planDetail8$blo, _edcr$planDetail8$blo2, _edcr$planDetail8$blo3, _edcr$planDetail9, _edcr$planDetail9$blo, _edcr$planDetail9$blo2, _edcr$planDetail9$blo3, _edcr$planDetail10, _edcr$planDetail10$bl, _edcr$planDetail10$bl2, _edcr$planDetail10$bl3, _edcr$planDetail11, _edcr$planDetail11$pl, _BPA$landInfo, _BPA$landInfo$address, _BPA$landInfo2, _BPA$landInfo2$addres, _BPA$landInfo3, _BPA$landInfo3$addres, _BPA$landInfo3$addres2, _BPA$landInfo4, _BPA$landInfo4$addres, _BPA$landInfo5, _BPA$landInfo5$addres, _BPA$landInfo6, _BPA$landInfo6$owners, _BPA$landInfo7, _BPA$landInfo7$owners, _BPA$landInfo9, _BPA$landInfo9$owners, _BPA$documents, _BPA$additionalDetail11, _BPA$additionalDetail12, _BPA$additionalDetail13, _BPA$additionalDetail14, _BPA$additionalDetail15, _BPA$additionalDetail16, _BPA$additionalDetail17, _details;
45365
+ if (BPA !== null && BPA !== void 0 && BPA.approvalNo) {
45366
+ var _applicationDetailsIn, _applicationDetailsIn2, _BPA$additionalDetail8, _BPA$additionalDetail9, _BPA$additionalDetail10;
44043
45367
 
44044
- var nocDetails = noc === null || noc === void 0 ? void 0 : noc.map(function (nocDetails, index) {
44045
- var _nocDetails$additiona, _nocDetails$additiona2, _nocDetails$additiona3, _nocDetails$auditDeta, _nocDetails$documents;
45368
+ applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : (_applicationDetailsIn = applicationDetailsInfo.values) === null || _applicationDetailsIn === void 0 ? void 0 : _applicationDetailsIn.push({
45369
+ title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_PERMIT_NUMBER_LABEL" : "BPA_OC_PERMIT_NUMBER_LABEL",
45370
+ value: (BPA === null || BPA === void 0 ? void 0 : BPA.approvalNo) || "NA"
45371
+ });
45372
+ applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : (_applicationDetailsIn2 = applicationDetailsInfo.values) === null || _applicationDetailsIn2 === void 0 ? void 0 : _applicationDetailsIn2.push({
45373
+ title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_PERMIT_VALIDITY" : "BPA_OC_PERMIT_VALIDITY",
45374
+ value: BPA !== null && BPA !== void 0 && (_BPA$additionalDetail8 = BPA.additionalDetails) !== null && _BPA$additionalDetail8 !== void 0 && _BPA$additionalDetail8.validityDate ? ConvertEpochToValidityDate(BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail9 = BPA.additionalDetails) === null || _BPA$additionalDetail9 === void 0 ? void 0 : _BPA$additionalDetail9.validityDate) + " - " + dateFns.format(new Date(BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail10 = BPA.additionalDetails) === null || _BPA$additionalDetail10 === void 0 ? void 0 : _BPA$additionalDetail10.validityDate), 'dd/MM/yyyy') : "NA"
45375
+ });
45376
+ }
44046
45377
 
44047
- return {
44048
- title: index === 0 ? "BPA_NOC_DETAILS_SUMMARY" : "",
45378
+ var basicDetails = {
45379
+ title: "BPA_BASIC_DETAILS_TITLE",
45380
+ asSectionHeader: true,
45381
+ isInsert: true,
45382
+ isCommon: true,
45383
+ values: [{
45384
+ title: "BPA_BASIC_DETAILS_APP_DATE_LABEL",
45385
+ value: BPA !== null && BPA !== void 0 && (_BPA$auditDetails = BPA.auditDetails) !== null && _BPA$auditDetails !== void 0 && _BPA$auditDetails.createdTime ? dateFns.format(new Date(BPA === null || BPA === void 0 ? void 0 : (_BPA$auditDetails2 = BPA.auditDetails) === null || _BPA$auditDetails2 === void 0 ? void 0 : _BPA$auditDetails2.createdTime), 'dd/MM/yyyy') : ''
45386
+ }, {
45387
+ title: "BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL",
45388
+ value: "WF_BPA_" + (edcr === null || edcr === void 0 ? void 0 : edcr.appliactionType)
45389
+ }, {
45390
+ title: "BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL",
45391
+ value: edcr === null || edcr === void 0 ? void 0 : edcr.applicationSubType
45392
+ }, {
45393
+ title: "BPA_BASIC_DETAILS_OCCUPANCY_LABEL",
45394
+ value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail3 = edcr.planDetail) === null || _edcr$planDetail3 === void 0 ? void 0 : (_edcr$planDetail3$pla = _edcr$planDetail3.planInformation) === null || _edcr$planDetail3$pla === void 0 ? void 0 : _edcr$planDetail3$pla.occupancy
45395
+ }, {
45396
+ title: "BPA_BASIC_DETAILS_RISK_TYPE_LABEL",
45397
+ value: "WF_BPA_" + riskType,
45398
+ isInsert: true
45399
+ }, {
45400
+ title: "BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL",
45401
+ value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail4 = edcr.planDetail) === null || _edcr$planDetail4 === void 0 ? void 0 : (_edcr$planDetail4$pla = _edcr$planDetail4.planInformation) === null || _edcr$planDetail4$pla === void 0 ? void 0 : _edcr$planDetail4$pla.applicantName
45402
+ }]
45403
+ };
45404
+ var plotDetails = {
45405
+ title: "BPA_PLOT_DETAILS_TITLE",
45406
+ asSectionHeader: true,
45407
+ isCommon: true,
44049
45408
  values: [{
44050
- title: "BPA_" + (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocType) + "_LABEL",
44051
- value: nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationNo,
45409
+ title: "BPA_BOUNDARY_PLOT_AREA_LABEL",
45410
+ value: "" + (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail5 = edcr.planDetail) === null || _edcr$planDetail5 === void 0 ? void 0 : (_edcr$planDetail5$pla = _edcr$planDetail5.planInformation) === null || _edcr$planDetail5$pla === void 0 ? void 0 : _edcr$planDetail5$pla.plotArea),
45411
+ isNotTranslated: true,
45412
+ isUnit: "BPA_SQ_FT_LABEL"
45413
+ }, {
45414
+ title: "BPA_PLOT_NUMBER_LABEL",
45415
+ value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail6 = edcr.planDetail) === null || _edcr$planDetail6 === void 0 ? void 0 : (_edcr$planDetail6$pla = _edcr$planDetail6.planInformation) === null || _edcr$planDetail6$pla === void 0 ? void 0 : _edcr$planDetail6$pla.plotNo) || "NA",
44052
45416
  isNotTranslated: true
44053
45417
  }, {
44054
- title: "BPA_NOC_STATUS",
44055
- value: nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus,
44056
- field: "STATUS"
44057
- }, (nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$additiona = nocDetails.additionalDetails) === null || _nocDetails$additiona === void 0 ? void 0 : _nocDetails$additiona.SubmittedOn) && {
44058
- title: "BPA_SUDMITTED_ON_LABEL",
44059
- value: nocDetails !== null && nocDetails !== void 0 && (_nocDetails$additiona2 = nocDetails.additionalDetails) !== null && _nocDetails$additiona2 !== void 0 && _nocDetails$additiona2.SubmittedOn ? dateFns.format(new Date(Number(nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$additiona3 = nocDetails.additionalDetails) === null || _nocDetails$additiona3 === void 0 ? void 0 : _nocDetails$additiona3.SubmittedOn)), 'dd/MM/yyyy') : "NA",
45418
+ title: "BPA_KHATHA_NUMBER_LABEL",
45419
+ value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail7 = edcr.planDetail) === null || _edcr$planDetail7 === void 0 ? void 0 : (_edcr$planDetail7$pla = _edcr$planDetail7.planInformation) === null || _edcr$planDetail7$pla === void 0 ? void 0 : _edcr$planDetail7$pla.khataNo) || "NA",
44060
45420
  isNotTranslated: true
44061
- }, (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) && {
44062
- title: "BPA_APPROVAL_NUMBER_LABEL",
44063
- value: (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) || "NA",
45421
+ }, {
45422
+ title: "BPA_HOLDING_NUMBER_LABEL",
45423
+ value: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail11 = BPA.additionalDetails) === null || _BPA$additionalDetail11 === void 0 ? void 0 : _BPA$additionalDetail11.holdingNo) || "NA",
44064
45424
  isNotTranslated: true
44065
- }, (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) && {
44066
- title: "BPA_APPROVED_REJECTED_ON_LABEL",
44067
- value: (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "APPROVED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "REJECTED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "AUTO_APPROVED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "AUTO_REJECTED" ? dateFns.format(new Date(Number(nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$auditDeta = nocDetails.auditDetails) === null || _nocDetails$auditDeta === void 0 ? void 0 : _nocDetails$auditDeta.lastModifiedTime)), 'dd/MM/yyyy') : "NA",
45425
+ }, {
45426
+ title: "BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",
45427
+ value: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail12 = BPA.additionalDetails) === null || _BPA$additionalDetail12 === void 0 ? void 0 : _BPA$additionalDetail12.registrationDetails) || "NA",
44068
45428
  isNotTranslated: true
44069
- }],
45429
+ }]
45430
+ };
45431
+ var scrutinyDetails = {
45432
+ title: "BPA_STEPPER_SCRUTINY_DETAILS_HEADER",
45433
+ isScrutinyDetails: true,
45434
+ isBackGroundColor: true,
44070
45435
  additionalDetails: {
44071
- data: nocDetails,
44072
- noc: [{
44073
- title: "BPA_DOCUMENT_DETAILS_LABEL",
44074
- values: nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$documents = nocDetails.documents) === null || _nocDetails$documents === void 0 ? void 0 : _nocDetails$documents.map(function (doc) {
44075
- var _doc$documentType2;
44076
-
44077
- return {
44078
- title: doc === null || doc === void 0 ? void 0 : (_doc$documentType2 = doc.documentType) === null || _doc$documentType2 === void 0 ? void 0 : _doc$documentType2.replaceAll('.', '_'),
44079
- documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
44080
- documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
44081
- fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
44082
- id: doc === null || doc === void 0 ? void 0 : doc.id
44083
- };
44084
- })
45436
+ values: [{
45437
+ title: "BPA_EDCR_DETAILS",
45438
+ value: " ",
45439
+ isHeader: true
45440
+ }, {
45441
+ title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_EDCR_NO_LABEL" : "BPA_OC_EDCR_NO_LABEL",
45442
+ value: (BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber) || "NA"
45443
+ }],
45444
+ scruntinyDetails: [{
45445
+ title: "BPA_UPLOADED_PLAN_DIAGRAM",
45446
+ value: edcr === null || edcr === void 0 ? void 0 : edcr.updatedDxfFile,
45447
+ text: "BPA_UPLOADED_PLAN_DXF"
45448
+ }, {
45449
+ title: "BPA_SCRUNTINY_REPORT_OUTPUT",
45450
+ value: edcr === null || edcr === void 0 ? void 0 : edcr.planReport,
45451
+ text: "BPA_SCRUTINY_REPORT_PDF"
44085
45452
  }]
44086
45453
  }
44087
45454
  };
44088
- });
44089
- var inspectionReport = [];
44090
- var checklist = [];
44091
- BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail = BPA.additionalDetails) === null || _BPA$additionalDetail === void 0 ? void 0 : (_BPA$additionalDetail2 = _BPA$additionalDetail.fieldinspection_pending) === null || _BPA$additionalDetail2 === void 0 ? void 0 : _BPA$additionalDetail2.filter(function (ob) {
44092
- return ob.docs && ob.docs.length > 0;
44093
- }).map(function (ob, ind) {
44094
- var _ob$date, _ob$date2, _ob$date3, _ob$questions, _ob$docs;
44095
-
44096
- checklist = [];
44097
- inspectionReport.push({
44098
- title: "BPA_FI_REPORT",
45455
+ var buildingExtractionDetails = {
45456
+ title: "",
45457
+ isScrutinyDetails: true,
45458
+ isBackGroundColor: true,
45459
+ additionalDetails: {
45460
+ values: [{
45461
+ title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_BUILDING_EXTRACT_HEADER" : "BPA_ACTUAL_BUILDING_EXTRACT_HEADER",
45462
+ value: " ",
45463
+ isHeader: true
45464
+ }, {
45465
+ title: "BPA_TOTAL_BUILT_UP_AREA_HEADER",
45466
+ value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail8 = edcr.planDetail) === null || _edcr$planDetail8 === void 0 ? void 0 : (_edcr$planDetail8$blo = _edcr$planDetail8.blocks) === null || _edcr$planDetail8$blo === void 0 ? void 0 : (_edcr$planDetail8$blo2 = _edcr$planDetail8$blo[0]) === null || _edcr$planDetail8$blo2 === void 0 ? void 0 : (_edcr$planDetail8$blo3 = _edcr$planDetail8$blo2.building) === null || _edcr$planDetail8$blo3 === void 0 ? void 0 : _edcr$planDetail8$blo3.totalBuitUpArea,
45467
+ isUnit: "BPA_SQ_MTRS_LABEL"
45468
+ }, {
45469
+ title: "BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL",
45470
+ value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail9 = edcr.planDetail) === null || _edcr$planDetail9 === void 0 ? void 0 : (_edcr$planDetail9$blo = _edcr$planDetail9.blocks) === null || _edcr$planDetail9$blo === void 0 ? void 0 : (_edcr$planDetail9$blo2 = _edcr$planDetail9$blo[0]) === null || _edcr$planDetail9$blo2 === void 0 ? void 0 : (_edcr$planDetail9$blo3 = _edcr$planDetail9$blo2.building) === null || _edcr$planDetail9$blo3 === void 0 ? void 0 : _edcr$planDetail9$blo3.totalFloors) || "NA"
45471
+ }, {
45472
+ title: "BPA_HEIGHT_FROM_GROUND_LEVEL",
45473
+ value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail10 = edcr.planDetail) === null || _edcr$planDetail10 === void 0 ? void 0 : (_edcr$planDetail10$bl = _edcr$planDetail10.blocks) === null || _edcr$planDetail10$bl === void 0 ? void 0 : (_edcr$planDetail10$bl2 = _edcr$planDetail10$bl[0]) === null || _edcr$planDetail10$bl2 === void 0 ? void 0 : (_edcr$planDetail10$bl3 = _edcr$planDetail10$bl2.building) === null || _edcr$planDetail10$bl3 === void 0 ? void 0 : _edcr$planDetail10$bl3.declaredBuildingHeigh,
45474
+ isUnit: "BPA_MTRS_LABEL"
45475
+ }],
45476
+ scruntinyDetails: []
45477
+ }
45478
+ };
45479
+ var demolitionAreaDetails = {
45480
+ title: "",
45481
+ isScrutinyDetails: true,
45482
+ isBackGroundColor: true,
45483
+ additionalDetails: {
45484
+ values: [{
45485
+ title: "BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL",
45486
+ value: " ",
45487
+ isHeader: true
45488
+ }, {
45489
+ title: "BPA_APPLICATION_DEMOLITION_AREA_LABEL",
45490
+ value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail11 = edcr.planDetail) === null || _edcr$planDetail11 === void 0 ? void 0 : (_edcr$planDetail11$pl = _edcr$planDetail11.planInformation) === null || _edcr$planDetail11$pl === void 0 ? void 0 : _edcr$planDetail11$pl.demolitionArea,
45491
+ isUnit: "BPA_SQ_MTRS_LABEL"
45492
+ }],
45493
+ scruntinyDetails: []
45494
+ }
45495
+ };
45496
+ var subOccupancyTableDetails = {
45497
+ title: "",
45498
+ isSubOccupancyTable: true,
45499
+ isTitleRepeat: true,
45500
+ additionalDetails: {
45501
+ values: [{
45502
+ title: "BPA_OCC_SUBOCC_HEADER",
45503
+ value: " ",
45504
+ isHeader: true
45505
+ }],
45506
+ subOccupancyTableDetails: [{
45507
+ title: "BPA_APPLICATION_DEMOLITION_AREA_LABEL",
45508
+ value: edcr
45509
+ }, {
45510
+ title: "NO_REPEAT",
45511
+ value: ""
45512
+ }]
45513
+ }
45514
+ };
45515
+ var addressDetails = {
45516
+ title: "BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",
44099
45517
  asSectionHeader: true,
45518
+ isCommon: true,
44100
45519
  values: [{
44101
- title: "BPA_FI_DATE_LABEL",
44102
- value: ob.date.includes("-") ? ((_ob$date = ob.date) === null || _ob$date === void 0 ? void 0 : _ob$date.split("-")[2]) + "/" + ((_ob$date2 = ob.date) === null || _ob$date2 === void 0 ? void 0 : _ob$date2.split("-")[1]) + "/" + ((_ob$date3 = ob.date) === null || _ob$date3 === void 0 ? void 0 : _ob$date3.split("-")[0]) : ob.date
45520
+ title: "BPA_DETAILS_PIN_LABEL",
45521
+ value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo = BPA.landInfo) === null || _BPA$landInfo === void 0 ? void 0 : (_BPA$landInfo$address = _BPA$landInfo.address) === null || _BPA$landInfo$address === void 0 ? void 0 : _BPA$landInfo$address.pincode
45522
+ }, {
45523
+ title: "BPA_CITY_LABEL",
45524
+ value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo2 = BPA.landInfo) === null || _BPA$landInfo2 === void 0 ? void 0 : (_BPA$landInfo2$addres = _BPA$landInfo2.address) === null || _BPA$landInfo2$addres === void 0 ? void 0 : _BPA$landInfo2$addres.city
45525
+ }, {
45526
+ title: "BPA_LOC_MOHALLA_LABEL",
45527
+ value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo3 = BPA.landInfo) === null || _BPA$landInfo3 === void 0 ? void 0 : (_BPA$landInfo3$addres = _BPA$landInfo3.address) === null || _BPA$landInfo3$addres === void 0 ? void 0 : (_BPA$landInfo3$addres2 = _BPA$landInfo3$addres.locality) === null || _BPA$landInfo3$addres2 === void 0 ? void 0 : _BPA$landInfo3$addres2.name
44103
45528
  }, {
44104
- title: "BPA_FI_TIME_LABEL",
44105
- value: ob.time
45529
+ title: "BPA_DETAILS_SRT_NAME_LABEL",
45530
+ value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo4 = BPA.landInfo) === null || _BPA$landInfo4 === void 0 ? void 0 : (_BPA$landInfo4$addres = _BPA$landInfo4.address) === null || _BPA$landInfo4$addres === void 0 ? void 0 : _BPA$landInfo4$addres.street
45531
+ }, {
45532
+ title: "ES_NEW_APPLICATION_LOCATION_LANDMARK",
45533
+ value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo5 = BPA.landInfo) === null || _BPA$landInfo5 === void 0 ? void 0 : (_BPA$landInfo5$addres = _BPA$landInfo5.address) === null || _BPA$landInfo5$addres === void 0 ? void 0 : _BPA$landInfo5$addres.landmark
44106
45534
  }]
44107
- });
44108
- ob === null || ob === void 0 ? void 0 : (_ob$questions = ob.questions) === null || _ob$questions === void 0 ? void 0 : _ob$questions.map(function (q, index) {
44109
- checklist.push({
44110
- title: q.question,
44111
- value: q.value
44112
- });
44113
- checklist.push({
44114
- title: "BPA_ENTER_REMARKS",
44115
- value: q.remarks
45535
+ };
45536
+ var checkOwnerLength = (BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo6 = BPA.landInfo) === null || _BPA$landInfo6 === void 0 ? void 0 : (_BPA$landInfo6$owners = _BPA$landInfo6.owners) === null || _BPA$landInfo6$owners === void 0 ? void 0 : _BPA$landInfo6$owners.length) || 1;
45537
+
45538
+ if ((BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo7 = BPA.landInfo) === null || _BPA$landInfo7 === void 0 ? void 0 : (_BPA$landInfo7$owners = _BPA$landInfo7.owners) === null || _BPA$landInfo7$owners === void 0 ? void 0 : _BPA$landInfo7$owners.length) > 0) {
45539
+ var _BPA$landInfo8, _BPA$landInfo8$owners;
45540
+
45541
+ BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo8 = BPA.landInfo) === null || _BPA$landInfo8 === void 0 ? void 0 : (_BPA$landInfo8$owners = _BPA$landInfo8.owners) === null || _BPA$landInfo8$owners === void 0 ? void 0 : _BPA$landInfo8$owners.forEach(function (ownerD) {
45542
+ if (!ownerD.isPrimaryOwner) ownerD.isPrimaryOwner = "false";
44116
45543
  });
44117
- });
44118
- inspectionReport.push({
44119
- title: "BPA_CHECK_LIST_DETAILS",
44120
- asSectionHeader: true,
44121
- values: checklist
44122
- });
44123
- inspectionReport.push({
45544
+ }
45545
+
45546
+ var ownerDetails = {
45547
+ title: "BPA_APPLICANT_DETAILS_HEADER",
45548
+ isOwnerDetails: true,
45549
+ additionalDetails: {
45550
+ owners: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo9 = BPA.landInfo) === null || _BPA$landInfo9 === void 0 ? void 0 : (_BPA$landInfo9$owners = _BPA$landInfo9.owners) === null || _BPA$landInfo9$owners === void 0 ? void 0 : _BPA$landInfo9$owners.map(function (owner, index) {
45551
+ return {
45552
+ title: Number(checkOwnerLength) > 1 ? "COMMON_OWNER" : "",
45553
+ values: [{
45554
+ title: "CORE_COMMON_NAME",
45555
+ value: owner === null || owner === void 0 ? void 0 : owner.name
45556
+ }, {
45557
+ title: "BPA_APPLICANT_GENDER_LABEL",
45558
+ value: owner === null || owner === void 0 ? void 0 : owner.gender
45559
+ }, {
45560
+ title: "CORE_COMMON_MOBILE_NUMBER",
45561
+ value: owner === null || owner === void 0 ? void 0 : owner.mobileNumber
45562
+ }, {
45563
+ title: "BPA_IS_PRIMARY_OWNER_LABEL",
45564
+ value: owner === null || owner === void 0 ? void 0 : owner.isPrimaryOwner,
45565
+ isNotTranslated: false
45566
+ }]
45567
+ };
45568
+ })
45569
+ }
45570
+ };
45571
+ var documentDetails = {
44124
45572
  title: "BPA_DOCUMENT_DETAILS_LABEL",
44125
45573
  asSectionHeader: true,
45574
+ isDocumentDetails: true,
44126
45575
  additionalDetails: {
44127
45576
  obpsDocuments: [{
44128
45577
  title: "",
44129
- values: ob === null || ob === void 0 ? void 0 : (_ob$docs = ob.docs) === null || _ob$docs === void 0 ? void 0 : _ob$docs.map(function (doc) {
44130
- var _doc$documentType3;
45578
+ values: BPA === null || BPA === void 0 ? void 0 : (_BPA$documents = BPA.documents) === null || _BPA$documents === void 0 ? void 0 : _BPA$documents.map(function (doc) {
45579
+ var _doc$documentType4, _fileDetails9, _fileDetails9$data, _fileDetails10, _fileDetails10$data, _fileDetails10$data$d;
44131
45580
 
44132
45581
  return {
44133
- title: doc === null || doc === void 0 ? void 0 : (_doc$documentType3 = doc.documentType) === null || _doc$documentType3 === void 0 ? void 0 : _doc$documentType3.replaceAll('.', '_'),
45582
+ title: doc === null || doc === void 0 ? void 0 : (_doc$documentType4 = doc.documentType) === null || _doc$documentType4 === void 0 ? void 0 : _doc$documentType4.replaceAll('.', '_'),
44134
45583
  documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
44135
- documentUid: doc === null || doc === void 0 ? void 0 : doc.fileStore,
45584
+ documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
44136
45585
  fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
44137
- id: doc === null || doc === void 0 ? void 0 : doc.id
45586
+ id: doc === null || doc === void 0 ? void 0 : doc.id,
45587
+ url: (_fileDetails9 = fileDetails) !== null && _fileDetails9 !== void 0 && (_fileDetails9$data = _fileDetails9.data) !== null && _fileDetails9$data !== void 0 && _fileDetails9$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId] ? (_fileDetails10 = fileDetails) === null || _fileDetails10 === void 0 ? void 0 : (_fileDetails10$data = _fileDetails10.data) === null || _fileDetails10$data === void 0 ? void 0 : (_fileDetails10$data$d = _fileDetails10$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId]) === null || _fileDetails10$data$d === void 0 ? void 0 : _fileDetails10$data$d.split(',')[0] : ""
44138
45588
  };
44139
45589
  })
44140
45590
  }]
44141
45591
  }
44142
- });
44143
- });
44144
- var details = [];
44145
- var applicationDetailsInfo = {
44146
- title: " ",
44147
- isCommon: true,
44148
- values: [{
44149
- title: "BPA_APPLICATION_NUMBER_LABEL",
44150
- value: (BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo) || "NA"
44151
- }]
44152
- };
45592
+ };
45593
+ var approvalChecks = [];
45594
+ var approvalChecksDetails = {};
44153
45595
 
44154
- if (BPA !== null && BPA !== void 0 && BPA.businessService.includes("BPA_OC")) {
44155
- var _bpaResponse$BPA4, _bpaResponse$BPA4$, _bpaResponse$BPA5, _bpaResponse$BPA5$;
45596
+ if ((BPA === null || BPA === void 0 ? void 0 : BPA.status) === "APPROVAL_INPROGRESS") {
45597
+ var _mdmsRes$BPA2;
44156
45598
 
44157
- applicationDetailsInfo["values"] = [].concat(applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : applicationDetailsInfo.values, [{
44158
- title: "BPA_PERMIT_APP_NUMBER",
44159
- to: "/digit-ui/employee/obps/bpa/" + (bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA4 = bpaResponse.BPA) === null || _bpaResponse$BPA4 === void 0 ? void 0 : (_bpaResponse$BPA4$ = _bpaResponse$BPA4[0]) === null || _bpaResponse$BPA4$ === void 0 ? void 0 : _bpaResponse$BPA4$.applicationNo),
44160
- value: bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA5 = bpaResponse.BPA) === null || _bpaResponse$BPA5 === void 0 ? void 0 : (_bpaResponse$BPA5$ = _bpaResponse$BPA5[0]) === null || _bpaResponse$BPA5$ === void 0 ? void 0 : _bpaResponse$BPA5$.applicationNo,
44161
- isLink: true
44162
- }]);
44163
- }
45599
+ mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$BPA2 = mdmsRes.BPA) === null || _mdmsRes$BPA2 === void 0 ? void 0 : _mdmsRes$BPA2.CheckList.forEach(function (checklist) {
45600
+ var _checklist$conditions;
44164
45601
 
44165
- var permitcondn = [];
44166
- (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail3 = BPA.additionalDetails) === null || _BPA$additionalDetail3 === void 0 ? void 0 : _BPA$additionalDetail3.pendingapproval) && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail4 = BPA.additionalDetails) === null || _BPA$additionalDetail4 === void 0 ? void 0 : _BPA$additionalDetail4.pendingapproval.length) > 0 && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail5 = BPA.additionalDetails) === null || _BPA$additionalDetail5 === void 0 ? void 0 : _BPA$additionalDetail5.pendingapproval.map(function (ob, index) {
44167
- permitcondn.push({
44168
- title: index + 1 + ". " + ob,
44169
- value: ""
44170
- });
44171
- }));
44172
- var PermitConditions = {
44173
- title: "BPA_PERMIT_CONDITIONS",
44174
- isTitleVisible: ((_permitcondn = permitcondn) === null || _permitcondn === void 0 ? void 0 : _permitcondn.length) > 0 ? false : true,
44175
- isNotAllowed: ((_permitcondn2 = permitcondn) === null || _permitcondn2 === void 0 ? void 0 : _permitcondn2.length) > 0 ? false : true,
44176
- additionalDetails: {
44177
- inspectionReport: [],
44178
- permit: [].concat(permitcondn)
45602
+ if ((checklist === null || checklist === void 0 ? void 0 : checklist.RiskType) === riskType && (checklist === null || checklist === void 0 ? void 0 : checklist.applicationType) === (edcr === null || edcr === void 0 ? void 0 : edcr.appliactionType) && (checklist === null || checklist === void 0 ? void 0 : checklist.ServiceType) === (edcr === null || edcr === void 0 ? void 0 : edcr.applicationSubType) && (checklist === null || checklist === void 0 ? void 0 : checklist.WFState) === "PENDINGAPPROVAL" && (checklist === null || checklist === void 0 ? void 0 : (_checklist$conditions = checklist.conditions) === null || _checklist$conditions === void 0 ? void 0 : _checklist$conditions.length) > 0) {
45603
+ approvalChecks.push.apply(approvalChecks, checklist === null || checklist === void 0 ? void 0 : checklist.conditions);
45604
+ }
45605
+ });
45606
+ approvalChecksDetails = {
45607
+ title: "",
45608
+ isTitleVisible: (approvalChecks === null || approvalChecks === void 0 ? void 0 : approvalChecks.length) > 0 ? false : true,
45609
+ asSectionHeader: true,
45610
+ isPermissions: true,
45611
+ additionalDetails: {
45612
+ permissions: approvalChecks
45613
+ }
45614
+ };
44179
45615
  }
44180
- };
44181
- if (permitcondn.length == 0) PermitConditions = {};
44182
-
44183
- if (riskType == "LOW" && permitcondn.length > 0) {
44184
- permitcondn = [];
44185
- PermitConditions = {};
44186
- }
44187
45616
 
44188
- if (BPA !== null && BPA !== void 0 && BPA.approvalNo) {
44189
- var _applicationDetailsIn, _applicationDetailsIn2, _BPA$additionalDetail6, _BPA$additionalDetail7, _BPA$additionalDetail8;
45617
+ if (riskType == "LOW" && approvalChecks.length > 0) approvalChecksDetails = {};
45618
+ var val;
45619
+ var i;
45620
+ var FieldInspectionData = [];
45621
+ inspectionReport && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail13 = BPA.additionalDetails) === null || _BPA$additionalDetail13 === void 0 ? void 0 : (_BPA$additionalDetail14 = _BPA$additionalDetail13.fieldinspection_pending) === null || _BPA$additionalDetail14 === void 0 ? void 0 : (_BPA$additionalDetail15 = _BPA$additionalDetail14[0]) === null || _BPA$additionalDetail15 === void 0 ? void 0 : _BPA$additionalDetail15.questions.length) > 0 && inspectionReport.map(function (ob, index) {
45622
+ if (ob.title.includes("FI_REPORT")) FieldInspectionData = [].concat(FieldInspectionData, [{
45623
+ title: ob.title,
45624
+ additionalDetails: {
45625
+ inspectionReport: [],
45626
+ values: ob.values
45627
+ }
45628
+ }]);else if (ob.title.includes("CHECK_LIST")) FieldInspectionData = [].concat(FieldInspectionData, [{
45629
+ title: ob.title,
45630
+ additionalDetails: {
45631
+ isChecklist: true,
45632
+ inspectionReport: [],
45633
+ values: ob.values
45634
+ }
45635
+ }]);else {
45636
+ var _ob$additionalDetails, _ob$additionalDetails2;
44190
45637
 
44191
- applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : (_applicationDetailsIn = applicationDetailsInfo.values) === null || _applicationDetailsIn === void 0 ? void 0 : _applicationDetailsIn.push({
44192
- title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_PERMIT_NUMBER_LABEL" : "BPA_OC_PERMIT_NUMBER_LABEL",
44193
- value: (BPA === null || BPA === void 0 ? void 0 : BPA.approvalNo) || "NA"
44194
- });
44195
- applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : (_applicationDetailsIn2 = applicationDetailsInfo.values) === null || _applicationDetailsIn2 === void 0 ? void 0 : _applicationDetailsIn2.push({
44196
- title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_PERMIT_VALIDITY" : "BPA_OC_PERMIT_VALIDITY",
44197
- value: BPA !== null && BPA !== void 0 && (_BPA$additionalDetail6 = BPA.additionalDetails) !== null && _BPA$additionalDetail6 !== void 0 && _BPA$additionalDetail6.validityDate ? ConvertEpochToValidityDate(BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail7 = BPA.additionalDetails) === null || _BPA$additionalDetail7 === void 0 ? void 0 : _BPA$additionalDetail7.validityDate) + " - " + dateFns.format(new Date(BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail8 = BPA.additionalDetails) === null || _BPA$additionalDetail8 === void 0 ? void 0 : _BPA$additionalDetail8.validityDate), 'dd/MM/yyyy') : "NA"
45638
+ var improvedDoc = [].concat((_ob$additionalDetails = ob.additionalDetails.obpsDocuments) === null || _ob$additionalDetails === void 0 ? void 0 : (_ob$additionalDetails2 = _ob$additionalDetails[0]) === null || _ob$additionalDetails2 === void 0 ? void 0 : _ob$additionalDetails2.values);
45639
+ improvedDoc.map(function (ob) {
45640
+ ob["isNotDuplicate"] = true;
45641
+ });
45642
+ improvedDoc.map(function (ob, index) {
45643
+ val = ob.documentType;
45644
+ if (ob.isNotDuplicate == true) for (i = index + 1; i < improvedDoc.length; i++) {
45645
+ if (val === improvedDoc[i].documentType) improvedDoc[i].isNotDuplicate = false;
45646
+ }
45647
+ });
45648
+ FieldInspectionData = [].concat(FieldInspectionData, [{
45649
+ title: ob.title,
45650
+ additionalDetails: {
45651
+ FIdocuments: [],
45652
+ "documents": [{
45653
+ values: improvedDoc
45654
+ }]
45655
+ }
45656
+ }]);
45657
+ }
44198
45658
  });
44199
- }
45659
+ var fiReports = {
45660
+ title: "",
45661
+ isFieldInspection: true,
45662
+ isNotAllowed: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail16 = BPA.additionalDetails) === null || _BPA$additionalDetail16 === void 0 ? void 0 : (_BPA$additionalDetail17 = _BPA$additionalDetail16.fieldinspection_pending) === null || _BPA$additionalDetail17 === void 0 ? void 0 : _BPA$additionalDetail17.length) > 0 ? false : true,
45663
+ additionalDetails: {
45664
+ values: [],
45665
+ fiReport: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail18 = BPA.additionalDetails) === null || _BPA$additionalDetail18 === void 0 ? void 0 : (_BPA$additionalDetail19 = _BPA$additionalDetail18.fieldinspection_pending) === null || _BPA$additionalDetail19 === void 0 ? void 0 : _BPA$additionalDetail19.length) > 0 ? true : false
45666
+ }
45667
+ };
44200
45668
 
44201
- var basicDetails = {
44202
- title: "BPA_BASIC_DETAILS_TITLE",
44203
- asSectionHeader: true,
44204
- isInsert: true,
44205
- isCommon: true,
44206
- values: [{
44207
- title: "BPA_BASIC_DETAILS_APP_DATE_LABEL",
44208
- value: BPA !== null && BPA !== void 0 && (_BPA$auditDetails = BPA.auditDetails) !== null && _BPA$auditDetails !== void 0 && _BPA$auditDetails.createdTime ? dateFns.format(new Date(BPA === null || BPA === void 0 ? void 0 : (_BPA$auditDetails2 = BPA.auditDetails) === null || _BPA$auditDetails2 === void 0 ? void 0 : _BPA$auditDetails2.createdTime), 'dd/MM/yyyy') : ''
44209
- }, {
44210
- title: "BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL",
44211
- value: "WF_BPA_" + (edcr === null || edcr === void 0 ? void 0 : edcr.appliactionType)
44212
- }, {
44213
- title: "BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL",
44214
- value: edcr === null || edcr === void 0 ? void 0 : edcr.applicationSubType
44215
- }, {
44216
- title: "BPA_BASIC_DETAILS_OCCUPANCY_LABEL",
44217
- value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail3 = edcr.planDetail) === null || _edcr$planDetail3 === void 0 ? void 0 : (_edcr$planDetail3$pla = _edcr$planDetail3.planInformation) === null || _edcr$planDetail3$pla === void 0 ? void 0 : _edcr$planDetail3$pla.occupancy
44218
- }, {
44219
- title: "BPA_BASIC_DETAILS_RISK_TYPE_LABEL",
44220
- value: "WF_BPA_" + riskType,
44221
- isInsert: true
44222
- }, {
44223
- title: "BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL",
44224
- value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail4 = edcr.planDetail) === null || _edcr$planDetail4 === void 0 ? void 0 : (_edcr$planDetail4$pla = _edcr$planDetail4.planInformation) === null || _edcr$planDetail4$pla === void 0 ? void 0 : _edcr$planDetail4$pla.applicantName
44225
- }]
44226
- };
44227
- var plotDetails = {
44228
- title: "BPA_PLOT_DETAILS_TITLE",
44229
- asSectionHeader: true,
44230
- isCommon: true,
44231
- values: [{
44232
- title: "BPA_BOUNDARY_PLOT_AREA_LABEL",
44233
- value: "" + (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail5 = edcr.planDetail) === null || _edcr$planDetail5 === void 0 ? void 0 : (_edcr$planDetail5$pla = _edcr$planDetail5.planInformation) === null || _edcr$planDetail5$pla === void 0 ? void 0 : _edcr$planDetail5$pla.plotArea),
44234
- isNotTranslated: true,
44235
- isUnit: "BPA_SQ_FT_LABEL"
44236
- }, {
44237
- title: "BPA_PLOT_NUMBER_LABEL",
44238
- value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail6 = edcr.planDetail) === null || _edcr$planDetail6 === void 0 ? void 0 : (_edcr$planDetail6$pla = _edcr$planDetail6.planInformation) === null || _edcr$planDetail6$pla === void 0 ? void 0 : _edcr$planDetail6$pla.plotNo) || "NA",
44239
- isNotTranslated: true
44240
- }, {
44241
- title: "BPA_KHATHA_NUMBER_LABEL",
44242
- value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail7 = edcr.planDetail) === null || _edcr$planDetail7 === void 0 ? void 0 : (_edcr$planDetail7$pla = _edcr$planDetail7.planInformation) === null || _edcr$planDetail7$pla === void 0 ? void 0 : _edcr$planDetail7$pla.khataNo) || "NA",
44243
- isNotTranslated: true
44244
- }, {
44245
- title: "BPA_HOLDING_NUMBER_LABEL",
44246
- value: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail9 = BPA.additionalDetails) === null || _BPA$additionalDetail9 === void 0 ? void 0 : _BPA$additionalDetail9.holdingNo) || "NA",
44247
- isNotTranslated: true
44248
- }, {
44249
- title: "BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",
44250
- value: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail10 = BPA.additionalDetails) === null || _BPA$additionalDetail10 === void 0 ? void 0 : _BPA$additionalDetail10.registrationDetails) || "NA",
44251
- isNotTranslated: true
44252
- }]
44253
- };
44254
- var scrutinyDetails = {
44255
- title: "BPA_STEPPER_SCRUTINY_DETAILS_HEADER",
44256
- isScrutinyDetails: true,
44257
- isBackGroundColor: true,
44258
- additionalDetails: {
44259
- values: [{
44260
- title: "BPA_EDCR_DETAILS",
44261
- value: " ",
44262
- isHeader: true
44263
- }, {
44264
- title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_EDCR_NO_LABEL" : "BPA_OC_EDCR_NO_LABEL",
44265
- value: (BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber) || "NA"
44266
- }],
44267
- scruntinyDetails: [{
44268
- title: "BPA_UPLOADED_PLAN_DIAGRAM",
44269
- value: edcr === null || edcr === void 0 ? void 0 : edcr.updatedDxfFile,
44270
- text: "BPA_UPLOADED_PLAN_DXF"
44271
- }, {
44272
- title: "BPA_SCRUNTINY_REPORT_OUTPUT",
44273
- value: edcr === null || edcr === void 0 ? void 0 : edcr.planReport,
44274
- text: "BPA_SCRUTINY_REPORT_PDF"
44275
- }]
44276
- }
44277
- };
44278
- var buildingExtractionDetails = {
44279
- title: "",
44280
- isScrutinyDetails: true,
44281
- isBackGroundColor: true,
44282
- additionalDetails: {
44283
- values: [{
44284
- title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_BUILDING_EXTRACT_HEADER" : "BPA_ACTUAL_BUILDING_EXTRACT_HEADER",
44285
- value: " ",
44286
- isHeader: true
44287
- }, {
44288
- title: "BPA_TOTAL_BUILT_UP_AREA_HEADER",
44289
- value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail8 = edcr.planDetail) === null || _edcr$planDetail8 === void 0 ? void 0 : (_edcr$planDetail8$blo = _edcr$planDetail8.blocks) === null || _edcr$planDetail8$blo === void 0 ? void 0 : (_edcr$planDetail8$blo2 = _edcr$planDetail8$blo[0]) === null || _edcr$planDetail8$blo2 === void 0 ? void 0 : (_edcr$planDetail8$blo3 = _edcr$planDetail8$blo2.building) === null || _edcr$planDetail8$blo3 === void 0 ? void 0 : _edcr$planDetail8$blo3.totalBuitUpArea,
44290
- isUnit: "BPA_SQ_MTRS_LABEL"
44291
- }, {
44292
- title: "BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL",
44293
- value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail9 = edcr.planDetail) === null || _edcr$planDetail9 === void 0 ? void 0 : (_edcr$planDetail9$blo = _edcr$planDetail9.blocks) === null || _edcr$planDetail9$blo === void 0 ? void 0 : (_edcr$planDetail9$blo2 = _edcr$planDetail9$blo[0]) === null || _edcr$planDetail9$blo2 === void 0 ? void 0 : (_edcr$planDetail9$blo3 = _edcr$planDetail9$blo2.building) === null || _edcr$planDetail9$blo3 === void 0 ? void 0 : _edcr$planDetail9$blo3.totalFloors) || "NA"
44294
- }, {
44295
- title: "BPA_HEIGHT_FROM_GROUND_LEVEL",
44296
- value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail10 = edcr.planDetail) === null || _edcr$planDetail10 === void 0 ? void 0 : (_edcr$planDetail10$bl = _edcr$planDetail10.blocks) === null || _edcr$planDetail10$bl === void 0 ? void 0 : (_edcr$planDetail10$bl2 = _edcr$planDetail10$bl[0]) === null || _edcr$planDetail10$bl2 === void 0 ? void 0 : (_edcr$planDetail10$bl3 = _edcr$planDetail10$bl2.building) === null || _edcr$planDetail10$bl3 === void 0 ? void 0 : _edcr$planDetail10$bl3.declaredBuildingHeigh,
44297
- isUnit: "BPA_MTRS_LABEL"
44298
- }],
44299
- scruntinyDetails: []
44300
- }
44301
- };
44302
- var demolitionAreaDetails = {
44303
- title: "",
44304
- isScrutinyDetails: true,
44305
- isBackGroundColor: true,
44306
- additionalDetails: {
44307
- values: [{
44308
- title: "BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL",
44309
- value: " ",
44310
- isHeader: true
44311
- }, {
44312
- title: "BPA_APPLICATION_DEMOLITION_AREA_LABEL",
44313
- value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail11 = edcr.planDetail) === null || _edcr$planDetail11 === void 0 ? void 0 : (_edcr$planDetail11$pl = _edcr$planDetail11.planInformation) === null || _edcr$planDetail11$pl === void 0 ? void 0 : _edcr$planDetail11$pl.demolitionArea,
44314
- isUnit: "BPA_SQ_MTRS_LABEL"
44315
- }],
44316
- scruntinyDetails: []
44317
- }
44318
- };
44319
- var subOccupancyTableDetails = {
44320
- title: "",
44321
- isSubOccupancyTable: true,
44322
- isTitleRepeat: true,
44323
- additionalDetails: {
44324
- values: [{
44325
- title: "BPA_OCC_SUBOCC_HEADER",
44326
- value: " ",
44327
- isHeader: true
44328
- }],
44329
- subOccupancyTableDetails: [{
44330
- title: "BPA_APPLICATION_DEMOLITION_AREA_LABEL",
44331
- value: edcr
44332
- }, {
44333
- title: "NO_REPEAT",
44334
- value: ""
44335
- }]
45669
+ if ((BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC") {
45670
+ details = [].concat(details, [applicationDetailsInfo, basicDetails, plotDetails, scrutinyDetails, buildingExtractionDetails, subOccupancyTableDetails, demolitionAreaDetails, addressDetails, ownerDetails, documentDetails, fiReports], nocDetails, [approvalChecksDetails, PermitConditions]);
45671
+ } else {
45672
+ details = [].concat(details, [applicationDetailsInfo, basicDetails, plotDetails, scrutinyDetails, buildingExtractionDetails, subOccupancyTableDetails, demolitionAreaDetails, documentDetails, fiReports], nocDetails, [PermitConditions]);
44336
45673
  }
44337
- };
44338
- var addressDetails = {
44339
- title: "BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",
44340
- asSectionHeader: true,
44341
- isCommon: true,
44342
- values: [{
44343
- title: "BPA_DETAILS_PIN_LABEL",
44344
- value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo = BPA.landInfo) === null || _BPA$landInfo === void 0 ? void 0 : (_BPA$landInfo$address = _BPA$landInfo.address) === null || _BPA$landInfo$address === void 0 ? void 0 : _BPA$landInfo$address.pincode
44345
- }, {
44346
- title: "BPA_CITY_LABEL",
44347
- value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo2 = BPA.landInfo) === null || _BPA$landInfo2 === void 0 ? void 0 : (_BPA$landInfo2$addres = _BPA$landInfo2.address) === null || _BPA$landInfo2$addres === void 0 ? void 0 : _BPA$landInfo2$addres.city
44348
- }, {
44349
- title: "BPA_LOC_MOHALLA_LABEL",
44350
- value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo3 = BPA.landInfo) === null || _BPA$landInfo3 === void 0 ? void 0 : (_BPA$landInfo3$addres = _BPA$landInfo3.address) === null || _BPA$landInfo3$addres === void 0 ? void 0 : (_BPA$landInfo3$addres2 = _BPA$landInfo3$addres.locality) === null || _BPA$landInfo3$addres2 === void 0 ? void 0 : _BPA$landInfo3$addres2.name
44351
- }, {
44352
- title: "BPA_DETAILS_SRT_NAME_LABEL",
44353
- value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo4 = BPA.landInfo) === null || _BPA$landInfo4 === void 0 ? void 0 : (_BPA$landInfo4$addres = _BPA$landInfo4.address) === null || _BPA$landInfo4$addres === void 0 ? void 0 : _BPA$landInfo4$addres.street
44354
- }, {
44355
- title: "ES_NEW_APPLICATION_LOCATION_LANDMARK",
44356
- value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo5 = BPA.landInfo) === null || _BPA$landInfo5 === void 0 ? void 0 : (_BPA$landInfo5$addres = _BPA$landInfo5.address) === null || _BPA$landInfo5$addres === void 0 ? void 0 : _BPA$landInfo5$addres.landmark
44357
- }]
44358
- };
44359
- var checkOwnerLength = (BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo6 = BPA.landInfo) === null || _BPA$landInfo6 === void 0 ? void 0 : (_BPA$landInfo6$owners = _BPA$landInfo6.owners) === null || _BPA$landInfo6$owners === void 0 ? void 0 : _BPA$landInfo6$owners.length) || 1;
44360
-
44361
- if ((BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo7 = BPA.landInfo) === null || _BPA$landInfo7 === void 0 ? void 0 : (_BPA$landInfo7$owners = _BPA$landInfo7.owners) === null || _BPA$landInfo7$owners === void 0 ? void 0 : _BPA$landInfo7$owners.length) > 0) {
44362
- var _BPA$landInfo8, _BPA$landInfo8$owners;
44363
45674
 
44364
- BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo8 = BPA.landInfo) === null || _BPA$landInfo8 === void 0 ? void 0 : (_BPA$landInfo8$owners = _BPA$landInfo8.owners) === null || _BPA$landInfo8$owners === void 0 ? void 0 : _BPA$landInfo8$owners.forEach(function (ownerD) {
44365
- if (!ownerD.isPrimaryOwner) ownerD.isPrimaryOwner = "false";
45675
+ var bpaFilterDetails = (_details = details) === null || _details === void 0 ? void 0 : _details.filter(function (data) {
45676
+ return data;
44366
45677
  });
45678
+ return {
45679
+ applicationData: BPA,
45680
+ applicationDetails: bpaFilterDetails,
45681
+ tenantId: BPA === null || BPA === void 0 ? void 0 : BPA.tenantId,
45682
+ edcrDetails: edcr,
45683
+ nocData: noc,
45684
+ comparisionReport: comparisionReport === null || comparisionReport === void 0 ? void 0 : comparisionReport.comparisonDetail,
45685
+ businessService: BPA === null || BPA === void 0 ? void 0 : BPA.businessService,
45686
+ applicationNo: BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo,
45687
+ applicationStatus: BPA === null || BPA === void 0 ? void 0 : BPA.status
45688
+ };
44367
45689
  }
44368
45690
 
44369
- var ownerDetails = {
44370
- title: "BPA_APPLICANT_DETAILS_HEADER",
44371
- isOwnerDetails: true,
44372
- additionalDetails: {
44373
- owners: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo9 = BPA.landInfo) === null || _BPA$landInfo9 === void 0 ? void 0 : (_BPA$landInfo9$owners = _BPA$landInfo9.owners) === null || _BPA$landInfo9$owners === void 0 ? void 0 : _BPA$landInfo9$owners.map(function (owner, index) {
44374
- return {
44375
- title: Number(checkOwnerLength) > 1 ? "COMMON_OWNER" : "",
44376
- values: [{
44377
- title: "CORE_COMMON_NAME",
44378
- value: owner === null || owner === void 0 ? void 0 : owner.name
44379
- }, {
44380
- title: "BPA_APPLICANT_GENDER_LABEL",
44381
- value: owner === null || owner === void 0 ? void 0 : owner.gender
44382
- }, {
44383
- title: "CORE_COMMON_MOBILE_NUMBER",
44384
- value: owner === null || owner === void 0 ? void 0 : owner.mobileNumber
44385
- }, {
44386
- title: "BPA_IS_PRIMARY_OWNER_LABEL",
44387
- value: owner === null || owner === void 0 ? void 0 : owner.isPrimaryOwner,
44388
- isNotTranslated: false
44389
- }]
44390
- };
44391
- })
44392
- }
44393
- };
44394
- var documentDetails = {
44395
- title: "BPA_DOCUMENT_DETAILS_LABEL",
44396
- asSectionHeader: true,
44397
- isDocumentDetails: true,
44398
- additionalDetails: {
44399
- obpsDocuments: [{
44400
- title: "",
44401
- values: BPA === null || BPA === void 0 ? void 0 : (_BPA$documents = BPA.documents) === null || _BPA$documents === void 0 ? void 0 : _BPA$documents.map(function (doc) {
44402
- var _doc$documentType4;
44403
-
44404
- return {
44405
- title: doc === null || doc === void 0 ? void 0 : (_doc$documentType4 = doc.documentType) === null || _doc$documentType4 === void 0 ? void 0 : _doc$documentType4.replaceAll('.', '_'),
44406
- documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
44407
- documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
44408
- fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
44409
- id: doc === null || doc === void 0 ? void 0 : doc.id
44410
- };
44411
- })
44412
- }]
44413
- }
44414
- };
44415
- var approvalChecks = [];
44416
- var approvalChecksDetails = {};
44417
-
44418
- if ((BPA === null || BPA === void 0 ? void 0 : BPA.status) === "APPROVAL_INPROGRESS") {
44419
- var _mdmsRes$BPA2;
45691
+ noc === null || noc === void 0 ? void 0 : noc.map(function (nocDetails) {
45692
+ var _nocDetails$documents2;
44420
45693
 
44421
- mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$BPA2 = mdmsRes.BPA) === null || _mdmsRes$BPA2 === void 0 ? void 0 : _mdmsRes$BPA2.CheckList.forEach(function (checklist) {
44422
- var _checklist$conditions;
44423
-
44424
- if ((checklist === null || checklist === void 0 ? void 0 : checklist.RiskType) === riskType && (checklist === null || checklist === void 0 ? void 0 : checklist.applicationType) === (edcr === null || edcr === void 0 ? void 0 : edcr.appliactionType) && (checklist === null || checklist === void 0 ? void 0 : checklist.ServiceType) === (edcr === null || edcr === void 0 ? void 0 : edcr.applicationSubType) && (checklist === null || checklist === void 0 ? void 0 : checklist.WFState) === "PENDINGAPPROVAL" && (checklist === null || checklist === void 0 ? void 0 : (_checklist$conditions = checklist.conditions) === null || _checklist$conditions === void 0 ? void 0 : _checklist$conditions.length) > 0) {
44425
- approvalChecks.push.apply(approvalChecks, checklist === null || checklist === void 0 ? void 0 : checklist.conditions);
44426
- }
45694
+ nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$documents2 = nocDetails.documents) === null || _nocDetails$documents2 === void 0 ? void 0 : _nocDetails$documents2.map(function (nocDoc) {
45695
+ if (nocDoc !== null && nocDoc !== void 0 && nocDoc.fileStoreId) appDocumentFileStoreIds.push(nocDoc === null || nocDoc === void 0 ? void 0 : nocDoc.fileStoreId);
44427
45696
  });
44428
- approvalChecksDetails = {
44429
- title: "",
44430
- isTitleVisible: (approvalChecks === null || approvalChecks === void 0 ? void 0 : approvalChecks.length) > 0 ? false : true,
44431
- asSectionHeader: true,
44432
- isPermissions: true,
44433
- additionalDetails: {
44434
- permissions: approvalChecks
44435
- }
44436
- };
44437
- }
45697
+ });
45698
+ var fileDetails = {};
44438
45699
 
44439
- if (riskType == "LOW" && approvalChecks.length > 0) approvalChecksDetails = {};
44440
- var val;
44441
- var i;
44442
- var FieldInspectionData = [];
44443
- inspectionReport && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail11 = BPA.additionalDetails) === null || _BPA$additionalDetail11 === void 0 ? void 0 : (_BPA$additionalDetail12 = _BPA$additionalDetail11.fieldinspection_pending) === null || _BPA$additionalDetail12 === void 0 ? void 0 : (_BPA$additionalDetail13 = _BPA$additionalDetail12[0]) === null || _BPA$additionalDetail13 === void 0 ? void 0 : _BPA$additionalDetail13.questions.length) > 0 && inspectionReport.map(function (ob, index) {
44444
- if (ob.title.includes("FI_REPORT")) FieldInspectionData = [].concat(FieldInspectionData, [{
44445
- title: ob.title,
44446
- additionalDetails: {
44447
- inspectionReport: [],
44448
- values: ob.values
44449
- }
44450
- }]);else if (ob.title.includes("CHECK_LIST")) FieldInspectionData = [].concat(FieldInspectionData, [{
44451
- title: ob.title,
44452
- additionalDetails: {
44453
- isChecklist: true,
44454
- inspectionReport: [],
44455
- values: ob.values
44456
- }
44457
- }]);else {
44458
- var _ob$additionalDetails, _ob$additionalDetails2;
45700
+ var _temp3 = function () {
45701
+ var _appDocumentFileStore;
44459
45702
 
44460
- var improvedDoc = [].concat((_ob$additionalDetails = ob.additionalDetails.obpsDocuments) === null || _ob$additionalDetails === void 0 ? void 0 : (_ob$additionalDetails2 = _ob$additionalDetails[0]) === null || _ob$additionalDetails2 === void 0 ? void 0 : _ob$additionalDetails2.values);
44461
- improvedDoc.map(function (ob) {
44462
- ob["isNotDuplicate"] = true;
44463
- });
44464
- improvedDoc.map(function (ob, index) {
44465
- val = ob.documentType;
44466
- if (ob.isNotDuplicate == true) for (i = index + 1; i < improvedDoc.length; i++) {
44467
- if (val === improvedDoc[i].documentType) improvedDoc[i].isNotDuplicate = false;
44468
- }
45703
+ if (((_appDocumentFileStore = appDocumentFileStoreIds) === null || _appDocumentFileStore === void 0 ? void 0 : _appDocumentFileStore.length) > 0) {
45704
+ return Promise.resolve(UploadServices.Filefetch(appDocumentFileStoreIds, Digit.ULBService.getStateId())).then(function (_UploadServices$Filef2) {
45705
+ fileDetails = _UploadServices$Filef2;
44469
45706
  });
44470
- FieldInspectionData = [].concat(FieldInspectionData, [{
44471
- title: ob.title,
44472
- additionalDetails: {
44473
- FIdocuments: [],
44474
- "documents": [{
44475
- values: improvedDoc
44476
- }]
44477
- }
44478
- }]);
44479
- }
44480
- });
44481
- var fiReports = {
44482
- title: "",
44483
- isFieldInspection: true,
44484
- isNotAllowed: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail14 = BPA.additionalDetails) === null || _BPA$additionalDetail14 === void 0 ? void 0 : (_BPA$additionalDetail15 = _BPA$additionalDetail14.fieldinspection_pending) === null || _BPA$additionalDetail15 === void 0 ? void 0 : _BPA$additionalDetail15.length) > 0 ? false : true,
44485
- additionalDetails: {
44486
- values: [],
44487
- fiReport: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail16 = BPA.additionalDetails) === null || _BPA$additionalDetail16 === void 0 ? void 0 : (_BPA$additionalDetail17 = _BPA$additionalDetail16.fieldinspection_pending) === null || _BPA$additionalDetail17 === void 0 ? void 0 : _BPA$additionalDetail17.length) > 0 ? true : false
44488
45707
  }
44489
- };
44490
-
44491
- if ((BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC") {
44492
- details = [].concat(details, [applicationDetailsInfo, basicDetails, plotDetails, scrutinyDetails, buildingExtractionDetails, subOccupancyTableDetails, demolitionAreaDetails, addressDetails, ownerDetails, documentDetails, fiReports], nocDetails, [approvalChecksDetails, PermitConditions]);
44493
- } else {
44494
- details = [].concat(details, [applicationDetailsInfo, basicDetails, plotDetails, scrutinyDetails, buildingExtractionDetails, subOccupancyTableDetails, demolitionAreaDetails, documentDetails, fiReports], nocDetails, [PermitConditions]);
44495
- }
45708
+ }();
44496
45709
 
44497
- var bpaFilterDetails = (_details = details) === null || _details === void 0 ? void 0 : _details.filter(function (data) {
44498
- return data;
44499
- });
44500
- return {
44501
- applicationData: BPA,
44502
- applicationDetails: bpaFilterDetails,
44503
- tenantId: BPA === null || BPA === void 0 ? void 0 : BPA.tenantId,
44504
- edcrDetails: edcr,
44505
- nocData: noc,
44506
- comparisionReport: comparisionReport === null || comparisionReport === void 0 ? void 0 : comparisionReport.comparisonDetail,
44507
- businessService: BPA === null || BPA === void 0 ? void 0 : BPA.businessService,
44508
- applicationNo: BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo,
44509
- applicationStatus: BPA === null || BPA === void 0 ? void 0 : BPA.status
44510
- };
45710
+ return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
44511
45711
  });
44512
45712
  });
44513
45713
  });
@@ -44792,6 +45992,34 @@ var useOBPSDocumentSearch = function useOBPSDocumentSearch(_ref, config, Code, i
44792
45992
  };
44793
45993
  };
44794
45994
 
45995
+ var updateNOCAPI = function updateNOCAPI(data, tenantId) {
45996
+ try {
45997
+ return Promise.resolve(_catch(function () {
45998
+ return Promise.resolve(OBPSService.updateNOC(data, tenantId));
45999
+ }, function (error) {
46000
+ var _error$response, _error$response$data;
46001
+
46002
+ throw new Error(error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.Errors[0].code);
46003
+ }));
46004
+ } catch (e) {
46005
+ return Promise.reject(e);
46006
+ }
46007
+ };
46008
+
46009
+ var updateAPI = function updateAPI(data, tenantId) {
46010
+ try {
46011
+ return Promise.resolve(_catch(function () {
46012
+ return Promise.resolve(OBPSService.update(data, tenantId));
46013
+ }, function (error) {
46014
+ var _error$response2, _error$response2$data;
46015
+
46016
+ throw new Error(error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : _error$response2$data.Errors[0].code);
46017
+ }));
46018
+ } catch (e) {
46019
+ return Promise.reject(e);
46020
+ }
46021
+ };
46022
+
44795
46023
  var useObpsAPI = function useObpsAPI(tenantId, type) {
44796
46024
  if (type === void 0) {
44797
46025
  type = false;
@@ -44799,11 +46027,11 @@ var useObpsAPI = function useObpsAPI(tenantId, type) {
44799
46027
 
44800
46028
  if (type) {
44801
46029
  return reactQuery.useMutation(function (data) {
44802
- return OBPSService.updateNOC(data, tenantId);
46030
+ return updateNOCAPI(data, tenantId);
44803
46031
  });
44804
46032
  } else {
44805
46033
  return reactQuery.useMutation(function (data) {
44806
- return OBPSService.update(data, tenantId);
46034
+ return updateAPI(data, tenantId);
44807
46035
  });
44808
46036
  }
44809
46037
  };
@@ -44987,7 +46215,7 @@ var useBPAInbox = function useBPAInbox(_ref) {
44987
46215
  processSearchCriteria: _extends({
44988
46216
  assignee: assignee === "ASSIGNED_TO_ME" ? user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.uuid : "",
44989
46217
  moduleName: moduleName !== "BPAREG" ? "bpa-services" : "BPAREG",
44990
- businessService: moduleName !== "BPAREG" ? businessService ? [businessService] : ["BPA_LOW", "BPA", "BPA_OC"] : businessService ? [businessService.identifier] : ["ARCHITECT", "BUILDER", "ENGINEER", "STRUCTURALENGINEER"]
46218
+ businessService: moduleName !== "BPAREG" ? businessService ? [businessService] : ["BPA_LOW", "BPA", "BPA_OC"] : businessService ? [businessService.identifier] : ["ARCHITECT", "BUILDER", "ENGINEER", "STRUCTURALENGINEER", "TOWNPLANNER", "SUPERVISOR"]
44991
46219
  }, (applicationStatus === null || applicationStatus === void 0 ? void 0 : applicationStatus.length) > 0 ? {
44992
46220
  status: applicationStatus
44993
46221
  } : {}),
@@ -45010,9 +46238,15 @@ var useBPAInbox = function useBPAInbox(_ref) {
45010
46238
  return item.code.split("_").pop();
45011
46239
  }).join(",")
45012
46240
  } : {}),
45013
- limit: limit,
45014
- offset: offset
46241
+ limit: limit
45015
46242
  };
46243
+
46244
+ if (!applicationNo) {
46245
+ _filters = _extends({}, _filters, {
46246
+ offset: offset
46247
+ });
46248
+ }
46249
+
45016
46250
  return useInbox({
45017
46251
  tenantId: tenantId,
45018
46252
  filters: _filters,
@@ -45409,8 +46643,8 @@ var useBusinessServiceData = function useBusinessServiceData(tenantId, businessS
45409
46643
  }, config);
45410
46644
  };
45411
46645
 
45412
- var useBPATaxDocuments = function useBPATaxDocuments(stateId, formData, PrevStateDocuments) {
45413
- var _bpaDocs$BPA, _filtredBpaDocs, _filtredBpaDocs$, _filtredBpaDocs$$docT;
46646
+ var useBPATaxDocuments = function useBPATaxDocuments(stateId, formData, beforeUploadDocuments) {
46647
+ var _beforeUploadDocument, _data$pdfFiles, _bpaDocs$BPA, _filtredBpaDocs, _filtredBpaDocs$, _filtredBpaDocs$$docT;
45414
46648
 
45415
46649
  var _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "BPA", ["DocTypeMapping"]),
45416
46650
  bpaDocsLoading = _Digit$Hooks$obps$use.isLoading,
@@ -45420,6 +46654,17 @@ var useBPATaxDocuments = function useBPATaxDocuments(stateId, formData, PrevStat
45420
46654
  commonDocsLoading = _Digit$Hooks$obps$use2.isLoading,
45421
46655
  commonDocs = _Digit$Hooks$obps$use2.data;
45422
46656
 
46657
+ var documents = beforeUploadDocuments;
46658
+
46659
+ var _Digit$Hooks$useDocum = Digit.Hooks.useDocumentSearch(documents, {
46660
+ enabled: ((_beforeUploadDocument = beforeUploadDocuments) === null || _beforeUploadDocument === void 0 ? void 0 : _beforeUploadDocument.length) > 0 ? true : false
46661
+ }),
46662
+ data = _Digit$Hooks$useDocum.data;
46663
+
46664
+ if ((data === null || data === void 0 ? void 0 : (_data$pdfFiles = data.pdfFiles) === null || _data$pdfFiles === void 0 ? void 0 : _data$pdfFiles.length) > 0) {
46665
+ beforeUploadDocuments = data === null || data === void 0 ? void 0 : data.pdfFiles;
46666
+ }
46667
+
45423
46668
  var filtredBpaDocs = [];
45424
46669
 
45425
46670
  if (bpaDocs !== null && bpaDocs !== void 0 && (_bpaDocs$BPA = bpaDocs.BPA) !== null && _bpaDocs$BPA !== void 0 && _bpaDocs$BPA.DocTypeMapping) {
@@ -45450,7 +46695,7 @@ var useBPATaxDocuments = function useBPATaxDocuments(stateId, formData, PrevStat
45450
46695
  });
45451
46696
  doc.uploadedDocuments[0] = {};
45452
46697
  doc.uploadedDocuments[0].values = [];
45453
- PrevStateDocuments.map(function (upDocs) {
46698
+ beforeUploadDocuments.map(function (upDocs) {
45454
46699
  var _upDocs$documentType, _upDocs$documentType2;
45455
46700
 
45456
46701
  if (code === (upDocs === null || upDocs === void 0 ? void 0 : (_upDocs$documentType = upDocs.documentType) === null || _upDocs$documentType === void 0 ? void 0 : _upDocs$documentType.split('.')[0]) + "." + (upDocs === null || upDocs === void 0 ? void 0 : (_upDocs$documentType2 = upDocs.documentType) === null || _upDocs$documentType2 === void 0 ? void 0 : _upDocs$documentType2.split('.')[1])) {
@@ -46531,6 +47776,7 @@ var Hooks = {
46531
47776
  useClearNotifications: useClearNotifications,
46532
47777
  useNotificationCount: useNotificationCount,
46533
47778
  useStore: useStore$1,
47779
+ useDocumentSearch: useDocumentSearch,
46534
47780
  useTenants: useTenants,
46535
47781
  useInbox: useTLInbox,
46536
47782
  pgr: pgr,