@djb25/digit-ui-module-commonpt 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { Loader, VerticalTimeline, FormComposer, Toast, Card, CardText, StatusTable, Row, SubmitBar, Banner, RadioButtons, Dropdown, InfoBannerIcon, Localities, Header, ResponseComposer, Modal, KeyNote, OTPInput, CardLabelError, FormStep, UploadFile, DatePicker, CardSubHeader, PDFSvg, LabelFieldPair, CardLabel, MultiUploadWrapper, CardHeader, CardSectionHeader, CheckBox, TextInput, LinkButton, Close as Close$e, ViewsIcon, BreakLine, Table, TelePhone, DisplayPhotos, EditIcon, CheckPoint, ConnectingCheckPoints, ActionBar, Menu, ButtonSelector, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, Label, CollapsibleCardPage, AddressDetails, DeleteIcon, MobileNumber, RadioOrSelect, TextArea, SearchForm, SearchField, DetailsCard, TickMark, PropertyHouse, EmployeeModuleCard, CitizenHomeCard, PTIcon } from '@djb25/digit-ui-react-components';
2
- import React, { useState, useEffect, useLayoutEffect, useMemo, useRef, Fragment as Fragment$1, memo, useCallback } from 'react';
1
+ import { Loader, VerticalTimeline, FormComposer, Toast, Card, CardText, StatusTable, Row, SubmitBar, Banner, Header, ResponseComposer, Table, Modal, KeyNote, Dropdown, Localities, OTPInput, CardLabelError, FormStep, UploadFile, RadioButtons, DatePicker, CardSubHeader, PDFSvg, LabelFieldPair, CardLabel, MultiUploadWrapper, CardHeader, CardSectionHeader, CheckBox, TextInput, LinkButton, Close as Close$e, ViewsIcon, BreakLine, TelePhone, DisplayPhotos, InfoBannerIcon, EditIcon, CheckPoint, ConnectingCheckPoints, ActionBar, Menu, ButtonSelector, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, CollapsibleCardPage, Label, AddressDetails, DeleteIcon, MobileNumber, RadioOrSelect, TextArea, SearchForm, SearchField, DetailsCard, TickMark, PropertyHouse, EmployeeModuleCard, CitizenHomeCard, PTIcon } from '@djb25/digit-ui-react-components';
2
+ import React, { useState, useEffect, useRef, useLayoutEffect, useMemo, Fragment as Fragment$1, memo, useCallback } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useHistory, useRouteMatch, Switch, Route, Link, useParams } from 'react-router-dom';
5
5
  import { useQueryClient } from 'react-query';
@@ -14,7 +14,6 @@ const newConfig = [{
14
14
  component: "CPTPropertyLocationDetails",
15
15
  texts: {
16
16
  headerCaption: "",
17
- header: "PT_LOCATION_DETAILS",
18
17
  cardText: "",
19
18
  submitBarLabel: "PT_COMMONS_NEXT"
20
19
  },
@@ -7574,1101 +7573,1029 @@ var propTypes = createCommonjsModule(function (module) {
7574
7573
  }
7575
7574
  });
7576
7575
 
7577
- const description = {
7578
- description: "PT_SEARCH_OR_DESC",
7579
- descriptionStyles: {
7580
- fontWeight: "300",
7581
- color: "#505A5F",
7582
- marginTop: "0px",
7583
- textAlign: "center",
7584
- marginBottom: "20px",
7585
- maxWidth: "540px"
7586
- }
7576
+ const TYPE_LOGIN$1 = {
7577
+ type: "login"
7587
7578
  };
7588
- const SearchProperty = ({
7589
- config: propsConfig,
7579
+ const DEFAULT_REDIRECT_URL = "/digit-ui/citizen";
7580
+ const PropertySearchResults = ({
7581
+ template,
7582
+ header,
7583
+ actionButtonLabel,
7584
+ isMutation,
7590
7585
  onSelect,
7591
- redirectToUrl
7586
+ config,
7587
+ clearParams: _clearParams = () => {},
7588
+ stateCode,
7589
+ redirectToUrl,
7590
+ searchQuery
7592
7591
  }) => {
7593
- var _Digit$Hooks$pt$useTe, _Digit$Hooks$tl$useTe, _propertyData$Propert2, _propertyData$Propert3, _searchData$filters2, _Object$values2, _Object$values2$filte;
7592
+ var _result$data, _result$data2, _properties$map, _paymentDetails$data, _paymentDetails$data$, _ref, _modalData$total_due;
7594
7593
  const {
7595
7594
  t
7596
7595
  } = useTranslation();
7597
- const history = useHistory();
7596
+ const modalRef = useRef();
7598
7597
  const {
7599
- action = 0
7598
+ mobileNumber,
7599
+ propertyIds,
7600
+ oldPropertyIds,
7601
+ locality,
7602
+ city,
7603
+ tenantId: tId,
7604
+ doorNo,
7605
+ name,
7606
+ PToffset
7600
7607
  } = Digit.Hooks.useQueryParams();
7601
- const [searchData, setSearchData] = useState({});
7602
- const [showToast, setShowToast] = useState(null);
7603
- sessionStorage.setItem("VisitedCommonPTSearch", true);
7604
- sessionStorage.setItem("VisitedLightCreate", false);
7605
- let allCities = (_Digit$Hooks$pt$useTe = Digit.Hooks.pt.useTenants()) === null || _Digit$Hooks$pt$useTe === void 0 ? void 0 : _Digit$Hooks$pt$useTe.sort((a, b) => {
7606
- var _a$i18nKey, _a$i18nKey$localeComp;
7607
- return a === null || a === void 0 ? void 0 : (_a$i18nKey = a.i18nKey) === null || _a$i18nKey === void 0 ? void 0 : (_a$i18nKey$localeComp = _a$i18nKey.localeCompare) === null || _a$i18nKey$localeComp === void 0 ? void 0 : _a$i18nKey$localeComp.call(_a$i18nKey, b === null || b === void 0 ? void 0 : b.i18nKey);
7608
- });
7609
- allCities = allCities ? allCities : (_Digit$Hooks$tl$useTe = Digit.Hooks.tl.useTenants()) === null || _Digit$Hooks$tl$useTe === void 0 ? void 0 : _Digit$Hooks$tl$useTe.sort((a, b) => {
7610
- var _a$i18nKey2, _a$i18nKey2$localeCom;
7611
- return a === null || a === void 0 ? void 0 : (_a$i18nKey2 = a.i18nKey) === null || _a$i18nKey2 === void 0 ? void 0 : (_a$i18nKey2$localeCom = _a$i18nKey2.localeCompare) === null || _a$i18nKey2$localeCom === void 0 ? void 0 : _a$i18nKey2$localeCom.call(_a$i18nKey2, b === null || b === void 0 ? void 0 : b.i18nKey);
7612
- });
7613
- if (window.location.href.includes("obps")) {
7614
- allCities = Digit.SessionStorage.get("OBPS_TENANTS");
7615
- } else if (window.location.href.includes("fsm")) {
7616
- allCities = [{
7617
- i18nKey: "TENANT_TENANTS_PG_CITYA",
7618
- code: Digit.ULBService.getCurrentTenantId(),
7619
- name: "City A",
7620
- description: "City A",
7621
- pincode: [143001, 143002, 143003, 143004, 143005],
7622
- logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
7623
- imageId: null,
7624
- domainUrl: "https://www.upyog.niua.org",
7625
- type: "CITY",
7626
- twitterUrl: null,
7627
- facebookUrl: null,
7628
- emailId: "citya@gmail.com",
7629
- OfficeTimings: {
7630
- "Mon - Fri": "9.00 AM - 6.00 PM"
7631
- },
7632
- city: {
7633
- name: "City A",
7634
- localName: null,
7635
- districtCode: "CITYA",
7636
- districtName: null,
7637
- districtTenantCode: Digit.ULBService.getCurrentTenantId(),
7638
- regionName: null,
7639
- ulbGrade: "Municipal Corporation",
7640
- longitude: 75.5761829,
7641
- latitude: 31.3260152,
7642
- shapeFileLocation: null,
7643
- captcha: null,
7644
- code: "1013",
7645
- ddrName: "DDR A"
7646
- },
7647
- address: "City A Municipal Corporation",
7648
- contactNumber: "001-2345876"
7649
- }, {
7650
- i18nKey: "TENANT_TENANTS_PG_CITYB",
7651
- code: "pg.cityb",
7652
- name: "City B",
7653
- description: null,
7654
- pincode: [143006, 143007, 143008, 143009, 143010],
7655
- logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
7656
- imageId: null,
7657
- domainUrl: "https://www.upyog.niua.org",
7658
- type: "CITY",
7659
- twitterUrl: null,
7660
- facebookUrl: null,
7661
- emailId: "cityb@gmail.com",
7662
- OfficeTimings: {
7663
- "Mon - Fri": "9.00 AM - 6.00 PM",
7664
- Sat: "9.00 AM - 12.00 PM"
7665
- },
7666
- city: {
7667
- name: "City B",
7668
- localName: null,
7669
- districtCode: "CITYB",
7670
- districtName: null,
7671
- districtTenantCode: "pg.cityb",
7672
- regionName: null,
7673
- ulbGrade: "Municipal Corporation",
7674
- longitude: 74.8722642,
7675
- latitude: 31.6339793,
7676
- shapeFileLocation: null,
7677
- captcha: null,
7678
- code: "107",
7679
- ddrName: "DDR B"
7680
- },
7681
- address: "City B Municipal Corporation Address",
7682
- contactNumber: "0978-7645345",
7683
- helpLineNumber: "0654-8734567"
7684
- }, {
7685
- i18nKey: "TENANT_TENANTS_PG_CITYC",
7686
- code: "pg.cityc",
7687
- name: "City C",
7688
- description: null,
7689
- logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
7690
- imageId: null,
7691
- domainUrl: "https://www.upyog.niua.org",
7692
- type: "CITY",
7693
- twitterUrl: null,
7694
- facebookUrl: null,
7695
- emailId: "cityc@gmail.com",
7696
- OfficeTimings: {
7697
- "Mon - Fri": "9.00 AM - 6.00 PM",
7698
- Sat: "9.00 AM - 12.00 PM"
7699
- },
7700
- city: {
7701
- name: "City C",
7702
- localName: null,
7703
- districtCode: "CITYC",
7704
- districtName: null,
7705
- districtTenantCode: "pg.cityc",
7706
- regionName: null,
7707
- ulbGrade: "Municipal Corporation",
7708
- longitude: 73.8722642,
7709
- latitude: 31.6339793,
7710
- shapeFileLocation: null,
7711
- captcha: null,
7712
- code: "108",
7713
- ddrName: "DDR C"
7714
- },
7715
- address: "City C Municipal Corporation Address",
7716
- contactNumber: "0978-7645345",
7717
- helpLineNumber: "0654-8734567"
7718
- }];
7608
+ const filters = {};
7609
+ const [modalData, setShowModal] = useState(false);
7610
+ const PrivacyInfoLabel = Digit.ComponentRegistryService.getComponent("WSInfoLabel");
7611
+ let OfsetForSearch = PToffset;
7612
+ let t1;
7613
+ let off;
7614
+ if (!isNaN(parseInt(OfsetForSearch))) {
7615
+ off = OfsetForSearch;
7616
+ t1 = parseInt(OfsetForSearch) + 5;
7617
+ } else {
7618
+ t1 = 5;
7719
7619
  }
7720
- console.log("allCities", allCities);
7721
- const [cityCode, setCityCode] = useState();
7722
- const [formValue, setFormValue] = useState();
7723
- const [errorShown, seterrorShown] = useState(false);
7724
- let isMobile = window.Digit.Utils.browser.isMobile();
7620
+ let filter1 = !isNaN(parseInt(OfsetForSearch)) ? {
7621
+ limit: "5",
7622
+ sortOrder: "ASC",
7623
+ sortBy: "createdTime",
7624
+ offset: off
7625
+ } : {
7626
+ limit: "5",
7627
+ sortOrder: "ASC",
7628
+ sortBy: "createdTime",
7629
+ offset: "0"
7630
+ };
7631
+ const closeModal = () => {
7632
+ setShowModal(false);
7633
+ };
7634
+ Digit.Hooks.useClickOutside(modalRef, closeModal, modalData);
7635
+ const sbm = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNumber) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNo);
7636
+ const spi = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyIds) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyId);
7637
+ const sop = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyIds) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyId);
7638
+ const sanitizeParam = param => param && param !== "undefined" ? param : null;
7639
+ const finalMobileNumber = sanitizeParam(mobileNumber) || sanitizeParam(sbm);
7640
+ if (finalMobileNumber) filters.mobileNumber = finalMobileNumber;
7641
+ const finalPropertyIds = sanitizeParam(propertyIds) || sanitizeParam(spi);
7642
+ if (finalPropertyIds) filters.propertyIds = finalPropertyIds;
7643
+ const finalOldPropertyIds = sanitizeParam(oldPropertyIds) || sanitizeParam(sop);
7644
+ if (finalOldPropertyIds) filters.oldPropertyIds = finalOldPropertyIds;
7645
+ const finalLocality = sanitizeParam(locality) || sanitizeParam(searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.locality);
7646
+ if (finalLocality) filters.locality = finalLocality;
7647
+ const finalDoorNo = sanitizeParam(doorNo) || sanitizeParam(searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.doorNo);
7648
+ if (finalDoorNo) filters.doorNo = finalDoorNo;
7649
+ const finalName = sanitizeParam(name) || sanitizeParam(searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.name);
7650
+ if (finalName) filters.name = finalName;
7651
+ filters.limit = filter1.limit;
7652
+ filters.sortOrder = filter1.sortOrder;
7653
+ filters.sortBy = filter1.sortBy;
7654
+ filters.offset = filter1.offset;
7655
+ if (!filters.status) {
7656
+ filters.status = "ACTIVE,INWORKFLOW";
7657
+ }
7658
+ const [owners, setOwners, clearOwners] = Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS", null);
7659
+ const [lastPath, setLastPath, clearLastPath] = Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS_LAST_PATH", null);
7725
7660
  const {
7726
- data: propertyData,
7727
- isLoading: propertyDataLoading,
7728
- error,
7729
- isSuccess,
7730
- billData
7731
- } = Digit.Hooks.pt.usePropertySearchWithDue({
7732
- tenantId: searchData === null || searchData === void 0 ? void 0 : searchData.city,
7733
- filters: searchData === null || searchData === void 0 ? void 0 : searchData.filters,
7734
- auth: false,
7735
- configs: {
7736
- enabled: Object.keys(searchData).length > 0,
7737
- retry: false,
7738
- retryOnMount: false,
7739
- staleTime: Infinity
7740
- }
7741
- });
7742
- useEffect(() => {
7743
- var _searchData$filters, _Object$values, _Object$values$filter;
7744
- if (!(searchData !== null && searchData !== void 0 && (_searchData$filters = searchData.filters) !== null && _searchData$filters !== void 0 && _searchData$filters.mobileNumber && ((_Object$values = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values === void 0 ? void 0 : (_Object$values$filter = _Object$values.filter(ob => ob !== undefined)) === null || _Object$values$filter === void 0 ? void 0 : _Object$values$filter.length) == 1) && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > 0 && ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && !errorShown) {
7745
- setShowToast({
7746
- error: true,
7747
- warning: true,
7748
- label: "ERR_PLEASE_REFINED_UR_SEARCH"
7749
- });
7750
- }
7751
- }, [propertyData]);
7752
- useEffect(() => {
7753
- showToast && (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "ERR_PLEASE_REFINED_UR_SEARCH" && (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "NO_PROPERTIES_FOUND" && setShowToast(null);
7754
- }, [action, propertyDataLoading]);
7661
+ path,
7662
+ url
7663
+ } = useRouteMatch();
7664
+ const searchParams = Digit.Hooks.useQueryParams();
7755
7665
  useEffect(() => {
7756
- var _propertyData$Propert;
7757
- if (!propertyDataLoading && propertyData && searchData && (propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert = propertyData.Properties) === null || _propertyData$Propert === void 0 ? void 0 : _propertyData$Propert.length) <= 0) {
7758
- setShowToast({
7759
- error: true,
7760
- warning: true,
7761
- label: "NO_PROPERTIES_FOUND"
7762
- });
7763
- }
7764
- }, [propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert2 = propertyData.Properties) === null || _propertyData$Propert2 === void 0 ? void 0 : (_propertyData$Propert3 = _propertyData$Propert2[0]) === null || _propertyData$Propert3 === void 0 ? void 0 : _propertyData$Propert3.propertyId, propertyDataLoading]);
7765
- useLayoutEffect(() => {
7766
- const getActionBar = () => {
7767
- let el = document.querySelector("div.action-bar-wrap");
7768
- if (el) {
7769
- el.style.position = "static";
7770
- el.style.padding = "8px 0";
7771
- el.style.boxShadow = "none";
7772
- el.style.marginBottom = "16px";
7773
- el.style.textAlign = "left";
7774
- el.style.zIndex = "0";
7775
- } else {
7776
- setTimeout(() => {
7777
- getActionBar();
7778
- }, 100);
7779
- }
7780
- };
7781
- getActionBar();
7666
+ setOwners([]);
7667
+ _clearParams();
7668
+ setLastPath("");
7782
7669
  }, []);
7783
- const {
7784
- data: ptSearchConfig,
7785
- isLoading
7786
- } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "DIGIT-UI", "HelpText", {
7787
- select: data => {
7788
- var _data$DIGITUI, _data$DIGITUI$HelpTex, _data$DIGITUI$HelpTex2;
7789
- return data === null || data === void 0 ? void 0 : (_data$DIGITUI = data["DIGIT-UI"]) === null || _data$DIGITUI === void 0 ? void 0 : (_data$DIGITUI$HelpTex = _data$DIGITUI["HelpText"]) === null || _data$DIGITUI$HelpTex === void 0 ? void 0 : (_data$DIGITUI$HelpTex2 = _data$DIGITUI$HelpTex[0]) === null || _data$DIGITUI$HelpTex2 === void 0 ? void 0 : _data$DIGITUI$HelpTex2.PT;
7790
- }
7670
+ const auth = false;
7671
+ const tenantId = Digit.ULBService.getCurrentTenantId();
7672
+ const scity = city || tId || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.city) || tenantId;
7673
+ const searchArgs = scity ? {
7674
+ tenantId: scity,
7675
+ filters,
7676
+ auth
7677
+ } : {
7678
+ filters,
7679
+ auth
7680
+ };
7681
+ const result = Digit.Hooks.pt.usePropertySearch(searchArgs, {
7682
+ privacy: Digit.Utils.getPrivacyObject()
7791
7683
  });
7792
- const [mobileNumber, property, oldProperty, name, doorNumber] = propsConfig.inputs;
7793
- const config = [{
7794
- body: [{
7795
- type: "custom",
7796
- populators: {
7797
- name: "addParam",
7798
- defaultValue: {
7799
- code: 0,
7800
- name: t("PT_KNOW_PTID")
7801
- },
7802
- customProps: {
7803
- t,
7804
- isMandatory: true,
7805
- optionsKey: "name",
7806
- options: [{
7807
- code: 0,
7808
- name: t("PT_KNOW_PTID")
7809
- }, {
7810
- code: 1,
7811
- name: t("PT_SEARCH_DOOR_NO")
7812
- }]
7813
- },
7814
- component: (props, customProps) => /*#__PURE__*/React.createElement(RadioButtons, Object.assign({}, customProps, {
7815
- selectedOption: props.value,
7816
- onSelect: d => {
7817
- props === null || props === void 0 ? void 0 : props.setValue("city", {});
7818
- props === null || props === void 0 ? void 0 : props.setValue("locality", {});
7819
- props === null || props === void 0 ? void 0 : props.setValue("mobileNumber", "");
7820
- props === null || props === void 0 ? void 0 : props.setValue("propertyIds", "");
7821
- props === null || props === void 0 ? void 0 : props.setValue("doorNumber", "");
7822
- props === null || props === void 0 ? void 0 : props.setValue("oldPropertyId", "");
7823
- props === null || props === void 0 ? void 0 : props.setValue("name", "");
7824
- history.replace(`${history.location.pathname}?action=${action == 0 ? 1 : 0}`);
7825
- }
7826
- }))
7684
+ const properties = (result === null || result === void 0 ? void 0 : (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.Properties) || (result === null || result === void 0 ? void 0 : (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.properties) || (Array.isArray(result === null || result === void 0 ? void 0 : result.data) ? result === null || result === void 0 ? void 0 : result.data : []);
7685
+ const consumerCode = properties === null || properties === void 0 ? void 0 : (_properties$map = properties.map) === null || _properties$map === void 0 ? void 0 : _properties$map.call(properties, a => a.propertyId || a.id).filter(id => id).join(",");
7686
+ if (result.isSuccess && (!properties || properties.length === 0)) {
7687
+ console.warn("Property Search: No properties found in result.data", result.data);
7688
+ }
7689
+ const fetchBillParams = mobileNumber ? {
7690
+ mobileNumber,
7691
+ consumerCode
7692
+ } : {
7693
+ consumerCode
7694
+ };
7695
+ const paymentDetails = Digit.Hooks.useFetchBillsForBuissnessService({
7696
+ businessService: "PT",
7697
+ ...fetchBillParams,
7698
+ tenantId: scity
7699
+ }, {
7700
+ enabled: !!(consumerCode && scity),
7701
+ retry: false
7702
+ });
7703
+ const history = useHistory();
7704
+ const proceedToPay = data => {
7705
+ history.push(`/digit-ui/citizen/payment/my-bills/PT/${data.property_id}`, {
7706
+ tenantId
7707
+ });
7708
+ };
7709
+ if (paymentDetails.isLoading || result.isLoading) {
7710
+ return /*#__PURE__*/React.createElement(Loader, null);
7711
+ }
7712
+ if (result.error || result.isSuccess && (!properties || properties.length === 0)) {
7713
+ return /*#__PURE__*/React.createElement("div", {
7714
+ style: {
7715
+ height: "150px"
7827
7716
  }
7828
- }, {
7829
- label: "PT_SELECT_CITY",
7830
- isMandatory: true,
7831
- type: "custom",
7832
- populators: {
7833
- name: "city",
7834
- defaultValue: null,
7835
- rules: {
7836
- required: true
7837
- },
7838
- customProps: {
7839
- t,
7840
- isMandatory: true,
7841
- option: [...allCities],
7842
- optionKey: "i18nKey"
7843
- },
7844
- component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown, Object.assign({}, customProps, {
7845
- selected: props.value,
7846
- select: d => {
7847
- Digit.ULBService.getCurrentTenantId();
7848
- if (d.code !== cityCode) props.setValue("locality", null);
7849
- props.onChange(d);
7717
+ }, /*#__PURE__*/React.createElement(Card, {
7718
+ style: {
7719
+ display: "flex",
7720
+ justifyContent: "center",
7721
+ alignItems: "center",
7722
+ height: "100%"
7723
+ }
7724
+ }, t("CS_PT_NO_PROPERTIES_FOUND")));
7725
+ }
7726
+ const payment = {};
7727
+ paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$data = paymentDetails.data) === null || _paymentDetails$data === void 0 ? void 0 : (_paymentDetails$data$ = _paymentDetails$data.Bill) === null || _paymentDetails$data$ === void 0 ? void 0 : _paymentDetails$data$.forEach(element => {
7728
+ if (element !== null && element !== void 0 && element.consumerCode) {
7729
+ payment[element === null || element === void 0 ? void 0 : element.consumerCode] = {
7730
+ total_due: element === null || element === void 0 ? void 0 : element.totalAmount,
7731
+ bil_due__date: new Date(element === null || element === void 0 ? void 0 : element.billDate).toDateString()
7732
+ };
7733
+ }
7734
+ });
7735
+ const searchResults = (_ref = properties || []) === null || _ref === void 0 ? void 0 : _ref.map(property => {
7736
+ var _sort, _sort$, _addr$locality, _addr$locality2, _addr$locality3, _addr$locality4, _payment$property$pro, _payment$property$pro2, _2, _property$owners, _property$owners$;
7737
+ let addr = (property === null || property === void 0 ? void 0 : property.address) || {};
7738
+ return {
7739
+ property_id: property === null || property === void 0 ? void 0 : property.propertyId,
7740
+ owner_name: (_sort = ((property === null || property === void 0 ? void 0 : property.owners) || []).sort((a, b) => {
7741
+ var _a$additionalDetails, _b$additionalDetails;
7742
+ return ((a === null || a === void 0 ? void 0 : (_a$additionalDetails = a.additionalDetails) === null || _a$additionalDetails === void 0 ? void 0 : _a$additionalDetails.ownerSequence) || 0) - ((b === null || b === void 0 ? void 0 : (_b$additionalDetails = b.additionalDetails) === null || _b$additionalDetails === void 0 ? void 0 : _b$additionalDetails.ownerSequence) || 0);
7743
+ })) === null || _sort === void 0 ? void 0 : (_sort$ = _sort[0]) === null || _sort$ === void 0 ? void 0 : _sort$.name,
7744
+ property_address: [addr.doorNo || "", addr.buildingName || "", addr.street || "", t(`TENANTS_MOHALLA_${(_addr$locality = addr.locality) === null || _addr$locality === void 0 ? void 0 : _addr$locality.code}`) !== `TENANTS_MOHALLA_${(_addr$locality2 = addr.locality) === null || _addr$locality2 === void 0 ? void 0 : _addr$locality2.code}` ? t(`TENANTS_MOHALLA_${(_addr$locality3 = addr.locality) === null || _addr$locality3 === void 0 ? void 0 : _addr$locality3.code}`) : ((_addr$locality4 = addr.locality) === null || _addr$locality4 === void 0 ? void 0 : _addr$locality4.name) || "", t(addr.tenantId) || ""].filter(a => a).join(", "),
7745
+ total_due: ((_payment$property$pro = payment[property === null || property === void 0 ? void 0 : property.propertyId]) === null || _payment$property$pro === void 0 ? void 0 : _payment$property$pro.total_due) || 0,
7746
+ bil_due__date: ((_payment$property$pro2 = payment[property === null || property === void 0 ? void 0 : property.propertyId]) === null || _payment$property$pro2 === void 0 ? void 0 : _payment$property$pro2.bil_due__date) || t("N/A"),
7747
+ status: t(property.status),
7748
+ owner_mobile: (_2 = ((property === null || property === void 0 ? void 0 : property.owners) || [])[0]) === null || _2 === void 0 ? void 0 : _2.mobileNumber,
7749
+ address: property === null || property === void 0 ? void 0 : property.address,
7750
+ owners: property.owners,
7751
+ propertyDetails: property,
7752
+ privacy: {
7753
+ property_address: {
7754
+ uuid: property === null || property === void 0 ? void 0 : (_property$owners = property.owners) === null || _property$owners === void 0 ? void 0 : (_property$owners$ = _property$owners[0]) === null || _property$owners$ === void 0 ? void 0 : _property$owners$.uuid,
7755
+ fieldName: ["doorNo", "street", "landmark"],
7756
+ model: "Property",
7757
+ showValue: true,
7758
+ loadData: {
7759
+ serviceName: "/property-services/property/_search",
7760
+ requestBody: {},
7761
+ requestParam: {
7762
+ tenantId: property === null || property === void 0 ? void 0 : property.tenantId,
7763
+ propertyIds: property === null || property === void 0 ? void 0 : property.propertyId
7764
+ },
7765
+ jsonPath: "Properties[0].address.street",
7766
+ isArray: false,
7767
+ d: res => {
7768
+ let resultString = (lodash.get(res, "Properties[0].address.doorNo") ? `${lodash.get(res, "Properties[0].address.doorNo")}, ` : "") + (lodash.get(res, "Properties[0].address.street") ? `${lodash.get(res, "Properties[0].address.street")}, ` : "") + (lodash.get(res, "Properties[0].address.landmark") ? `${lodash.get(res, "Properties[0].address.landmark")}` : "");
7769
+ return resultString;
7770
+ }
7850
7771
  }
7851
- }))
7772
+ }
7852
7773
  }
7853
- }, {
7854
- label: t("PT_PROVIDE_ONE_MORE_PARAM"),
7855
- isInsideBox: true,
7856
- placementinbox: 0,
7857
- isSectionText: true
7858
- }, {
7859
- label: mobileNumber.label,
7860
- type: mobileNumber.type,
7861
- populators: {
7862
- defaultValue: "",
7863
- name: mobileNumber.name,
7864
- validation: mobileNumber === null || mobileNumber === void 0 ? void 0 : mobileNumber.validation
7865
- },
7866
- ...description,
7867
- isMandatory: false,
7868
- isInsideBox: true,
7869
- placementinbox: 1
7870
- }, {
7871
- label: "",
7872
- labelChildren: /*#__PURE__*/React.createElement("div", {
7873
- className: "tooltip"
7874
- }, /*#__PURE__*/React.createElement("div", {
7875
- style: {
7876
- display: "flex",
7877
- gap: "0 4px"
7774
+ };
7775
+ });
7776
+ const getUserType = () => Digit.UserService.getType();
7777
+ const getFromLocation = (state, searchParams) => {
7778
+ return (state === null || state === void 0 ? void 0 : state.from) || (searchParams === null || searchParams === void 0 ? void 0 : searchParams.from) || DEFAULT_REDIRECT_URL;
7779
+ };
7780
+ const sendOtpToUser = async record => {
7781
+ sessionStorage.setItem("Digit_OBPS_PT", JSON.stringify(record));
7782
+ sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(record));
7783
+ if (onSelect) {
7784
+ onSelect("cptId", {
7785
+ id: record.property_id
7786
+ });
7787
+ } else {
7788
+ const data = {
7789
+ mobileNumber: record === null || record === void 0 ? void 0 : record.owner_mobile,
7790
+ tenantId: stateCode,
7791
+ userType: getUserType()
7792
+ };
7793
+ const [res, err] = await sendOtp({
7794
+ otp: {
7795
+ ...data,
7796
+ ...TYPE_LOGIN$1
7878
7797
  }
7879
- }, /*#__PURE__*/React.createElement("h2", null, t(property.label)), /*#__PURE__*/React.createElement(InfoBannerIcon, {
7880
- fill: "#0b0c0c"
7881
- }), /*#__PURE__*/React.createElement("span", {
7882
- className: "tooltiptext",
7883
- style: {
7884
- position: "absolute",
7885
- width: "72%",
7886
- marginLeft: "50%",
7887
- fontSize: "medium"
7798
+ });
7799
+ if (!err) {
7800
+ let redirectUrl = "/digit-ui/citizen/commonPt/property/link-success/" + record.property_id;
7801
+ if (redirectToUrl) {
7802
+ redirectUrl = redirectToUrl + "?propertyId=" + record.property_id + "&tenantId=" + tenantId;
7888
7803
  }
7889
- }, t(property.description) + " " + "PG-PT-xxxx-xxxxxx"))),
7890
- type: property.type,
7891
- populators: {
7892
- name: property.name,
7893
- defaultValue: "",
7894
- validation: property === null || property === void 0 ? void 0 : property.validation
7895
- },
7896
- ...description,
7897
- isMandatory: false,
7898
- isInsideBox: true,
7899
- placementinbox: 1
7900
- }, {
7901
- label: oldProperty.label,
7902
- type: oldProperty.type,
7903
- populators: {
7904
- name: oldProperty.name,
7905
- defaultValue: "",
7906
- validation: oldProperty === null || oldProperty === void 0 ? void 0 : oldProperty.validation
7907
- },
7908
- isMandatory: false,
7909
- isInsideBox: true,
7910
- placementinbox: 2
7911
- }],
7912
- body1: [{
7913
- type: "custom",
7914
- populators: {
7915
- name: "addParam1",
7916
- defaultValue: {
7917
- code: 1,
7918
- name: t("PT_SEARCH_DOOR_NO")
7919
- },
7920
- customProps: {
7921
- t,
7922
- isMandatory: true,
7923
- optionsKey: "name",
7924
- options: [{
7925
- code: 0,
7926
- name: t("PT_KNOW_PTID")
7927
- }, {
7928
- code: 1,
7929
- name: t("PT_SEARCH_DOOR_NO")
7930
- }]
7931
- },
7932
- component: (props, customProps) => /*#__PURE__*/React.createElement(RadioButtons, Object.assign({}, customProps, {
7933
- selectedOption: props.value,
7934
- onSelect: d => {
7935
- props === null || props === void 0 ? void 0 : props.setValue("city", {});
7936
- props === null || props === void 0 ? void 0 : props.setValue("locality", {});
7937
- props === null || props === void 0 ? void 0 : props.setValue("mobileNumber", "");
7938
- props === null || props === void 0 ? void 0 : props.setValue("propertyIds", "");
7939
- props === null || props === void 0 ? void 0 : props.setValue("doorNumber", "");
7940
- props === null || props === void 0 ? void 0 : props.setValue("oldPropertyId", "");
7941
- props === null || props === void 0 ? void 0 : props.setValue("name", "");
7942
- history.replace(`${history.location.pathname}?action=${action == 0 ? 1 : 0}`);
7943
- }
7944
- }))
7804
+ history.replace(`/digit-ui/citizen/commonPt/property/citizen-otp`, {
7805
+ from: getFromLocation(location.state, searchParams),
7806
+ mobileNumber: record.owner_mobile,
7807
+ redirectBackTo: redirectUrl
7808
+ });
7809
+ return;
7810
+ } else {
7811
+ history.push(`/digit-ui/citizen/`, {
7812
+ from: getFromLocation(location.state, searchParams),
7813
+ data: data
7814
+ });
7945
7815
  }
7816
+ }
7817
+ };
7818
+ const sendOtp = async data => {
7819
+ try {
7820
+ const res = await Digit.UserService.sendOtp(data, stateCode);
7821
+ return [res, null];
7822
+ } catch (err) {
7823
+ return [null, err];
7824
+ }
7825
+ };
7826
+ return /*#__PURE__*/React.createElement("div", {
7827
+ style: {
7828
+ marginTop: "16px"
7829
+ }
7830
+ }, /*#__PURE__*/React.createElement("div", null, header && /*#__PURE__*/React.createElement(Header, {
7831
+ style: {
7832
+ marginLeft: "8px"
7833
+ }
7834
+ }, t(header), " (", searchResults === null || searchResults === void 0 ? void 0 : searchResults.length, ")"), PrivacyInfoLabel && /*#__PURE__*/React.createElement(PrivacyInfoLabel, {
7835
+ t: t
7836
+ }), window.Digit.Utils.browser.isMobile() ? /*#__PURE__*/React.createElement(ResponseComposer, {
7837
+ data: searchResults,
7838
+ template: template,
7839
+ actionButtonLabel: actionButtonLabel,
7840
+ onSubmit: sendOtpToUser
7841
+ }) : /*#__PURE__*/React.createElement(Table, {
7842
+ t: t,
7843
+ data: searchResults,
7844
+ totalCount: searchResults === null || searchResults === void 0 ? void 0 : searchResults.length,
7845
+ totalRecords: searchResults === null || searchResults === void 0 ? void 0 : searchResults.length,
7846
+ columns: [{
7847
+ Header: t("PT_PROPERTY_PTUID"),
7848
+ disableSortBy: true,
7849
+ accessor: "property_id"
7946
7850
  }, {
7947
- label: "PT_SELECT_CITY",
7948
- isMandatory: true,
7949
- type: "custom",
7950
- populators: {
7951
- name: "city",
7952
- defaultValue: null,
7953
- rules: {
7954
- required: true
7955
- },
7956
- customProps: {
7957
- t,
7958
- isMandatory: true,
7959
- option: [...allCities],
7960
- optionKey: "i18nKey"
7961
- },
7962
- component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown, Object.assign({}, customProps, {
7963
- selected: props.value,
7964
- select: d => {
7965
- var _props$value, _props$value2;
7966
- Digit.LocalizationService.getLocale({
7967
- modules: [`rainmaker-${props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.code}`],
7968
- locale: Digit.StoreData.getCurrentLanguage(),
7969
- tenantId: `${props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.code}`
7970
- });
7971
- if (d.code !== cityCode) props.setValue("locality", null);
7972
- props.onChange(d);
7973
- }
7974
- }))
7975
- }
7976
- }, {
7977
- label: "PT_SELECT_LOCALITY",
7978
- type: "custom",
7979
- isMandatory: true,
7980
- populators: {
7981
- name: "locality",
7982
- defaultValue: "",
7983
- rules: {
7984
- required: true
7985
- },
7986
- customProps: {},
7987
- component: (props, customProps) => /*#__PURE__*/React.createElement(Localities, {
7988
- selectLocality: d => {
7989
- props.onChange(d);
7990
- },
7991
- tenantId: cityCode,
7992
- boundaryType: "revenue",
7993
- keepNull: false,
7994
- optionCardStyles: {
7995
- height: "600px",
7996
- overflow: "auto",
7997
- zIndex: "10",
7998
- maxHeight: "300px"
7999
- },
8000
- selected: formValue === null || formValue === void 0 ? void 0 : formValue.locality,
8001
- disable: !cityCode,
8002
- disableLoader: true
8003
- })
8004
- }
8005
- }, {
8006
- label: t("PT_PROVIDE_ONE_MORE_PARAM"),
8007
- isInsideBox: true,
8008
- placementinbox: 0,
8009
- isSectionText: true
8010
- }, {
8011
- label: doorNumber.label,
8012
- type: doorNumber.type,
8013
- populators: {
8014
- defaultValue: "",
8015
- name: doorNumber.name,
8016
- validation: doorNumber === null || doorNumber === void 0 ? void 0 : doorNumber.validation
8017
- },
8018
- isMandatory: false,
8019
- isInsideBox: true,
8020
- placementinbox: 1
7851
+ Header: t("PT_OWNER_NAME"),
7852
+ disableSortBy: true,
7853
+ accessor: "owner_name"
8021
7854
  }, {
8022
- label: name.label,
8023
- type: name.type,
8024
- populators: {
8025
- defaultValue: "",
8026
- name: name.name,
8027
- validation: name === null || name === void 0 ? void 0 : name.validation
8028
- },
8029
- isMandatory: false,
8030
- isInsideBox: true,
8031
- placementinbox: 2
7855
+ Header: t("PT_PROPERTY_ADDRESS_SUB_HEADER"),
7856
+ disableSortBy: true,
7857
+ accessor: "property_address"
8032
7858
  }]
8033
- }];
8034
- const onPropertySearch = async data => {
8035
- var _data$city, _tempObject;
8036
- if (ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > 0 && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && errorShown) {
8037
- seterrorShown(true);
8038
- return;
8039
- }
8040
- if (!(data !== null && data !== void 0 && (_data$city = data.city) !== null && _data$city !== void 0 && _data$city.code)) {
8041
- setShowToast({
8042
- error: true,
8043
- label: "ERR_PT_FILL_VALID_FIELDS"
8044
- });
8045
- return;
7859
+ })), modalData ? /*#__PURE__*/React.createElement(Modal, {
7860
+ hideSubmit: true,
7861
+ isDisabled: false,
7862
+ popupStyles: {
7863
+ width: "319px",
7864
+ height: "250px",
7865
+ margin: "auto"
7866
+ },
7867
+ formId: "modal-action"
7868
+ }, /*#__PURE__*/React.createElement("div", {
7869
+ ref: modalRef
7870
+ }, /*#__PURE__*/React.createElement(KeyNote, {
7871
+ keyValue: t("PT_AMOUNT_DUE"),
7872
+ note: `₹ ${modalData === null || modalData === void 0 ? void 0 : (_modalData$total_due = modalData.total_due) === null || _modalData$total_due === void 0 ? void 0 : _modalData$total_due.toLocaleString("en-IN")}`,
7873
+ noteStyle: {
7874
+ fontSize: "24px",
7875
+ fontWeight: "bold"
8046
7876
  }
8047
- if (action == 0) {
8048
- var _data$mobileNumber, _mobileNumber$validat, _mobileNumber$validat2, _data$propertyIds, _property$validation, _property$validation$, _data$oldPropertyId, _oldProperty$validati, _oldProperty$validati2;
8049
- if (!(data !== null && data !== void 0 && data.mobileNumber || data !== null && data !== void 0 && data.propertyIds || data !== null && data !== void 0 && data.oldPropertyId)) {
8050
- setShowToast({
8051
- error: true,
8052
- label: "ERR_PT_FILL_VALID_FIELDS"
8053
- });
8054
- return;
8055
- }
8056
- if (data !== null && data !== void 0 && data.mobileNumber && !((_data$mobileNumber = data.mobileNumber) !== null && _data$mobileNumber !== void 0 && _data$mobileNumber.match(mobileNumber === null || mobileNumber === void 0 ? void 0 : (_mobileNumber$validat = mobileNumber.validation) === null || _mobileNumber$validat === void 0 ? void 0 : (_mobileNumber$validat2 = _mobileNumber$validat.pattern) === null || _mobileNumber$validat2 === void 0 ? void 0 : _mobileNumber$validat2.value))) {
8057
- var _mobileNumber$validat3, _mobileNumber$validat4;
8058
- setShowToast({
8059
- error: true,
8060
- label: mobileNumber === null || mobileNumber === void 0 ? void 0 : (_mobileNumber$validat3 = mobileNumber.validation) === null || _mobileNumber$validat3 === void 0 ? void 0 : (_mobileNumber$validat4 = _mobileNumber$validat3.pattern) === null || _mobileNumber$validat4 === void 0 ? void 0 : _mobileNumber$validat4.message
8061
- });
8062
- return;
8063
- }
8064
- if (data !== null && data !== void 0 && data.propertyIds && !((_data$propertyIds = data.propertyIds) !== null && _data$propertyIds !== void 0 && _data$propertyIds.match(property === null || property === void 0 ? void 0 : (_property$validation = property.validation) === null || _property$validation === void 0 ? void 0 : (_property$validation$ = _property$validation.pattern) === null || _property$validation$ === void 0 ? void 0 : _property$validation$.value))) {
8065
- var _property$validation2, _property$validation3;
8066
- setShowToast({
8067
- error: true,
8068
- label: property === null || property === void 0 ? void 0 : (_property$validation2 = property.validation) === null || _property$validation2 === void 0 ? void 0 : (_property$validation3 = _property$validation2.pattern) === null || _property$validation3 === void 0 ? void 0 : _property$validation3.message
8069
- });
8070
- return;
8071
- }
8072
- if (data !== null && data !== void 0 && data.oldPropertyId && !((_data$oldPropertyId = data.oldPropertyId) !== null && _data$oldPropertyId !== void 0 && _data$oldPropertyId.match(oldProperty === null || oldProperty === void 0 ? void 0 : (_oldProperty$validati = oldProperty.validation) === null || _oldProperty$validati === void 0 ? void 0 : (_oldProperty$validati2 = _oldProperty$validati.pattern) === null || _oldProperty$validati2 === void 0 ? void 0 : _oldProperty$validati2.value))) {
8073
- var _oldProperty$validati3, _oldProperty$validati4;
8074
- setShowToast({
8075
- error: true,
8076
- label: oldProperty === null || oldProperty === void 0 ? void 0 : (_oldProperty$validati3 = oldProperty.validation) === null || _oldProperty$validati3 === void 0 ? void 0 : (_oldProperty$validati4 = _oldProperty$validati3.pattern) === null || _oldProperty$validati4 === void 0 ? void 0 : _oldProperty$validati4.message
8077
- });
8078
- return;
8079
- }
8080
- } else {
8081
- var _data$locality, _data$name, _name$validation, _name$validation$patt, _data$doorNumber, _doorNumber$validatio, _doorNumber$validatio2;
8082
- if (!(data !== null && data !== void 0 && (_data$locality = data.locality) !== null && _data$locality !== void 0 && _data$locality.code)) {
8083
- setShowToast({
8084
- error: true,
8085
- label: "ERR_PT_FILL_VALID_FIELDS"
8086
- });
8087
- return;
8088
- }
8089
- if (!(data !== null && data !== void 0 && data.doorNumber || data !== null && data !== void 0 && data.name)) {
8090
- setShowToast({
8091
- error: true,
8092
- label: "ERR_PT_FILL_VALID_FIELDS"
8093
- });
8094
- return;
8095
- }
8096
- if (data !== null && data !== void 0 && data.name && !((_data$name = data.name) !== null && _data$name !== void 0 && _data$name.match(name === null || name === void 0 ? void 0 : (_name$validation = name.validation) === null || _name$validation === void 0 ? void 0 : (_name$validation$patt = _name$validation.pattern) === null || _name$validation$patt === void 0 ? void 0 : _name$validation$patt.value))) {
8097
- var _name$validation2, _name$validation2$pat;
8098
- setShowToast({
8099
- error: true,
8100
- label: name === null || name === void 0 ? void 0 : (_name$validation2 = name.validation) === null || _name$validation2 === void 0 ? void 0 : (_name$validation2$pat = _name$validation2.pattern) === null || _name$validation2$pat === void 0 ? void 0 : _name$validation2$pat.message
8101
- });
8102
- return;
8103
- }
8104
- if (data !== null && data !== void 0 && data.doorNumber && !((_data$doorNumber = data.doorNumber) !== null && _data$doorNumber !== void 0 && _data$doorNumber.match(doorNumber === null || doorNumber === void 0 ? void 0 : (_doorNumber$validatio = doorNumber.validation) === null || _doorNumber$validatio === void 0 ? void 0 : (_doorNumber$validatio2 = _doorNumber$validatio.pattern) === null || _doorNumber$validatio2 === void 0 ? void 0 : _doorNumber$validatio2.value))) {
8105
- var _doorNumber$validatio3, _doorNumber$validatio4;
8106
- setShowToast({
8107
- error: true,
8108
- label: doorNumber === null || doorNumber === void 0 ? void 0 : (_doorNumber$validatio3 = doorNumber.validation) === null || _doorNumber$validatio3 === void 0 ? void 0 : (_doorNumber$validatio4 = _doorNumber$validatio3.pattern) === null || _doorNumber$validatio4 === void 0 ? void 0 : _doorNumber$validatio4.message
8109
- });
8110
- return;
8111
- }
7877
+ }), /*#__PURE__*/React.createElement("p", null, t("PT_YOU_HAVE") + " " + "₹" + " " + (modalData === null || modalData === void 0 ? void 0 : modalData.total_due.toLocaleString("en-IN")) + " " + t("PT_PENDING_AMOUNT") + " " + t("PT_INORDER_TO_TRANSFER")), /*#__PURE__*/React.createElement(SubmitBar, {
7878
+ submit: false,
7879
+ onSubmit: () => proceedToPay(modalData),
7880
+ style: {
7881
+ marginTop: "14px",
7882
+ width: "100%"
7883
+ },
7884
+ label: t("PT_PROCEED_PAYMENT")
7885
+ }))) : null, (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) === 0 && /*#__PURE__*/React.createElement("p", {
7886
+ style: {
7887
+ marginLeft: "16px",
7888
+ marginTop: "16px"
8112
7889
  }
8113
- if ((showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "ERR_PLEASE_REFINED_UR_SEARCH" || (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "NO_PROPERTIES_FOUND") setShowToast(null);
8114
- if (data !== null && data !== void 0 && data.doorNumber && (data === null || data === void 0 ? void 0 : data.doorNumber) !== "" && (data === null || data === void 0 ? void 0 : data.propertyIds) !== "") {
8115
- data["propertyIds"] = "";
7890
+ }, t("PT_NO_PROP_FOUND_MSG")), (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) !== 0 && ((searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) == 5 || (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) == 50) && (locality || searchQuery && searchQuery.locality) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
7891
+ style: {
7892
+ marginLeft: "16px",
7893
+ marginTop: "16px"
8116
7894
  }
8117
- let tempObject = Object.keys(data).filter(k => data[k]).reduce((acc, key) => ({
8118
- ...acc,
8119
- [key]: typeof data[key] === "object" ? data[key].code : data[key]
8120
- }), {});
8121
- let city = tempObject.city;
8122
- tempObject.doorNo = tempObject.doorNumber || ((_tempObject = tempObject) === null || _tempObject === void 0 ? void 0 : _tempObject.doorNo);
8123
- delete tempObject.addParam;
8124
- delete tempObject.addParam1;
8125
- delete tempObject.city;
8126
- if (action === "0") {
8127
- var _tempObject2, _tempObject3, _tempObject4;
8128
- tempObject = {
8129
- oldPropertyId: (_tempObject2 = tempObject) === null || _tempObject2 === void 0 ? void 0 : _tempObject2.oldPropertyId,
8130
- mobileNumber: (_tempObject3 = tempObject) === null || _tempObject3 === void 0 ? void 0 : _tempObject3.mobileNumber,
8131
- propertyIds: (_tempObject4 = tempObject) === null || _tempObject4 === void 0 ? void 0 : _tempObject4.propertyIds
8132
- };
8133
- } else if (action === "1") {
8134
- var _tempObject5, _tempObject6, _tempObject7, _tempObject8;
8135
- tempObject = {
8136
- name: (_tempObject5 = tempObject) === null || _tempObject5 === void 0 ? void 0 : _tempObject5.name,
8137
- doorNo: ((_tempObject6 = tempObject) === null || _tempObject6 === void 0 ? void 0 : _tempObject6.doorNumber) || ((_tempObject7 = tempObject) === null || _tempObject7 === void 0 ? void 0 : _tempObject7.doorNo),
8138
- locality: (_tempObject8 = tempObject) === null || _tempObject8 === void 0 ? void 0 : _tempObject8.locality
7895
+ }, t("PT_LOAD_MORE_MSG"), " ", /*#__PURE__*/React.createElement("span", {
7896
+ className: "link"
7897
+ }, /*#__PURE__*/React.createElement(Link, {
7898
+ to: `/digit-ui/citizen/pt/property/search-results?mobileNumber=${mobileNumber || searchQuery.mobileNumber ? mobileNumber || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNumber) : ""}&propertyIds=${propertyIds || searchQuery !== null && searchQuery !== void 0 && searchQuery.propertyIds ? propertyIds || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyIds) : ""}&oldPropertyIds=${oldPropertyIds || searchQuery !== null && searchQuery !== void 0 && searchQuery.oldPropertyIds ? oldPropertyIds || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyIds) : ""}&doorNo=${doorNo || searchQuery !== null && searchQuery !== void 0 && searchQuery.doorNo ? doorNo || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.doorNo) : ""}&name=${name || searchQuery !== null && searchQuery !== void 0 && searchQuery.name ? name || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.name) : ""}&city=${city ? city : ""}&locality=${locality || searchQuery !== null && searchQuery !== void 0 && searchQuery.locality ? locality || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.locality) : ""}&PToffset=${t1}`
7899
+ }, t("PT_COMMON_CLICK_HERE"))))));
7900
+ };
7901
+ PropertySearchResults.propTypes = {
7902
+ template: propTypes.any,
7903
+ header: propTypes.string,
7904
+ actionButtonLabel: propTypes.string
7905
+ };
7906
+ PropertySearchResults.defaultProps = {
7907
+ template: [],
7908
+ header: null,
7909
+ actionButtonLabel: null
7910
+ };
7911
+
7912
+ const SearchProperty = ({
7913
+ config: propsConfig,
7914
+ onSelect,
7915
+ redirectToUrl
7916
+ }) => {
7917
+ var _Digit$Hooks$pt$useTe, _Digit$Hooks$tl$useTe, _propertyData$Propert2, _propertyData$Propert3, _allCities, _allCities2, _Digit$UserService$ge3, _Digit$UserService$ge4, _allCities3, _allCities4, _searchData$filters2, _Object$values2, _Object$values2$filte;
7918
+ const {
7919
+ t
7920
+ } = useTranslation();
7921
+ const history = useHistory();
7922
+ const {
7923
+ action = 0
7924
+ } = Digit.Hooks.useQueryParams();
7925
+ const [searchData, setSearchData] = useState(() => {
7926
+ var _Digit$UserService$ge, _Digit$UserService$ge2;
7927
+ const isFirstVisit = sessionStorage.getItem("VisitedCitizenSearchRedirect");
7928
+ const mobileNumber = (_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.mobileNumber;
7929
+ if (!isFirstVisit && mobileNumber && window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")) {
7930
+ sessionStorage.setItem("VisitedCitizenSearchRedirect", "true");
7931
+ return {
7932
+ filters: {
7933
+ mobileNumber
7934
+ }
8139
7935
  };
8140
7936
  }
8141
- setSearchData({
8142
- city: city,
8143
- filters: tempObject
8144
- });
8145
- return;
8146
- };
8147
- const onFormValueChange = (setValue, data, formState) => {
8148
- const city = (data === null || data === void 0 ? void 0 : data.city) || allCities[0];
8149
- console.log("citycity", city);
8150
- setCityCode(city.code);
8151
- const locality = data === null || data === void 0 ? void 0 : data.locality;
8152
- if ((city === null || city === void 0 ? void 0 : city.code) !== cityCode) {
8153
- setCityCode(city === null || city === void 0 ? void 0 : city.code);
8154
- }
8155
- if (!lodash.isEqual(data, formValue)) {
8156
- setFormValue(data);
8157
- }
8158
- if (!locality || !city) {
8159
- return;
8160
- }
8161
- };
8162
- if (isLoading) {
8163
- return /*#__PURE__*/React.createElement(Loader, null);
8164
- }
8165
- let validation = ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && !(searchData !== null && searchData !== void 0 && (_searchData$filters2 = searchData.filters) !== null && _searchData$filters2 !== void 0 && _searchData$filters2.mobileNumber && ((_Object$values2 = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values2 === void 0 ? void 0 : (_Object$values2$filte = _Object$values2.filter(ob => ob !== undefined)) === null || _Object$values2$filte === void 0 ? void 0 : _Object$values2$filte.length) == 1) ? (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) < (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && (showToast == null || showToast !== null && !(showToast !== null && showToast !== void 0 && showToast.error)) : true;
8166
- if (propertyData && !propertyDataLoading && !error && validation) {
8167
- var _searchData$filters3, _Object$values3, _Object$values3$filte, _searchData$filters4, _propertyDataLoading$;
8168
- let qs = {};
8169
- qs = {
8170
- ...searchData.filters,
8171
- city: searchData.city
8172
- };
8173
- if (!(searchData !== null && searchData !== void 0 && (_searchData$filters3 = searchData.filters) !== null && _searchData$filters3 !== void 0 && _searchData$filters3.mobileNumber && ((_Object$values3 = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values3 === void 0 ? void 0 : (_Object$values3$filte = _Object$values3.filter(ob => ob !== undefined)) === null || _Object$values3$filte === void 0 ? void 0 : _Object$values3$filte.length) == 1) && ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.ptSearchCount && searchData !== null && searchData !== void 0 && (_searchData$filters4 = searchData.filters) !== null && _searchData$filters4 !== void 0 && _searchData$filters4.locality && propertyDataLoading && propertyDataLoading !== null && propertyDataLoading !== void 0 && (_propertyDataLoading$ = propertyDataLoading.Properties) !== null && _propertyDataLoading$ !== void 0 && _propertyDataLoading$.length && propertyDataLoading.Properties.length > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.ptSearchCount)) {
8174
- !showToast && setShowToast({
8175
- error: true,
8176
- label: "PT_MODIFY_SEARCH_CRITERIA"
8177
- });
8178
- } else if (propsConfig.action === "MUTATION") {
8179
- onSelect(propsConfig.key, qs, null, null, null, {
8180
- queryParams: {
8181
- ...qs
8182
- }
8183
- });
8184
- } else {
8185
- if (redirectToUrl || window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")) {
8186
- history.push(`/digit-ui/citizen/commonPt/property/search-results?${Object.keys(qs).map(key => `${key}=${qs[key]}`).join("&")}${redirectToUrl ? `&redirectToUrl=${redirectToUrl}` : ""}`);
8187
- } else {
8188
- var _qs, _qs2, _qs3, _qs4, _qs5, _qs6, _qs7, _qs8, _qs9, _propertyData$Propert4;
8189
- let SearchParams = {};
8190
- if (action == 0) SearchParams = {
8191
- city: (_qs = qs) === null || _qs === void 0 ? void 0 : _qs.city,
8192
- mobileNumber: ((_qs2 = qs) === null || _qs2 === void 0 ? void 0 : _qs2.mobileNumber) || "",
8193
- propertyIds: ((_qs3 = qs) === null || _qs3 === void 0 ? void 0 : _qs3.propertyIds) || "",
8194
- oldPropertyIds: ((_qs4 = qs) === null || _qs4 === void 0 ? void 0 : _qs4.oldPropertyIds) || "",
8195
- locality: "",
8196
- doorNo: "",
8197
- name: ""
8198
- };else SearchParams = {
8199
- city: (_qs5 = qs) === null || _qs5 === void 0 ? void 0 : _qs5.city,
8200
- locality: ((_qs6 = qs) === null || _qs6 === void 0 ? void 0 : _qs6.locality) || "",
8201
- doorNo: ((_qs7 = qs) === null || _qs7 === void 0 ? void 0 : _qs7.doorNumber) || ((_qs8 = qs) === null || _qs8 === void 0 ? void 0 : _qs8.doorNo) || "",
8202
- name: ((_qs9 = qs) === null || _qs9 === void 0 ? void 0 : _qs9.name) || "",
8203
- mobileNumber: "",
8204
- propertyIds: "",
8205
- oldPropertyIds: ""
8206
- };
8207
- !propertyDataLoading && (propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert4 = propertyData.Properties) === null || _propertyData$Propert4 === void 0 ? void 0 : _propertyData$Propert4.length) > 0 && onSelect("cptSearchQuery", SearchParams, null, null, null, {
8208
- queryParams: {
8209
- ...SearchParams
8210
- }
8211
- });
8212
- }
8213
- }
8214
- }
8215
- if (error) {
8216
- var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
8217
- !showToast && setShowToast({
8218
- error: true,
8219
- label: (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) || error
8220
- });
8221
- }
8222
- if (action == 1) {
8223
- config[0].body = [...config[0].body1];
8224
- }
8225
- return /*#__PURE__*/React.createElement("div", {
8226
- style: {
8227
- marginTop: "16px",
8228
- marginBottom: "16px",
8229
- backgroundColor: "white",
8230
- maxWidth: "960px"
8231
- }
8232
- }, /*#__PURE__*/React.createElement(FormComposer, {
8233
- onSubmit: onPropertySearch,
8234
- noBoxShadow: true,
8235
- inline: true,
8236
- config: config,
8237
- label: propsConfig.texts.submitButtonLabel,
8238
- heading: t(propsConfig.texts.header),
8239
- text: t(propsConfig.texts.text),
8240
- headingStyle: {
8241
- fontSize: "32px",
8242
- marginBottom: "16px",
8243
- fontFamily: "Roboto Condensed,sans-serif"
8244
- },
8245
- onFormValueChange: onFormValueChange,
8246
- cardStyle: {
8247
- marginBottom: "0",
8248
- maxWidth: "960px"
8249
- }
8250
- }), /*#__PURE__*/React.createElement("div", {
8251
- style: {
8252
- display: "flex"
8253
- }
8254
- }, window.location.href.includes("/obps/bpa/") ? /*#__PURE__*/React.createElement("span", {
8255
- className: "link",
8256
- style: isMobile ? {
8257
- display: "flex",
8258
- justifyContent: "center",
8259
- paddingBottom: "16px"
8260
- } : {
8261
- display: "flex",
8262
- justifyContent: "left",
8263
- paddingBottom: "16px",
8264
- marginLeft: "45px"
8265
- }
8266
- }, /*#__PURE__*/React.createElement(Link, {
8267
- to: "/digit-ui/citizen/obps/bpa/building_plan_scrutiny/new_construction/location"
8268
- }, t("CORE_COMMON_SKIP_CONTINUE"))) : /*#__PURE__*/React.createElement("span", {
8269
- className: "link",
8270
- style: isMobile ? {
8271
- display: "flex",
8272
- justifyContent: "center",
8273
- paddingBottom: "16px"
8274
- } : {
8275
- display: "flex",
8276
- justifyContent: "left",
8277
- paddingBottom: "16px",
8278
- marginLeft: "45px"
8279
- }
8280
- }, /*#__PURE__*/React.createElement(Link, {
8281
- to: window.location.href.includes("/ws/") ? "/digit-ui/citizen/ws/create-application/create-property" : window.location.href.includes("/tl/tradelicence/") ? "/digit-ui/citizen/tl/tradelicence/new-application/create-property" : window.location.href.includes("/fsm/") ? "/digit-ui/citizen/fsm/new-application/create-property" : "/digit-ui/citizen/commonpt/property/new-application"
8282
- }, t("CPT_REG_NEW_PROPERTY")))), showToast && /*#__PURE__*/React.createElement(Toast, {
8283
- isDleteBtn: true,
8284
- error: showToast.error,
8285
- warning: showToast.warning,
8286
- label: t(showToast.label),
8287
- onClose: () => {
8288
- setShowToast(null);
8289
- }
8290
- }));
8291
- };
8292
- SearchProperty.propTypes = {
8293
- loginParams: propTypes.any
8294
- };
8295
- SearchProperty.defaultProps = {
8296
- loginParams: null
8297
- };
8298
-
8299
- const SearchProperty$1 = ({
8300
- onSelect
8301
- }) => {
8302
- const {
8303
- t
8304
- } = useTranslation();
8305
- const {
8306
- path
8307
- } = useRouteMatch();
8308
- const search = useLocation().search;
8309
- const redirectToUrl = new URLSearchParams(search).get('redirectToUrl');
8310
- const params = useMemo(() => config.map(step => {
8311
- const texts = {};
8312
- for (const key in step.texts) {
8313
- texts[key] = t(step.texts[key]);
8314
- }
8315
- return {
8316
- ...step,
8317
- texts
8318
- };
8319
- }, [config]));
8320
- return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
8321
- path: `${path}`,
8322
- exact: true
8323
- }, /*#__PURE__*/React.createElement(SearchProperty, {
8324
- config: params[0],
8325
- onSelect: onSelect,
8326
- redirectToUrl: redirectToUrl
8327
- })));
8328
- };
8329
-
8330
- const config$1 = [{
8331
- texts: {
8332
- header: "CS_SEARCH_RESULTS",
8333
- actionButtonLabel: "PT_COMMONS_SELECT_PLACEHOLDER"
8334
- },
8335
- labels: [{
8336
- label: "PT_DUES_ARE_PENDING",
8337
- key: "total_due",
8338
- noteStyle: {
8339
- fontSize: "24px",
8340
- fontWeight: "bold"
8341
- },
8342
- notePrefix: "₹ "
8343
- }, {
8344
- label: "TL_PROPERTY_ID",
8345
- key: "property_id"
8346
- }, {
8347
- label: "PT_OWNERS_NAME",
8348
- key: "owner_name"
8349
- }, {
8350
- label: "PT_COMMON_COL_ADDRESS",
8351
- key: "property_address"
8352
- }, {
8353
- label: "PT_COMMON_TABLE_COL_STATUS_LABEL",
8354
- key: "status"
8355
- }]
8356
- }];
8357
-
8358
- const TYPE_LOGIN$1 = {
8359
- type: "login"
8360
- };
8361
- const DEFAULT_REDIRECT_URL = "/digit-ui/citizen";
8362
- const PropertySearchResults = ({
8363
- template,
8364
- header,
8365
- actionButtonLabel,
8366
- isMutation,
8367
- onSelect,
8368
- config,
8369
- clearParams: _clearParams = () => {},
8370
- stateCode,
8371
- redirectToUrl,
8372
- searchQuery
8373
- }) => {
8374
- var _result$data, _result$data2, _properties$map, _paymentDetails$data, _paymentDetails$data$, _ref, _modalData$total_due;
8375
- const {
8376
- t
8377
- } = useTranslation();
8378
- const modalRef = useRef();
8379
- const {
8380
- mobileNumber,
8381
- propertyIds,
8382
- oldPropertyIds,
8383
- locality,
8384
- city,
8385
- tenantId: tId,
8386
- doorNo,
8387
- name,
8388
- PToffset
8389
- } = Digit.Hooks.useQueryParams();
8390
- const filters = {};
8391
- const [modalData, setShowModal] = useState(false);
8392
- const PrivacyInfoLabel = Digit.ComponentRegistryService.getComponent("WSInfoLabel");
8393
- let OfsetForSearch = PToffset;
8394
- let t1;
8395
- let off;
8396
- if (!isNaN(parseInt(OfsetForSearch))) {
8397
- off = OfsetForSearch;
8398
- t1 = parseInt(OfsetForSearch) + 5;
8399
- } else {
8400
- t1 = 5;
8401
- }
8402
- let filter1 = !isNaN(parseInt(OfsetForSearch)) ? {
8403
- limit: "5",
8404
- sortOrder: "ASC",
8405
- sortBy: "createdTime",
8406
- offset: off
8407
- } : {
8408
- limit: "5",
8409
- sortOrder: "ASC",
8410
- sortBy: "createdTime",
8411
- offset: "0"
8412
- };
8413
- const closeModal = () => {
8414
- setShowModal(false);
8415
- };
8416
- Digit.Hooks.useClickOutside(modalRef, closeModal, modalData);
8417
- const sbm = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNumber) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNo);
8418
- const spi = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyIds) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyId);
8419
- const sop = (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyIds) || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyId);
8420
- if (mobileNumber || sbm) filters.mobileNumber = mobileNumber ? mobileNumber : sbm;
8421
- if (propertyIds || spi) filters.propertyIds = propertyIds ? propertyIds : spi;
8422
- if (oldPropertyIds || sop) filters.oldPropertyIds = oldPropertyIds ? oldPropertyIds : sop;
8423
- if (locality || searchQuery && searchQuery.locality) filters.locality = locality ? locality : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.locality;
8424
- if (doorNo || searchQuery && searchQuery.doorNo) filters.doorNo = doorNo ? doorNo : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.doorNo;
8425
- if (name || searchQuery && searchQuery.name) filters.name = name ? name : searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.name;
8426
- filters.limit = filter1.limit;
8427
- filters.sortOrder = filter1.sortOrder;
8428
- filters.sortBy = filter1.sortBy;
8429
- filters.offset = filter1.offset;
8430
- if (!filters.status) {
8431
- filters.status = "ACTIVE,INWORKFLOW";
7937
+ return {};
7938
+ });
7939
+ const [showToast, setShowToast] = useState(null);
7940
+ sessionStorage.setItem("VisitedCommonPTSearch", true);
7941
+ sessionStorage.setItem("VisitedLightCreate", false);
7942
+ let allCities = (_Digit$Hooks$pt$useTe = Digit.Hooks.pt.useTenants()) === null || _Digit$Hooks$pt$useTe === void 0 ? void 0 : _Digit$Hooks$pt$useTe.sort((a, b) => {
7943
+ var _a$i18nKey, _a$i18nKey$localeComp;
7944
+ return a === null || a === void 0 ? void 0 : (_a$i18nKey = a.i18nKey) === null || _a$i18nKey === void 0 ? void 0 : (_a$i18nKey$localeComp = _a$i18nKey.localeCompare) === null || _a$i18nKey$localeComp === void 0 ? void 0 : _a$i18nKey$localeComp.call(_a$i18nKey, b === null || b === void 0 ? void 0 : b.i18nKey);
7945
+ });
7946
+ allCities = allCities ? allCities : (_Digit$Hooks$tl$useTe = Digit.Hooks.tl.useTenants()) === null || _Digit$Hooks$tl$useTe === void 0 ? void 0 : _Digit$Hooks$tl$useTe.sort((a, b) => {
7947
+ var _a$i18nKey2, _a$i18nKey2$localeCom;
7948
+ return a === null || a === void 0 ? void 0 : (_a$i18nKey2 = a.i18nKey) === null || _a$i18nKey2 === void 0 ? void 0 : (_a$i18nKey2$localeCom = _a$i18nKey2.localeCompare) === null || _a$i18nKey2$localeCom === void 0 ? void 0 : _a$i18nKey2$localeCom.call(_a$i18nKey2, b === null || b === void 0 ? void 0 : b.i18nKey);
7949
+ });
7950
+ if (window.location.href.includes("obps")) {
7951
+ allCities = Digit.SessionStorage.get("OBPS_TENANTS");
7952
+ } else if (window.location.href.includes("fsm")) {
7953
+ allCities = [{
7954
+ i18nKey: "TENANT_TENANTS_PG_CITYA",
7955
+ code: Digit.ULBService.getCurrentTenantId(),
7956
+ name: "City A",
7957
+ description: "City A",
7958
+ pincode: [143001, 143002, 143003, 143004, 143005],
7959
+ logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
7960
+ imageId: null,
7961
+ domainUrl: "https://www.upyog.niua.org",
7962
+ type: "CITY",
7963
+ twitterUrl: null,
7964
+ facebookUrl: null,
7965
+ emailId: "citya@gmail.com",
7966
+ OfficeTimings: {
7967
+ "Mon - Fri": "9.00 AM - 6.00 PM"
7968
+ },
7969
+ city: {
7970
+ name: "City A",
7971
+ localName: null,
7972
+ districtCode: "CITYA",
7973
+ districtName: null,
7974
+ districtTenantCode: Digit.ULBService.getCurrentTenantId(),
7975
+ regionName: null,
7976
+ ulbGrade: "Municipal Corporation",
7977
+ longitude: 75.5761829,
7978
+ latitude: 31.3260152,
7979
+ shapeFileLocation: null,
7980
+ captcha: null,
7981
+ code: "1013",
7982
+ ddrName: "DDR A"
7983
+ },
7984
+ address: "City A Municipal Corporation",
7985
+ contactNumber: "001-2345876"
7986
+ }, {
7987
+ i18nKey: "TENANT_TENANTS_PG_CITYB",
7988
+ code: "pg.cityb",
7989
+ name: "City B",
7990
+ description: null,
7991
+ pincode: [143006, 143007, 143008, 143009, 143010],
7992
+ logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
7993
+ imageId: null,
7994
+ domainUrl: "https://www.upyog.niua.org",
7995
+ type: "CITY",
7996
+ twitterUrl: null,
7997
+ facebookUrl: null,
7998
+ emailId: "cityb@gmail.com",
7999
+ OfficeTimings: {
8000
+ "Mon - Fri": "9.00 AM - 6.00 PM",
8001
+ Sat: "9.00 AM - 12.00 PM"
8002
+ },
8003
+ city: {
8004
+ name: "City B",
8005
+ localName: null,
8006
+ districtCode: "CITYB",
8007
+ districtName: null,
8008
+ districtTenantCode: "pg.cityb",
8009
+ regionName: null,
8010
+ ulbGrade: "Municipal Corporation",
8011
+ longitude: 74.8722642,
8012
+ latitude: 31.6339793,
8013
+ shapeFileLocation: null,
8014
+ captcha: null,
8015
+ code: "107",
8016
+ ddrName: "DDR B"
8017
+ },
8018
+ address: "City B Municipal Corporation Address",
8019
+ contactNumber: "0978-7645345",
8020
+ helpLineNumber: "0654-8734567"
8021
+ }, {
8022
+ i18nKey: "TENANT_TENANTS_PG_CITYC",
8023
+ code: "pg.cityc",
8024
+ name: "City C",
8025
+ description: null,
8026
+ logoId: "https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",
8027
+ imageId: null,
8028
+ domainUrl: "https://www.upyog.niua.org",
8029
+ type: "CITY",
8030
+ twitterUrl: null,
8031
+ facebookUrl: null,
8032
+ emailId: "cityc@gmail.com",
8033
+ OfficeTimings: {
8034
+ "Mon - Fri": "9.00 AM - 6.00 PM",
8035
+ Sat: "9.00 AM - 12.00 PM"
8036
+ },
8037
+ city: {
8038
+ name: "City C",
8039
+ localName: null,
8040
+ districtCode: "CITYC",
8041
+ districtName: null,
8042
+ districtTenantCode: "pg.cityc",
8043
+ regionName: null,
8044
+ ulbGrade: "Municipal Corporation",
8045
+ longitude: 73.8722642,
8046
+ latitude: 31.6339793,
8047
+ shapeFileLocation: null,
8048
+ captcha: null,
8049
+ code: "108",
8050
+ ddrName: "DDR C"
8051
+ },
8052
+ address: "City C Municipal Corporation Address",
8053
+ contactNumber: "0978-7645345",
8054
+ helpLineNumber: "0654-8734567"
8055
+ }];
8432
8056
  }
8433
- const [owners, setOwners, clearOwners] = Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS", null);
8434
- const [lastPath, setLastPath, clearLastPath] = Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS_LAST_PATH", null);
8057
+ console.log("allCities", allCities);
8058
+ const [cityCode, setCityCode] = useState();
8059
+ const [formValue, setFormValue] = useState();
8060
+ const [errorShown, seterrorShown] = useState(false);
8061
+ let isMobile = window.Digit.Utils.browser.isMobile();
8435
8062
  const {
8436
- path,
8437
- url
8438
- } = useRouteMatch();
8439
- const searchParams = Digit.Hooks.useQueryParams();
8440
- useEffect(() => {
8441
- setOwners([]);
8442
- _clearParams();
8443
- setLastPath("");
8444
- }, []);
8445
- const auth = false;
8446
- const tenantId = Digit.ULBService.getCurrentTenantId();
8447
- const scity = city || tId || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.city) || tenantId;
8448
- const searchArgs = scity ? {
8449
- tenantId: scity,
8450
- filters,
8451
- auth
8452
- } : {
8453
- filters,
8454
- auth
8455
- };
8456
- const result = Digit.Hooks.pt.usePropertySearch(searchArgs, {
8457
- privacy: Digit.Utils.getPrivacyObject()
8458
- });
8459
- const properties = (result === null || result === void 0 ? void 0 : (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.Properties) || (result === null || result === void 0 ? void 0 : (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.properties) || (Array.isArray(result === null || result === void 0 ? void 0 : result.data) ? result === null || result === void 0 ? void 0 : result.data : []);
8460
- const consumerCode = properties === null || properties === void 0 ? void 0 : (_properties$map = properties.map) === null || _properties$map === void 0 ? void 0 : _properties$map.call(properties, a => a.propertyId || a.id).filter(id => id).join(",");
8461
- if (result.isSuccess && (!properties || properties.length === 0)) {
8462
- console.warn("Property Search: No properties found in result.data", result.data);
8463
- }
8464
- const fetchBillParams = mobileNumber ? {
8465
- mobileNumber,
8466
- consumerCode
8467
- } : {
8468
- consumerCode
8469
- };
8470
- const paymentDetails = Digit.Hooks.useFetchBillsForBuissnessService({
8471
- businessService: "PT",
8472
- ...fetchBillParams,
8473
- tenantId: scity
8474
- }, {
8475
- enabled: !!(consumerCode && scity),
8476
- retry: false
8063
+ data: propertyData,
8064
+ isLoading: propertyDataLoading,
8065
+ error,
8066
+ isSuccess,
8067
+ billData
8068
+ } = Digit.Hooks.pt.usePropertySearchWithDue({
8069
+ tenantId: searchData === null || searchData === void 0 ? void 0 : searchData.city,
8070
+ filters: searchData === null || searchData === void 0 ? void 0 : searchData.filters,
8071
+ auth: false,
8072
+ configs: {
8073
+ enabled: Object.keys(searchData).length > 0,
8074
+ retry: false,
8075
+ retryOnMount: false,
8076
+ staleTime: Infinity
8077
+ }
8477
8078
  });
8478
- const history = useHistory();
8479
- const proceedToPay = data => {
8480
- history.push(`/digit-ui/citizen/payment/my-bills/PT/${data.property_id}`, {
8481
- tenantId
8482
- });
8483
- };
8484
- if (paymentDetails.isLoading || result.isLoading) {
8485
- return /*#__PURE__*/React.createElement(Loader, null);
8486
- }
8487
- if (result.error || result.isSuccess && (!properties || properties.length === 0)) {
8488
- return /*#__PURE__*/React.createElement("div", {
8489
- style: {
8490
- height: "150px"
8491
- }
8492
- }, /*#__PURE__*/React.createElement(Card, {
8493
- style: {
8494
- display: "flex",
8495
- justifyContent: "center",
8496
- alignItems: "center",
8497
- height: "100%"
8079
+ useEffect(() => {
8080
+ var _searchData$filters, _Object$values, _Object$values$filter;
8081
+ if (!(searchData !== null && searchData !== void 0 && (_searchData$filters = searchData.filters) !== null && _searchData$filters !== void 0 && _searchData$filters.mobileNumber && ((_Object$values = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values === void 0 ? void 0 : (_Object$values$filter = _Object$values.filter(ob => ob !== undefined)) === null || _Object$values$filter === void 0 ? void 0 : _Object$values$filter.length) == 1) && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > 0 && ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && !errorShown) {
8082
+ setShowToast({
8083
+ error: true,
8084
+ warning: true,
8085
+ label: "ERR_PLEASE_REFINED_UR_SEARCH"
8086
+ });
8087
+ }
8088
+ }, [propertyData]);
8089
+ useEffect(() => {
8090
+ showToast && (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "ERR_PLEASE_REFINED_UR_SEARCH" && (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "NO_PROPERTIES_FOUND" && setShowToast(null);
8091
+ }, [action, propertyDataLoading]);
8092
+ useEffect(() => {
8093
+ var _propertyData$Propert;
8094
+ if (!propertyDataLoading && propertyData && searchData && (propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert = propertyData.Properties) === null || _propertyData$Propert === void 0 ? void 0 : _propertyData$Propert.length) <= 0) {
8095
+ setShowToast({
8096
+ error: true,
8097
+ warning: true,
8098
+ label: "NO_PROPERTIES_FOUND"
8099
+ });
8100
+ }
8101
+ }, [propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert2 = propertyData.Properties) === null || _propertyData$Propert2 === void 0 ? void 0 : (_propertyData$Propert3 = _propertyData$Propert2[0]) === null || _propertyData$Propert3 === void 0 ? void 0 : _propertyData$Propert3.propertyId, propertyDataLoading]);
8102
+ useLayoutEffect(() => {
8103
+ const getActionBar = () => {
8104
+ let el = document.querySelector("div.action-bar-wrap");
8105
+ let clearBtn = document.querySelector(".primary-label-btn");
8106
+ if (el && clearBtn) {
8107
+ el.style.position = "static";
8108
+ el.style.padding = "8px 0";
8109
+ el.style.boxShadow = "none";
8110
+ el.style.marginBottom = "16px";
8111
+ el.style.display = "flex";
8112
+ el.style.justifyContent = "flex-end";
8113
+ el.style.alignItems = "center";
8114
+ el.style.zIndex = "0";
8115
+ clearBtn.style.margin = "0";
8116
+ clearBtn.style.marginRight = "24px";
8117
+ clearBtn.style.marginLeft = "auto";
8118
+ if (clearBtn.parentElement !== el) {
8119
+ el.insertBefore(clearBtn, el.firstChild);
8120
+ }
8121
+ } else {
8122
+ setTimeout(() => {
8123
+ getActionBar();
8124
+ }, 100);
8498
8125
  }
8499
- }, t("CS_PT_NO_PROPERTIES_FOUND")));
8500
- }
8501
- const payment = {};
8502
- paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$data = paymentDetails.data) === null || _paymentDetails$data === void 0 ? void 0 : (_paymentDetails$data$ = _paymentDetails$data.Bill) === null || _paymentDetails$data$ === void 0 ? void 0 : _paymentDetails$data$.forEach(element => {
8503
- if (element !== null && element !== void 0 && element.consumerCode) {
8504
- payment[element === null || element === void 0 ? void 0 : element.consumerCode] = {
8505
- total_due: element === null || element === void 0 ? void 0 : element.totalAmount,
8506
- bil_due__date: new Date(element === null || element === void 0 ? void 0 : element.billDate).toDateString()
8507
- };
8126
+ };
8127
+ getActionBar();
8128
+ }, [action]);
8129
+ const {
8130
+ data: ptSearchConfig,
8131
+ isLoading
8132
+ } = Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(), "DIGIT-UI", "HelpText", {
8133
+ select: data => {
8134
+ var _data$DIGITUI, _data$DIGITUI$HelpTex, _data$DIGITUI$HelpTex2;
8135
+ return data === null || data === void 0 ? void 0 : (_data$DIGITUI = data["DIGIT-UI"]) === null || _data$DIGITUI === void 0 ? void 0 : (_data$DIGITUI$HelpTex = _data$DIGITUI["HelpText"]) === null || _data$DIGITUI$HelpTex === void 0 ? void 0 : (_data$DIGITUI$HelpTex2 = _data$DIGITUI$HelpTex[0]) === null || _data$DIGITUI$HelpTex2 === void 0 ? void 0 : _data$DIGITUI$HelpTex2.PT;
8508
8136
  }
8509
8137
  });
8510
- const searchResults = (_ref = properties || []) === null || _ref === void 0 ? void 0 : _ref.map(property => {
8511
- var _sort, _sort$, _addr$locality, _addr$locality2, _addr$locality3, _addr$locality4, _payment$property$pro, _payment$property$pro2, _2, _property$owners, _property$owners$;
8512
- let addr = (property === null || property === void 0 ? void 0 : property.address) || {};
8513
- return {
8514
- property_id: property === null || property === void 0 ? void 0 : property.propertyId,
8515
- owner_name: (_sort = ((property === null || property === void 0 ? void 0 : property.owners) || []).sort((a, b) => {
8516
- var _a$additionalDetails, _b$additionalDetails;
8517
- return ((a === null || a === void 0 ? void 0 : (_a$additionalDetails = a.additionalDetails) === null || _a$additionalDetails === void 0 ? void 0 : _a$additionalDetails.ownerSequence) || 0) - ((b === null || b === void 0 ? void 0 : (_b$additionalDetails = b.additionalDetails) === null || _b$additionalDetails === void 0 ? void 0 : _b$additionalDetails.ownerSequence) || 0);
8518
- })) === null || _sort === void 0 ? void 0 : (_sort$ = _sort[0]) === null || _sort$ === void 0 ? void 0 : _sort$.name,
8519
- property_address: [addr.doorNo || "", addr.buildingName || "", addr.street || "", t(`TENANTS_MOHALLA_${(_addr$locality = addr.locality) === null || _addr$locality === void 0 ? void 0 : _addr$locality.code}`) !== `TENANTS_MOHALLA_${(_addr$locality2 = addr.locality) === null || _addr$locality2 === void 0 ? void 0 : _addr$locality2.code}` ? t(`TENANTS_MOHALLA_${(_addr$locality3 = addr.locality) === null || _addr$locality3 === void 0 ? void 0 : _addr$locality3.code}`) : ((_addr$locality4 = addr.locality) === null || _addr$locality4 === void 0 ? void 0 : _addr$locality4.name) || "", t(addr.tenantId) || ""].filter(a => a).join(", "),
8520
- total_due: ((_payment$property$pro = payment[property === null || property === void 0 ? void 0 : property.propertyId]) === null || _payment$property$pro === void 0 ? void 0 : _payment$property$pro.total_due) || 0,
8521
- bil_due__date: ((_payment$property$pro2 = payment[property === null || property === void 0 ? void 0 : property.propertyId]) === null || _payment$property$pro2 === void 0 ? void 0 : _payment$property$pro2.bil_due__date) || t("N/A"),
8522
- status: t(property.status),
8523
- owner_mobile: (_2 = ((property === null || property === void 0 ? void 0 : property.owners) || [])[0]) === null || _2 === void 0 ? void 0 : _2.mobileNumber,
8524
- address: property === null || property === void 0 ? void 0 : property.address,
8525
- owners: property.owners,
8526
- propertyDetails: property,
8527
- privacy: {
8528
- property_address: {
8529
- uuid: property === null || property === void 0 ? void 0 : (_property$owners = property.owners) === null || _property$owners === void 0 ? void 0 : (_property$owners$ = _property$owners[0]) === null || _property$owners$ === void 0 ? void 0 : _property$owners$.uuid,
8530
- fieldName: ["doorNo", "street", "landmark"],
8531
- model: "Property",
8532
- showValue: true,
8533
- loadData: {
8534
- serviceName: "/property-services/property/_search",
8535
- requestBody: {},
8536
- requestParam: {
8537
- tenantId: property === null || property === void 0 ? void 0 : property.tenantId,
8538
- propertyIds: property === null || property === void 0 ? void 0 : property.propertyId
8539
- },
8540
- jsonPath: "Properties[0].address.street",
8541
- isArray: false,
8542
- d: res => {
8543
- let resultString = (lodash.get(res, "Properties[0].address.doorNo") ? `${lodash.get(res, "Properties[0].address.doorNo")}, ` : "") + (lodash.get(res, "Properties[0].address.street") ? `${lodash.get(res, "Properties[0].address.street")}, ` : "") + (lodash.get(res, "Properties[0].address.landmark") ? `${lodash.get(res, "Properties[0].address.landmark")}` : "");
8544
- return resultString;
8545
- }
8138
+ const [mobileNumber, property, oldProperty, name, doorNumber] = propsConfig.inputs;
8139
+ const config = [{
8140
+ body: [{
8141
+ label: "PT_SELECT_CITY",
8142
+ isMandatory: true,
8143
+ type: "custom",
8144
+ populators: {
8145
+ name: "city",
8146
+ defaultValue: ((_allCities = allCities) === null || _allCities === void 0 ? void 0 : _allCities.find(c => c.code === "dl.djb" || c.code === "dl")) || ((_allCities2 = allCities) === null || _allCities2 === void 0 ? void 0 : _allCities2[0]) || null,
8147
+ rules: {
8148
+ required: true
8149
+ },
8150
+ customProps: {
8151
+ t,
8152
+ isMandatory: true,
8153
+ option: [...allCities],
8154
+ optionKey: "i18nKey"
8155
+ },
8156
+ component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown, Object.assign({}, customProps, {
8157
+ disable: true,
8158
+ selected: props.value,
8159
+ select: d => {
8160
+ Digit.ULBService.getCurrentTenantId();
8161
+ if (d.code !== cityCode) props.setValue("locality", null);
8162
+ props.onChange(d);
8163
+ }
8164
+ }))
8165
+ }
8166
+ }, {
8167
+ label: mobileNumber.label,
8168
+ type: mobileNumber.type,
8169
+ populators: {
8170
+ defaultValue: ((_Digit$UserService$ge3 = Digit.UserService.getUser()) === null || _Digit$UserService$ge3 === void 0 ? void 0 : (_Digit$UserService$ge4 = _Digit$UserService$ge3.info) === null || _Digit$UserService$ge4 === void 0 ? void 0 : _Digit$UserService$ge4.mobileNumber) || "",
8171
+ name: mobileNumber.name,
8172
+ validation: mobileNumber === null || mobileNumber === void 0 ? void 0 : mobileNumber.validation
8173
+ },
8174
+ isMandatory: false
8175
+ }],
8176
+ body1: [{
8177
+ label: "PT_SELECT_CITY",
8178
+ isMandatory: true,
8179
+ type: "custom",
8180
+ populators: {
8181
+ name: "city",
8182
+ defaultValue: ((_allCities3 = allCities) === null || _allCities3 === void 0 ? void 0 : _allCities3.find(c => c.code === "dl.djb" || c.code === "dl")) || ((_allCities4 = allCities) === null || _allCities4 === void 0 ? void 0 : _allCities4[0]) || null,
8183
+ rules: {
8184
+ required: true
8185
+ },
8186
+ customProps: {
8187
+ t,
8188
+ isMandatory: true,
8189
+ option: [...allCities],
8190
+ optionKey: "i18nKey"
8191
+ },
8192
+ component: (props, customProps) => /*#__PURE__*/React.createElement(Dropdown, Object.assign({}, customProps, {
8193
+ disable: true,
8194
+ selected: props.value,
8195
+ select: d => {
8196
+ var _props$value, _props$value2;
8197
+ Digit.LocalizationService.getLocale({
8198
+ modules: [`rainmaker-${props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.code}`],
8199
+ locale: Digit.StoreData.getCurrentLanguage(),
8200
+ tenantId: `${props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.code}`
8201
+ });
8202
+ if (d.code !== cityCode) props.setValue("locality", null);
8203
+ props.onChange(d);
8546
8204
  }
8547
- }
8205
+ }))
8548
8206
  }
8549
- };
8550
- });
8551
- const getUserType = () => Digit.UserService.getType();
8552
- const getFromLocation = (state, searchParams) => {
8553
- return (state === null || state === void 0 ? void 0 : state.from) || (searchParams === null || searchParams === void 0 ? void 0 : searchParams.from) || DEFAULT_REDIRECT_URL;
8554
- };
8555
- const sendOtpToUser = async record => {
8556
- sessionStorage.setItem("Digit_OBPS_PT", JSON.stringify(record));
8557
- sessionStorage.setItem("Digit_FSM_PT", JSON.stringify(record));
8558
- if (onSelect) {
8559
- onSelect('cptId', {
8560
- id: record.property_id
8207
+ }, {
8208
+ label: "PT_SELECT_LOCALITY",
8209
+ type: "custom",
8210
+ isMandatory: true,
8211
+ populators: {
8212
+ name: "locality",
8213
+ defaultValue: "",
8214
+ rules: {
8215
+ required: true
8216
+ },
8217
+ customProps: {},
8218
+ component: (props, customProps) => /*#__PURE__*/React.createElement(Localities, {
8219
+ selectLocality: d => {
8220
+ props.onChange(d);
8221
+ },
8222
+ tenantId: cityCode,
8223
+ boundaryType: "revenue",
8224
+ keepNull: false,
8225
+ optionCardStyles: {
8226
+ height: "600px",
8227
+ overflow: "auto",
8228
+ zIndex: "10",
8229
+ maxHeight: "300px"
8230
+ },
8231
+ selected: formValue === null || formValue === void 0 ? void 0 : formValue.locality,
8232
+ disable: !cityCode,
8233
+ disableLoader: true
8234
+ })
8235
+ }
8236
+ }, {
8237
+ label: doorNumber.label,
8238
+ type: doorNumber.type,
8239
+ populators: {
8240
+ defaultValue: "",
8241
+ name: doorNumber.name,
8242
+ validation: doorNumber === null || doorNumber === void 0 ? void 0 : doorNumber.validation
8243
+ },
8244
+ isMandatory: false
8245
+ }, {
8246
+ label: name.label,
8247
+ type: name.type,
8248
+ populators: {
8249
+ defaultValue: "",
8250
+ name: name.name,
8251
+ validation: name === null || name === void 0 ? void 0 : name.validation
8252
+ },
8253
+ isMandatory: false
8254
+ }]
8255
+ }];
8256
+ const onPropertySearch = async data => {
8257
+ var _data$city, _tempObject;
8258
+ if (ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > 0 && (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && errorShown) {
8259
+ seterrorShown(true);
8260
+ return;
8261
+ }
8262
+ if (!(data !== null && data !== void 0 && (_data$city = data.city) !== null && _data$city !== void 0 && _data$city.code)) {
8263
+ setShowToast({
8264
+ error: true,
8265
+ label: "ERR_PT_FILL_VALID_FIELDS"
8561
8266
  });
8267
+ return;
8268
+ }
8269
+ if (action == 0) {
8270
+ var _data$mobileNumber, _mobileNumber$validat, _mobileNumber$validat2, _data$propertyIds, _property$validation, _property$validation$, _data$oldPropertyId, _oldProperty$validati, _oldProperty$validati2;
8271
+ if (!(data !== null && data !== void 0 && data.mobileNumber || data !== null && data !== void 0 && data.propertyIds || data !== null && data !== void 0 && data.oldPropertyId)) {
8272
+ setShowToast({
8273
+ error: true,
8274
+ label: "ERR_PT_FILL_VALID_FIELDS"
8275
+ });
8276
+ return;
8277
+ }
8278
+ if (data !== null && data !== void 0 && data.mobileNumber && !((_data$mobileNumber = data.mobileNumber) !== null && _data$mobileNumber !== void 0 && _data$mobileNumber.match(mobileNumber === null || mobileNumber === void 0 ? void 0 : (_mobileNumber$validat = mobileNumber.validation) === null || _mobileNumber$validat === void 0 ? void 0 : (_mobileNumber$validat2 = _mobileNumber$validat.pattern) === null || _mobileNumber$validat2 === void 0 ? void 0 : _mobileNumber$validat2.value))) {
8279
+ var _mobileNumber$validat3, _mobileNumber$validat4;
8280
+ setShowToast({
8281
+ error: true,
8282
+ label: mobileNumber === null || mobileNumber === void 0 ? void 0 : (_mobileNumber$validat3 = mobileNumber.validation) === null || _mobileNumber$validat3 === void 0 ? void 0 : (_mobileNumber$validat4 = _mobileNumber$validat3.pattern) === null || _mobileNumber$validat4 === void 0 ? void 0 : _mobileNumber$validat4.message
8283
+ });
8284
+ return;
8285
+ }
8286
+ if (data !== null && data !== void 0 && data.propertyIds && !((_data$propertyIds = data.propertyIds) !== null && _data$propertyIds !== void 0 && _data$propertyIds.match(property === null || property === void 0 ? void 0 : (_property$validation = property.validation) === null || _property$validation === void 0 ? void 0 : (_property$validation$ = _property$validation.pattern) === null || _property$validation$ === void 0 ? void 0 : _property$validation$.value))) {
8287
+ var _property$validation2, _property$validation3;
8288
+ setShowToast({
8289
+ error: true,
8290
+ label: property === null || property === void 0 ? void 0 : (_property$validation2 = property.validation) === null || _property$validation2 === void 0 ? void 0 : (_property$validation3 = _property$validation2.pattern) === null || _property$validation3 === void 0 ? void 0 : _property$validation3.message
8291
+ });
8292
+ return;
8293
+ }
8294
+ if (data !== null && data !== void 0 && data.oldPropertyId && !((_data$oldPropertyId = data.oldPropertyId) !== null && _data$oldPropertyId !== void 0 && _data$oldPropertyId.match(oldProperty === null || oldProperty === void 0 ? void 0 : (_oldProperty$validati = oldProperty.validation) === null || _oldProperty$validati === void 0 ? void 0 : (_oldProperty$validati2 = _oldProperty$validati.pattern) === null || _oldProperty$validati2 === void 0 ? void 0 : _oldProperty$validati2.value))) {
8295
+ var _oldProperty$validati3, _oldProperty$validati4;
8296
+ setShowToast({
8297
+ error: true,
8298
+ label: oldProperty === null || oldProperty === void 0 ? void 0 : (_oldProperty$validati3 = oldProperty.validation) === null || _oldProperty$validati3 === void 0 ? void 0 : (_oldProperty$validati4 = _oldProperty$validati3.pattern) === null || _oldProperty$validati4 === void 0 ? void 0 : _oldProperty$validati4.message
8299
+ });
8300
+ return;
8301
+ }
8562
8302
  } else {
8563
- const data = {
8564
- mobileNumber: record === null || record === void 0 ? void 0 : record.owner_mobile,
8565
- tenantId: stateCode,
8566
- userType: getUserType()
8567
- };
8568
- const [res, err] = await sendOtp({
8569
- otp: {
8570
- ...data,
8571
- ...TYPE_LOGIN$1
8572
- }
8573
- });
8574
- if (!err) {
8575
- let redirectUrl = '/digit-ui/citizen/commonPt/property/link-success/' + record.property_id;
8576
- if (redirectToUrl) {
8577
- redirectUrl = redirectToUrl + '?propertyId=' + record.property_id + '&tenantId=' + tenantId;
8578
- }
8579
- history.replace(`/digit-ui/citizen/commonPt/property/citizen-otp`, {
8580
- from: getFromLocation(location.state, searchParams),
8581
- mobileNumber: record.owner_mobile,
8582
- redirectBackTo: redirectUrl
8303
+ var _data$locality, _data$name, _name$validation, _name$validation$patt, _data$doorNumber, _doorNumber$validatio, _doorNumber$validatio2;
8304
+ if (!(data !== null && data !== void 0 && (_data$locality = data.locality) !== null && _data$locality !== void 0 && _data$locality.code)) {
8305
+ setShowToast({
8306
+ error: true,
8307
+ label: "ERR_PT_FILL_VALID_FIELDS"
8583
8308
  });
8584
8309
  return;
8585
- } else {
8586
- history.push(`/digit-ui/citizen/`, {
8587
- from: getFromLocation(location.state, searchParams),
8588
- data: data
8310
+ }
8311
+ if (!(data !== null && data !== void 0 && data.doorNumber || data !== null && data !== void 0 && data.name)) {
8312
+ setShowToast({
8313
+ error: true,
8314
+ label: "ERR_PT_FILL_VALID_FIELDS"
8315
+ });
8316
+ return;
8317
+ }
8318
+ if (data !== null && data !== void 0 && data.name && !((_data$name = data.name) !== null && _data$name !== void 0 && _data$name.match(name === null || name === void 0 ? void 0 : (_name$validation = name.validation) === null || _name$validation === void 0 ? void 0 : (_name$validation$patt = _name$validation.pattern) === null || _name$validation$patt === void 0 ? void 0 : _name$validation$patt.value))) {
8319
+ var _name$validation2, _name$validation2$pat;
8320
+ setShowToast({
8321
+ error: true,
8322
+ label: name === null || name === void 0 ? void 0 : (_name$validation2 = name.validation) === null || _name$validation2 === void 0 ? void 0 : (_name$validation2$pat = _name$validation2.pattern) === null || _name$validation2$pat === void 0 ? void 0 : _name$validation2$pat.message
8323
+ });
8324
+ return;
8325
+ }
8326
+ if (data !== null && data !== void 0 && data.doorNumber && !((_data$doorNumber = data.doorNumber) !== null && _data$doorNumber !== void 0 && _data$doorNumber.match(doorNumber === null || doorNumber === void 0 ? void 0 : (_doorNumber$validatio = doorNumber.validation) === null || _doorNumber$validatio === void 0 ? void 0 : (_doorNumber$validatio2 = _doorNumber$validatio.pattern) === null || _doorNumber$validatio2 === void 0 ? void 0 : _doorNumber$validatio2.value))) {
8327
+ var _doorNumber$validatio3, _doorNumber$validatio4;
8328
+ setShowToast({
8329
+ error: true,
8330
+ label: doorNumber === null || doorNumber === void 0 ? void 0 : (_doorNumber$validatio3 = doorNumber.validation) === null || _doorNumber$validatio3 === void 0 ? void 0 : (_doorNumber$validatio4 = _doorNumber$validatio3.pattern) === null || _doorNumber$validatio4 === void 0 ? void 0 : _doorNumber$validatio4.message
8331
+ });
8332
+ return;
8333
+ }
8334
+ }
8335
+ if ((showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "ERR_PLEASE_REFINED_UR_SEARCH" || (showToast === null || showToast === void 0 ? void 0 : showToast.label) !== "NO_PROPERTIES_FOUND") setShowToast(null);
8336
+ if (data !== null && data !== void 0 && data.doorNumber && (data === null || data === void 0 ? void 0 : data.doorNumber) !== "" && (data === null || data === void 0 ? void 0 : data.propertyIds) !== "") {
8337
+ data["propertyIds"] = "";
8338
+ }
8339
+ let tempObject = Object.keys(data).filter(k => data[k]).reduce((acc, key) => ({
8340
+ ...acc,
8341
+ [key]: typeof data[key] === "object" ? data[key].code : data[key]
8342
+ }), {});
8343
+ let city = tempObject.city;
8344
+ tempObject.doorNo = tempObject.doorNumber || ((_tempObject = tempObject) === null || _tempObject === void 0 ? void 0 : _tempObject.doorNo);
8345
+ delete tempObject.addParam;
8346
+ delete tempObject.addParam1;
8347
+ delete tempObject.city;
8348
+ if (action === "0") {
8349
+ var _tempObject2, _tempObject3, _tempObject4;
8350
+ tempObject = {
8351
+ oldPropertyId: (_tempObject2 = tempObject) === null || _tempObject2 === void 0 ? void 0 : _tempObject2.oldPropertyId,
8352
+ mobileNumber: (_tempObject3 = tempObject) === null || _tempObject3 === void 0 ? void 0 : _tempObject3.mobileNumber,
8353
+ propertyIds: (_tempObject4 = tempObject) === null || _tempObject4 === void 0 ? void 0 : _tempObject4.propertyIds
8354
+ };
8355
+ } else if (action === "1") {
8356
+ var _tempObject5, _tempObject6, _tempObject7, _tempObject8;
8357
+ tempObject = {
8358
+ name: (_tempObject5 = tempObject) === null || _tempObject5 === void 0 ? void 0 : _tempObject5.name,
8359
+ doorNo: ((_tempObject6 = tempObject) === null || _tempObject6 === void 0 ? void 0 : _tempObject6.doorNumber) || ((_tempObject7 = tempObject) === null || _tempObject7 === void 0 ? void 0 : _tempObject7.doorNo),
8360
+ locality: (_tempObject8 = tempObject) === null || _tempObject8 === void 0 ? void 0 : _tempObject8.locality
8361
+ };
8362
+ }
8363
+ setSearchData({
8364
+ city: city,
8365
+ filters: tempObject
8366
+ });
8367
+ return;
8368
+ };
8369
+ const onFormValueChange = (setValue, data, formState) => {
8370
+ const city = (data === null || data === void 0 ? void 0 : data.city) || allCities[0];
8371
+ console.log("citycity", city);
8372
+ setCityCode(city.code);
8373
+ const locality = data === null || data === void 0 ? void 0 : data.locality;
8374
+ if ((city === null || city === void 0 ? void 0 : city.code) !== cityCode) {
8375
+ setCityCode(city === null || city === void 0 ? void 0 : city.code);
8376
+ }
8377
+ if (!lodash.isEqual(data, formValue)) {
8378
+ setFormValue(data);
8379
+ }
8380
+ if (!locality || !city) {
8381
+ return;
8382
+ }
8383
+ };
8384
+ if (isLoading) {
8385
+ return /*#__PURE__*/React.createElement(Loader, null);
8386
+ }
8387
+ let validation = ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.maxResultValidation && !(searchData !== null && searchData !== void 0 && (_searchData$filters2 = searchData.filters) !== null && _searchData$filters2 !== void 0 && _searchData$filters2.mobileNumber && ((_Object$values2 = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values2 === void 0 ? void 0 : (_Object$values2$filte = _Object$values2.filter(ob => ob !== undefined)) === null || _Object$values2$filte === void 0 ? void 0 : _Object$values2$filte.length) == 1) ? (propertyData === null || propertyData === void 0 ? void 0 : propertyData.Properties.length) < (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.maxPropertyResult) && (showToast == null || showToast !== null && !(showToast !== null && showToast !== void 0 && showToast.error)) : true;
8388
+ if (propertyData && !propertyDataLoading && !error && validation) {
8389
+ var _searchData$filters3, _Object$values3, _Object$values3$filte, _searchData$filters4, _propertyDataLoading$;
8390
+ let qs = {};
8391
+ qs = {
8392
+ ...searchData.filters,
8393
+ city: searchData.city
8394
+ };
8395
+ if (!(searchData !== null && searchData !== void 0 && (_searchData$filters3 = searchData.filters) !== null && _searchData$filters3 !== void 0 && _searchData$filters3.mobileNumber && ((_Object$values3 = Object.values(searchData === null || searchData === void 0 ? void 0 : searchData.filters)) === null || _Object$values3 === void 0 ? void 0 : (_Object$values3$filte = _Object$values3.filter(ob => ob !== undefined)) === null || _Object$values3$filte === void 0 ? void 0 : _Object$values3$filte.length) == 1) && ptSearchConfig !== null && ptSearchConfig !== void 0 && ptSearchConfig.ptSearchCount && searchData !== null && searchData !== void 0 && (_searchData$filters4 = searchData.filters) !== null && _searchData$filters4 !== void 0 && _searchData$filters4.locality && propertyDataLoading && propertyDataLoading !== null && propertyDataLoading !== void 0 && (_propertyDataLoading$ = propertyDataLoading.Properties) !== null && _propertyDataLoading$ !== void 0 && _propertyDataLoading$.length && propertyDataLoading.Properties.length > (ptSearchConfig === null || ptSearchConfig === void 0 ? void 0 : ptSearchConfig.ptSearchCount)) {
8396
+ !showToast && setShowToast({
8397
+ error: true,
8398
+ label: "PT_MODIFY_SEARCH_CRITERIA"
8399
+ });
8400
+ } else if (propsConfig.action === "MUTATION") {
8401
+ onSelect(propsConfig.key, qs, null, null, null, {
8402
+ queryParams: {
8403
+ ...qs
8404
+ }
8405
+ });
8406
+ } else {
8407
+ if (redirectToUrl && !window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")) {
8408
+ history.push(`/digit-ui/citizen/commonPt/property/search-results?${Object.keys(qs).filter(key => qs[key] !== undefined && qs[key] !== "").map(key => `${key}=${qs[key]}`).join("&")}${redirectToUrl ? `&redirectToUrl=${redirectToUrl}` : ""}`);
8409
+ } else if (!window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")) {
8410
+ var _qs, _qs2, _qs3, _qs4, _qs5, _qs6, _qs7, _qs8, _qs9, _propertyData$Propert4;
8411
+ let SearchParams = {};
8412
+ if (action == 0) SearchParams = {
8413
+ city: (_qs = qs) === null || _qs === void 0 ? void 0 : _qs.city,
8414
+ mobileNumber: ((_qs2 = qs) === null || _qs2 === void 0 ? void 0 : _qs2.mobileNumber) || "",
8415
+ propertyIds: ((_qs3 = qs) === null || _qs3 === void 0 ? void 0 : _qs3.propertyIds) || "",
8416
+ oldPropertyIds: ((_qs4 = qs) === null || _qs4 === void 0 ? void 0 : _qs4.oldPropertyIds) || "",
8417
+ locality: "",
8418
+ doorNo: "",
8419
+ name: ""
8420
+ };else SearchParams = {
8421
+ city: (_qs5 = qs) === null || _qs5 === void 0 ? void 0 : _qs5.city,
8422
+ locality: ((_qs6 = qs) === null || _qs6 === void 0 ? void 0 : _qs6.locality) || "",
8423
+ doorNo: ((_qs7 = qs) === null || _qs7 === void 0 ? void 0 : _qs7.doorNumber) || ((_qs8 = qs) === null || _qs8 === void 0 ? void 0 : _qs8.doorNo) || "",
8424
+ name: ((_qs9 = qs) === null || _qs9 === void 0 ? void 0 : _qs9.name) || "",
8425
+ mobileNumber: "",
8426
+ propertyIds: "",
8427
+ oldPropertyIds: ""
8428
+ };
8429
+ !propertyDataLoading && (propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$Propert4 = propertyData.Properties) === null || _propertyData$Propert4 === void 0 ? void 0 : _propertyData$Propert4.length) > 0 && onSelect("cptSearchQuery", SearchParams, null, null, null, {
8430
+ queryParams: {
8431
+ ...SearchParams
8432
+ }
8589
8433
  });
8590
8434
  }
8591
8435
  }
8592
- };
8593
- const sendOtp = async data => {
8594
- try {
8595
- const res = await Digit.UserService.sendOtp(data, stateCode);
8596
- return [res, null];
8597
- } catch (err) {
8598
- return [null, err];
8599
- }
8600
- };
8601
- return /*#__PURE__*/React.createElement("div", {
8602
- className: "static",
8436
+ }
8437
+ if (error) {
8438
+ var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
8439
+ !showToast && setShowToast({
8440
+ error: true,
8441
+ label: (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) || error
8442
+ });
8443
+ }
8444
+ if (action == 1) {
8445
+ config[0].body = [...config[0].body1];
8446
+ }
8447
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
8448
+ className: "search-tabs-container",
8603
8449
  style: {
8604
- marginTop: "16px"
8450
+ marginBottom: "16px",
8451
+ display: "flex",
8452
+ gap: "24px",
8453
+ justifyContent: "flex-start",
8454
+ borderBottom: "1px solid #ccc"
8605
8455
  }
8606
8456
  }, /*#__PURE__*/React.createElement("div", {
8607
- className: "static-wrapper"
8608
- }, header && /*#__PURE__*/React.createElement(Header, {
8457
+ className: `search-tab ${action == 0 ? "active" : ""}`,
8609
8458
  style: {
8610
- marginLeft: "8px"
8611
- }
8612
- }, t(header), " (", searchResults === null || searchResults === void 0 ? void 0 : searchResults.length, ")"), PrivacyInfoLabel && /*#__PURE__*/React.createElement(PrivacyInfoLabel, {
8613
- t: t
8614
- }), /*#__PURE__*/React.createElement(ResponseComposer, {
8615
- data: searchResults,
8616
- template: template,
8617
- actionButtonLabel: actionButtonLabel,
8618
- onSubmit: sendOtpToUser
8619
- })), modalData ? /*#__PURE__*/React.createElement(Modal, {
8620
- hideSubmit: true,
8621
- isDisabled: false,
8622
- popupStyles: {
8623
- width: "319px",
8624
- height: "250px",
8625
- margin: "auto"
8459
+ padding: "8px 16px",
8460
+ cursor: "pointer",
8461
+ borderBottom: action == 0 ? "2px solid #f47738" : "2px solid transparent",
8462
+ color: action == 0 ? "#f47738" : "#0b0c0c",
8463
+ fontWeight: action == 0 ? "bold" : "normal"
8626
8464
  },
8627
- formId: "modal-action"
8628
- }, /*#__PURE__*/React.createElement("div", {
8629
- ref: modalRef
8630
- }, /*#__PURE__*/React.createElement(KeyNote, {
8631
- keyValue: t("PT_AMOUNT_DUE"),
8632
- note: `₹ ${modalData === null || modalData === void 0 ? void 0 : (_modalData$total_due = modalData.total_due) === null || _modalData$total_due === void 0 ? void 0 : _modalData$total_due.toLocaleString("en-IN")}`,
8633
- noteStyle: {
8634
- fontSize: "24px",
8635
- fontWeight: "bold"
8465
+ onClick: () => {
8466
+ history.replace(`${history.location.pathname}?action=0`);
8467
+ setSearchData({});
8636
8468
  }
8637
- }), /*#__PURE__*/React.createElement("p", null, t("PT_YOU_HAVE") + " " + "₹" + " " + (modalData === null || modalData === void 0 ? void 0 : modalData.total_due.toLocaleString("en-IN")) + " " + t("PT_PENDING_AMOUNT") + " " + t("PT_INORDER_TO_TRANSFER")), /*#__PURE__*/React.createElement(SubmitBar, {
8638
- submit: false,
8639
- onSubmit: () => proceedToPay(modalData),
8469
+ }, t("PT_KNOW_PTID")), /*#__PURE__*/React.createElement("div", {
8470
+ className: `search-tab ${action == 1 ? "active" : ""}`,
8640
8471
  style: {
8641
- marginTop: "14px",
8642
- width: "100%"
8472
+ padding: "8px 16px",
8473
+ cursor: "pointer",
8474
+ borderBottom: action == 1 ? "2px solid #f47738" : "2px solid transparent",
8475
+ color: action == 1 ? "#f47738" : "#0b0c0c",
8476
+ fontWeight: action == 1 ? "bold" : "normal"
8643
8477
  },
8644
- label: t("PT_PROCEED_PAYMENT")
8645
- }))) : null, (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) === 0 && /*#__PURE__*/React.createElement("p", {
8478
+ onClick: () => {
8479
+ history.replace(`${history.location.pathname}?action=1`);
8480
+ setSearchData({});
8481
+ }
8482
+ }, t("PT_SEARCH_DOOR_NO")), /*#__PURE__*/React.createElement("div", {
8646
8483
  style: {
8647
- marginLeft: "16px",
8648
- marginTop: "16px"
8484
+ marginLeft: "auto",
8485
+ display: "flex",
8486
+ alignItems: "center"
8649
8487
  }
8650
- }, t("PT_NO_PROP_FOUND_MSG")), (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) !== 0 && ((searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) == 5 || (searchResults === null || searchResults === void 0 ? void 0 : searchResults.length) == 50) && (locality || searchQuery && searchQuery.locality) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
8488
+ }, window.location.href.includes("/obps/bpa/") ? /*#__PURE__*/React.createElement(Link, {
8489
+ to: "/digit-ui/citizen/obps/bpa/building_plan_scrutiny/new_construction/location",
8651
8490
  style: {
8652
- marginLeft: "16px",
8653
- marginTop: "16px"
8491
+ padding: "8px 24px",
8492
+ textDecoration: "none",
8493
+ borderRadius: "2px"
8654
8494
  }
8655
- }, t("PT_LOAD_MORE_MSG"), " ", /*#__PURE__*/React.createElement("span", {
8656
- className: "link"
8657
- }, /*#__PURE__*/React.createElement(Link, {
8658
- to: `/digit-ui/citizen/pt/property/search-results?mobileNumber=${mobileNumber || searchQuery.mobileNumber ? mobileNumber || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.mobileNumber) : ""}&propertyIds=${propertyIds || searchQuery !== null && searchQuery !== void 0 && searchQuery.propertyIds ? propertyIds || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.propertyIds) : ""}&oldPropertyIds=${oldPropertyIds || searchQuery !== null && searchQuery !== void 0 && searchQuery.oldPropertyIds ? oldPropertyIds || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.oldPropertyIds) : ""}&doorNo=${doorNo || searchQuery !== null && searchQuery !== void 0 && searchQuery.doorNo ? doorNo || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.doorNo) : ""}&name=${name || searchQuery !== null && searchQuery !== void 0 && searchQuery.name ? name || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.name) : ""}&city=${city ? city : ""}&locality=${locality || searchQuery !== null && searchQuery !== void 0 && searchQuery.locality ? locality || (searchQuery === null || searchQuery === void 0 ? void 0 : searchQuery.locality) : ""}&PToffset=${t1}`
8659
- }, t("PT_COMMON_CLICK_HERE"))))));
8495
+ }, t("CORE_COMMON_SKIP_CONTINUE")) : /*#__PURE__*/React.createElement(Link, {
8496
+ to: window.location.href.includes("/ws/") ? "/digit-ui/citizen/ws/create-application/create-property" : window.location.href.includes("/tl/tradelicence/") ? "/digit-ui/citizen/tl/tradelicence/new-application/create-property" : window.location.href.includes("/fsm/") ? "/digit-ui/citizen/fsm/new-application/create-property" : "/digit-ui/citizen/commonpt/property/new-application",
8497
+ style: {
8498
+ padding: "8px 24px",
8499
+ textDecoration: "none",
8500
+ borderRadius: "2px"
8501
+ }
8502
+ }, t("CPT_REG_NEW_PROPERTY")))), /*#__PURE__*/React.createElement(FormComposer, {
8503
+ key: action,
8504
+ onSubmit: onPropertySearch,
8505
+ config: config,
8506
+ label: propsConfig.texts.submitButtonLabel,
8507
+ secondaryActionLabel: t("ES_COMMON_CLEAR_SEARCH"),
8508
+ onSecondayActionClick: () => {
8509
+ setSearchData({});
8510
+ history.replace(`${history.location.pathname}?action=0`);
8511
+ },
8512
+ text: t(propsConfig.texts.text),
8513
+ onFormValueChange: onFormValueChange
8514
+ }), Object.keys(searchData).length > 0 && /*#__PURE__*/React.createElement(PropertySearchResults, {
8515
+ searchQuery: {
8516
+ ...searchData.filters,
8517
+ city: searchData.city
8518
+ },
8519
+ city: searchData.city,
8520
+ stateCode: Digit.ULBService.getStateId(),
8521
+ onSelect: onSelect,
8522
+ config: propsConfig
8523
+ }), showToast && /*#__PURE__*/React.createElement(Toast, {
8524
+ isDleteBtn: true,
8525
+ error: showToast.error,
8526
+ warning: showToast.warning,
8527
+ label: t(showToast.label),
8528
+ onClose: () => {
8529
+ setShowToast(null);
8530
+ }
8531
+ }));
8660
8532
  };
8661
- PropertySearchResults.propTypes = {
8662
- template: propTypes.any,
8663
- header: propTypes.string,
8664
- actionButtonLabel: propTypes.string
8533
+ SearchProperty.propTypes = {
8534
+ loginParams: propTypes.any
8665
8535
  };
8666
- PropertySearchResults.defaultProps = {
8667
- template: [],
8668
- header: null,
8669
- actionButtonLabel: null
8536
+ SearchProperty.defaultProps = {
8537
+ loginParams: null
8538
+ };
8539
+
8540
+ const SearchProperty$1 = ({
8541
+ onSelect
8542
+ }) => {
8543
+ const {
8544
+ t
8545
+ } = useTranslation();
8546
+ const {
8547
+ path
8548
+ } = useRouteMatch();
8549
+ const search = useLocation().search;
8550
+ const redirectToUrl = new URLSearchParams(search).get('redirectToUrl');
8551
+ const params = useMemo(() => config.map(step => {
8552
+ const texts = {};
8553
+ for (const key in step.texts) {
8554
+ texts[key] = t(step.texts[key]);
8555
+ }
8556
+ return {
8557
+ ...step,
8558
+ texts
8559
+ };
8560
+ }, [config]));
8561
+ return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
8562
+ path: `${path}`,
8563
+ exact: true
8564
+ }, /*#__PURE__*/React.createElement(SearchProperty, {
8565
+ config: params[0],
8566
+ onSelect: onSelect,
8567
+ redirectToUrl: redirectToUrl
8568
+ })));
8670
8569
  };
8671
8570
 
8571
+ const config$1 = [{
8572
+ texts: {
8573
+ header: "CS_SEARCH_RESULTS",
8574
+ actionButtonLabel: "PT_COMMONS_SELECT_PLACEHOLDER"
8575
+ },
8576
+ labels: [{
8577
+ label: "PT_DUES_ARE_PENDING",
8578
+ key: "total_due",
8579
+ noteStyle: {
8580
+ fontSize: "24px",
8581
+ fontWeight: "bold"
8582
+ },
8583
+ notePrefix: "₹ "
8584
+ }, {
8585
+ label: "TL_PROPERTY_ID",
8586
+ key: "property_id"
8587
+ }, {
8588
+ label: "PT_OWNERS_NAME",
8589
+ key: "owner_name"
8590
+ }, {
8591
+ label: "PT_COMMON_COL_ADDRESS",
8592
+ key: "property_address"
8593
+ }, {
8594
+ label: "PT_COMMON_TABLE_COL_STATUS_LABEL",
8595
+ key: "status"
8596
+ }]
8597
+ }];
8598
+
8672
8599
  const loginSteps = [{
8673
8600
  texts: {
8674
8601
  header: "CS_LOGIN_PROVIDE_MOBILE_NUMBER",
@@ -17850,7 +17777,7 @@ const PropertySearchNSummary = ({
17850
17777
  formState,
17851
17778
  clearErrors
17852
17779
  }) => {
17853
- var _formData$cptId, _formData$tradedetils, _formData$tradedetils2, _formData$tradedetils3;
17780
+ var _formData$cptId, _formData$tradedetils, _formData$tradedetils2, _formData$tradedetils3, _propertyDetails$Prop3, _propertyDetails$Prop4, _propertyDetails$Prop5, _propertyDetails$Prop6, _propertyDetails$Prop7, _propertyDetails$Prop8;
17854
17781
  const {
17855
17782
  t
17856
17783
  } = useTranslation();
@@ -17945,8 +17872,20 @@ const PropertySearchNSummary = ({
17945
17872
  };
17946
17873
  } else return {};
17947
17874
  };
17875
+ const getOwnerNames = propertyData => {
17876
+ var _propertyData$owners, _getActiveOwners$sort, _getActiveOwners$sort2;
17877
+ const getActiveOwners = propertyData === null || propertyData === void 0 ? void 0 : (_propertyData$owners = propertyData.owners) === null || _propertyData$owners === void 0 ? void 0 : _propertyData$owners.filter(owner => owner === null || owner === void 0 ? void 0 : owner.active);
17878
+ const getOwnersList = (_getActiveOwners$sort = getActiveOwners.sort((a, b) => {
17879
+ var _a$additionalDetails, _b$additionalDetails;
17880
+ return (a === null || a === void 0 ? void 0 : (_a$additionalDetails = a.additionalDetails) === null || _a$additionalDetails === void 0 ? void 0 : _a$additionalDetails.ownerSequence) - (b === null || b === void 0 ? void 0 : (_b$additionalDetails = b.additionalDetails) === null || _b$additionalDetails === void 0 ? void 0 : _b$additionalDetails.ownerSequence);
17881
+ })) === null || _getActiveOwners$sort === void 0 ? void 0 : (_getActiveOwners$sort2 = _getActiveOwners$sort.map(activeOwner => activeOwner === null || activeOwner === void 0 ? void 0 : activeOwner.name)) === null || _getActiveOwners$sort2 === void 0 ? void 0 : _getActiveOwners$sort2.join(",");
17882
+ return getOwnersList ? getOwnersList : t("NA");
17883
+ };
17948
17884
  if (window.location.href.includes("/ws/")) ;
17949
- return /*#__PURE__*/React.createElement(React.Fragment, null, (window.location.href.includes("/tl/") ? !((formData === null || formData === void 0 ? void 0 : (_formData$tradedetils = formData.tradedetils) === null || _formData$tradedetils === void 0 ? void 0 : (_formData$tradedetils2 = _formData$tradedetils[0]) === null || _formData$tradedetils2 === void 0 ? void 0 : (_formData$tradedetils3 = _formData$tradedetils2.structureType) === null || _formData$tradedetils3 === void 0 ? void 0 : _formData$tradedetils3.code) === "MOVABLE") && (isEmpNewApplication || isEmpRenewLicense) : true) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(Label, {
17885
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
17886
+ title: t("PT_PROPERTY_SEARCH"),
17887
+ defaultOpen: true
17888
+ }, (window.location.href.includes("/tl/") ? !((formData === null || formData === void 0 ? void 0 : (_formData$tradedetils = formData.tradedetils) === null || _formData$tradedetils === void 0 ? void 0 : (_formData$tradedetils2 = _formData$tradedetils[0]) === null || _formData$tradedetils2 === void 0 ? void 0 : (_formData$tradedetils3 = _formData$tradedetils2.structureType) === null || _formData$tradedetils3 === void 0 ? void 0 : _formData$tradedetils3.code) === "MOVABLE") && (isEmpNewApplication || isEmpRenewLicense) : true) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(Label, {
17950
17889
  style: getInputStyles()
17951
17890
  }, `${t(`PROPERTY_ID`)}`), /*#__PURE__*/React.createElement("div", {
17952
17891
  style: {
@@ -17992,7 +17931,85 @@ const PropertySearchNSummary = ({
17992
17931
  style: {
17993
17932
  color: "white"
17994
17933
  }
17995
- }, t("CPT_CREATE_PROPERTY"))))), showToast && /*#__PURE__*/React.createElement(Toast, {
17934
+ }, t("CPT_CREATE_PROPERTY"))))), searchPropertyId && propertyDetails && propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.Properties.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, {
17935
+ className: "card-with-background",
17936
+ style: {
17937
+ margin: "16px 0px",
17938
+ padding: "20px",
17939
+ boxShadow: "none"
17940
+ }
17941
+ }, /*#__PURE__*/React.createElement(StatusTable, {
17942
+ style: {
17943
+ padding: "0",
17944
+ margin: "0"
17945
+ }
17946
+ }, /*#__PURE__*/React.createElement("div", {
17947
+ className: "formcomposer-section-grid",
17948
+ style: isMobile ? {} : {}
17949
+ }, /*#__PURE__*/React.createElement(Row, {
17950
+ className: "border-none",
17951
+ labelStyle: isMobile ? {
17952
+ width: "40%"
17953
+ } : {
17954
+ width: "30%",
17955
+ color: "#505a5f",
17956
+ fontWeight: "600"
17957
+ },
17958
+ textStyle: {
17959
+ color: "#000"
17960
+ },
17961
+ label: t(`PROPERTY_ID`),
17962
+ text: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3.propertyId
17963
+ }), /*#__PURE__*/React.createElement(Row, {
17964
+ className: "border-none",
17965
+ labelStyle: isMobile ? {
17966
+ width: "40%"
17967
+ } : {
17968
+ width: "30%",
17969
+ color: "#505a5f",
17970
+ fontWeight: "600"
17971
+ },
17972
+ textStyle: {
17973
+ color: "#000"
17974
+ },
17975
+ label: t(`OWNER_NAME`),
17976
+ text: getOwnerNames(propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.Properties[0])
17977
+ }), /*#__PURE__*/React.createElement(Row, {
17978
+ className: "border-none",
17979
+ labelStyle: isMobile ? {
17980
+ width: "40%"
17981
+ } : {
17982
+ width: "30%",
17983
+ color: "#505a5f",
17984
+ fontWeight: "600"
17985
+ },
17986
+ textStyle: {
17987
+ wordBreak: "break-word",
17988
+ color: "#000"
17989
+ },
17990
+ label: t(`PROPERTY_ADDRESS`),
17991
+ text: propertyAddress,
17992
+ privacy: {
17993
+ uuid: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop4 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop4 === void 0 ? void 0 : (_propertyDetails$Prop5 = _propertyDetails$Prop4.owners) === null || _propertyDetails$Prop5 === void 0 ? void 0 : (_propertyDetails$Prop6 = _propertyDetails$Prop5[0]) === null || _propertyDetails$Prop6 === void 0 ? void 0 : _propertyDetails$Prop6.uuid,
17994
+ fieldName: ["doorNo", "street", "landmark"],
17995
+ model: "Property",
17996
+ showValue: true,
17997
+ loadData: {
17998
+ serviceName: "/property-services/property/_search",
17999
+ requestBody: {},
18000
+ requestParam: {
18001
+ tenantId: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop7 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop7 === void 0 ? void 0 : _propertyDetails$Prop7.tenantId,
18002
+ propertyIds: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop8 = propertyDetails.Properties[0]) === null || _propertyDetails$Prop8 === void 0 ? void 0 : _propertyDetails$Prop8.propertyId
18003
+ },
18004
+ jsonPath: "Properties[0].address.street",
18005
+ d: res => {
18006
+ let resultString = (lodash.get(res, "Properties[0].address.doorNo") ? `${lodash.get(res, "Properties[0].address.doorNo")}, ` : "") + (lodash.get(res, "Properties[0].address.street") ? `${lodash.get(res, "Properties[0].address.street")}, ` : "") + (lodash.get(res, "Properties[0].address.landmark") ? `${lodash.get(res, "Properties[0].address.landmark")}` : "");
18007
+ return resultString;
18008
+ },
18009
+ isArray: false
18010
+ }
18011
+ }
18012
+ }))))) : null, showToast && /*#__PURE__*/React.createElement(Toast, {
17996
18013
  isDleteBtn: true,
17997
18014
  labelstyle: {
17998
18015
  width: "100%"
@@ -18003,7 +18020,7 @@ const PropertySearchNSummary = ({
18003
18020
  onClose: () => {
18004
18021
  setShowToast(null);
18005
18022
  }
18006
- })));
18023
+ }))));
18007
18024
  };
18008
18025
 
18009
18026
  const PropertyLocationDetails = ({
@@ -18140,20 +18157,6 @@ const PropertyLocationDetails = ({
18140
18157
  return /*#__PURE__*/React.createElement(CollapsibleCardPage, {
18141
18158
  title: t("PT_LOCATION_DETAILS"),
18142
18159
  defaultOpen: true
18143
- }, /*#__PURE__*/React.createElement("div", {
18144
- style: {
18145
- boxShadow: "none",
18146
- ...props.style
18147
- }
18148
- }, !window.location.href.includes("create-application/create-property") && /*#__PURE__*/React.createElement(PropertySearchNSummary, {
18149
- config: config,
18150
- onSelect: onSelect,
18151
- formData: formDataProp,
18152
- userType: window.location.href.includes("/employee/") ? "employee" : "citizen"
18153
- }), /*#__PURE__*/React.createElement("div", {
18154
- style: {
18155
- marginTop: "20px"
18156
- }
18157
18160
  }, /*#__PURE__*/React.createElement(AddressDetails, {
18158
18161
  t: t,
18159
18162
  formData: formData,
@@ -18172,7 +18175,7 @@ const PropertyLocationDetails = ({
18172
18175
  showZRO: true,
18173
18176
  disable: isPropertyFound,
18174
18177
  hideNextButton: true
18175
- }))));
18178
+ }));
18176
18179
  };
18177
18180
 
18178
18181
  const PropertyOwnerDetails = ({