@djb25/digit-ui-module-ekyc 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var e,t=require("react"),a=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,n=require("react-i18next"),l=require("react-router-dom"),o=require("@djb25/digit-ui-react-components"),r=require("chart.js");r.Chart.register(...r.registerables);const i=e=>{let{countData:l}=e;const{t:o}=n.useTranslation(),i=t.useRef(null),s=t.useRef(null),c=(null==l?void 0:l.total)||0,d=(null==l?void 0:l.pending)||0,E=(null==l?void 0:l.completed)||0,m=(null==l?void 0:l.completed)||0,p=m,u=c>0?Math.round(m/c*100):0,v=c>0?Math.round(p/c*100):0,g=e=>new Intl.NumberFormat("en-IN").format(e||0);t.useEffect(()=>{if(i.current){s.current&&s.current.destroy();const e=i.current.getContext("2d");s.current=new r.Chart(e,{type:"doughnut",data:{labels:[o("EKYC_ACTIVE"),o("EKYC_PENDING"),o("EKYC_COMPLETED")],datasets:[{data:[E,d,0],backgroundColor:["#0c2a52","#77B6EA","#c8ddf5"],borderColor:["#ffffff","#ffffff","#ffffff"],borderWidth:2,hoverOffset:4}]},options:{cutout:"75%",plugins:{legend:{display:!1}},maintainAspectRatio:!1,responsive:!0}})}return()=>{s.current&&s.current.destroy()}},[d,0,E,o]);const C=[{color:"#0c2a52",label:o("EKYC_ACTIVE"),value:E},{color:"#77B6EA",label:o("EKYC_PENDING"),value:d},{color:"#c8ddf5",label:o("EKYC_COMPLETED"),value:0}];return a.createElement("div",{className:"ekyc-employee-container"},a.createElement("div",{className:"status-cards-wrapper"},a.createElement("div",{className:"status-cards-header"},a.createElement("div",null,a.createElement("div",{className:"eyebrow"},a.createElement("span",{className:"eyebrow-dot"}),o("EKYC_INSTITUTIONAL_OVERVIEW")||"Institutional Performance Overview"),a.createElement("h1",{className:"status-cards-h1"},o("EKYC_DASHBOARD_TITLE")||"eKYC Verification Dashboard"),a.createElement("p",{className:"status-cards-subtitle"},o("EKYC_DASHBOARD_SUBTITLE")||"Real-time monitoring of consumer verification workflows across all administrative zones.")),a.createElement("div",{className:"total-applications-card"},a.createElement("div",{className:"total-label"},o("EKYC_TOTAL_APPLICATIONS")||"Total Applications Processed"),a.createElement("div",{className:"total-number"},g(c)),a.createElement("div",{className:"total-badge"},"↗ +12.4% ",o("EKYC_FROM_LAST_QUARTER")||"from last quarter"))),a.createElement("div",{className:"status-panels-grid"},a.createElement("div",{className:"status-panel"},a.createElement("div",{className:"panel-title"},o("EKYC_STATUS_BREAKDOWN")||"Status Breakdown"),a.createElement("div",{className:"panel-subtitle"},o("EKYC_VERIFICATION_LIFECYCLE")||"Verification lifecycle distribution"),a.createElement("div",{className:"breakdown-body"},a.createElement("div",{className:"status-legend"},C.map(e=>a.createElement("div",{key:e.label,className:"legend-row"},a.createElement("span",{className:"legend-label"},a.createElement("span",{className:"indicator-dot",style:{background:e.color}}),e.label),a.createElement("span",{className:"legend-value"},g(e.value))))),a.createElement("div",{className:"chart-wrapper"},a.createElement("canvas",{ref:i,style:{width:"100%",height:"100%"}}),a.createElement("div",{className:"chart-center"},a.createElement("div",{className:"chart-percentage"},u,"%"),a.createElement("div",{className:"chart-label"},o("EKYC_COMPLETE")||"Complete"))))),a.createElement("div",{className:"status-panel"},a.createElement("div",{className:"panel-title"},o("EKYC_SUBMISSION_HEALTH")||"Submission Health",a.createElement("span",{className:"optimal-badge"},o("EKYC_OPTIMAL")||"Optimal")),a.createElement("div",{className:"panel-subtitle"},o("EKYC_PLATFORM_EFFICIENCY")||"Platform operational efficiency"),a.createElement("div",{className:"health-metrics-row"},a.createElement("div",{className:"health-percentage"},v,"%"),a.createElement("div",{className:"health-trend"},"↗ +2.1%")),a.createElement("div",{className:"status-progress-bar"},a.createElement("div",{className:"progress-fill",style:{width:v+"%"}})),a.createElement("div",{className:"mini-metrics-grid"},a.createElement("div",{className:"metric-box"},a.createElement("div",{className:"metric-label"},o("EKYC_AVG_LATENCY")||"Avg Latency"),a.createElement("div",{className:"metric-value"},"1.2s")),a.createElement("div",{className:"metric-box"},a.createElement("div",{className:"metric-label"},o("EKYC_ERROR_RATE")||"Error Rate"),a.createElement("div",{className:"metric-value"},"0.04%")))))))},s=e=>{var l;let{filterComponent:r,...s}=e;const{data:c,isLoading:d,onSort:E,onNextPage:m,onPrevPage:p,currentPage:u,pageSizeLimit:v,onPageSizeChange:g,parentRoute:C,searchParams:_,sortParams:f,totalRecords:S,countData:y}=s,{t:h}=n.useTranslation(),A=Digit.ULBService.getCurrentTenantId(),[x,N]=a.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r)}),[b,T]=t.useState(!1),[I,R]=t.useState(""),[O,Y]=t.useState(""),D=(null===(l=Digit.Hooks.ekyc)||void 0===l?void 0:l.useEkycApplicationReview)||((e,t)=>Digit.Hooks.useMutation(t=>Digit.EkycService.application_review(t,e),t)),{mutate:K,isLoading:L}=D({tenantId:A},{onSuccess:e=>{if(null!=e&&e.applicationReviewInfo){const a=(t=e.applicationReviewInfo)?`\n <!DOCTYPE html>\n <html>\n <head>\n <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">\n <style>\n body { font-family: 'Inter', sans-serif; padding: 30px; color: #101828; line-height: 1.5; background: #fff; }\n .header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #185FA5; padding-bottom: 20px; margin-bottom: 30px; }\n .title { margin: 0; color: #185FA5; font-size: 24px; font-weight: 700; }\n .subtitle { margin: 5px 0 0; color: #667085; font-size: 14px; }\n .section { margin-bottom: 30px; border: 1px solid #EAECF0; border-radius: 12px; overflow: hidden; }\n .section-header { background: #F9FAFB; padding: 12px 20px; border-bottom: 1px solid #EAECF0; font-weight: 700; font-size: 14px; color: #344054; text-transform: uppercase; letter-spacing: 0.05em; }\n .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }\n .item { padding: 16px 20px; border-bottom: 1px solid #F2F4F7; }\n .item:nth-last-child(-n+2) { border-bottom: none; }\n .label { font-size: 11px; color: #667085; text-transform: uppercase; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 4px; }\n .value { font-size: 14px; font-weight: 500; color: #1D2939; }\n .badge { display: inline-block; padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 600; }\n .badge-success { background: #ECFDF3; color: #027A48; }\n .badge-warning { background: #FFFAEB; color: #B54708; }\n .print-btn { background: #185FA5; color: #fff; padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; display: block; margin: 20px auto; }\n @media print { .print-btn { display: none; } body { padding: 0; } }\n </style>\n </head>\n <body>\n <div class="header">\n <div>\n <h1 class="title">Delhi Jal Board</h1>\n <p class="subtitle">EKYC Application Review Summary</p>\n </div>\n <div style="text-align: right">\n <span class="badge ${"ACTIVE"===t.statusFlag?"badge-success":"badge-warning"}">${t.statusFlag||"N/A"}</span>\n <p class="subtitle" style="margin-top: 8px">Generated on: ${(new Date).toLocaleDateString()}</p>\n </div>\n </div>\n\n <div class="section">\n <div class="section-header">Basic Details</div>\n <div class="grid">\n <div class="item"><div class="label">KNO Number</div><div class="value">${t.kno||"N/A"}</div></div>\n <div class="item"><div class="label">Consumer Name</div><div class="value">${t.consumerName||"N/A"}</div></div>\n <div class="item"><div class="label">Mobile Number</div><div class="value">${t.mobileNo||"N/A"}</div></div>\n <div class="item"><div class="label">Email Address</div><div class="value">${t.email||"N/A"}</div></div>\n <div class="item"><div class="label">Connection Type</div><div class="value">${t.typeOfConnection||"N/A"}</div></div>\n <div class="item"><div class="label">Category</div><div class="value">${t.connectionCategory||"N/A"}</div></div>\n </div>\n </div>\n\n <div class="section">\n <div class="section-header">Location & Property Information</div>\n <div class="grid">\n <div class="item"><div class="label">Address</div><div class="value">${t.addressRaw||"N/A"}</div></div>\n <div class="item"><div class="label">Locality</div><div class="value">${t.locality||"N/A"}</div></div>\n <div class="item"><div class="label">City - Pincode</div><div class="value">${t.city||"N/A"} - ${t.pincode||"N/A"}</div></div>\n <div class="item"><div class="label">PID Number</div><div class="value">${t.pidNumber||"N/A"}</div></div>\n <div class="item"><div class="label">No. of Floors</div><div class="value">${t.noOfFloor||"N/A"}</div></div>\n <div class="item"><div class="label">Verification Status</div><div class="value"><span class="badge ${"SUCCESSFUL"===t.verificationStatus?"badge-success":"badge-warning"}">${t.verificationStatus||"PENDING"}</span></div></div>\n </div>\n </div>\n\n <div class="section">\n <div class="section-header">Meter Information</div>\n <div class="grid">\n <div class="item"><div class="label">Meter Number</div><div class="value">${t.meterNumber||"N/A"}</div></div>\n <div class="item"><div class="label">Meter Make</div><div class="value">${t.meterMake||"N/A"}</div></div>\n <div class="item"><div class="label">Meter Location</div><div class="value">${t.meterLocationAddress||"N/A"}</div></div>\n <div class="item"><div class="label">Working Status</div><div class="value">${t.workingStatus?"Working":"Not Working"}</div></div>\n </div>\n </div>\n\n <button class="print-btn" onclick="window.print()">Print This Review</button>\n </body>\n </html>\n `:"<h3>No data found</h3>";R(a),T(!0)}else{const t=(null==e?void 0:e.acknowledgementURL)||(null==e?void 0:e.reviewUrl)||(null==e?void 0:e.url);t?(R(""),setReviewUrl(t),T(!0)):alert(h("EKYC_REVIEW_INFO_NOT_FOUND"))}var t},onError:e=>{alert((null==e?void 0:e.message)||h("ERR_FAILED_TO_FETCH_REVIEW"))}}),P=t.useMemo(()=>[{Header:h("EKYC_APPLICATION_NO"),accessor:"applicationNumber",Cell:e=>{var t,n;let{row:l}=e;const o=(null===(t=l.original)||void 0===t?void 0:t.kno)||(null===(n=l.original)||void 0===n?void 0:n.applicationNumber)||"NA";return a.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>(e=>{Y(e),K({kno:e})})(o)},o)}},{Header:h("EKYC_CITIZEN_NAME"),accessor:"citizenName",Cell:e=>{var t;let{row:n}=e;return a.createElement("span",null,(null===(t=n.original)||void 0===t?void 0:t.citizenName)||"NA")}},{Header:h("EKYC_STATUS"),accessor:"status",Cell:e=>{var t;let{row:n}=e;const l=(null===(t=n.original)||void 0===t?void 0:t.status)||"DEFAULT";return a.createElement("span",{className:"ekyc-status-tag "+l},h(""+l))}}],[h,C]),k=t.useMemo(()=>(null==c?void 0:c.items)||[],[c]);return a.createElement("div",{className:"inbox-container"},b&&a.createElement(o.Modal,{headerBarMain:h("EKYC_APPLICATION_REVIEW")+(O?" - "+O:""),headerBarEnd:a.createElement("div",{style:{cursor:"pointer",padding:"5px 10px",background:"#F2F4F7",borderRadius:"4px"},onClick:()=>T(!1)},h("CLOSE")),hideSubmit:!0,popupStyles:{width:"90%",height:"90%",maxWidth:"1000px"},popupModuleMianStyles:{height:"calc(100% - 60px)",padding:0}},a.createElement("iframe",{srcDoc:I,src:I?void 0:reviewUrl,title:"Application Review",style:{width:"100%",height:"100%",border:"none"}})),(d||L)&&a.createElement(o.Loader,null),a.createElement("div",{className:"filters-container"},a.createElement(o.Card,{className:"sidebar-title-card",style:{display:"flex",alignItems:"center",padding:"16px",marginBottom:"16px",borderRadius:"4px"}},a.createElement("div",{className:"icon-container",style:{color:"#3A8DCC",marginRight:"12px"}},a.createElement(o.HomeIcon,{style:{width:"24px",height:"24px"}})),a.createElement("div",{style:{fontWeight:"700",fontSize:"18px",color:"#0B0C0C"}},h("ACTION_TEST_EKYC"))),a.createElement("div",null,x&&a.createElement(x,{defaultSearchParams:s.defaultSearchParams,onFilterChange:s.onSearch,searchParams:_,type:"desktop",moduleCode:"EKYC"}))),a.createElement("div",{style:{flex:1,marginLeft:"16px"}},a.createElement(o.Card,{className:"ekyc-metrics-card",style:{marginBottom:"16px",padding:"16px"}},a.createElement(i,{countData:y})),a.createElement("div",{className:"result",style:{flex:1}},a.createElement(o.Card,{className:"ekyc-table-card",style:{padding:0}},a.createElement(o.Table,{t:h,data:k,columns:P,isLoading:d,onSort:E,sortParams:f,totalRecords:S,onNextPage:m,onPrevPage:p,currentPage:u,pageSizeLimit:v,onPageSizeChange:g,getCellProps:e=>({className:"ekyc-table-cell"})})))))},c=e=>{var l,r,i;let{onSearch:s,searchParams:c,children:d,...E}=e;const{t:m}=n.useTranslation(),[p,u]=t.useState(()=>({...c})),v=(e,t)=>{u(a=>({...a,[e]:t}))};return a.createElement("div",{className:"ekyc-employee-container"},a.createElement("div",{className:"search-consumer-wrapper"},a.createElement("div",{className:"header-wrapper"},a.createElement(o.Card,{className:"sidebar-title-card"},a.createElement("div",{className:"icon-container"},a.createElement(o.HomeIcon,null)),a.createElement("div",{className:"title-text"},m("EKYC_SEARCH_CONSUMER_HEADER")))),a.createElement("div",{className:"main-content-wrapper"},a.createElement("div",{className:"search-stats-row"},a.createElement("div",{className:"identity-lookup-card"},a.createElement("div",{className:"lookup-card-title"},a.createElement("div",{className:"lookup-icon-bg"},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("circle",{cx:"11",cy:"11",r:"8"}),a.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))),a.createElement("span",{className:"lookup-title-text"},m("EKYC_IDENTITY_LOOKUP")||"Identity Lookup")),a.createElement("form",{onSubmit:e=>{e&&e.preventDefault&&e.preventDefault(),s(p)}},a.createElement("div",{className:"inputs-row"},a.createElement("div",{className:"input-group"},a.createElement("label",null,m("EKYC_K_NUMBER")||"K Number",a.createElement("span",{className:"info-badge"},"i")),a.createElement(o.TextInput,{value:null==p?void 0:p.kNumber,onChange:e=>v("kNumber",e.target.value),placeholder:m("EKYC_K_NUMBER_PLACEHOLDER")||"e.g. 8234910234"})),a.createElement("div",{className:"input-group"},a.createElement("label",null,m("EKYC_K_NAME")||"K Name",a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"}))),a.createElement(o.TextInput,{value:null==p?void 0:p.kName,onChange:e=>v("kName",e.target.value),placeholder:m("EKYC_K_NAME_PLACEHOLDER")||"Consumer name search"}))),a.createElement("div",{className:"actions-row"},a.createElement("button",{type:"button",onClick:()=>{const e={kNumber:"",kName:""};u(e),s(e)},className:"clear-btn"},m("ES_COMMON_CLEAR")||"Clear"),a.createElement("button",{type:"submit",className:"search-btn"},m("ES_COMMON_SEARCH")||"Execute Search")))),a.createElement("div",{className:"stats-column"},a.createElement("div",{className:"audits-card"},a.createElement("div",{className:"audits-label"},m("EKYC_TODAYS_AUDITS")||"Today's Audits"),a.createElement("div",{className:"audits-count"},(null===(l=E.countData)||void 0===l?void 0:l.todaysAudits)||24),a.createElement("div",{className:"audits-change"},a.createElement("span",null,"↗"),(null===(r=E.countData)||void 0===r?void 0:r.auditChange)||"12% increase from yesterday"),a.createElement("div",{className:"audits-watermark"},"M")),a.createElement("div",{className:"queue-card"},a.createElement("div",{className:"queue-label"},m("EKYC_QUEUE_STATUS")||"Queue Status"),a.createElement("div",{className:"queue-content"},a.createElement("div",{className:"queue-status-text"},(null===(i=E.countData)||void 0===i?void 0:i.pendingCount)||3," Pending"),a.createElement("div",{className:"avatar-group"},[0,1].map(e=>a.createElement("div",{key:e,className:"avatar-item"},String.fromCharCode(65+e))),a.createElement("div",{className:"avatar-more"},"+1")))))),d)))},d=e=>{var t;let{data:r,isLoading:s,onSearch:d,searchParams:E,parentRoute:m,countData:p}=e;const{t:u}=n.useTranslation(),v=(null==r||null===(t=r.items)||void 0===t?void 0:t.map(e=>({[u("EKYC_APPLICATION_NO")]:e.applicationNumber,[u("EKYC_CITIZEN_NAME")]:e.citizenName,[u("EKYC_MOBILE_NO")]:e.mobileNumber,[u("EKYC_STATUS")]:a.createElement("span",{className:"ekyc-status-tag "+e.status},u("EKYC_STATUS_"+e.status))})))||[];return a.createElement("div",{className:"inbox-wrapper"},a.createElement("div",{className:"ekyc-header-container module-header"},a.createElement(o.Header,{className:"title"},u("EKYC_INBOX_HEADER")),a.createElement(l.Link,{to:m+"/create-kyc"},a.createElement(o.SubmitBar,{label:u("EKYC_CREATE_KYC")}))),a.createElement("div",{className:"ekyc-metrics-section"},a.createElement(i,{countData:p})),a.createElement(c,{onSearch:d,searchParams:E}),a.createElement("div",{className:"mobile-data-container"},s?a.createElement(o.Loader,null):(null==v?void 0:v.length)>0?a.createElement(o.DetailsCard,{data:v,t:u,serviceRequestIdKey:u("EKYC_APPLICATION_NO"),linkPrefix:m+"/application-details/"}):a.createElement(o.Card,null,u("ES_COMMON_NO_DATA").split("\\n").map((e,t)=>a.createElement("p",{key:t,style:{textAlign:"center"}},e)))))},E=e=>{let{searchParams:l,onFilterChange:r,defaultSearchParams:i,...s}=e;const{t:c}=n.useTranslation(),[d,E]=t.useState(()=>({...l}));return a.createElement(o.FilterForm,{onSubmit:()=>{r(d)},handleSubmit:e=>t=>{t&&t.preventDefault(),e()},onResetFilterForm:()=>{E({...i}),r({...i})},id:"ekyc-filter-form",onMobileExclusiveFilterPopupFormClose:s.onClose},a.createElement(o.FilterFormField,null,a.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},c("EKYC_STATUS"),":"),a.createElement(o.Dropdown,{option:[{label:c("EKYC_STATUS_ALL"),value:""},{label:c("EKYC_STATUS_ACTIVE"),value:"ACTIVE"},{label:c("EKYC_STATUS_PENDING"),value:"PENDING START"}],optionKey:"label",select:e=>{const t={...d,status:e};E(t),r(t)},selected:(null==d?void 0:d.status)||{label:c("EKYC_STATUS_ALL"),value:""}})))},m=e=>{var l;let{parentRoute:o,businessService:r="EKYC",initialStates:i={}}=e;const c=Digit.ULBService.getCurrentTenantId(),{t:E}=n.useTranslation(),[m,p]=t.useState(i.pageOffset||0),[u,v]=t.useState(i.pageSize||10),[g,C]=t.useState(i.sortParams||[{id:"createdTime",desc:!0}]),_=t.useMemo(()=>({label:E("EKYC_STATUS_ALL"),value:""}),[E]),[f,S]=t.useState(i.searchParams||{status:_}),{isLoading:y,data:h,isFetching:A}=Digit.Hooks.ekyc.useEkycSurveyorDashboard({},{tenantId:c,offset:m,limit:u},{enabled:!!c}),x=t.useMemo(()=>{var e,t;let a=(null==h||null===(e=h.dashboardInfo)||void 0===e?void 0:e.consumerList)||[];const n=null===(t=f.status)||void 0===t?void 0:t.value;return n&&""!==n&&(a=a.filter(e=>e.status===n)),a.map(e=>({...e,applicationNumber:e.kno||e.applicationNumber,citizenName:e.consumerName||e.citizenName}))},[h,f.status]),N=t.useMemo(()=>{const e=(null==h?void 0:h.dashboardInfo)||{};return{total:e.total||0,completed:e.completed||0,pending:e.pending||0,rejected:e.rejected||0,active:e.active||0}},[h]),b=(null==h||null===(l=h.dashboardInfo)||void 0===l?void 0:l.totalRecords)||(null==h?void 0:h.totalCount)||0,T=t.useCallback(e=>{S(t=>({...t,...e})),p(0)},[]),I=t.useCallback(e=>{e.length>0&&C(e)},[]),R=t.useMemo(()=>[{label:E("EKYC_STATUS"),name:"status",type:"dropdown",options:[{label:E("EKYC_STATUS_ALL"),value:""},{label:E("EKYC_STATUS_ACTIVE"),value:"ACTIVE"},{label:E("EKYC_STATUS_PENDING"),value:"PENDING START"}],optionsKey:"label"}],[E]);return a.createElement("div",{className:"ekyc-employee-container"},a.createElement("div",{className:"inbox-main-container"},Digit.Utils.browser.isMobile()?a.createElement(d,{data:{items:x,totalCount:b},isLoading:y||A,onSearch:T,searchFields:R,searchParams:f,parentRoute:o,countData:N}):a.createElement(s,{businessService:r,data:{items:x,totalCount:b},isLoading:y||A,searchFields:R,onSearch:T,onSort:I,onNextPage:()=>p(e=>e+u),onPrevPage:()=>p(e=>Math.max(e-u,0)),currentPage:Math.floor(m/u),pageSizeLimit:u,onPageSizeChange:e=>{const t=Number(e.target.value);v(t),p(0)},parentRoute:o,searchParams:f,sortParams:g,totalRecords:b,countData:N,filterComponent:"EKYC_INBOX_FILTER"})))},p=e=>{let{kNumber:r,kName:i,connectionDetails:s,isLoading:c}=e;const{t:d}=n.useTranslation(),E=l.useHistory(),{path:m}=l.useRouteMatch(),[p,u]=t.useState(!1),[v,g]=t.useState({code:"SELF",name:"EKYC_SELF"});if(c)return a.createElement(o.Loader,null);if(!s)return null;const C=(null==s?void 0:s.connectionDetails)||{},_=C.statusflag||"",f="active"===(null==_?void 0:_.toLowerCase())||"A"===_;return a.createElement(a.Fragment,null,a.createElement("div",{className:"ekyc-employee-container"},a.createElement("div",{className:"connection-details-card"},a.createElement("div",{className:"details-card-header"},a.createElement("div",{className:"header-title-wrapper"},a.createElement("div",{className:"header-icon-bg"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"}))),a.createElement("span",{className:"header-title-text"},d("EKYC_K_NUMBER_DETAILS")||"Consumer Identity Details")),a.createElement("span",{className:"status-badge "+(f?"active":"inactive")},f?d("EKYC_ACTIVE_CONNECTION")||"Active Connection":_||d("CS_NA"))),a.createElement("div",{className:"details-card-body"},a.createElement("div",{className:"body-content-row"},a.createElement("div",{className:"detail-section"},a.createElement("div",{className:"section-title"},d("EKYC_VERIFICATION_PARAMETERS")||"Verification Parameters"),a.createElement("div",{className:"data-grid"},a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_CONSUMER_NAME")||"Consumer Name"),a.createElement("div",{className:"data-value"},C.consumerName||i||d("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_K_NUMBER")||"K Number"),a.createElement("div",{className:"data-value blue"},r||d("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_METER_NO")||"Meter Serial No."),a.createElement("div",{className:"data-value"},C.meterNumber||d("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_CONNECTION_TYPE")||"Connection Type"),a.createElement("div",{className:"data-value"},C.connectionType||d("CS_NA"))))),a.createElement("div",{className:"vertical-divider"}),a.createElement("div",{className:"detail-section"},a.createElement("div",{className:"section-title"},d("EKYC_ADDRESS_AND_CONTACT")||"Address & Contact"),a.createElement("div",{className:"address-block"},a.createElement("div",{className:"icon-wrapper-small"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M21 10c0 7-9 13-9 13S3 17 3 10a9 9 0 0 1 18 0z"}),a.createElement("circle",{cx:"12",cy:"10",r:"3"}))),a.createElement("div",null,a.createElement("div",{className:"data-label"},d("EKYC_ADDRESS")||"Service Address"),a.createElement("div",{className:"address-text"},C.address||d("CS_NA")))),a.createElement("div",{className:"contact-row"},a.createElement("div",{className:"contact-item"},a.createElement("div",{className:"icon-wrapper-small"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),a.createElement("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"}))),a.createElement("div",null,a.createElement("div",{className:"data-label"},d("EKYC_PHONE_NO")||"Contact"),a.createElement("div",{className:"address-text"},C.phoneNumber||d("CS_NA")))),a.createElement("div",{className:"contact-item"},a.createElement("div",{className:"icon-wrapper-small"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("circle",{cx:"12",cy:"12",r:"4"}),a.createElement("path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"}))),a.createElement("div",null,a.createElement("div",{className:"data-label"},d("EKYC_EMAIL")||"Email Address"),a.createElement("div",{className:"address-text"},C.email||d("CS_NA")))))))),a.createElement("div",{className:"details-card-footer"},a.createElement("div",{className:"footer-meta-text"},null!=s&&s.lastVerified?`${d("EKYC_LAST_VERIFIED")||"Last verified:"} ${s.lastVerified}`:""),a.createElement("div",{className:"action-btns-container"},a.createElement("button",{onClick:()=>u(!0),className:"primary-action-btn"},d("EKYC_START_VERIFICATION")||"Start Verification",a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),a.createElement("polyline",{points:"12 5 19 12 12 19"}))))))),p&&a.createElement(o.Modal,{headerBarMain:d("EKYC_SELECT_VERIFICATION_TYPE"),headerBarEnd:a.createElement("span",{onClick:()=>u(!1),style:{cursor:"pointer",padding:"8px"}},"X"),actionSaveLabel:d("ES_COMMON_CONFIRM"),actionSaveOnSubmit:()=>{const e=m.includes("/create-kyc")?m.replace("/create-kyc",""):m.replace("/k-details","");E.push(e+"/aadhaar-verification",{kNumber:r,selectedOption:v,connectionDetails:s}),u(!1)},actionCancelLabel:d("ES_COMMON_CANCEL"),actionCancelOnSubmit:()=>u(!1),style:{borderRadius:"12px"}},a.createElement("div",{style:{padding:"24px"}},a.createElement(o.RadioButtons,{options:[{code:"SELF",name:"EKYC_SELF"},{code:"OTHER",name:"EKYC_OTHER"}],optionsKey:"name",selectedOption:v,onSelect:g,style:{display:"flex",flexDirection:"column",gap:"12px",buttonStyle:{borderRadius:"5px"}},t:d}))))},u=()=>{const{t:e}=n.useTranslation(),[l,r]=t.useState(()=>{const e=sessionStorage.getItem("EKYC_CREATE_SEARCH_PARAMS");return e?JSON.parse(e):{kNumber:"",kName:""}}),[i,s]=t.useState(()=>"true"===sessionStorage.getItem("EKYC_CREATE_SEARCH_PERFORMED")),[d,E]=t.useState(null),m=Digit.ULBService.getCurrentTenantId(),{isLoading:u,data:v}=Digit.Hooks.ekyc.useSearchConnection({tenantId:m,details:{kno:l.kNumber,name:l.kName}},{enabled:i&&!!l.kNumber&&!!l.kName,onError:t=>{var a,n,l,o;E({error:!0,label:(null==t||null===(a=t.response)||void 0===a||null===(n=a.data)||void 0===n||null===(l=n.Errors)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.message)||e("EKYC_SEARCH_ERROR_PLEASE_ENTER_THE_CORRECT_CREDENTIALS")}),s(!1),sessionStorage.removeItem("EKYC_CREATE_SEARCH_PERFORMED")}});return a.createElement(c,{onSearch:t=>{if(!t.kNumber&&!t.kName)return r({kNumber:"",kName:""}),s(!1),sessionStorage.removeItem("EKYC_CREATE_SEARCH_PARAMS"),void sessionStorage.removeItem("EKYC_CREATE_SEARCH_PERFORMED");t.kNumber&&t.kName?(r(t),s(!0),sessionStorage.getItem("EKYC_K_NUMBER")!==t.kNumber&&Object.keys(sessionStorage).forEach(e=>{e.startsWith("EKYC_")&&sessionStorage.removeItem(e)}),sessionStorage.setItem("EKYC_CREATE_SEARCH_PARAMS",JSON.stringify(t)),sessionStorage.setItem("EKYC_CREATE_SEARCH_PERFORMED","true"),sessionStorage.setItem("EKYC_K_NUMBER",t.kNumber)):E({error:!0,label:e("EKYC_FILL_ALL_FIELDS")})},searchParams:l},i&&a.createElement(p,{kNumber:l.kNumber,kName:l.kName,connectionDetails:v,isLoading:u}),!i&&!u&&a.createElement(o.Card,{style:{textAlign:"center",padding:"40px"}},a.createElement("div",{style:{color:"#667085"}},e("EKYC_SEARCH_TO_VIEW_DETAILS"))),d&&a.createElement(o.Toast,{error:d.error,label:d.label,onClose:()=>{E(null)},isDsc:!0}))};function v(){return(v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(null,arguments)}const g=(e,t)=>{const a=sessionStorage.getItem(e);try{return a?JSON.parse(a):t}catch(a){return console.warn(`Error parsing sessionStorage key "${e}":`,a),t}};function C(e,t){try{var a=e()}catch(e){return t(e)}return a&&a.then?a.then(void 0,t):a}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const _=e=>{let{size:t=28}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M9 2L7.17 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6C22 4.9 21.1 4 20 4H16.83L15 2H9ZM12 17C9.24 17 7 14.76 7 12C7 9.24 9.24 7 12 7C14.76 7 17 9.24 17 12C17 14.76 14.76 17 12 17ZM12 9C10.34 9 9 10.34 9 12C9 13.66 10.34 15 12 15C13.66 15 15 13.66 15 12C15 10.34 13.66 9 12 9Z",fill:"#185FA5"}))},f=e=>{let{size:t=20}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M12 8C9.79 8 8 9.79 8 12C8 14.21 9.79 16 12 16C14.21 16 16 14.21 16 12C16 9.79 14.21 8 12 8ZM20.94 11C20.48 6.83 17.17 3.52 13 3.06V1H11V3.06C6.83 3.52 3.52 6.83 3.06 11H1V13H3.06C3.52 17.17 6.83 20.48 11 20.94V23H13V20.94C17.17 20.48 20.48 17.17 20.94 13H23V11H20.94ZM12 19C8.13 19 5 15.87 5 12C5 8.13 8.13 5 12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19Z",fill:"#185FA5"}))},S=e=>{let{size:t=18}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M13 13V11H15V13H13ZM13 9V7H15V9H13ZM17 13V11H19V13H17ZM17 9V7H19V9H17ZM11 13V11H9V13H11ZM11 9V7H9V9H11ZM7 13V11H5V13H7ZM7 9V7H5V9H7ZM21 3H3C1.9 3 1 3.9 1 5V19C1 20.1 1.9 21 3 21H21C22.1 21 23 20.1 23 19V5C23 3.9 22.1 3 21 3ZM21 19H3V5H21V19Z",fill:"currentColor"}))},y=e=>{let{size:t=11,color:n="#fff"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"3",strokeLinecap:"round"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))},h=e=>{let{icon:t,topAligned:n=!1,inputStyle:l={},...r}=e;return a.createElement("div",{style:{position:"relative",width:"100%"}},a.createElement("div",{style:{position:"absolute",left:"10px",...n?{top:"14px"}:{top:"50%",transform:"translateY(-50%)"},zIndex:1,opacity:.45,display:"flex",pointerEvents:"none"}},t),a.createElement(o.TextInput,v({textInputStyle:{paddingLeft:"36px",paddingRight:"12px",...l}},r)))},A=e=>{let{icon:t,label:n}=e;return a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"16px",marginTop:"4px"}},a.createElement("div",{style:{opacity:.5,display:"flex"}},t),a.createElement("span",{style:{fontSize:"15px",fontWeight:"600",color:"#0B0C0C",whiteSpace:"nowrap"}},n),a.createElement("div",{style:{flex:1,height:"1px",background:"#EAECF0"}}))},x=e=>{var r,i,s,c,d;let{isSection:E=!1,onComplete:m,parentState:p}=e;const{t:u}=n.useTranslation(),v=l.useHistory(),x=l.useLocation(),N=p||x.state||{kNumber:"EKYC-1234567890",selectedOption:{code:"SELF",name:"EKYC_SELF"},connectionDetails:null,initialData:{}},b=N.initialData||{},T=(null===(r=N.connectionDetails)||void 0===r?void 0:r.addressDetails)||{},[I,R]=t.useState(()=>g("EKYC_ADDRESS_TYPE",{code:"AADHAAR",name:"EKYC_AADHAAR_ADDRESS"})),[O,Y]=t.useState(()=>g("EKYC_ADDRESS_CORRECT",{code:"NO",name:"CORE_COMMON_NO"})),[D,K]=t.useState(()=>sessionStorage.getItem("EKYC_FULL_ADDRESS")||b.fullAddress||""),[L,P]=t.useState(()=>sessionStorage.getItem("EKYC_FLAT_NO")||b.flatNo||""),[k,F]=t.useState(()=>sessionStorage.getItem("EKYC_BUILDING")||b.building||""),[M,B]=t.useState(()=>sessionStorage.getItem("EKYC_LANDMARK")||b.landmark||""),[w,U]=t.useState(()=>sessionStorage.getItem("EKYC_PINCODE")||b.pincode||""),[H,z]=t.useState(()=>sessionStorage.getItem("EKYC_DOOR_PHOTO")||null),[W,V]=t.useState(()=>sessionStorage.getItem("EKYC_DOOR_PHOTO_FILESTORE_ID")||null),[j,G]=t.useState(null),[X,$]=t.useState(null),[Z,J]=t.useState(null);t.useEffect(()=>{sessionStorage.setItem("EKYC_ADDRESS_TYPE",JSON.stringify(I)),sessionStorage.setItem("EKYC_ADDRESS_CORRECT",JSON.stringify(O)),sessionStorage.setItem("EKYC_FULL_ADDRESS",D),sessionStorage.setItem("EKYC_FLAT_NO",L),sessionStorage.setItem("EKYC_BUILDING",k),sessionStorage.setItem("EKYC_LANDMARK",M),sessionStorage.setItem("EKYC_PINCODE",w),H&&sessionStorage.setItem("EKYC_DOOR_PHOTO",H),W&&sessionStorage.setItem("EKYC_DOOR_PHOTO_FILESTORE_ID",W),sessionStorage.setItem("EKYC_CURRENT_STEP","ADDRESS")},[I,O,D,L,k,M,w,H,W]),t.useEffect(()=>{!function(){try{$(null);const e=function(){if(j){const e=function(){if(j.size>=2e6)$(u("EKYC_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),J({type:"error",message:u("EKYC_MAXIMUM_UPLOAD_SIZE_EXCEEDED")});else{const e=C(function(){return J({type:"info",message:u("EKYC_UPLOADING")}),Promise.resolve(function(e,t){try{return e?Promise.resolve(Digit.UploadServices.Filestorage("EKYC",e,t)).then(function(e){var t,a,n;return(null==e||null===(t=e.data)||void 0===t||null===(a=t.files)||void 0===a||null===(n=a[0])||void 0===n?void 0:n.fileStoreId)||null}):Promise.resolve(null)}catch(e){return Promise.reject(e)}}(j,ee)).then(function(e){if(e){V(e);const t=new FileReader;t.onloadend=()=>z(t.result),t.readAsDataURL(j),J({type:"success",message:u("EKYC_UPLOAD_SUCCESS")})}else $(u("EKYC_FILE_UPLOAD_ERROR")),J({type:"error",message:u("EKYC_FILE_UPLOAD_ERROR")})})},function(){$(u("EKYC_FILE_UPLOAD_ERROR")),J({type:"error",message:u("EKYC_FILE_UPLOAD_ERROR")})});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[j]);const[q,Q]=t.useState(!1),ee=(t.useRef(null),Digit.ULBService.getCurrentTenantId()),{data:te,isLoading:ae}=Digit.Hooks.useCommonMDMS(ee,"egov-location",["TenantBoundary"]),ne=(null==te?void 0:te.MdmsRes)||te,le=(null==ne||null===(i=ne["egov-location"])||void 0===i||null===(s=i.TenantBoundary)||void 0===s?void 0:s.find(e=>"ADMIN"===e.hierarchyType.code))||(null==ne||null===(c=ne["egov-location"])||void 0===c||null===(d=c.TenantBoundary)||void 0===d?void 0:d[0]),oe=null==le?void 0:le.boundary,re=e=>{if(!e)return[];let t=[];for(const n of e){var a;const e=(n.label||n.name||"").toLowerCase().replace(/_/g," ");"assembly constituency"!==e&&"assemblyconstituency"!==e||t.push({code:n.code,name:n.name,children:n.children}),null!==(a=n.children)&&void 0!==a&&a.length&&t.push(...re(n.children))}return t},ie=e=>{if(!e)return[];let t=[];for(const n of e){var a;"block"===(n.label||n.name||"").toLowerCase().replace(/_/g," ")&&t.push({code:n.code,name:n.name}),null!==(a=n.children)&&void 0!==a&&a.length&&t.push(...ie(n.children))}return t},se=re(Array.isArray(oe)?oe:oe?[oe]:[]),[ce,de]=t.useState(()=>g("EKYC_ASSEMBLY_DATA",b.assembly?{name:b.assembly}:null)),[Ee,me]=t.useState(()=>g("EKYC_WARD_DATA",b.ward?{name:b.ward}:null));t.useEffect(()=>{sessionStorage.setItem("EKYC_ASSEMBLY_DATA",JSON.stringify(ce)),sessionStorage.setItem("EKYC_WARD_DATA",JSON.stringify(Ee))},[ce,Ee]),t.useEffect(()=>{if(ne&&T.assembly&&(null==ce||!ce.code)){const e=se.find(e=>e.name===T.assembly||e.code===T.assembly);e&&de(e)}},[ne,se]);const pe=ce?ie(ce.children):[];t.useEffect(()=>{ce&&Ee&&!pe.find(e=>e.name===Ee.name)&&me(null)},[ce]);const ue=[{code:"AADHAAR",name:"EKYC_AADHAAR_ADDRESS"},{code:"OLD",name:"EKYC_OLD_ADDRESS"}],ve=[{code:"YES",name:"CORE_COMMON_YES"},{code:"NO",name:"CORE_COMMON_NO"}],ge=()=>{const e={addressType:I,fullAddress:D,flatNo:L,building:k,landmark:M,pincode:w,doorPhoto:H,doorPhotoFileStoreId:W,assembly:null==ce?void 0:ce.name,ward:null==Ee?void 0:Ee.name};if(m)m(e);else{const{kNumber:t,selectedOption:a,connectionDetails:n,initialData:l}=N;v.push("/digit-ui/employee/ekyc/property-info",{kNumber:t,selectedOption:a,connectionDetails:n,addressDetails:e,initialData:l})}};function Ce(e){V(null),G(e.target.files[0])}const _e=()=>{z(null),V(null),G(null)},fe=()=>{"geolocation"in navigator?(Q(!0),navigator.geolocation.getCurrentPosition(function(e){let{coords:{latitude:t,longitude:a}}=e;try{return Promise.resolve(function(e,n){try{var l=C(function(){return Promise.resolve(fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${t}&lon=${a}&zoom=18&addressdetails=1`)).then(function(e){if(!e.ok)throw new Error("Geocode failed");return Promise.resolve(e.json()).then(function(e){if(null!=e&&e.address){const t=e.address;K([t.amenity,t.road,t.neighbourhood,t.suburb,t.city,t.state,t.postcode].filter(Boolean).join(", ")),U(t.postcode||""),B(t.suburb||t.neighbourhood||""),P(t.amenity||"")}})})},function(e){console.error("Reverse geocode error:",e)})}catch(e){return n(!0,e)}return l&&l.then?l.then(n.bind(null,!1),n.bind(null,!0)):n(!1,l)}(0,function(e,t){if(Q(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}},e=>{console.error("Geolocation error:",e),Q(!1),alert(u("LOCATION_FETCH_FAILED"))},{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})):alert(u("GEOLOCATION_NOT_SUPPORTED"))},Se=()=>a.createElement("div",{style:{animation:"fadeSlideIn 0.3s ease"}},a.createElement(A,{icon:a.createElement(o.LocationIcon,{className:"icon",styles:{fill:"#0B0C0C",width:"16px",height:"16px"}}),label:u("EKYC_ADDRESS_DETAILS_HEADER")}),a.createElement("div",{style:{marginBottom:"20px"}},a.createElement(o.RadioButtons,{options:ue,optionsKey:"name",selectedOption:I,onSelect:R,t:u,innerStyles:{display:"flex",alignItems:"center"},style:{display:"flex",gap:"40px"}})),"AADHAAR"===I.code&&a.createElement("div",{style:{backgroundColor:"#E1F5EE",border:"0.5px solid #5DCAA5",borderRadius:"8px",padding:"14px 16px",display:"flex",alignItems:"flex-start",gap:"12px",marginBottom:"20px",animation:"fadeSlideIn 0.3s ease"}},a.createElement("div",{style:{backgroundColor:"#9FE1CB",padding:"6px",borderRadius:"6px",display:"flex",flexShrink:0}},a.createElement(o.LocationIcon,{className:"icon",styles:{fill:"#085041",width:"16px",height:"16px"}})),a.createElement("div",{style:{fontSize:"14px",lineHeight:"1.6",color:"#04342C",fontWeight:"500"}},T.fullAddress)),"OLD"===I.code&&a.createElement("div",{style:{animation:"fadeSlideIn 0.3s ease"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"14px"}},a.createElement(o.CardLabel,{style:{fontWeight:"500",marginBottom:0,fontSize:"13px",color:"#505A5F"}},u("EKYC_ADDRESS_CORRECTION_PROMPT")),a.createElement(o.RadioButtons,{options:ve,optionsKey:"name",selectedOption:O,onSelect:Y,t:u,innerStyles:{display:"flex",gap:"20px"},style:{marginBottom:0}})),a.createElement("div",{onClick:q?void 0:fe,style:{border:"0.5px solid #D0D5DD",borderRadius:"8px",padding:"12px 16px",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px",cursor:q?"not-allowed":"pointer",backgroundColor:q?"#F9FAFB":"#fff",transition:"background 0.15s",opacity:q?.7:1},onMouseOver:e=>{q||(e.currentTarget.style.background="#F9FAFB")},onMouseOut:e=>{q||(e.currentTarget.style.background="#fff")}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},a.createElement("div",{style:{backgroundColor:"#E6F1FB",padding:"7px",borderRadius:"7px",display:"flex"}},q?a.createElement("div",{style:{width:"18px",height:"18px",border:"2px solid #185FA5",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 1s linear infinite"}}):a.createElement(f,{size:18})),a.createElement("span",{style:{fontWeight:"500",fontSize:"14px",color:"#344054"}},u(q?"EKYC_FETCHING_LOCATION":"EKYC_USE_CURRENT_LOCATION"))),!q&&a.createElement("span",{style:{fontSize:"18px",color:"#98A2B3",lineHeight:1}},"›")),a.createElement("div",{style:{marginBottom:"14px"}},a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},u("EKYC_FULL_ADDRESS")),a.createElement(h,{icon:a.createElement(o.PropertyHouse,{styles:{fill:"#0068fa",width:"15px",height:"15px"}}),topAligned:!0,value:D,onChange:e=>K(e.target.value),placeholder:u("EKYC_ENTER_FULL_ADDRESS"),inputStyle:{minHeight:"72px"}})),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"14px"}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},u("EKYC_FLAT_HOUSE_NUMBER")),a.createElement(h,{icon:a.createElement(o.PropertyHouse,{styles:{fill:"#0068fa",width:"15px",height:"15px"}}),value:L,onChange:e=>P(e.target.value),placeholder:u("EKYC_ENTER_FLAT_NO")})),a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},u("EKYC_BUILDING_TOWER")),a.createElement(h,{icon:a.createElement(o.PropertyHouse,{styles:{fill:"#0068fa",width:"15px",height:"15px"}}),value:k,onChange:e=>F(e.target.value),placeholder:u("EKYC_ENTER_BUILDING")}))),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"4px"}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},u("EKYC_LANDMARK")),a.createElement(h,{icon:a.createElement(o.LocationIcon,{className:"icon",styles:{fill:"#0068fa",width:"15px",height:"15px"}}),value:M,onChange:e=>B(e.target.value),placeholder:u("EKYC_ENTER_LANDMARK")})),a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},u("EKYC_PINCODE")),a.createElement(h,{icon:a.createElement(S,{size:15}),value:w,onChange:e=>{/^\d*$/.test(e.target.value)&&U(e.target.value)},placeholder:u("EKYC_ENTER_PINCODE"),maxLength:6})))),a.createElement("hr",{style:{margin:"24px 0",border:0,borderTop:"1px solid #EAECF0"}}),a.createElement(A,{icon:a.createElement(o.PropertyHouse,{styles:{fill:"#0B0C0C",width:"16px",height:"16px"}}),label:u("EKYC_ADMINISTRATIVE_DIVISION")}),ae?a.createElement(o.Loader,null):a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"24px"}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},u("EKYC_ASSEMBLY")),a.createElement(o.Dropdown,{option:se,optionKey:"name",selected:ce,select:e=>{de(e),me(null)},t:u})),a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},u("EKYC_WARD")||"Block"),a.createElement(o.Dropdown,{option:pe,optionKey:"name",selected:Ee,select:me,disabled:!ce,t:u}))),a.createElement("hr",{style:{margin:"24px 0",border:0,borderTop:"1px solid #EAECF0"}}),a.createElement(A,{icon:a.createElement(_,{size:16}),label:u("EKYC_CAPTURE_DOOR_IMAGE")}),a.createElement("div",{style:{fontSize:"12px",color:"#667085",marginBottom:"12px"}},u("EKYC_REQUIRED_FOR_VERIFICATION")),a.createElement(o.UploadFile,{id:"ekyc-door-photo",extraStyleName:"propertyCreate",accept:".jpg,.png,.jpeg",onUpload:Ce,onDelete:_e,message:W?"1 "+u("EKYC_ACTION_FILEUPLOADED"):u("EKYC_ACTION_NO_FILEUPLOADED"),error:X}),H&&a.createElement("div",{style:{marginTop:"10px",borderRadius:"8px",overflow:"hidden",border:"1px solid #EAECF0"}},a.createElement("img",{src:H,alt:"Door Preview",style:{width:"100%",maxHeight:"250px",objectFit:"cover"}})),E?a.createElement("div",{style:{marginTop:"24px"}},a.createElement(o.SubmitBar,{label:u("ES_COMMON_SAVE_CONTINUE"),onSubmit:ge})):a.createElement(o.ActionBar,null,a.createElement(o.SubmitBar,{label:u("EKYC_COMPLETE_VERIFICATION"),onSubmit:ge})),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",marginTop:"16px",fontSize:"11px",color:"#98A2B3"}},a.createElement("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},a.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),a.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})),u("EKYC_SECURE_DATA_NOTICE")),Z&&a.createElement(o.Toast,{label:Z.message,error:"error"===Z.type,info:"info"===Z.type,success:"success"===Z.type,onClose:()=>J(null)}));return E?a.createElement(t.Fragment,null,a.createElement("hr",{style:{margin:"32px 0",border:0,borderTop:"2px solid #EAECF0"}}),Se()):a.createElement("div",{className:"inbox-container"},a.createElement("style",null,"\n @keyframes spin { to { transform: rotate(360deg); } }\n @keyframes fadeSlideIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }\n "),a.createElement("div",{className:"filters-container"},a.createElement(o.Card,{style:{display:"flex",alignItems:"center",padding:"12px 16px",marginBottom:"12px",borderRadius:"8px"}},a.createElement("div",{style:{color:"#185FA5",marginRight:"10px",display:"flex"}},a.createElement(o.HomeIcon,{style:{width:"20px",height:"20px"}})),a.createElement("div",{style:{fontWeight:"600",fontSize:"15px",color:"#0B0C0C"}},u("EKYC_PROCESS")||"eKYC Process")),a.createElement("div",{style:{background:"#fff",padding:"16px 14px",borderRadius:"8px",border:"1px solid #EAECF0"}},[{label:u("EKYC_STEP_AADHAAR")||"Aadhaar",done:!0,active:!1},{label:u("EKYC_STEP_ADDRESS")||"Address",done:!1,active:!0},{label:u("EKYC_STEP_PROPERTY")||"Property",done:!1,active:!1},{label:u("EKYC_STEP_METER")||"Meter",done:!1,active:!1},{label:u("EKYC_STEP_REVIEW")||"Review",done:!1,active:!1}].map((e,t)=>a.createElement("div",{key:t,style:{display:"flex",gap:"10px",alignItems:"flex-start",position:"relative",paddingBottom:t<4?"18px":0}},t<4&&a.createElement("div",{style:{position:"absolute",left:"10px",top:"22px",width:"1px",height:"calc(100% - 10px)",background:"#EAECF0"}}),a.createElement("div",{style:{width:"20px",height:"20px",borderRadius:"50%",flexShrink:0,marginTop:"1px",border:e.done?"none":e.active?"1.5px solid #185FA5":"1.5px solid #D0D5DD",background:e.done?"#0F6E56":e.active?"#E6F1FB":"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontWeight:"500",color:e.done?"#fff":e.active?"#185FA5":"#98A2B3"}},e.done?a.createElement(y,{size:11,color:"#fff"}):t+1),a.createElement("div",{style:{fontSize:"12px",paddingTop:"2px",color:e.done?"#0F6E56":e.active?"#0B0C0C":"#667085",fontWeight:e.done||e.active?"600":"400"}},e.label))))),a.createElement("div",{style:{flex:1,marginLeft:"16px"}},a.createElement(o.Card,null,a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"}},a.createElement(o.CardHeader,{style:{margin:0,fontSize:"18px"}},u("EKYC_ADDRESS_DETAILS_HEADER")||"Address Details"),a.createElement("div",{style:{background:"#F9FAFB",border:"0.5px solid #EAECF0",borderRadius:"20px",padding:"4px 14px",fontSize:"12px",color:"#667085"}},u("EKYC_K_NUMBER")||"K Number",":"," ",a.createElement("span",{style:{color:"#0B0C0C",fontWeight:"600"}},null==N?void 0:N.kNumber))),Se())))},N=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"},a.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),a.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}))},b=e=>{let{size:t=16,color:n="currentColor"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"1.8",strokeLinecap:"round"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"}))},T=e=>{let{size:t=16,color:n="currentColor"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"1.8",strokeLinecap:"round"},a.createElement("path",{d:"M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-5.37-5.37 19.79 19.79 0 01-3.07-8.63A2 2 0 014.82 0h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.91 7.91a16 16 0 006.16 6.16l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z"}))},I=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413z",fill:"#25D366"}),a.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12c0 1.89.525 3.66 1.438 5.168L2 22l4.832-1.438A9.96 9.96 0 0012 22c5.523 0 10-4.477 10-10S17.523 2 12 2z",stroke:"#25D366",strokeWidth:"1.8",strokeLinecap:"round"}))},R=e=>{let{size:t=16,color:n="currentColor"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"1.8",strokeLinecap:"round"},a.createElement("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"}),a.createElement("path",{d:"M22 6l-10 7L2 6"}))},O=e=>{let{size:t=16,color:n="currentColor"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"1.8",strokeLinecap:"round"},a.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"9",cy:"7",r:"4"}),a.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75"}))},Y=e=>{let{size:t=15,color:n="#1D9E75"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2.8",strokeLinecap:"round"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))},D=e=>{let{icon:t,rightIcon:n,inputStyle:l={},...r}=e;return a.createElement("div",{style:{position:"relative",width:"100%"}},a.createElement("div",{style:{position:"absolute",left:"10px",top:"50%",transform:"translateY(-50%)",zIndex:1,opacity:.45,display:"flex",pointerEvents:"none"}},t),a.createElement(o.TextInput,v({textInputStyle:{paddingLeft:"36px",paddingRight:n?"36px":"12px",...l}},r)),n&&a.createElement("div",{style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)",display:"flex"}},n))},K=e=>{let{icon:t,label:n}=e;return a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"16px",marginTop:"4px"}},a.createElement("div",{style:{opacity:.5,display:"flex"}},t),a.createElement("span",{style:{fontSize:"15px",fontWeight:"600",color:"#0B0C0C",whiteSpace:"nowrap"}},n),a.createElement("div",{style:{flex:1,height:"1px",background:"#EAECF0"}}))},L=e=>{let{label:t,selected:n,onSelect:l,t:r,options:i}=e;return a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"}},a.createElement(o.CardLabel,{style:{fontWeight:"500",marginBottom:0,fontSize:"13px",color:"#505A5F"}},t),a.createElement(o.RadioButtons,{options:i,optionsKey:"name",selectedOption:n,onSelect:l,t:r,innerStyles:{display:"flex",gap:"20px",alignItems:"center"},style:{display:"flex",gap:"20px",marginBottom:0}}))},P=()=>{const{t:e}=n.useTranslation(),r=l.useLocation(),i=l.useHistory(),s=t.useRef(null),{kNumber:c,selectedOption:d,connectionDetails:E}=r.state||{kNumber:"EKYC-1234567890",selectedOption:{code:"SELF",name:"EKYC_SELF"},connectionDetails:{connectionDetailsInfo:{consumerName:"Rajesh Kumar Singh",address:"House No. 45, Sector 12, New Delhi - 110001",phoneNumber:"9876543210",email:"rajesh.singh@example.com"}}},m=(null==E?void 0:E.connectionDetails)||(null==E?void 0:E.connectionDetailsInfo)||{},[p]=t.useState(()=>{var e,t,a,n,l,o,r,i,s,c,d,p,u;return g("EKYC_INITIAL_DATA",{userName:m.consumerName||"",mobileNumber:m.phoneNumber||"",whatsappNumber:m.phoneNumber||"",email:m.email||"",noOfPersons:(null==E||null===(e=E.addressDetails)||void 0===e?void 0:e.noOfPerson)||"",pidNumber:(null==E||null===(t=E.propertyDetails)||void 0===t?void 0:t.pidNumber)||"",typeOfConnection:(null==E||null===(a=E.connectionDetails)||void 0===a?void 0:a.connectionType)||"",connectionCategory:(null==E||null===(n=E.connectionDetails)||void 0===n?void 0:n.connectionCategory)||"",userType:(null==E||null===(l=E.propertyDetails)||void 0===l?void 0:l.userType)||"",noOfFloor:(null==E||null===(o=E.propertyDetails)||void 0===o?void 0:o.noOfFloor)||null,fullAddress:(null==E||null===(r=E.addressDetails)||void 0===r?void 0:r.fullAddress)||"",flatNo:(null==E||null===(i=E.addressDetails)||void 0===i?void 0:i.flatHouseNumber)||"",building:(null==E||null===(s=E.addressDetails)||void 0===s?void 0:s.buildingTower)||"",landmark:(null==E||null===(c=E.addressDetails)||void 0===c?void 0:c.landmark)||"",pincode:(null==E||null===(d=E.addressDetails)||void 0===d?void 0:d.pinCode)||"",assembly:(null==E||null===(p=E.addressDetails)||void 0===p?void 0:p.assembly)||"",ward:(null==E||null===(u=E.addressDetails)||void 0===u?void 0:u.ward)||""})});t.useEffect(()=>{sessionStorage.setItem("EKYC_INITIAL_DATA",JSON.stringify(p))},[p]);const[u,v]=t.useState(()=>sessionStorage.getItem("EKYC_AADHAAR_LAST_FOUR")||""),[C,_]=t.useState(()=>"true"===sessionStorage.getItem("EKYC_AADHAAR_VERIFIED")),[f,S]=t.useState(!1),[y,h]=t.useState(!1),[A,P]=t.useState(""),[k,F]=t.useState(!1),[M,B]=t.useState(()=>g("EKYC_NAME_CORRECT",{code:"NO",name:"CORE_COMMON_NO"})),[w,U]=t.useState(()=>sessionStorage.getItem("EKYC_USER_NAME")||p.userName),[H,z]=t.useState(()=>g("EKYC_MOBILE_CHANGE",{code:"NO",name:"CORE_COMMON_NO"})),[W,V]=t.useState(()=>sessionStorage.getItem("EKYC_MOBILE_NUMBER")||p.mobileNumber),[j,G]=t.useState(()=>sessionStorage.getItem("EKYC_WHATSAPP_NUMBER")||p.whatsappNumber),[X,$]=t.useState(()=>sessionStorage.getItem("EKYC_EMAIL")||p.email),[Z,J]=t.useState(()=>sessionStorage.getItem("EKYC_NO_OF_PERSONS")||p.noOfPersons);t.useEffect(()=>{sessionStorage.setItem("EKYC_AADHAAR_LAST_FOUR",u),sessionStorage.setItem("EKYC_AADHAAR_VERIFIED",C),sessionStorage.setItem("EKYC_NAME_CORRECT",JSON.stringify(M)),sessionStorage.setItem("EKYC_USER_NAME",w),sessionStorage.setItem("EKYC_MOBILE_CHANGE",JSON.stringify(H)),sessionStorage.setItem("EKYC_MOBILE_NUMBER",W),sessionStorage.setItem("EKYC_WHATSAPP_NUMBER",j),sessionStorage.setItem("EKYC_EMAIL",X),sessionStorage.setItem("EKYC_NO_OF_PERSONS",Z),sessionStorage.setItem("EKYC_CURRENT_STEP","AADHAAR")},[u,C,M,w,H,W,j,X,Z]);const[q,Q]=t.useState(!1),[ee,te]=t.useState(null),ae=[{code:"YES",name:"CORE_COMMON_YES"},{code:"NO",name:"CORE_COMMON_NO"}],ne={verifiedInput:{borderColor:"#1D9E75",backgroundColor:"#E1F5EE"},verifiedCard:{backgroundColor:"#E1F5EE",border:"0.5px solid #5DCAA5",borderRadius:"8px",padding:"16px",marginTop:"14px",marginBottom:"4px",animation:"fadeSlideIn 0.35s ease"},infoLabel:{fontSize:"11px",fontWeight:"600",color:"#1D9E75",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:"3px"},infoValue:{fontSize:"14px",fontWeight:"500",color:"#04342C"},twoCol:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"20px"},optionalTag:{display:"inline-block",fontSize:"10px",background:"#F1EFE8",color:"#5F5E5A",border:"0.5px solid #D3D1C7",borderRadius:"10px",padding:"1px 7px",marginLeft:"6px",fontWeight:"400"}};return a.createElement("div",{className:"inbox-container"},a.createElement("style",null,"\n @keyframes fadeSlideIn {\n from { opacity: 0; transform: translateY(6px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes pulseGreen {\n 0%, 100% { box-shadow: 0 0 0 0 rgba(29,158,117,0.35); }\n 50% { box-shadow: 0 0 0 6px rgba(29,158,117,0); }\n }\n .ekyc-sidebar-step { display: flex; gap: 10px; align-items: flex-start; position: relative; padding-bottom: 18px; }\n .ekyc-sidebar-step:last-child { padding-bottom: 0; }\n .ekyc-step-line { position: absolute; left: 10px; top: 22px; width: 1px; height: calc(100% - 10px); background: #EAECF0; }\n .ekyc-step-dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #D0D5DD; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 500; color: #98A2B3; background: #fff; flex-shrink: 0; margin-top: 1px; }\n .ekyc-step-dot.active { border-color: #185FA5; color: #185FA5; background: #E6F1FB; }\n .ekyc-step-dot.done { border-color: #0F6E56; background: #0F6E56; color: #fff; }\n .ekyc-step-label { font-size: 12px; color: #667085; padding-top: 2px; }\n .ekyc-step-label.active { color: #0B0C0C; font-weight: 600; }\n .ekyc-step-label.done { color: #0F6E56; }\n .ekyc-field-label { font-size: 11px; font-weight: 600; color: #667085; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }\n "),a.createElement("div",{className:"filters-container"},a.createElement(o.Card,{style:{display:"flex",alignItems:"center",padding:"12px 16px",marginBottom:"12px",borderRadius:"8px"}},a.createElement("div",{style:{color:"#185FA5",marginRight:"10px",display:"flex"}},a.createElement(o.HomeIcon,{style:{width:"20px",height:"20px"}})),a.createElement("div",{style:{fontWeight:"600",fontSize:"15px",color:"#0B0C0C"}},e("EKYC_PROCESS")||"eKYC Process")),a.createElement("div",{style:{background:"#fff",padding:"16px 14px",borderRadius:"8px",border:"1px solid #EAECF0"}},[{label:e("EKYC_STEP_AADHAAR")||"Aadhaar",done:q,active:!q},{label:e("EKYC_STEP_ADDRESS")||"Address",done:null!==ee,active:q&&null===ee},{label:e("EKYC_STEP_PROPERTY")||"Property",done:!1,active:!1},{label:e("EKYC_STEP_METER")||"Meter",done:!1,active:!1},{label:e("EKYC_STEP_REVIEW")||"Review",done:!1,active:!1}].map((e,t)=>a.createElement("div",{className:"ekyc-sidebar-step",key:t},a.createElement("div",{className:"ekyc-step-dot"+(e.done?" done":e.active?" active":"")},e.done?a.createElement(Y,{size:11,color:"#fff"}):t+1),t<4&&a.createElement("div",{className:"ekyc-step-line"}),a.createElement("div",{className:"ekyc-step-label"+(e.done?" done":e.active?" active":"")},e.label))))),a.createElement("div",{style:{flex:1,marginLeft:"16px"}},a.createElement(o.Card,null,a.createElement("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:"20px"}},a.createElement("div",{style:{background:"#F9FAFB",border:"0.5px solid #EAECF0",borderRadius:"20px",padding:"4px 14px",fontSize:"12px",color:"#667085"}},e("EKYC_K_NUMBER")||"K Number",":"," ",a.createElement("span",{style:{color:"#0B0C0C",fontWeight:"600"}},c))),a.createElement(K,{icon:a.createElement(N,{size:16}),label:e("EKYC_AADHAAR_NUMBER_HEADER")||"Aadhaar Number"}),a.createElement("div",{className:"ekyc-field-label"},e("EKYC_LAST_4_DIGIT_AADHAAR")||"Enter 12 digits of Aadhaar"),a.createElement(o.LabelFieldPair,null,a.createElement("div",{className:"field"},a.createElement(D,{icon:a.createElement(N,{size:15}),rightIcon:C?a.createElement(Y,{size:15}):null,value:u,onChange:e=>{const t=e.target.value;t.length<=12&&/^\d*$/.test(t)&&v(t)},placeholder:e("EKYC_ENTER_LAST_4_DIGIT")||"Enter 12 digits",maxLength:12,disabled:C,inputStyle:C?ne.verifiedInput:{}}))),!C&&!y&&a.createElement(o.SubmitBar,{label:f?e("EKYC_VERIFYING")||"Verifying...":e("EKYC_VERIFY_AADHAAR_BTN")||"Verify Aadhaar",onSubmit:()=>{12!==u.length||f||(S(!0),setTimeout(()=>{S(!1),h(!0)},1200))},disabled:12!==u.length||f,style:{marginTop:"12px"}}),!C&&y&&a.createElement(t.Fragment,null,a.createElement("div",{className:"ekyc-field-label",style:{marginTop:"16px"}},e("EKYC_ENTER_OTP")),a.createElement(o.LabelFieldPair,null,a.createElement("div",{className:"field"},a.createElement(D,{icon:a.createElement(N,{size:15}),value:A,onChange:e=>{const t=e.target.value;/^\d*$/.test(t)&&(P(t),k&&F(!1))},placeholder:e("EKYC_ENTER_OTP_PLACEHOLDER")||"Enter 123456",maxLength:6}))),k&&a.createElement("div",{style:{color:"#D4351C",fontSize:"12px",marginTop:"4px"}},e("EKYC_INVALID_OTP")||"Invalid OTP. Please enter 123456."),a.createElement(o.SubmitBar,{label:e("EKYC_VERIFY_OTP_BTN")||"Verify OTP",onSubmit:()=>{"123456"===A?(_(!0),h(!1),F(!1),Q(!0),setTimeout(()=>{var e;null===(e=s.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"})},100)):F(!0)},disabled:6!==A.length,style:{marginTop:"12px"}})),C&&a.createElement("div",{style:ne.verifiedCard},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"14px"}},a.createElement("div",{style:{width:"24px",height:"24px",borderRadius:"50%",background:"#9FE1CB",display:"flex",alignItems:"center",justifyContent:"center",animation:"pulseGreen 2s ease infinite",flexShrink:0}},a.createElement(Y,{size:13,color:"#085041"})),a.createElement("span",{style:{fontWeight:"600",color:"#085041",fontSize:"14px"}},e("EKYC_AADHAAR_VERIFIED_SUCCESS")||"Aadhaar Verified Successfully")),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"}},a.createElement("div",null,a.createElement("div",{style:ne.infoLabel},e("EKYC_NAME")||"Name"),a.createElement("div",{style:ne.infoValue},m.consumerName)),a.createElement("div",null,a.createElement("div",{style:ne.infoLabel},e("EKYC_AADHAAR")||"Aadhaar"),a.createElement("div",{style:ne.infoValue},u)),a.createElement("div",{style:{gridColumn:"span 2"}},a.createElement("div",{style:ne.infoLabel},e("EKYC_ADDRESS")||"Address"),a.createElement("div",{style:{...ne.infoValue,fontSize:"13px"}},m.address)))),a.createElement("hr",{style:{margin:"24px 0",border:0,borderTop:"1px solid #EAECF0"}}),a.createElement(K,{icon:a.createElement(b,{size:16}),label:e("EKYC_CONTACT_DETAILS_HEADER")||"Contact Details"}),a.createElement(L,{label:`${e("EKYC_USER_NAME")} (${e("EKYC_NAME_CORRECT_HINT")})`,selected:M,onSelect:B,options:ae,sty:!0,t:e}),a.createElement(o.LabelFieldPair,null,a.createElement("div",{className:"field"},a.createElement(D,{icon:a.createElement(b,{size:15,color:"YES"===M.code?"#64748b":"#94a3b8"}),style:{marginBottom:"12px"},value:w,onChange:e=>U(e.target.value),placeholder:e("EKYC_ENTER_NAME_PLACEHOLDER")||"Enter full name",disabled:"YES"!==M.code}))),a.createElement(L,{label:`${e("EKYC_USER_MOBILE_NUMBER")} (${e("EKYC_UPDATE_MOBILE_HINT")})`,selected:H,onSelect:z,options:ae,t:e}),a.createElement(o.LabelFieldPair,null,a.createElement("div",{className:"field"},a.createElement(D,{icon:a.createElement(T,{size:15,color:"YES"===H.code?"#64748b":"#94a3b8"}),style:{marginBottom:"12px"},value:W,onChange:e=>V(e.target.value),placeholder:"+91 XXXXX XXXXX",disabled:"YES"!==H.code}))),a.createElement("div",{style:ne.twoCol},a.createElement("div",null,a.createElement("div",{className:"ekyc-field-label"},e("EKYC_WHATSAPP_NUMBER")||"WhatsApp Number",a.createElement("span",{style:ne.optionalTag},e("EKYC_OPTIONAL")||"Optional")),a.createElement(D,{icon:a.createElement(I,{size:15}),value:j,onChange:e=>G(e.target.value),placeholder:"+91 XXXXX XXXXX"})),a.createElement("div",null,a.createElement("div",{className:"ekyc-field-label"},e("EKYC_EMAIL_ADDRESS")||"Email Address",a.createElement("span",{style:ne.optionalTag},e("EKYC_OPTIONAL")||"Optional")),a.createElement(D,{icon:a.createElement(R,{size:15}),value:X,onChange:e=>$(e.target.value),placeholder:e("EKYC_EMAIL_ADDRESS_PLACEHOLDER")||"example@email.com"}))),a.createElement("hr",{style:{margin:"24px 0",border:0,borderTop:"1px solid #EAECF0"}}),a.createElement(K,{icon:a.createElement(O,{size:16}),label:e("EKYC_FAMILY_DETAILS_HEADER")||"Family Details"}),a.createElement("div",{className:"ekyc-field-label"},e("EKYC_NO_OF_PERSONS")||"Number of Family Members"),a.createElement(o.LabelFieldPair,null,a.createElement("div",{className:"field"},a.createElement(D,{icon:a.createElement(O,{size:15}),value:Z,onChange:e=>{/^\d*$/.test(e.target.value)&&J(e.target.value)},placeholder:e("EKYC_ENTER_NO_OF_PERSONS")||"Enter total number of persons"}))),!q&&a.createElement("div",{style:{marginTop:"24px"}},a.createElement(o.SubmitBar,{label:e("ES_COMMON_SAVE_CONTINUE")||"Save & Continue",onSubmit:()=>{Q(!0),setTimeout(()=>{var e;null===(e=s.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"})},100)}})),q&&a.createElement("div",{ref:s},a.createElement(x,{isSection:!0,onComplete:e=>{te(e),i.push("/digit-ui/employee/ekyc/property-info",{kNumber:c,selectedOption:d,connectionDetails:E,aadhaarDetails:{aadhaarLastFour:u,isAadhaarVerified:C,userName:w,mobileNumber:W,whatsappNumber:j,email:X,noOfPersons:Z},addressDetails:e,initialData:p})},parentState:{kNumber:c,selectedOption:d,connectionDetails:E}})),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",marginTop:"20px",fontSize:"11px",color:"#98A2B3"}},a.createElement(N,{size:11}),e("EKYC_SECURE_DATA_NOTICE")||"Your data is encrypted and secure"))))},k=e=>{let{size:t=11,color:n="#fff"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"3",strokeLinecap:"round"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))},F=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8V9h8v10zm-2-8h-4v2h4v-2zm0 4h-4v2h4v-2z"}))},M=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M20 6H16V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-2 .89-2 2v13c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-6-2v2h-4V4h4z"}))},B=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13z"}))},w=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},a.createElement("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),a.createElement("path",{d:"M7 8h5M7 12h8M7 16h4"}))},U=e=>{let{icon:t,label:n}=e;return a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"16px",marginTop:"4px"}},a.createElement("div",{style:{opacity:.5,display:"flex"}},t),a.createElement("span",{style:{fontSize:"15px",fontWeight:"600",color:"#0B0C0C",whiteSpace:"nowrap"}},n),a.createElement("div",{style:{flex:1,height:"1px",background:"#EAECF0"}}))},H=e=>{let{icon:t,...n}=e;return a.createElement("div",{style:{position:"relative",width:"100%"}},a.createElement("div",{style:{position:"absolute",left:"10px",top:"50%",transform:"translateY(-50%)",zIndex:1,opacity:.45,display:"flex",pointerEvents:"none"}},t),a.createElement(o.TextInput,v({textInputStyle:{paddingLeft:"36px",paddingRight:"12px"}},n)))},z=()=>{var e,r,i,s,c,d,E,m;const{t:p}=n.useTranslation(),u=l.useHistory(),v=l.useLocation().state||{kNumber:sessionStorage.getItem("EKYC_K_NUMBER")||"EKYC-1234567890",initialData:g("EKYC_INITIAL_DATA",{})},{kNumber:_}=v,f=v.initialData||g("EKYC_INITIAL_DATA",{}),S=Digit.ULBService.getCurrentTenantId(),{data:y}=Digit.Hooks.ekyc.useGetPropertyType(S),{data:h}=Digit.Hooks.ekyc.useGetConnectionTypeV2(S),{data:A}=Digit.Hooks.ekyc.useGetUserType(S),{data:x}=Digit.Hooks.ekyc.useGetFloorCount(S),[N,b]=t.useState(()=>sessionStorage.getItem("EKYC_OWNER_TYPE")||f.ownerType||"OWNER"),[T,I]=t.useState(()=>sessionStorage.getItem("EKYC_PID_NUMBER")||f.pidNumber||""),[R,O]=t.useState(()=>g("EKYC_TYPE_OF_CONNECTION_DATA",f.typeOfConnection?{label:p(f.typeOfConnection),value:f.typeOfConnection}:null)),[Y,D]=t.useState(()=>g("EKYC_CONNECTION_CATEGORY_DATA",f.connectionCategory?{label:p(f.connectionCategory),value:f.connectionCategory}:null)),[K,L]=t.useState(()=>g("EKYC_USER_TYPE_DATA",f.userType?{label:p(f.userType),value:f.userType}:null)),[P,z]=t.useState(()=>g("EKYC_NO_OF_FLOORS_DATA",f.noOfFloor?{label:p(f.noOfFloor),value:f.noOfFloor}:null)),[W,V]=t.useState(()=>sessionStorage.getItem("EKYC_PROPERTY_DOC")||null),[j,G]=t.useState(()=>sessionStorage.getItem("EKYC_PROPERTY_DOC_FILESTORE_ID")||null),[X,$]=t.useState(()=>sessionStorage.getItem("EKYC_BUILDING_PHOTO")||null),[Z,J]=t.useState(()=>sessionStorage.getItem("EKYC_BUILDING_PHOTO_FILESTORE_ID")||null),[q,Q]=t.useState(null),[ee,te]=t.useState(null),[ae,ne]=t.useState(null),[le,oe]=t.useState(null);t.useEffect(()=>{sessionStorage.setItem("EKYC_OWNER_TYPE",N),sessionStorage.setItem("EKYC_PID_NUMBER",T),sessionStorage.setItem("EKYC_TYPE_OF_CONNECTION_DATA",JSON.stringify(R)),sessionStorage.setItem("EKYC_CONNECTION_CATEGORY_DATA",JSON.stringify(Y)),sessionStorage.setItem("EKYC_USER_TYPE_DATA",JSON.stringify(K)),sessionStorage.setItem("EKYC_NO_OF_FLOORS_DATA",JSON.stringify(P)),W&&sessionStorage.setItem("EKYC_PROPERTY_DOC",W),j&&sessionStorage.setItem("EKYC_PROPERTY_DOC_FILESTORE_ID",j),X&&sessionStorage.setItem("EKYC_BUILDING_PHOTO",X),Z&&sessionStorage.setItem("EKYC_BUILDING_PHOTO_FILESTORE_ID",Z),sessionStorage.setItem("EKYC_CURRENT_STEP","PROPERTY")},[N,T,R,Y,K,P,W,j,X,Z]);const re=function(e,t){try{return e?Promise.resolve(Digit.UploadServices.Filestorage("EKYC",e,t)).then(function(e){var t,a,n;return(null==e||null===(t=e.data)||void 0===t||null===(a=t.files)||void 0===a||null===(n=a[0])||void 0===n?void 0:n.fileStoreId)||null}):Promise.resolve(null)}catch(e){return Promise.reject(e)}};t.useEffect(()=>{!function(){try{ne(null);const e=function(){if(q){const e=function(){if(q.size>=5e6)ne(p("EKYC_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),oe({type:"error",message:p("EKYC_MAXIMUM_UPLOAD_SIZE_EXCEEDED")});else{const e=C(function(){return oe({type:"info",message:p("EKYC_UPLOADING")}),Promise.resolve(re(q,S)).then(function(e){e?(G(e),V(q.name),oe({type:"success",message:p("EKYC_UPLOAD_SUCCESS")})):(ne(p("EKYC_FILE_UPLOAD_ERROR")),oe({type:"error",message:p("EKYC_FILE_UPLOAD_ERROR")}))})},function(){ne(p("EKYC_FILE_UPLOAD_ERROR")),oe({type:"error",message:p("EKYC_FILE_UPLOAD_ERROR")})});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[q]),t.useEffect(()=>{!function(){try{ne(null);const e=function(){if(ee){const e=function(){if(ee.size>=2e6)ne(p("EKYC_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),oe({type:"error",message:p("EKYC_MAXIMUM_UPLOAD_SIZE_EXCEEDED")});else{const e=C(function(){return oe({type:"info",message:p("EKYC_UPLOADING")}),Promise.resolve(re(ee,S)).then(function(e){if(e){J(e);const t=new FileReader;t.onloadend=()=>$(t.result),t.readAsDataURL(ee),oe({type:"success",message:p("EKYC_UPLOAD_SUCCESS")})}else ne(p("EKYC_FILE_UPLOAD_ERROR")),oe({type:"error",message:p("EKYC_FILE_UPLOAD_ERROR")})})},function(){ne(p("EKYC_FILE_UPLOAD_ERROR")),oe({type:"error",message:p("EKYC_FILE_UPLOAD_ERROR")})});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[ee]),t.useRef(null),t.useRef(null),null==y||null===(e=y["ws-services-calculation"])||void 0===e||null===(r=e.propertyTypeV2)||void 0===r||r.map(e=>({label:p(e.code),value:e.code})),null==h||null===(i=h["ws-services-calculation"])||void 0===i||null===(s=i.connectionTypeV2)||void 0===s||s.map(e=>({label:p(e.code),value:e.code}));const ie=(null==A||null===(c=A["ws-services-calculation"])||void 0===c||null===(d=c.userTypeV2)||void 0===d?void 0:d.map(e=>({label:p(e.code),value:e.code})))||[],se=(null==x||null===(E=x["ws-services-calculation"])||void 0===E||null===(m=E.floorCount)||void 0===m?void 0:m.map(e=>({label:p(e.code),value:e.code})))||[];return a.createElement(t.Fragment,null,a.createElement("div",{className:"inbox-container"},a.createElement("style",null,"\n @keyframes fadeSlideIn {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "),a.createElement("div",{className:"filters-container"},a.createElement(o.Card,{style:{display:"flex",alignItems:"center",padding:"12px 16px",marginBottom:"12px",borderRadius:"8px"}},a.createElement("div",{style:{color:"#185FA5",marginRight:"10px",display:"flex"}},a.createElement(o.HomeIcon,{style:{width:"20px",height:"20px"}})),a.createElement("div",{style:{fontWeight:"600",fontSize:"15px",color:"#0B0C0C"}},p("EKYC_PROCESS")||"eKYC Process")),a.createElement("div",{style:{background:"#fff",padding:"16px 14px",borderRadius:"8px",border:"1px solid #EAECF0"}},[{label:p("EKYC_STEP_AADHAAR")||"Aadhaar",done:!0,active:!1},{label:p("EKYC_STEP_ADDRESS")||"Address",done:!0,active:!1},{label:p("EKYC_STEP_PROPERTY")||"Property",done:!1,active:!0},{label:p("EKYC_STEP_METER")||"Meter",done:!1,active:!1},{label:p("EKYC_STEP_REVIEW")||"Review",done:!1,active:!1}].map((e,t)=>a.createElement("div",{key:t,style:{display:"flex",gap:"10px",alignItems:"flex-start",position:"relative",paddingBottom:t<4?"18px":0}},t<4&&a.createElement("div",{style:{position:"absolute",left:"10px",top:"22px",width:"1px",height:"calc(100% - 10px)",background:"#EAECF0"}}),a.createElement("div",{style:{width:"20px",height:"20px",borderRadius:"50%",flexShrink:0,marginTop:"1px",border:e.done?"none":e.active?"1.5px solid #185FA5":"1.5px solid #D0D5DD",background:e.done?"#0F6E56":e.active?"#E6F1FB":"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontWeight:"500",color:e.done?"#fff":e.active?"#185FA5":"#98A2B3"}},e.done?a.createElement(k,{size:11,color:"#fff"}):t+1),a.createElement("div",{style:{fontSize:"12px",paddingTop:"2px",color:e.done?"#0F6E56":e.active?"#0B0C0C":"#667085",fontWeight:e.done||e.active?"600":"400"}},e.label))))),a.createElement("div",{style:{flex:1,marginLeft:"16px"}},a.createElement(o.Card,null,a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"}},a.createElement(o.CardHeader,{style:{margin:0,fontSize:"18px"}},p("EKYC_PROPERTY_DETAILS_HEADER")||"Property Details"),a.createElement("div",{style:{background:"#F9FAFB",border:"0.5px solid #EAECF0",borderRadius:"20px",padding:"4px 14px",fontSize:"12px",color:"#667085"}},p("EKYC_K_NUMBER")||"K Number",":"," ",a.createElement("span",{style:{color:"#0B0C0C",fontWeight:"600"}},_))),a.createElement("div",{style:{animation:"fadeSlideIn 0.3s ease"}},a.createElement(U,{icon:a.createElement(M,{size:16}),label:p("EKYC_PROPERTY_DETAILS")||"Property details"}),a.createElement("div",{style:{marginBottom:"20px"}},a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"8px"}},p("EKYC_PROPERTY_OWNER")||"Property owner"),a.createElement("div",{style:{display:"flex",backgroundColor:"#F2F4F7",padding:"4px",borderRadius:"10px",gap:"4px"}},["OWNER","TENANT"].map(e=>a.createElement("button",{key:e,onClick:()=>b(e),style:{flex:1,padding:"9px 12px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:"600",transition:"all 0.15s",background:N===e?"#185FA5":"transparent",color:N===e?"#fff":"#667085"}},p("EKYC_"+e)||("OWNER"===e?"Owner":"Tenant"))))),a.createElement("div",{style:{marginBottom:"20px"}},a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},p("EKYC_PID_NUMBER")||"PID number"," ",a.createElement("span",{style:{fontStyle:"italic",fontWeight:"400",textTransform:"none",color:"#98A2B3"}},"— ",p("EKYC_OPTIONAL")||"optional")),a.createElement(H,{icon:a.createElement(w,{size:15}),value:T,onChange:e=>I(e.target.value),placeholder:p("EKYC_ENTER_PID_NUMBER")||"Enter PID number"})),a.createElement("hr",{style:{margin:"24px 0",border:0,borderTop:"1px solid #EAECF0"}}),a.createElement(U,{icon:a.createElement(F,{size:16}),label:p("EKYC_BUILDING_INFO")||"Building info"}),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"14px"}}),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"24px"}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},p("EKYC_USER_TYPE")||"User type"),a.createElement(o.Dropdown,{selected:K,select:L,option:ie,optionKey:"label",t:p,placeholder:p("EKYC_SELECT")||"Select"})),a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},p("EKYC_NO_OF_FLOORS")||"No. of floors"),a.createElement(o.Dropdown,{selected:P,select:z,option:se,optionKey:"label",t:p,placeholder:p("EKYC_SELECT")||"Select"}))),a.createElement("hr",{style:{margin:"24px 0",border:0,borderTop:"1px solid #EAECF0"}}),a.createElement(U,{icon:a.createElement(B,{size:16}),label:p("EKYC_DOCUMENTS_PHOTO")||"Documents & photo"}),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"20px"}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"8px"}},p("EKYC_UPLOAD_PROPERTY_DOC")||"Upload property document"),a.createElement(o.UploadFile,{id:"ekyc-property-doc",extraStyleName:"propertyCreate",accept:".pdf",onUpload:function(e){G(null),Q(e.target.files[0])},onDelete:()=>{G(null),V(null),Q(null)},message:j?"1 "+p("EKYC_ACTION_FILEUPLOADED"):p("EKYC_ACTION_NO_FILEUPLOADED"),error:ae,disabled:!T}),!T&&a.createElement("div",{style:{fontSize:"11px",color:"#D92D20",marginTop:"4px"}},p("EKYC_ENTER_PID_FIRST_CTA")||"Enter PID to upload")),a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"8px"}},p("EKYC_CAPTURE_BUILDING_IMAGE")||"Capture building image"),a.createElement(o.UploadFile,{id:"ekyc-building-photo",extraStyleName:"propertyCreate",accept:".jpg,.png,.jpeg",onUpload:function(e){J(null),te(e.target.files[0])},onDelete:()=>{J(null),$(null),te(null)},message:Z?"1 "+p("EKYC_ACTION_FILEUPLOADED"):p("EKYC_ACTION_NO_FILEUPLOADED"),error:ae}),X&&a.createElement("div",{style:{marginTop:"10px",borderRadius:"8px",overflow:"hidden",border:"1px solid #EAECF0"}},a.createElement("img",{src:X,alt:"Building Preview",style:{width:"100%",maxHeight:"150px",objectFit:"cover"}})))),a.createElement("div",{style:{backgroundColor:"#E6F1FB",border:"0.5px solid #B5D4F4",borderRadius:"8px",padding:"12px 14px",display:"flex",alignItems:"flex-start",gap:"10px",marginBottom:"4px"}},a.createElement("div",{style:{flexShrink:0,marginTop:"1px"}},a.createElement(o.InfoBannerIcon,{fill:"#185FA5"})),a.createElement("div",{style:{fontSize:"13px",color:"#185FA5",lineHeight:"1.5"}},p("EKYC_TENANT_INFO_NOTICE")||"This section is enabled only if the user is not the owner. Tenant details will be required if tenant is selected."))),a.createElement("div",{style:{marginTop:"24px"}},a.createElement(o.SubmitBar,{label:p("EKYC_SAVE_AND_CONTINUE")||"Save & Continue",onSubmit:()=>{u.push("/digit-ui/employee/ekyc/meter-details",{...v,propertyDetails:{ownerType:N,pidNumber:T,connectionType:Y,connectionCategory:R,userType:K,noOfFloors:P,propertyDocument:W,propertyDocumentFileStoreId:j,buildingPhoto:X,buildingPhotoFileStoreId:Z},initialData:f})}})),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",marginTop:"16px",fontSize:"11px",color:"#98A2B3"}},a.createElement("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},a.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),a.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})),p("EKYC_SECURE_DATA_NOTICE")||"Your data is encrypted and secure")))),le&&a.createElement(o.Toast,{label:le.message,error:"error"===le.type,info:"info"===le.type,success:"success"===le.type,onClose:()=>oe(null)}))},W=e=>{let{size:t=11,color:n="#fff"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"3",strokeLinecap:"round"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))},V=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67V7z"}))},j=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}))},G=e=>{let{icon:t,label:n}=e;return a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"16px",marginTop:"4px"}},a.createElement("div",{style:{opacity:.5,display:"flex"}},t),a.createElement("span",{style:{fontSize:"15px",fontWeight:"600",color:"#0B0C0C",whiteSpace:"nowrap"}},n),a.createElement("div",{style:{flex:1,height:"1px",background:"#EAECF0"}}))},X=()=>{var e,r,i,s;const{t:c}=n.useTranslation(),d=l.useHistory(),E=l.useLocation(),m=E.state||{kNumber:sessionStorage.getItem("EKYC_K_NUMBER")||"EKYC-1234567890",initialData:g("EKYC_INITIAL_DATA",{})},{kNumber:p}=m,u=m.initialData||g("EKYC_INITIAL_DATA",{}),v=Digit.ULBService.getCurrentTenantId(),{data:_}=Digit.Hooks.ekyc.useGetPropertyType(v),{data:f}=Digit.Hooks.ekyc.useGetConnectionTypeV2(v),[S,y]=t.useState(()=>g("EKYC_METER_STATUS_DATA",u.meterStatus?{label:c("EKYC_METER_"+u.meterStatus),value:u.meterStatus}:null)),[h,A]=t.useState(()=>sessionStorage.getItem("EKYC_METER_PHOTO")||null),[x,N]=t.useState(()=>sessionStorage.getItem("EKYC_METER_PHOTO_FILESTORE_ID")||null),[b,T]=t.useState(()=>g("EKYC_METER_WORKING_STATUS_DATA",u.workingStatus?{label:c("EKYC_METER_"+u.workingStatus),value:u.workingStatus}:null)),[I,R]=t.useState(()=>sessionStorage.getItem("EKYC_METER_LOCATION")||u.meterLocation||""),[O,Y]=t.useState(()=>g("EKYC_LAST_BILL_RAISED_DATA",u.lastBillRaised?{label:c("EKYC_"+u.lastBillRaised),value:u.lastBillRaised}:null)),[D,K]=t.useState(()=>sessionStorage.getItem("EKYC_REASON_FOR_NO_BILL")||u.noBillReason||""),[L,P]=t.useState(()=>g("EKYC_SEWER_CONNECTION_DATA",u.sewerConnection?{label:c("EKYC_"+u.sewerConnection),value:u.sewerConnection}:null)),[k,F]=t.useState(()=>g("EKYC_TYPE_OF_CONNECTION_DATA",u.typeOfConnection?{label:c(u.typeOfConnection),value:u.typeOfConnection}:null)),[M,B]=t.useState(()=>g("EKYC_CONNECTION_CATEGORY_DATA",u.connectionCategory?{label:c(u.connectionCategory),value:u.connectionCategory}:null)),[w,U]=t.useState(null),[H,z]=t.useState(null),[X,$]=t.useState(null);t.useEffect(()=>{sessionStorage.setItem("EKYC_METER_STATUS_DATA",JSON.stringify(S)),sessionStorage.setItem("EKYC_METER_WORKING_STATUS_DATA",JSON.stringify(b)),sessionStorage.setItem("EKYC_METER_LOCATION",I),sessionStorage.setItem("EKYC_LAST_BILL_RAISED_DATA",JSON.stringify(O)),sessionStorage.setItem("EKYC_REASON_FOR_NO_BILL",D),sessionStorage.setItem("EKYC_SEWER_CONNECTION_DATA",JSON.stringify(L)),sessionStorage.setItem("EKYC_TYPE_OF_CONNECTION_DATA",JSON.stringify(k)),sessionStorage.setItem("EKYC_CONNECTION_CATEGORY_DATA",JSON.stringify(M)),h&&sessionStorage.setItem("EKYC_METER_PHOTO",h),x&&sessionStorage.setItem("EKYC_METER_PHOTO_FILESTORE_ID",x),sessionStorage.setItem("EKYC_CURRENT_STEP","METER")},[S,b,I,O,D,L,k,M,h,x]),t.useEffect(()=>{!function(){try{z(null);const e=function(){if(w){const e=function(){if(w.size>=2e6)z(c("EKYC_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),$({type:"error",message:c("EKYC_MAXIMUM_UPLOAD_SIZE_EXCEEDED")});else{const e=C(function(){return $({type:"info",message:c("EKYC_UPLOADING")}),Promise.resolve(function(e,t){try{return e?Promise.resolve(Digit.UploadServices.Filestorage("EKYC",e,t)).then(function(e){var t,a,n;return(null==e||null===(t=e.data)||void 0===t||null===(a=t.files)||void 0===a||null===(n=a[0])||void 0===n?void 0:n.fileStoreId)||null}):Promise.resolve(null)}catch(e){return Promise.reject(e)}}(w,v)).then(function(e){if(e){N(e);const t=new FileReader;t.onloadend=()=>A(t.result),t.readAsDataURL(w),$({type:"success",message:c("EKYC_UPLOAD_SUCCESS")})}else z(c("EKYC_FILE_UPLOAD_ERROR")),$({type:"error",message:c("EKYC_FILE_UPLOAD_ERROR")})})},function(){z(c("EKYC_FILE_UPLOAD_ERROR")),$({type:"error",message:c("EKYC_FILE_UPLOAD_ERROR")})});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[w]);const Z=[{label:c("EKYC_METERED"),value:"Metered"},{label:c("EKYC_UNMETERED"),value:"Unmetered"}],J=[{label:c("EKYC_WORKING"),value:"Working"},{label:c("EKYC_NOT_WORKING"),value:"Not Working"}],q=[{label:c("CORE_COMMON_YES"),value:"Yes"},{label:c("CORE_COMMON_NO"),value:"No"}],Q=(null==_||null===(e=_["ws-services-calculation"])||void 0===e||null===(r=e.propertyTypeV2)||void 0===r?void 0:r.map(e=>({label:c(e.code),value:e.code})))||[],ee=(null==f||null===(i=f["ws-services-calculation"])||void 0===i||null===(s=i.connectionTypeV2)||void 0===s?void 0:s.map(e=>({label:c(e.code),value:e.code})))||[];return a.createElement("div",{className:"inbox-container"},a.createElement("style",null,"\n @keyframes fadeSlideIn {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "),a.createElement("div",{className:"filters-container"},a.createElement(o.Card,{style:{display:"flex",alignItems:"center",padding:"12px 16px",marginBottom:"12px",borderRadius:"8px"}},a.createElement("div",{style:{color:"#185FA5",marginRight:"10px",display:"flex"}},a.createElement(o.HomeIcon,{style:{width:"20px",height:"20px"}})),a.createElement("div",{style:{fontWeight:"600",fontSize:"15px",color:"#0B0C0C"}},c("EKYC_PROCESS")||"eKYC Process")),a.createElement("div",{style:{background:"#fff",padding:"16px 14px",borderRadius:"8px",border:"1px solid #EAECF0"}},[{label:c("EKYC_STEP_AADHAAR")||"Aadhaar",done:!0,active:!1},{label:c("EKYC_STEP_ADDRESS")||"Address",done:!0,active:!1},{label:c("EKYC_STEP_PROPERTY")||"Property",done:!0,active:!1},{label:c("EKYC_STEP_METER")||"Meter",done:!1,active:!0},{label:c("EKYC_STEP_REVIEW")||"Review",done:!1,active:!1}].map((e,t)=>a.createElement("div",{key:t,style:{display:"flex",gap:"10px",alignItems:"flex-start",position:"relative",paddingBottom:t<4?"18px":0}},t<4&&a.createElement("div",{style:{position:"absolute",left:"10px",top:"22px",width:"1px",height:"calc(100% - 10px)",background:"#EAECF0"}}),a.createElement("div",{style:{width:"20px",height:"20px",borderRadius:"50%",flexShrink:0,marginTop:"1px",border:e.done?"none":e.active?"1.5px solid #185FA5":"1.5px solid #D0D5DD",background:e.done?"#0F6E56":e.active?"#E6F1FB":"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontWeight:"500",color:e.done?"#fff":e.active?"#185FA5":"#98A2B3"}},e.done?a.createElement(W,{size:11,color:"#fff"}):t+1),a.createElement("div",{style:{fontSize:"12px",paddingTop:"2px",color:e.done?"#0F6E56":e.active?"#0B0C0C":"#667085",fontWeight:e.done||e.active?"600":"400"}},e.label))))),a.createElement("div",{style:{flex:1,marginLeft:"16px"}},a.createElement(o.Card,null,a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"}},a.createElement(o.CardHeader,{style:{margin:0,fontSize:"18px"}},c("EKYC_METER_DETAILS_HEADER")||"Meter Details"),a.createElement("div",{style:{background:"#F9FAFB",border:"0.5px solid #EAECF0",borderRadius:"20px",padding:"4px 14px",fontSize:"12px",color:"#667085"}},c("EKYC_K_NUMBER")||"K Number",":"," ",a.createElement("span",{style:{color:"#0B0C0C",fontWeight:"600"}},p))),a.createElement("div",{style:{animation:"fadeSlideIn 0.3s ease"}},a.createElement(G,{icon:a.createElement(V,{size:16}),label:c("EKYC_METER_DETAILS")||"Meter details"}),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"20px"}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},c("EKYC_METER_STATUS")||"Meter status"),a.createElement(o.Dropdown,{selected:S,select:y,option:Z,optionKey:"label",t:c,placeholder:c("EKYC_SELECT")||"Select"})),"Metered"===(null==S?void 0:S.value)&&a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},c("EKYC_METER_WORKING_STATUS")||"Meter working status"),a.createElement(o.Dropdown,{selected:b,select:T,option:J,optionKey:"label",t:c,placeholder:c("EKYC_SELECT")||"Select"}))),"Metered"===(null==S?void 0:S.value)&&a.createElement(t.Fragment,null,a.createElement("div",{style:{marginBottom:"20px"}},a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"8px"}},c("EKYC_CAPTURE_METER_IMAGE")||"Capture meter image"),a.createElement(o.UploadFile,{id:"ekyc-meter-photo",extraStyleName:"propertyCreate",accept:".jpg,.png,.jpeg",onUpload:function(e){N(null),U(e.target.files[0])},onDelete:()=>{N(null),A(null),U(null)},message:x?"1 "+c("EKYC_ACTION_FILEUPLOADED"):c("EKYC_ACTION_NO_FILEUPLOADED"),error:H}),h&&a.createElement("div",{style:{marginTop:"10px",borderRadius:"8px",overflow:"hidden",border:"1px solid #EAECF0"}},a.createElement("img",{src:h,alt:"Meter Preview",style:{width:"100%",maxHeight:"150px",objectFit:"cover"}}))),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"20px"}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},c("EKYC_METER_LOCATION")||"Meter location"),a.createElement(o.TextInput,{value:I,onChange:e=>R(e.target.value),placeholder:c("EKYC_ENTER_METER_LOCATION")||"Enter location"})),a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},c("EKYC_LAST_BILL_RAISED")||"Last bill raised"),a.createElement(o.Dropdown,{selected:O,select:Y,option:q,optionKey:"label",t:c,placeholder:c("EKYC_SELECT")||"Select"}))),"No"===(null==O?void 0:O.value)&&a.createElement("div",{style:{marginBottom:"20px"}},a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},c("EKYC_REASON_FOR_NO_BILL")||"Reason for no bill"),a.createElement(o.TextInput,{value:D,onChange:e=>K(e.target.value),placeholder:c("EKYC_ENTER_REASON")||"Enter reason"}))),a.createElement("div",{style:{marginBottom:"20px"}},a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},c("EKYC_SEWER_CONNECTION")||"Sewer connection"),a.createElement("div",{style:{width:"calc(50% - 7px)"}},a.createElement(o.Dropdown,{selected:L,select:P,option:q,optionKey:"label",t:c,placeholder:c("EKYC_SELECT")||"Select"}))),a.createElement("hr",{style:{margin:"24px 0",border:0,borderTop:"1px solid #EAECF0"}}),a.createElement(G,{icon:a.createElement(j,{size:16}),label:c("EKYC_PROPERTY_CONNECTION_DETAILS")||"Property Connection Details"}),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"24px"}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},c("EKYC_TYPE_OF_CONNECTION")||"Type of connection"),a.createElement(o.Dropdown,{selected:k,select:F,option:Q,optionKey:"label",t:c,placeholder:c("EKYC_SELECT")||"Select"})),a.createElement("div",null,a.createElement("div",{style:{fontSize:"11px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"}},c("EKYC_CONNECTION_CATEGORY")||"Connection category"),a.createElement(o.Dropdown,{selected:M,select:B,option:ee,optionKey:"label",t:c,placeholder:c("EKYC_SELECT")||"Select"})))),a.createElement("div",{style:{marginTop:"24px"}},a.createElement(o.SubmitBar,{label:c("EKYC_SAVE_AND_CONTINUE")||"Save & Continue",onSubmit:()=>{d.push("/digit-ui/employee/ekyc/review",{...E.state,meterDetails:{meterStatus:S,meterPhoto:h,meterPhotoFileStoreId:x,workingStatus:b,meterLocation:I,lastBillRaised:O,noBillReason:D,sewerConnection:L,connectionType:M,connectionCategory:k}})}})),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",marginTop:"16px",fontSize:"11px",color:"#98A2B3"}},a.createElement("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},a.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),a.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})),c("EKYC_SECURE_DATA_NOTICE")||"Your data is encrypted and secure"))),X&&a.createElement(o.Toast,{label:X.message,error:"error"===X.type,info:"info"===X.type,success:"success"===X.type,onClose:()=>$(null)}))},$=e=>{let{size:t=11,color:n="#fff"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"3",strokeLinecap:"round"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))},Z=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"}))},J=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"}))},q=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8V9h8v10zm-2-8h-4v2h4v-2zm0 4h-4v2h4v-2z"}))},Q=e=>{let{size:t=14}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},a.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))},ee=e=>{let{icon:t,label:n}=e;return a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"16px",marginTop:"4px"}},a.createElement("div",{style:{opacity:.5,display:"flex"}},t),a.createElement("span",{style:{fontSize:"15px",fontWeight:"600",color:"#0B0C0C",whiteSpace:"nowrap"}},n),a.createElement("div",{style:{flex:1,height:"1px",background:"#EAECF0"}}))},te=e=>{let{icon:t,title:n,onEdit:l,editLabel:o,rows:r,t:i}=e;return a.createElement("div",{style:{border:"0.5px solid #EAECF0",borderRadius:"10px",overflow:"hidden",marginBottom:"16px",animation:"fadeSlideIn 0.3s ease"}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"14px 16px",background:"#F9FAFB",borderBottom:"0.5px solid #EAECF0"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},a.createElement("div",{style:{opacity:.5,display:"flex"}},t),a.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#0B0C0C"}},n)),a.createElement("button",{onClick:l,style:{display:"flex",alignItems:"center",gap:"5px",background:"none",border:"0.5px solid #D0D5DD",borderRadius:"6px",padding:"5px 12px",fontSize:"12px",fontWeight:"600",color:"#185FA5",cursor:"pointer"}},a.createElement(Q,{size:12}),o)),a.createElement("div",{style:{padding:"4px 0"}},r.map((e,t)=>e.value?a.createElement("div",{key:t,style:{display:"flex",alignItems:"flex-start",padding:"10px 16px",borderBottom:t<r.length-1?"0.5px solid #F2F4F7":"none"}},a.createElement("div",{style:{flex:"0 0 180px",fontSize:"12px",fontWeight:"600",color:"#667085",textTransform:"uppercase",letterSpacing:"0.04em",paddingTop:"1px"}},e.label),a.createElement("div",{style:{flex:1,fontSize:"14px",color:"#101828",fontWeight:"500",wordBreak:"break-word",display:"flex",alignItems:"center",gap:"8px"}},e.value,e.isModified&&a.createElement("span",{style:{fontSize:"10px",background:"#FFF4ED",color:"#B45309",border:"0.5px solid #FDE68A",borderRadius:"4px",padding:"2px 6px",fontWeight:"600",textTransform:"uppercase"}},i("EKYC_MODIFIED")||"Modified"))):null)))},ae=()=>{var e,r,i,s,c,d,E,m,p,u,v,_,f,S,y,h,A,x,N,b,T,I;const{t:R}=n.useTranslation(),O=l.useHistory(),Y=l.useLocation(),D=Y.state||{},K=D.initialData||g("EKYC_INITIAL_DATA",{}),L=D.kNumber||sessionStorage.getItem("EKYC_K_NUMBER")||"EKYC-1234567890",P=D.aadhaarDetails||{userName:sessionStorage.getItem("EKYC_USER_NAME"),mobileNumber:sessionStorage.getItem("EKYC_MOBILE_NUMBER"),whatsappNumber:sessionStorage.getItem("EKYC_WHATSAPP_NUMBER"),email:sessionStorage.getItem("EKYC_EMAIL"),noOfPersons:sessionStorage.getItem("EKYC_NO_OF_PERSONS")},k=D.addressDetails||{fullAddress:sessionStorage.getItem("EKYC_FULL_ADDRESS"),flatNo:sessionStorage.getItem("EKYC_FLAT_NO"),building:sessionStorage.getItem("EKYC_BUILDING"),landmark:sessionStorage.getItem("EKYC_LANDMARK"),pincode:sessionStorage.getItem("EKYC_PINCODE"),assembly:null===(e=g("EKYC_ASSEMBLY_DATA"))||void 0===e?void 0:e.name,ward:null===(r=g("EKYC_WARD_DATA"))||void 0===r?void 0:r.name,doorPhoto:sessionStorage.getItem("EKYC_DOOR_PHOTO"),doorPhotoFileStoreId:sessionStorage.getItem("EKYC_DOOR_PHOTO_FILESTORE_ID")},F=D.propertyDetails||{ownerType:sessionStorage.getItem("EKYC_OWNER_TYPE"),pidNumber:sessionStorage.getItem("EKYC_PID_NUMBER"),userType:g("EKYC_USER_TYPE_DATA"),noOfFloors:g("EKYC_NO_OF_FLOORS_DATA"),propertyDocument:sessionStorage.getItem("EKYC_PROPERTY_DOC"),propertyDocumentFileStoreId:sessionStorage.getItem("EKYC_PROPERTY_DOC_FILESTORE_ID"),buildingPhoto:sessionStorage.getItem("EKYC_BUILDING_PHOTO"),buildingPhotoFileStoreId:sessionStorage.getItem("EKYC_BUILDING_PHOTO_FILESTORE_ID")},M=D.meterDetails||{meterStatus:g("EKYC_METER_STATUS_DATA"),workingStatus:g("EKYC_METER_WORKING_STATUS_DATA"),meterLocation:sessionStorage.getItem("EKYC_METER_LOCATION"),lastBillRaised:g("EKYC_LAST_BILL_RAISED_DATA"),noBillReason:sessionStorage.getItem("EKYC_REASON_FOR_NO_BILL"),sewerConnection:g("EKYC_SEWER_CONNECTION_DATA"),connectionCategory:g("EKYC_TYPE_OF_CONNECTION_DATA"),connectionType:g("EKYC_CONNECTION_CATEGORY_DATA"),meterPhoto:sessionStorage.getItem("EKYC_METER_PHOTO"),meterPhotoFileStoreId:sessionStorage.getItem("EKYC_METER_PHOTO_FILESTORE_ID")};t.useEffect(()=>{sessionStorage.setItem("EKYC_CURRENT_STEP","REVIEW")},[]);const B=(e,t)=>{const a=K[e];return void 0!==a&&JSON.stringify(a)!==JSON.stringify(t)},[w,U]=t.useState(null),H=Digit.ULBService.getCurrentTenantId()||"dl",{mutate:z,isLoading:W}=Digit.Hooks.ekyc.useEkycApplicationUpdate(H),V=W,j=function(e,t){try{return e?Promise.resolve(Digit.UploadServices.Filestorage("EKYC",e,t)).then(function(e){var t,a,n;return(null==e||null===(t=e.data)||void 0===t||null===(a=t.files)||void 0===a||null===(n=a[0])||void 0===n?void 0:n.fileStoreId)||null}):Promise.resolve(null)}catch(e){return Promise.reject(e)}},G=(e,t)=>{const a=e.split(","),n=a[0].match(/:(.*?);/)[1],l=atob(a[1]);let o=l.length;const r=new Uint8Array(o);for(;o--;)r[o]=l.charCodeAt(o);return new File([r],t,{type:n})};return a.createElement(t.Fragment,null,a.createElement("div",{className:"inbox-container"},a.createElement("style",null,"\n @keyframes fadeSlideIn {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "),a.createElement("div",{className:"filters-container"},a.createElement(o.Card,{style:{display:"flex",alignItems:"center",padding:"12px 16px",marginBottom:"12px",borderRadius:"8px"}},a.createElement("div",{style:{color:"#185FA5",marginRight:"10px",display:"flex"}},a.createElement(o.HomeIcon,{style:{width:"20px",height:"20px"}})),a.createElement("div",{style:{fontWeight:"600",fontSize:"15px",color:"#0B0C0C"}},R("EKYC_PROCESS")||"eKYC Process")),a.createElement("div",{style:{background:"#fff",padding:"16px 14px",borderRadius:"8px",border:"1px solid #EAECF0"}},[{label:R("EKYC_STEP_AADHAAR")||"Aadhaar",done:!0,active:!1},{label:R("EKYC_STEP_ADDRESS")||"Address",done:!0,active:!1},{label:R("EKYC_STEP_PROPERTY")||"Property",done:!0,active:!1},{label:R("EKYC_STEP_METER")||"Meter",done:!0,active:!1},{label:R("EKYC_STEP_REVIEW")||"Review",done:!1,active:!0}].map((e,t)=>a.createElement("div",{key:t,style:{display:"flex",gap:"10px",alignItems:"flex-start",position:"relative",paddingBottom:t<4?"18px":0}},t<4&&a.createElement("div",{style:{position:"absolute",left:"10px",top:"22px",width:"1px",height:"calc(100% - 10px)",background:"#EAECF0"}}),a.createElement("div",{style:{width:"20px",height:"20px",borderRadius:"50%",flexShrink:0,marginTop:"1px",border:e.done?"none":e.active?"1.5px solid #185FA5":"1.5px solid #D0D5DD",background:e.done?"#0F6E56":e.active?"#E6F1FB":"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontWeight:"500",color:e.done?"#fff":e.active?"#185FA5":"#98A2B3"}},e.done?a.createElement($,{size:11,color:"#fff"}):t+1),a.createElement("div",{style:{fontSize:"12px",paddingTop:"2px",color:e.done?"#0F6E56":e.active?"#0B0C0C":"#667085",fontWeight:e.done||e.active?"600":"400"}},e.label))))),a.createElement("div",{style:{flex:1,marginLeft:"16px"}},a.createElement(o.Card,null,a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"}},a.createElement(o.CardHeader,{style:{margin:0,fontSize:"18px"}},R("EKYC_REVIEW_DETAILS")||"Review Details"),a.createElement("div",{style:{background:"#F9FAFB",border:"0.5px solid #EAECF0",borderRadius:"20px",padding:"4px 14px",fontSize:"12px",color:"#667085"}},R("EKYC_K_NUMBER")||"K Number",":"," ",a.createElement("span",{style:{color:"#0B0C0C",fontWeight:"600"}},L))),a.createElement("div",{style:{backgroundColor:"#E1F5EE",border:"0.5px solid #5DCAA5",borderRadius:"8px",padding:"12px 16px",display:"flex",alignItems:"center",gap:"10px",marginBottom:"24px"}},a.createElement("div",{style:{backgroundColor:"#9FE1CB",padding:"5px",borderRadius:"6px",display:"flex",flexShrink:0}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#085041",strokeWidth:"3",strokeLinecap:"round"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))),a.createElement("div",{style:{fontSize:"13px",color:"#04342C",fontWeight:"500"}},R("EKYC_REVIEW_NOTICE")||"Please review all details carefully before submitting. You can edit any section by clicking Edit.")),a.createElement("div",{style:{animation:"fadeSlideIn 0.3s ease"}},a.createElement(ee,{icon:a.createElement(Z,{size:16}),label:R("EKYC_AADHAAR_VERIFICATION_HEADER")||"Aadhaar details"}),a.createElement(te,{icon:a.createElement(Z,{size:16}),title:R("EKYC_AADHAAR_VERIFICATION_HEADER")||"Aadhaar details",onEdit:()=>{O.push("/digit-ui/employee/ekyc/aadhaar-verification",Y.state)},editLabel:R("CS_COMMON_EDIT")||"Edit",t:R,rows:[{label:R("EKYC_NAME")||"Name",value:P.userName||"Rajesh Kumar Singh",isModified:B("userName",P.userName)},{label:R("EKYC_AADHAAR")||"Aadhaar no.",value:P.aadhaarLastFour?""+P.aadhaarLastFour:"XXXX XXXX 1234"},{label:R("EKYC_MOBILE_NO")||"Mobile no.",value:P.mobileNumber||"XXXXXXXXXX",isModified:B("mobileNumber",P.mobileNumber)},{label:R("EKYC_EMAIL_ADDRESS")||"Email",value:P.email||null,isModified:B("email",P.email)}]}),a.createElement("hr",{style:{margin:"20px 0",border:0,borderTop:"1px solid #EAECF0"}}),a.createElement(ee,{icon:a.createElement(J,{size:16}),label:R("EKYC_ADDRESS_DETAILS_HEADER")||"Address details"}),a.createElement(te,{icon:a.createElement(J,{size:16}),title:R("EKYC_ADDRESS_DETAILS_HEADER")||"Address details",onEdit:()=>{O.push("/digit-ui/employee/ekyc/address-details",Y.state)},editLabel:R("CS_COMMON_EDIT")||"Edit",t:R,rows:[{label:R("EKYC_FULL_ADDRESS")||"Full address",value:k.fullAddress||"H.No. 123, Sector 15, Rohini, Delhi – 110085",isModified:B("fullAddress",k.fullAddress)},{label:R("EKYC_FLAT_HOUSE_NUMBER")||"Flat / House no.",value:k.flatNo||null,isModified:B("flatNo",k.flatNo)},{label:R("EKYC_BUILDING_TOWER")||"Building",value:k.building||null,isModified:B("building",k.building)},{label:R("EKYC_LANDMARK")||"Landmark",value:k.landmark||null,isModified:B("landmark",k.landmark)},{label:R("EKYC_PINCODE")||"Pincode",value:k.pincode||"110085",isModified:B("pincode",k.pincode)},{label:R("EKYC_ASSEMBLY")||"Assembly",value:k.assembly||"AC-12 Chandni Chowk",isModified:B("assembly",k.assembly)},{label:R("EKYC_WARD")||"Ward",value:k.ward||"WARD-45 Civil Lines",isModified:B("ward",k.ward)}]}),a.createElement("hr",{style:{margin:"20px 0",border:0,borderTop:"1px solid #EAECF0"}}),a.createElement(ee,{icon:a.createElement(q,{size:16}),label:R("EKYC_PROPERTY_INFO")||"Property details"}),a.createElement(te,{icon:a.createElement(q,{size:16}),title:R("EKYC_PROPERTY_INFO")||"Property details",onEdit:()=>{O.push("/digit-ui/employee/ekyc/property-info",Y.state)},editLabel:R("CS_COMMON_EDIT")||"Edit",t:R,rows:[{label:R("EKYC_PROPERTY_OWNER")||"Property owner",value:F.ownerType||"Owner"},{label:R("EKYC_PID_NUMBER")||"PID number",value:F.pidNumber||null,isModified:B("pidNumber",F.pidNumber)},{label:R("EKYC_TYPE_OF_CONNECTION")||"Type of connection",value:(null===(i=F.connectionCategory)||void 0===i?void 0:i.label)||null,isModified:B("typeOfConnection",null===(s=F.connectionCategory)||void 0===s?void 0:s.value)},{label:R("EKYC_CONNECTION_CATEGORY")||"Connection category",value:(null===(c=F.connectionType)||void 0===c?void 0:c.label)||null,isModified:B("connectionCategory",null===(d=F.connectionType)||void 0===d?void 0:d.value)},{label:R("EKYC_USER_TYPE")||"User type",value:(null===(E=F.userType)||void 0===E?void 0:E.label)||null,isModified:B("userType",null===(m=F.userType)||void 0===m?void 0:m.value)},{label:R("EKYC_NO_OF_FLOORS")||"No. of floors",value:(null===(p=F.noOfFloors)||void 0===p?void 0:p.label)||null,isModified:B("noOfFloor",null===(u=F.noOfFloors)||void 0===u?void 0:u.value)}]}),a.createElement("hr",{style:{margin:"20px 0",border:0,borderTop:"1px solid #EAECF0"}}),a.createElement(ee,{icon:a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67V7z"})),label:R("EKYC_METER_DETAILS_HEADER")||"Meter details"}),a.createElement(te,{icon:a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67V7z"})),title:R("EKYC_METER_DETAILS_HEADER")||"Meter details",onEdit:()=>{O.push("/digit-ui/employee/ekyc/meter-details",Y.state)},editLabel:R("CS_COMMON_EDIT")||"Edit",t:R,rows:[{label:R("EKYC_METER_STATUS")||"Meter status",value:(null===(v=M.meterStatus)||void 0===v?void 0:v.label)||null,isModified:B("meterStatus",null===(_=M.meterStatus)||void 0===_?void 0:_.value)},{label:R("EKYC_METER_WORKING_STATUS")||"Meter working status",value:(null===(f=M.workingStatus)||void 0===f?void 0:f.label)||null,isModified:B("meterWorkingStatus",null===(S=M.workingStatus)||void 0===S?void 0:S.value)},{label:R("EKYC_METER_LOCATION")||"Meter location",value:M.meterLocation||null,isModified:B("meterLocation",M.meterLocation)},{label:R("EKYC_LAST_BILL_RAISED")||"Last bill raised",value:(null===(y=M.lastBillRaised)||void 0===y?void 0:y.label)||null,isModified:B("lastBillRaised",null===(h=M.lastBillRaised)||void 0===h?void 0:h.value)},{label:R("EKYC_REASON_FOR_NO_BILL")||"Reason for no bill",value:M.noBillReason||null,isModified:B("noBillReason",M.noBillReason)},{label:R("EKYC_SEWER_CONNECTION")||"Sewer connection",value:(null===(A=M.sewerConnection)||void 0===A?void 0:A.label)||null,isModified:B("sewerConnection",null===(x=M.sewerConnection)||void 0===x?void 0:x.value)},{label:R("EKYC_TYPE_OF_CONNECTION")||"Type of connection",value:(null===(N=M.connectionCategory)||void 0===N?void 0:N.label)||null,isModified:B("typeOfConnection",null===(b=M.connectionCategory)||void 0===b?void 0:b.value)},{label:R("EKYC_CONNECTION_CATEGORY")||"Connection category",value:(null===(T=M.connectionType)||void 0===T?void 0:T.label)||null,isModified:B("connectionCategory",null===(I=M.connectionType)||void 0===I?void 0:I.value)}]})),a.createElement("div",{style:{marginTop:"24px"}},a.createElement(o.SubmitBar,{label:V?R("EKYC_SUBMITTING")||"Submitting...":R("ES_COMMON_SUBMIT")||"Submit",onSubmit:function(){try{U(null);const e=C(function(){var e;function t(){function e(){function e(){function e(){var e,r,i,s,c,d,E,m,p,u;const v={updateType:"PROPERTY",kno:L,pidNumber:F.pidNumber||null,propertyDocumentFileStoreId:n,buildingImageFileStoreId:t,userType:(null===(e=F.userType)||void 0===e?void 0:e.value)||null,noOfFloor:null!==(r=F.noOfFloors)&&void 0!==r&&r.value?parseInt(F.noOfFloors.value,10):null,typeOfConnection:(null===(i=F.connectionCategory)||void 0===i?void 0:i.value)||null,connectionCategory:(null===(s=F.connectionType)||void 0===s?void 0:s.value)||null,modifiedBy:a.name||a.userName||null,mobileNumber:P.mobileNumber||null,email:P.email||null,userName:P.userName||null,noOfPersons:P.noOfPersons||null,doorPhotoFileStoreId:l,fullAddress:k.fullAddress||null,flatNo:k.flatNo||null,building:k.building||null,landmark:k.landmark||null,pincode:k.pincode||null,assembly:k.assembly||null,ward:k.ward||null,meterStatus:(null===(c=M.meterStatus)||void 0===c?void 0:c.value)||null,meterWorkingStatus:(null===(d=M.workingStatus)||void 0===d?void 0:d.value)||null,meterLocation:M.meterLocation||null,lastBillRaised:(null===(E=M.lastBillRaised)||void 0===E?void 0:E.value)||null,noBillReason:M.noBillReason||null,sewerConnection:(null===(m=M.sewerConnection)||void 0===m?void 0:m.value)||null,typeOfConnection:(null===(p=M.connectionCategory)||void 0===p?void 0:p.value)||null,connectionCategory:(null===(u=M.connectionType)||void 0===u?void 0:u.value)||null,meterImageFileStoreId:o};z(v,{onSuccess:e=>{U({type:"success",message:R("EKYC_SUBMIT_SUCCESS")||"Application submitted successfully!"}),Object.keys(sessionStorage).forEach(e=>{e.startsWith("EKYC_")&&sessionStorage.removeItem(e)}),setTimeout(()=>{O.push("/digit-ui/employee/ekyc/dashboard")},1800)},onError:e=>{var t,a,n,l;console.error("eKYC Submit Error:",e),U({type:"error",message:(null==e||null===(t=e.response)||void 0===t||null===(a=t.data)||void 0===a||null===(n=a.Errors)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.message)||R("EKYC_SUBMIT_ERROR")||"Submission failed. Please try again."})}})}let o=M.meterPhotoFileStoreId||null;const r=function(){if(!o&&M.meterPhoto){const e=G(M.meterPhoto,"meter_photo.jpg");return Promise.resolve(j(e,H)).then(function(e){o=e})}}();return r&&r.then?r.then(e):e()}let l=k.doorPhotoFileStoreId||null;const o=function(){if(!l&&k.doorPhoto){const e=G(k.doorPhoto,"door_photo.jpg");return Promise.resolve(j(e,H)).then(function(e){l=e})}}();return o&&o.then?o.then(e):e()}let t=F.buildingPhotoFileStoreId||null;const l=function(){if(!t&&F.buildingPhoto){const e=G(F.buildingPhoto,"building_photo.jpg");return Promise.resolve(j(e,H)).then(function(e){t=e})}}();return l&&l.then?l.then(e):e()}const a=(null===(e=Digit.UserService.getUser())||void 0===e?void 0:e.info)||{};let n=F.propertyDocumentFileStoreId||null;const l=function(){if(!n&&F.propertyDocument instanceof File)return Promise.resolve(j(F.propertyDocument,H)).then(function(e){n=e})}();return l&&l.then?l.then(t):t()},function(e){console.error("eKYC Frontend Error:",e),U({type:"error",message:R("EKYC_SUBMIT_ERROR")||"An error occurred during submission."})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:V})),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",marginTop:"16px",fontSize:"11px",color:"#98A2B3"}},a.createElement("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},a.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),a.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})),R("EKYC_SECURE_DATA_NOTICE")||"Your data is encrypted and secure")))),w&&a.createElement(o.Toast,{label:w.message,error:"error"===w.type,success:"success"===w.type,onClose:()=>U(null)}))},ne=e=>{let{path:t}=e;const{t:r}=n.useTranslation(),i=l.useLocation();sessionStorage.removeItem("revalidateddone");const s=[{icon:o.HomeIcon,path:"/digit-ui/employee"},{label:r((()=>{const e=i.pathname;return e.includes("/dashboard")?"ES_COMMON_INBOX":e.includes("/create-kyc")?"EKYC_CREATE_KYC":e.includes("/k-details")?"EKYC_K_DETAILS":e.includes("/aadhaar-verification")?"EKYC_AADHAAR_VERIFICATION":e.includes("/address-details")?"EKYC_ADDRESS_DETAILS":e.includes("/property-info")?"EKYC_PROPERTY_INFO":e.includes("/meter-details")?"EKYC_METER_DETAILS":e.includes("/review")?"EKYC_REVIEW":"ES_COMMON_INBOX"})())}];return a.createElement(o.AppContainer,null,a.createElement("div",{className:"ground-container employee-app-container employee-app-homepage-container"},a.createElement(o.ModuleHeader,{leftContent:a.createElement(a.Fragment,null,a.createElement(o.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:s}),a.createElement(l.Switch,null,a.createElement(o.PrivateRoute,{path:t+"/dashboard",component:()=>a.createElement(m,{parentRoute:t,businessService:"EKYC",moduleCode:"EKYC",isInbox:!0})}),a.createElement(o.PrivateRoute,{path:t+"/create-kyc",component:()=>a.createElement(u,null)}),a.createElement(o.PrivateRoute,{path:t+"/aadhaar-verification",component:()=>a.createElement(P,null)}),a.createElement(o.PrivateRoute,{path:t+"/address-details",component:()=>a.createElement(x,null)}),a.createElement(o.PrivateRoute,{path:t+"/property-info",component:()=>a.createElement(z,null)}),a.createElement(o.PrivateRoute,{path:t+"/meter-details",component:()=>a.createElement(X,null)}),a.createElement(o.PrivateRoute,{path:t+"/review",component:()=>a.createElement(ae,null)}),a.createElement(o.PrivateRoute,{path:t+"/",component:()=>a.createElement(m,{parentRoute:t,businessService:"EKYC",moduleCode:"EKYC",isInbox:!0})}))))},le=()=>{const{t:e}=n.useTranslation(),t=l.useLocation(),{path:r}=l.useRouteMatch();sessionStorage.removeItem("revalidateddone");const i=[{icon:o.HomeIcon,path:"/digit-ui/citizen"},{label:e((()=>{const e=t.pathname;return e.includes("/create-kyc")?"EKYC_CREATE_KYC":e.includes("/aadhaar-verification")?"EKYC_AADHAAR_VERIFICATION":e.includes("/address-details")?"EKYC_ADDRESS_DETAILS":e.includes("/property-info")?"EKYC_PROPERTY_INFO":e.includes("/meter-details")?"EKYC_METER_DETAILS":e.includes("/review")?"EKYC_REVIEW":"EKYC_HOME"})())}];return a.createElement(o.AppContainer,null,a.createElement("div",{className:"ground-container employee-app-container form-container"},a.createElement(o.ModuleHeader,{leftContent:a.createElement(a.Fragment,null,a.createElement(o.ArrowLeft,{className:"icon"}),e("CS_COMMON_BACK")),onLeftClick:()=>window.history.back(),breadcrumbs:i}),a.createElement(l.Switch,null,a.createElement(o.PrivateRoute,{path:r+"/create-kyc",component:()=>a.createElement(u,null)}),a.createElement(o.PrivateRoute,{path:r+"/aadhaar-verification",component:()=>a.createElement(P,null)}),a.createElement(o.PrivateRoute,{path:r+"/address-details",component:()=>a.createElement(x,null)}),a.createElement(o.PrivateRoute,{path:r+"/property-info",component:()=>a.createElement(z,null)}),a.createElement(o.PrivateRoute,{path:r+"/meter-details",component:()=>a.createElement(X,null)}),a.createElement(o.PrivateRoute,{path:r+"/review",component:()=>a.createElement(ae,null)}),a.createElement(o.PrivateRoute,{path:r+"/",component:()=>a.createElement(u,null)}))))},oe=e=>{let{stateCode:t,userType:n,tenants:o}=e;const{path:r,url:i}=l.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage(),{isLoading:c}=Digit.Services.useStore({stateCode:t,moduleCode:"EKYC",language:s});return Digit.SessionStorage.set("EKYC_TENANTS",o),c?null:"employee"===n?a.createElement(ne,{path:r,url:i,userType:n,tenants:o}):a.createElement(le,null)},re=e=>{let{matchPath:t}=e;const{t:l}=n.useTranslation(),r=[{link:t+"/create-kyc",i18nKey:l("EKYC_CREATE_KYC")}];return a.createElement(o.CitizenHomeCard,{header:l("EKYC_MODULE_NAME"),links:r,Icon:()=>a.createElement(o.DocumentIcon,{className:"fill-path-primary-main"})})},ie={EKYCModule:oe,EKYCCard:()=>{const{t:e}=n.useTranslation(),t={Icon:a.createElement(o.PersonIcon,null),moduleName:e("ACTION_TEST_EKYC"),kpis:[{count:"-",label:e("TOTAL_EKYC"),link:"/digit-ui/employee/ekyc/dashboard"}],links:[{label:e("EKYC_DASHBOARD"),link:"/digit-ui/employee/ekyc/dashboard"},{label:e("EKYC_CREATE_KYC"),link:"/digit-ui/employee/ekyc/create-kyc"}]};return a.createElement(o.EmployeeModuleCard,t)},EKYCInbox:m,EKYCDesktopInbox:s,EKYCMobileInbox:d,EKYC_INBOX_FILTER:e=>a.createElement(E,e),EkycLinks:re};exports.EkycLinks=re,exports.EkycModule=oe,exports.default=oe,exports.initEkycComponents=()=>{Object.entries(ie).forEach(e=>{let[t,a]=e;Digit.ComponentRegistryService.setComponent(t,a)})};
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),a=e(t),l=require("react-i18next"),n=require("react-router-dom"),r=require("@djb25/digit-ui-react-components"),o=require("chart.js/auto"),i=e(o);require("react-dom");const s=e=>{let{countData:n}=e;const{t:r}=l.useTranslation(),s=t.useRef(null),c=t.useRef(null),d=(null==n?void 0:n.total)||0,m=(null==n?void 0:n.pending)||0,u=(null==n?void 0:n.completed)||0,E=(null==n?void 0:n.completed)||0,p=E,v=d>0?Math.round(E/d*100):0,g=d>0?Math.round(p/d*100):0,C=e=>new Intl.NumberFormat("en-IN").format(e||0);t.useEffect(()=>{if(s.current){c.current&&c.current.destroy();const e=s.current.getContext("2d");c.current=new(o.Chart||i||o)(e,{type:"doughnut",data:{labels:[r("EKYC_ACTIVE"),r("EKYC_PENDING"),r("EKYC_COMPLETED")],datasets:[{data:[u,m,0],backgroundColor:["#0c2a52","#77B6EA","#c8ddf5"],borderColor:["#ffffff","#ffffff","#ffffff"],borderWidth:2,hoverOffset:4}]},options:{cutout:"75%",plugins:{legend:{display:!1}},maintainAspectRatio:!1,responsive:!0}})}return()=>{c.current&&c.current.destroy()}},[m,0,u,r]);const b=[{color:"#0c2a52",label:r("EKYC_ACTIVE"),value:u},{color:"#77B6EA",label:r("EKYC_PENDING"),value:m},{color:"#c8ddf5",label:r("EKYC_COMPLETED"),value:0}];return a.createElement("div",{className:"ekyc-employee-container"},a.createElement("div",{className:"status-cards-wrapper"},a.createElement("div",{className:"status-cards-header"},a.createElement("div",null,a.createElement("div",{className:"eyebrow"},a.createElement("span",{className:"eyebrow-dot"}),r("EKYC_INSTITUTIONAL_OVERVIEW")||"Institutional Performance Overview"),a.createElement("h1",{className:"status-cards-h1"},r("EKYC_DASHBOARD_TITLE")||"eKYC Verification Dashboard"),a.createElement("p",{className:"status-cards-subtitle"},r("EKYC_DASHBOARD_SUBTITLE")||"Real-time monitoring of consumer verification workflows across all administrative zones.")),a.createElement("div",{className:"total-applications-card"},a.createElement("div",{className:"total-label"},r("EKYC_TOTAL_APPLICATIONS")||"Total Applications Processed"),a.createElement("div",{className:"total-number"},C(d)),a.createElement("div",{className:"total-badge"},"↗ +12.4% ",r("EKYC_FROM_LAST_QUARTER")||"from last quarter"))),a.createElement("div",{className:"status-panels-grid"},a.createElement("div",{className:"status-panel"},a.createElement("div",{className:"panel-title"},r("EKYC_STATUS_BREAKDOWN")||"Status Breakdown"),a.createElement("div",{className:"panel-subtitle"},r("EKYC_VERIFICATION_LIFECYCLE")||"Verification lifecycle distribution"),a.createElement("div",{className:"breakdown-body"},a.createElement("div",{className:"status-legend"},b.map(e=>a.createElement("div",{key:e.label,className:"legend-row"},a.createElement("span",{className:"legend-label"},a.createElement("span",{className:"indicator-dot",style:{background:e.color}}),e.label),a.createElement("span",{className:"legend-value"},C(e.value))))),a.createElement("div",{className:"chart-wrapper"},a.createElement("canvas",{ref:s,style:{width:"100%",height:"100%"}}),a.createElement("div",{className:"chart-center"},a.createElement("div",{className:"chart-percentage"},v,"%"),a.createElement("div",{className:"chart-label"},r("EKYC_COMPLETE")||"Complete"))))),a.createElement("div",{className:"status-panel"},a.createElement("div",{className:"panel-title"},r("EKYC_SUBMISSION_HEALTH")||"Submission Health",a.createElement("span",{className:"optimal-badge"},r("EKYC_OPTIMAL")||"Optimal")),a.createElement("div",{className:"panel-subtitle"},r("EKYC_PLATFORM_EFFICIENCY")||"Platform operational efficiency"),a.createElement("div",{className:"health-metrics-row"},a.createElement("div",{className:"health-percentage"},g,"%"),a.createElement("div",{className:"health-trend"},"↗ +2.1%")),a.createElement("div",{className:"status-progress-bar"},a.createElement("div",{className:"progress-fill",style:{width:g+"%"}})),a.createElement("div",{className:"mini-metrics-grid"},a.createElement("div",{className:"metric-box"},a.createElement("div",{className:"metric-label"},r("EKYC_AVG_LATENCY")||"Avg Latency"),a.createElement("div",{className:"metric-value"},"1.2s")),a.createElement("div",{className:"metric-box"},a.createElement("div",{className:"metric-label"},r("EKYC_ERROR_RATE")||"Error Rate"),a.createElement("div",{className:"metric-value"},"0.04%")))))))},c=e=>{const l=Digit.ULBService.getCurrentTenantId(),{isLoading:n,data:o}=Digit.Hooks.ekyc.useEkycSurveyorDashboard({},{tenantId:l,offset:0,limit:10},{enabled:!!l}),i=t.useMemo(()=>{const e=(null==o?void 0:o.dashboardInfo)||{};return{total:e.total||0,completed:e.completed||0,pending:e.pending||0,rejected:e.rejected||0,active:e.active||0}},[o]);return n?a.createElement(r.Loader,null):a.createElement(r.Card,null,a.createElement(s,{countData:i}))},d=e=>{var n,o,i;let{onSearch:s,searchParams:c,children:d,...m}=e;const{t:u}=l.useTranslation(),[E,p]=t.useState(()=>({...c})),v=(e,t)=>{p(a=>({...a,[e]:t}))};return a.createElement("div",{className:"ekyc-employee-container"},a.createElement("div",{className:"search-consumer-wrapper"},a.createElement("div",{className:"header-wrapper"},a.createElement(r.Card,{className:"sidebar-title-card"},a.createElement("div",{className:"icon-container"},a.createElement(r.HomeIcon,null)),a.createElement("div",{className:"title-text"},u("EKYC_SEARCH_CONSUMER_HEADER")))),a.createElement("div",{className:"main-content-wrapper"},a.createElement("div",{className:"search-stats-row"},a.createElement("div",{className:"identity-lookup-card"},a.createElement("div",{className:"lookup-card-title"},a.createElement("div",{className:"lookup-icon-bg"},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("circle",{cx:"11",cy:"11",r:"8"}),a.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))),a.createElement("span",{className:"lookup-title-text"},u("EKYC_IDENTITY_LOOKUP")||"Identity Lookup")),a.createElement("form",{onSubmit:e=>{e&&e.preventDefault&&e.preventDefault(),s(E)}},a.createElement("div",{className:"inputs-row"},a.createElement("div",{className:"input-group"},a.createElement("label",null,u("EKYC_K_NUMBER")||"K Number",a.createElement("span",{className:"info-badge"},"i")),a.createElement(r.TextInput,{value:null==E?void 0:E.kNumber,onChange:e=>v("kNumber",e.target.value),placeholder:u("EKYC_K_NUMBER_PLACEHOLDER")||"e.g. 8234910234"})),a.createElement("div",{className:"input-group"},a.createElement("label",null,u("EKYC_K_NAME")||"K Name",a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"}))),a.createElement(r.TextInput,{value:null==E?void 0:E.kName,onChange:e=>v("kName",e.target.value),placeholder:u("EKYC_K_NAME_PLACEHOLDER")||"Consumer name search"}))),a.createElement("div",{className:"actions-row"},a.createElement("button",{type:"button",onClick:()=>{const e={kNumber:"",kName:""};p(e),s(e)},className:"clear-btn"},u("ES_COMMON_CLEAR")||"Clear"),a.createElement("button",{type:"submit",className:"search-btn"},u("ES_COMMON_SEARCH")||"Execute Search")))),a.createElement("div",{className:"stats-column"},a.createElement("div",{className:"audits-card"},a.createElement("div",{className:"audits-label"},u("EKYC_TODAYS_AUDITS")||"Today's Audits"),a.createElement("div",{className:"audits-count"},(null===(n=m.countData)||void 0===n?void 0:n.todaysAudits)||24),a.createElement("div",{className:"audits-change"},a.createElement("span",null,"↗"),(null===(o=m.countData)||void 0===o?void 0:o.auditChange)||"12% increase from yesterday"),a.createElement("div",{className:"audits-watermark"},"M")),a.createElement("div",{className:"queue-card"},a.createElement("div",{className:"queue-label"},u("EKYC_QUEUE_STATUS")||"Queue Status"),a.createElement("div",{className:"queue-content"},a.createElement("div",{className:"queue-status-text"},(null===(i=m.countData)||void 0===i?void 0:i.pendingCount)||3," Pending"),a.createElement("div",{className:"avatar-group"},[0,1].map(e=>a.createElement("div",{key:e,className:"avatar-item"},String.fromCharCode(65+e))),a.createElement("div",{className:"avatar-more"},"+1")))))),d)))},m=e=>{let{searchParams:n,onFilterChange:o,defaultSearchParams:i,...s}=e;const{t:c}=l.useTranslation(),[d,m]=t.useState(()=>({...n}));return a.createElement(r.FilterForm,{onSubmit:()=>{o(d)},handleSubmit:e=>t=>{t&&t.preventDefault(),e()},onResetFilterForm:()=>{m({...i}),o({...i})},id:"ekyc-filter-form",onMobileExclusiveFilterPopupFormClose:s.onClose},a.createElement(r.FilterFormField,null,a.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},c("EKYC_STATUS"),":"),a.createElement(r.Dropdown,{option:[{label:c("EKYC_STATUS_ALL"),value:""},{label:c("EKYC_STATUS_ACTIVE"),value:"ACTIVE"},{label:c("EKYC_STATUS_PENDING"),value:"PENDING START"}],optionKey:"label",select:e=>{const t={...d,status:e};m(t),o(t)},selected:(null==d?void 0:d.status)||{label:c("EKYC_STATUS_ALL"),value:""}})))};function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e}).apply(null,arguments)}function E(e,t){try{var a=e()}catch(e){return t(e)}return a&&a.then?a.then(void 0,t):a}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var p=e=>null==e;const v=e=>"object"==typeof e;var g=e=>!p(e)&&!Array.isArray(e)&&v(e)&&!(e instanceof Date),C=e=>e.filter(Boolean),b=e=>void 0===e,S=function(e,t,a){void 0===e&&(e={});const l=C(t.split(/[,[\].]+?/)).reduce((e,t)=>p(e)?e:e[t],e);return b(l)||l===e?b(e[t])?a:e[t]:l},f=e=>"function"==typeof e;const N=t.createContext(null);N.displayName="RHFContext";const y=e=>{const{as:a,render:l}=e,n=function(e,t){var a={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(a[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(l=Object.getOwnPropertySymbols(e);n<l.length;n++)t.indexOf(l[n])<0&&Object.prototype.propertyIsEnumerable.call(e,l[n])&&(a[l[n]]=e[l[n]])}return a}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:r,meta:o}=function(e){let{name:a,rules:l,defaultValue:n,control:r,onFocus:o}=e;const i=t.useContext(N);if("production"!==process.env.NODE_ENV&&!r&&!i)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:s,setValue:c,register:d,unregister:m,trigger:u,mode:E,reValidateMode:{isReValidateOnBlur:y,isReValidateOnChange:h},formState:_,formStateRef:{current:{isSubmitted:x,touched:T,errors:I}},updateFormState:R,readFormStateRef:k,fieldsRef:D,fieldArrayNamesRef:A,shallowFieldsStateRef:L}=r||i.control,w=!((e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)))(A.current,a),O=()=>!b(S(L.current,a))&&w?S(L.current,a):b(n)?S(s.current,a):n,[F,K]=t.useState(O()),Y=t.useRef(F),M=t.useRef({focus:()=>null}),P=t.useRef(o||(()=>{f(M.current.focus)&&M.current.focus(),"production"!==process.env.NODE_ENV&&(f(M.current.focus)||console.warn("📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method"))})),B=t.useCallback(e=>!(e=>{let{isOnBlur:t,isOnChange:a,isOnTouch:l,isTouched:n,isReValidateOnBlur:r,isReValidateOnChange:o,isBlurEvent:i,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&l?!(n||i):(s?r:t)?!i:!(s?o:a)||i)})(Object.assign({isBlurEvent:e,isReValidateOnBlur:y,isReValidateOnChange:h,isSubmitted:x,isTouched:!!S(T,a)},E)),[y,h,x,T,a,E]),z=t.useCallback(e=>{let[t]=e;const a=(e=>{return p(t=e)||!v(t)||!g(e.target)||g(e.target)&&!e.type?e:b(e.target.value)?e.target.checked:e.target.value;var t})(t);return K(a),Y.current=a,a},[]),U=t.useCallback(e=>{if("production"!==process.env.NODE_ENV&&!a)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");D.current[a]?D.current[a]=Object.assign({ref:D.current[a].ref},l):(d(Object.defineProperties({name:a,focus:P.current},{value:{set(e){K(e),Y.current=e},get:()=>Y.current}}),l),e=b(S(s.current,a))),e&&w&&K(O())},[l,a,d]);t.useEffect(()=>()=>m(a),[a]),t.useEffect(()=>{"production"!==process.env.NODE_ENV&&(b(F)&&console.warn(`📋 ${a} is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)`),!w&&b(n)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),U()},[U]),t.useEffect(()=>{!D.current[a]&&U(!0)});const H=t.useCallback(()=>{k.current.touched&&!S(T,a)&&(function(e,t,a){let l=-1;const n=(e=>/^\w*$/.test(e))(t)?[t]:C(t.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split(".")),r=n.length,o=r-1;for(;++l<r;){const t=n[l];let a=!0;if(l!==o){const r=e[t];a=g(r)||Array.isArray(r)?r:isNaN(+n[l+1])?{}:[]}e[t]=a,e=e[t]}}(T,a),R({touched:T})),B(!0)&&u(a)},[a,R,B,u,k]);return{field:{onChange:t.useCallback(function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];return c(a,z(t),{shouldValidate:B(),shouldDirty:!0})},[c,a,B]),onBlur:H,name:a,value:F,ref:M},meta:Object.defineProperties({invalid:!!S(I,a)},{isDirty:{get:()=>!!S(_.dirtyFields,a)},isTouched:{get:()=>!!S(_.touched,a)}})}}(e),i=Object.assign(Object.assign({},n),r);return a?t.isValidElement(a)?t.cloneElement(a,i):t.createElement(a,i):l?l(r,o):null},h=e=>{let{searchFormState:t,controlSearchForm:n}=e;const{t:o}=l.useTranslation(),{errors:i}=t;return a.createElement(a.Fragment,null,a.createElement("span",{className:"mobile-input"},a.createElement(r.Label,{className:"flex-roww flex-gap-2"},o("EKYC_K_NUMBER")||"K Number",a.createElement(r.Tooltip,{message:o("EKYC_K_NUMBER_MESSAGE")})),a.createElement(y,{name:"kNumber",control:n,defaultValue:"",rules:{pattern:{value:/^[a-zA-Z0-9-_/]*$/,message:o("ERR_INVALID_APPLICATION_NO")}},render:e=>{let{onChange:t,value:l}=e;return a.createElement(r.TextInput,{value:l||"",onChange:e=>t(e.target.value)})}}),(null==i?void 0:i.kNumber)&&a.createElement(r.CardLabelError,null,i.kNumber.message)))},_=e=>{var o,i,s,c,d;let{parentRoute:m,businessService:E="EKYC",initialStates:p={}}=e;const v=Digit.ULBService.getCurrentTenantId(),g=n.useLocation(),[C,b]=t.useReducer(function(e,t){const a=t.checkPathName?"EKYC.INBOX":"EKYC.SW.INBOX";switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set(a,{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set(a,{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set(a,{...e,tableForm:t.data}),{...e,tableForm:t.data};default:return e}},{filterForm:{},searchForm:{},tableForm:{limit:10,offset:0,sortBy:"createdTime",sortOrder:"DESC"}}),S=t.useMemo(()=>{var e,t;return{tenantId:v,offset:(null==C||null===(e=C.tableForm)||void 0===e?void 0:e.offset)||0,limit:(null==C||null===(t=C.tableForm)||void 0===t?void 0:t.limit)||10,search:(null==C?void 0:C.searchForm)||{}}},[v,null==C||null===(o=C.tableForm)||void 0===o?void 0:o.offset,null==C||null===(i=C.tableForm)||void 0===i?void 0:i.limit,null==C?void 0:C.searchForm]),{isLoading:f,data:N={}}=Digit.Hooks.ekyc.useEkycSurveyorDashboard({},S,{enabled:!!v,keepPreviousData:!0}),y=t.useMemo(()=>{var e,t;return{kno:(null==C||null===(e=C.searchForm)||void 0===e?void 0:e.kNumber)||"",name:(null==C||null===(t=C.searchForm)||void 0===t?void 0:t.kName)||""}},[null==C||null===(s=C.searchForm)||void 0===s?void 0:s.kNumber,null==C||null===(c=C.searchForm)||void 0===c?void 0:c.kName]),_=!(!y.kno&&!y.name),{isLoading:x,data:T}=Digit.Hooks.ekyc.useSearchConnection({tenantId:v,details:y},{enabled:!!v&&!!y.kno,keepPreviousData:!0}),I=t.useMemo(()=>{var e;return _?T?[T]:[]:(null==N||null===(e=N.dashboardInfo)||void 0===e?void 0:e.consumerList)||[]},[_,T,N]),R=t.useMemo(()=>(I||[]).map(e=>{var t,a,l,n,r,o;return e.connectionDetails?{applicationNo:(null===(t=e.propertyInfo)||void 0===t?void 0:t.kno)||"",connectionNo:(null===(a=e.propertyInfo)||void 0===a?void 0:a.kno)||"",owner:(null===(l=e.connectionDetails)||void 0===l?void 0:l.consumerName)||"",applicationNumber:(null===(n=e.propertyInfo)||void 0===n?void 0:n.kno)||"",citizenName:(null===(r=e.connectionDetails)||void 0===r?void 0:r.consumerName)||"",status:(null===(o=e.connectionDetails)||void 0===o?void 0:o.statusflag)||"",sla:0}:{...e,applicationNo:e.kno||e.applicationNumber||"",connectionNo:e.connectionNo||"",owner:e.consumerName||e.citizenName||"",applicationNumber:e.kno||e.applicationNumber||"",citizenName:e.consumerName||e.citizenName||"",status:e.status||"",sla:e.sla??0}}),[I]),k=(null==N||null===(d=N.dashboardInfo)||void 0===d?void 0:d.totalRecords)||(null==N?void 0:N.totalCount)||0,D=g.pathname.includes("ekyc/inbox"),A={headerText:D?"MODULE_WATER":"MODULE_SW"},L=t.useCallback(e=>{let{registerRef:t,searchFormState:l,controlSearchForm:n}=e;return a.createElement(h,{registerRef:t,searchFormState:l,controlSearchForm:n,className:"search"})},[]),w={sortBy:"createdTime",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},O={mobileNumber:"",applicationNumber:"",consumerNo:""},F={SearchFormFields:L,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),b({action:"mutateTableForm",data:{...w},checkPathName:D}),b({action:"mutateSearchForm",data:e,checkPathName:D})},searchFormDefaultValues:null==C?void 0:C.searchForm,resetSearchFormDefaultValues:O,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNumber",null),e("consumerNo",null),b({action:"mutateSearchForm",data:O})},className:"search-form-wns-inbox"},K={FilterFormFields:t.useCallback(e=>a.createElement(a.Fragment,null),[]),onFilterFormSubmit:()=>{},filterFormDefaultValues:"",resetFilterFormDefaultValues:"",onFilterFormReset:()=>{}},Y=(e=>{var r,o,i;let{onPageSizeChange:s,formState:c,totalCount:d,table:m,dispatch:u,checkPathName:E,onSortingByData:p,tenantId:v,inboxStyles:g={},tableStyle:C={}}=e;const{t:b}=l.useTranslation(),S=n.useHistory(),[f,N]=t.useState(""),{data:y,getReview:h}=Digit.Hooks.ekyc.useEkycAPI("review",v),_=e=>{N(e),h({kno:e})},x=(null==c||null===(r=c.tableForm)||void 0===r?void 0:r.limit)||10,T=(null==c||null===(o=c.tableForm)||void 0===o?void 0:o.offset)||0;a.useEffect(()=>{y&&S.push("/digit-ui/employee/ekyc/review",{kNumber:f,aadhaarData:null==y?void 0:y.aadhaarData,reviewData:y})},[y]);const I=[{Header:b("EKYC_APPLICATION_NO"),accessor:"applicationNumber",disableSortBy:!0,Cell:e=>{var t,l;let{row:n}=e;const r=(null===(t=n.original)||void 0===t?void 0:t.kno)||(null===(l=n.original)||void 0===l?void 0:l.applicationNumber)||"NA";return a.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>_(r)},r)}},{Header:b("EKYC_CITIZEN_NAME"),accessor:"citizenName",Cell:e=>{var t;let{row:l}=e;return a.createElement("span",null,(null===(t=l.original)||void 0===t?void 0:t.citizenName)||"NA")}},{Header:b("EKYC_STATUS"),accessor:"actionStatus",Cell:e=>{var t;let{row:l}=e;const n=(null===(t=l.original)||void 0===t?void 0:t.status)||"DEFAULT";return a.createElement("span",{className:"ekyc-status-tag "+n},b(""+n))}},{Header:b("EKYC_ACTION"),accessor:"status",Cell:e=>{var t,l;let{row:n}=e;const r=(null===(t=n.original)||void 0===t?void 0:t.kno)||(null===(l=n.original)||void 0===l?void 0:l.applicationNumber)||"NA";return a.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>_(r)},b("EKYC_REVIEW"))}}];return{getCellProps:e=>({style:{padding:"8px",fontSize:"12px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:s,currentPage:Math.floor(T/x),onNextPage:()=>{var e,t;return u({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)},checkPathName:E})},onPrevPage:()=>{var e,t;return u({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)},checkPathName:E})},pageSizeLimit:x,onSort:p,totalRecords:d,onSearch:null==c||null===(i=c.searchForm)||void 0===i?void 0:i.message,onLastPage:()=>{var e;return u({action:"mutateTableForm",data:{...c.tableForm,offset:10*Math.ceil(d/10)-parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.limit)},checkPathName:E})},onFirstPage:()=>u({action:"mutateTableForm",data:{...c.tableForm,offset:0},checkPathName:E}),data:m,columns:I,inboxStyles:{...g},tableStyle:{...C}}})({parentRoute:m,onPageSizeChange:e=>{const t=Number(e.target.value);b({action:"mutateTableForm",data:{...C.tableForm,limit:t,offset:0},checkPathName:D})},formState:C,totalCount:k,table:R,dispatch:b,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:a}]=e,l=a?"DESC":"ASC";C.tableForm.sortBy===t&&C.tableForm.sortOrder===l||b({action:"mutateTableForm",data:{...C.tableForm,sortBy:t,sortOrder:a?"DESC":"ASC"},checkPathName:D})}},tenantId:v,checkPathName:D,inboxStyles:{overflowX:"scroll",overflowY:"hidden"},tableStyle:{width:"70%"}});return a.createElement("div",{className:"app-container"},a.createElement(r.InboxComposer,u({isInboxLoading:f||x,PropsForInboxLinks:A},F,K,{propsForInboxTable:Y,formState:C})))},x=e=>{let{size:t=18,color:l="currentColor"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:l,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"}))},T=e=>{let{size:t=18,color:l="currentColor"}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:l,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),a.createElement("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"}))},I=e=>{let{size:t=14}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))},R=e=>{let{size:t=14}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))},k=e=>{let{size:t=12}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),a.createElement("circle",{cx:"12",cy:"10",r:"3"}))},D=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}))},A=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),a.createElement("polyline",{points:"17 21 17 13 7 13 7 21"}),a.createElement("polyline",{points:"7 3 7 8 15 8"}))},L=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))},w=e=>{let{size:t=16}=e;return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))},O=[{name:"Amit Kumar",id:"SVR001",role:"Surveyor"},{name:"Sanjay Singh",id:"SVR002",role:"Surveyor"},{name:"Rahul Sharma",id:"SVR003",role:"Surveyor"},{name:"Priya Verma",id:"SVR004",role:"Surveyor"}],F=[{name:"MRD - 01 (Central Zone)",code:"MRD01",zone:"Central"},{name:"MRD - 02 (North Zone)",code:"MRD02",zone:"North"},{name:"MRD - 03 (South Zone)",code:"MRD03",zone:"South"},{name:"MRD - 04 (West Zone)",code:"MRD04",zone:"West"},{name:"MRD - 05 (East Zone)",code:"MRD05",zone:"East"},{name:"MRD - 06 (Rohini)",code:"MRD06",zone:"Rohini"},{name:"MRD - 07 (Dwarka)",code:"MRD07",zone:"Dwarka"}],K=e=>{let{mapping:t,onConfirm:l,onCancel:n}=e;return a.createElement("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3}},a.createElement("div",{style:{background:"#fff",borderRadius:"12px",padding:"28px 28px 24px",width:"400px",boxShadow:"0 20px 60px rgba(0,0,0,0.15)"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"}},a.createElement("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"#FEF3F2",display:"flex",alignItems:"center",justifyContent:"center"}},a.createElement(I,{size:18})),a.createElement("div",null,a.createElement("div",{style:{fontWeight:"700",fontSize:"16px",color:"#0D1B2A"}},"Remove Mapping"),a.createElement("div",{style:{fontSize:"12px",color:"#6B7B8E"}},"This action cannot be undone"))),a.createElement("p",{style:{fontSize:"13px",color:"#344054",marginBottom:"24px",lineHeight:"1.6"}},"Are you sure you want to remove the mapping between"," ",a.createElement("strong",null,null==t?void 0:t.surveyorName)," and ",a.createElement("strong",null,null==t?void 0:t.mrdName),"?"),a.createElement("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"}},a.createElement("button",{onClick:n,style:{background:"none",border:"1px solid #D0D5DD",borderRadius:"8px",padding:"8px 20px",fontWeight:"600",fontSize:"13px",color:"#344054",cursor:"pointer"}},"Cancel"),a.createElement("button",{onClick:l,style:{background:"#B42318",border:"none",borderRadius:"8px",padding:"8px 20px",fontWeight:"600",fontSize:"13px",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"}},a.createElement(I,{size:13})," Remove"))))},Y=()=>{const{t:e}=l.useTranslation(),[n,o]=t.useState(null),[i,s]=t.useState(null),[c,d]=t.useState([]),[m,u]=t.useState(null),[E,p]=t.useState(null),[v,g]=t.useState(null),[C,b]=t.useState(null),[S,f]=t.useState(null),N=()=>{u(null),p(null),g(null)},y=t.useMemo(()=>[{Header:e("EKYC_SURVEYOR_NAME")||"Surveyor",accessor:"surveyorName",Cell:t=>{let{row:l}=t;return m===l.original.id?a.createElement("div",{style:{minWidth:"180px"}},a.createElement(r.Dropdown,{selected:E,select:p,option:O,optionKey:"name",t:e,placeholder:"Choose surveyor..."})):a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},a.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},a.createElement(x,{size:15,color:"#3A7BD5"})),a.createElement("div",null,a.createElement("div",{style:{fontWeight:"600",fontSize:"13px",color:"#0D1B2A"}},l.original.surveyorName),a.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"ID: ",l.original.surveyorId)))}},{Header:e("EKYC_MRD_ASSIGNED")||"MRD Assigned",accessor:"mrdName",Cell:t=>{let{row:l}=t;return m===l.original.id?a.createElement("div",{style:{minWidth:"200px"}},a.createElement(r.Dropdown,{selected:v,select:g,option:F,optionKey:"name",t:e,placeholder:"Choose MRD..."})):a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},a.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},a.createElement(T,{size:15,color:"#3A7BD5"})),a.createElement("div",null,a.createElement("div",{style:{fontWeight:"600",fontSize:"13px",color:"#0D1B2A"}},l.original.mrdName),a.createElement("div",{style:{fontSize:"11px",color:"#3A7BD5",display:"flex",alignItems:"center",gap:"3px"}},a.createElement(k,{size:10})," ",l.original.zone)))}},{Header:e("ES_COMMON_ACTION")||"Actions",Cell:e=>{let{row:t}=e;return m===t.original.id?a.createElement("div",{style:{display:"flex",gap:"8px"}},a.createElement("button",{onClick:()=>{return e=t.original.id,void(E&&v?c.some(t=>t.id!==e&&t.surveyorId===E.id&&t.mrdCode===v.code)?f({type:"warning",message:"This mapping already exists"}):(d(t=>t.map(t=>t.id!==e?t:{...t,surveyorName:E.name,surveyorId:E.id,mrdName:v.name,mrdCode:v.code,zone:v.zone})),u(null),f({type:"success",message:"Mapping updated successfully"})):f({type:"error",message:"Please select both Surveyor and MRD to save"}));var e},style:{display:"flex",alignItems:"center",gap:"5px",background:"#3A7BD5",color:"#fff",border:"none",borderRadius:"6px",padding:"6px 12px",fontWeight:"600",fontSize:"12px",cursor:"pointer"}},a.createElement(L,{size:13})," Save"),a.createElement("button",{onClick:N,style:{display:"flex",alignItems:"center",gap:"5px",background:"none",border:"1px solid #D0D5DD",borderRadius:"6px",padding:"6px 12px",fontWeight:"600",fontSize:"12px",color:"#344054",cursor:"pointer"}},a.createElement(w,{size:13})," Cancel")):a.createElement("div",{style:{display:"flex",gap:"8px"}},a.createElement("button",{onClick:()=>(e=>{u(e.id),p(O.find(t=>t.id===e.surveyorId)||null),g(F.find(t=>t.code===e.mrdCode)||null)})(t.original),style:{display:"flex",alignItems:"center",gap:"5px",background:"none",border:"1px solid #D0D5DD",borderRadius:"6px",padding:"6px 12px",color:"#344054",fontSize:"12px",fontWeight:"600",cursor:"pointer"}},a.createElement(R,{size:13})," Edit"),a.createElement("button",{onClick:()=>b(t.original),style:{display:"flex",alignItems:"center",gap:"5px",background:"none",border:"1px solid #FECDCA",borderRadius:"6px",padding:"6px 12px",color:"#B42318",fontSize:"12px",fontWeight:"600",cursor:"pointer"}},a.createElement(I,{size:13})," Remove"))}}],[m,E,v,c,e]);return a.createElement("div",{style:{background:"#F5F7FA",minHeight:"100vh",padding:"0"}},a.createElement(r.Card,{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",marginBottom:"0",borderRadius:"4px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},a.createElement("div",{style:{color:"#3A8DCC"}},a.createElement(T,{size:24})),a.createElement("div",{style:{fontWeight:"700",fontSize:"18px",color:"#0B0C0C"}},e("EKYC_SURVEYOR_MAPPING")||"Surveyor Mapping")),a.createElement("button",{onClick:()=>{f(0!==c.length?{type:"success",message:e("EKYC_MAPPINGS_SAVED_SUCCESS")||"Surveyor mappings saved successfully!"}:{type:"error",message:e("EKYC_NO_MAPPINGS_TO_SAVE")||"No mappings to save"})},disabled:0===c.length,style:{display:"flex",alignItems:"center",gap:"8px",background:0===c.length?"#D0D5DD":"#0F3460",color:"#fff",border:"none",borderRadius:"8px",padding:"10px 20px",fontWeight:"600",fontSize:"14px",cursor:0===c.length?"not-allowed":"pointer",transition:"background 0.2s"}},a.createElement(A,{size:15}),e("EKYC_SAVE_MAPPINGS")||"Save Mappings")),a.createElement("div",{style:{padding:"24px 32px"}},a.createElement("p",{style:{fontSize:"13px",color:"#6B7B8E",marginBottom:"24px",marginTop:"0"}},e("EKYC_MAPPING_SUBHEADER")||"Assign Meter Reading Dairies to surveyors to manage their data access."),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"360px 1fr",gap:"20px",alignItems:"start"}},a.createElement("div",{style:{background:"#fff",borderRadius:"12px",border:"1px solid #E5E9EF",overflow:"hidden"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"16px 20px",borderBottom:"1px solid #F0F2F5",background:"#FAFBFC"}},a.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center"}},a.createElement(T,{size:16,color:"#3A7BD5"})),a.createElement("span",{style:{fontWeight:"700",fontSize:"15px",color:"#0D1B2A"}},e("EKYC_NEW_MAPPING")||"New Mapping")),a.createElement("div",{style:{padding:"20px"}},a.createElement("div",{style:{marginBottom:"16px"}},a.createElement("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"11px",fontWeight:"700",letterSpacing:"0.06em",color:"#3A7BD5",textTransform:"uppercase",marginBottom:"8px"}},a.createElement(x,{size:12,color:"#3A7BD5"}),e("EKYC_SELECT_SURVEYOR")||"Select Surveyor"),a.createElement(r.Dropdown,{selected:n,select:o,option:O,optionKey:"name",t:e,placeholder:e("EKYC_SELECT_SURVEYOR_PLACEHOLDER")||"Choose a surveyor..."})),a.createElement("div",{style:{marginBottom:"16px"}},a.createElement("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"11px",fontWeight:"700",letterSpacing:"0.06em",color:"#3A7BD5",textTransform:"uppercase",marginBottom:"8px"}},a.createElement(T,{size:12,color:"#3A7BD5"}),e("EKYC_SELECT_MRD")||"Select MRD"),a.createElement(r.Dropdown,{selected:i,select:s,option:F,optionKey:"name",t:e,placeholder:e("EKYC_SELECT_MRD_PLACEHOLDER")||"Choose an MRD..."})),i&&a.createElement("div",{style:{background:"#EEF4FB",borderLeft:"3px solid #3A7BD5",borderRadius:"6px",padding:"10px 14px",fontSize:"12px",color:"#0D1B2A",marginBottom:"16px",display:"flex",alignItems:"center",gap:"8px"}},a.createElement(k,{size:13}),a.createElement("span",null,a.createElement("strong",null,i.name)," — ",i.zone," Zone")),n&&a.createElement("div",{style:{background:"#F5F7FA",borderLeft:"3px solid #6B7B8E",borderRadius:"6px",padding:"10px 14px",fontSize:"12px",color:"#0D1B2A",marginBottom:"16px",display:"flex",alignItems:"center",gap:"8px"}},a.createElement(x,{size:13,color:"#6B7B8E"}),a.createElement("span",null,a.createElement("strong",null,n.name)," — ",n.id)),a.createElement("button",{onClick:()=>{n&&i?c.some(e=>e.surveyorId===n.id&&e.mrdCode===i.code)?f({type:"warning",message:e("EKYC_MAPPING_EXISTS")||"This mapping already exists"}):(d(e=>[...e,{id:Date.now(),surveyorName:n.name,surveyorId:n.id,mrdName:i.name,mrdCode:i.code,zone:i.zone}]),s(null),f({type:"success",message:e("EKYC_MAPPING_ADDED")||"Mapping added successfully"})):f({type:"error",message:e("EKYC_SELECT_BOTH_ERROR")||"Please select both Surveyor and MRD"})},disabled:!n||!i,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",background:n&&i?"#3A7BD5":"#D0D5DD",color:"#fff",border:"none",borderRadius:"8px",padding:"12px",fontWeight:"600",fontSize:"14px",cursor:n&&i?"pointer":"not-allowed",marginTop:"4px",transition:"background 0.2s"}},a.createElement(D,{size:16}),e("EKYC_ADD_TO_LIST")||"Add to Mapping List")),c.length>0&&a.createElement("div",{style:{padding:"12px 20px",borderTop:"1px solid #F0F2F5",background:"#FAFBFC",display:"flex",gap:"16px"}},a.createElement("div",{style:{textAlign:"center",flex:1}},a.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:"#0F3460"}},c.length),a.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"Total Mappings")),a.createElement("div",{style:{width:"1px",background:"#E5E9EF"}}),a.createElement("div",{style:{textAlign:"center",flex:1}},a.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:"#0F3460"}},[...new Set(c.map(e=>e.surveyorId))].length),a.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"Surveyors")),a.createElement("div",{style:{width:"1px",background:"#E5E9EF"}}),a.createElement("div",{style:{textAlign:"center",flex:1}},a.createElement("div",{style:{fontSize:"20px",fontWeight:"700",color:"#0F3460"}},[...new Set(c.map(e=>e.mrdCode))].length),a.createElement("div",{style:{fontSize:"11px",color:"#6B7B8E"}},"MRDs")))),a.createElement("div",{style:{background:"#fff",borderRadius:"12px",border:"1px solid #E5E9EF",overflow:"hidden",minHeight:"420px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #F0F2F5",background:"#FAFBFC"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},a.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:"#EEF4FB",display:"flex",alignItems:"center",justifyContent:"center"}},a.createElement(x,{size:16,color:"#3A7BD5"})),a.createElement("span",{style:{fontWeight:"700",fontSize:"15px",color:"#0D1B2A"}},e("EKYC_MAPPING_SUMMARY")||"Mapping Summary")),a.createElement("span",{style:{background:c.length>0?"#0F3460":"#E5E9EF",color:c.length>0?"#fff":"#6B7B8E",fontSize:"12px",fontWeight:"700",padding:"3px 10px",borderRadius:"20px"}},c.length," ",e("EKYC_ITEMS")||"items")),a.createElement("div",{style:{padding:"20px"}},c.length>0?a.createElement("div",{style:{border:"1px solid #E5E9EF",borderRadius:"8px",overflow:"hidden"}},a.createElement(r.Table,{t:e,data:c,columns:y,getCellProps:()=>({}),tableClassName:"digit-table"})):a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"320px",textAlign:"center"}},a.createElement("div",{style:{marginBottom:"16px",opacity:.2}},a.createElement(T,{size:56,color:"#0F3460"})),a.createElement("div",{style:{fontSize:"15px",fontWeight:"700",color:"#0D1B2A",marginBottom:"6px"}},e("EKYC_NO_MAPPINGS")||"No Mappings Created Yet"),a.createElement("div",{style:{fontSize:"13px",color:"#6B7B8E"}},e("EKYC_NO_MAPPINGS_HINT")||"Select a surveyor and MRD on the left to get started.")))))),C&&a.createElement(K,{mapping:C,onConfirm:()=>{d(e=>e.filter(e=>e.id!==C.id)),b(null),f({type:"info",message:e("EKYC_MAPPING_REMOVED")||"Mapping removed"})},onCancel:()=>b(null)}),S&&a.createElement(r.Toast,{label:S.message,error:"error"===S.type,warning:"warning"===S.type,isDsc:!0,onClose:()=>f(null)}))},M=e=>{let{kNumber:o,kName:i,connectionDetails:s,isLoading:c}=e;const{t:d}=l.useTranslation(),m=n.useHistory(),{path:u}=n.useRouteMatch(),[E,p]=t.useState(!1),[v,g]=t.useState({code:"SELF",name:"EKYC_SELF"});if(c)return a.createElement(r.Loader,null);if(!s)return null;const C=(null==s?void 0:s.connectionDetails)||{},b=C.statusflag||"",S="active"===(null==b?void 0:b.toLowerCase())||"A"===b;return a.createElement(a.Fragment,null,a.createElement("div",{className:"ekyc-employee-container"},a.createElement("div",{className:"connection-details-card"},a.createElement("div",{className:"details-card-header"},a.createElement("div",{className:"header-title-wrapper"},a.createElement("div",{className:"header-icon-bg"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#3A7BD5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"}))),a.createElement("span",{className:"header-title-text"},d("EKYC_K_NUMBER_DETAILS")||"Consumer Identity Details")),a.createElement("span",{className:"status-badge "+(S?"active":"inactive")},S?d("EKYC_ACTIVE_CONNECTION")||"Active Connection":b||d("CS_NA"))),a.createElement("div",{className:"details-card-body"},a.createElement("div",{className:"body-content-row"},a.createElement("div",{className:"detail-section"},a.createElement("div",{className:"section-title"},d("EKYC_VERIFICATION_PARAMETERS")||"Verification Parameters"),a.createElement("div",{className:"data-grid"},a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_CONSUMER_NAME")||"Consumer Name"),a.createElement("div",{className:"data-value"},C.consumerName||i||d("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_K_NUMBER")||"K Number"),a.createElement("div",{className:"data-value blue"},o||d("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_METER_NO")||"Meter Serial No."),a.createElement("div",{className:"data-value"},C.meterNumber||d("CS_NA"))),a.createElement("div",{className:"data-item"},a.createElement("div",{className:"data-label"},d("EKYC_CONNECTION_TYPE")||"Connection Type"),a.createElement("div",{className:"data-value"},C.connectionType||d("CS_NA"))))),a.createElement("div",{className:"vertical-divider"}),a.createElement("div",{className:"detail-section"},a.createElement("div",{className:"section-title"},d("EKYC_ADDRESS_AND_CONTACT")||"Address & Contact"),a.createElement("div",{className:"address-block"},a.createElement("div",{className:"icon-wrapper-small"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M21 10c0 7-9 13-9 13S3 17 3 10a9 9 0 0 1 18 0z"}),a.createElement("circle",{cx:"12",cy:"10",r:"3"}))),a.createElement("div",null,a.createElement("div",{className:"data-label"},d("EKYC_ADDRESS")||"Service Address"),a.createElement("div",{className:"address-text"},C.address||d("CS_NA")))),a.createElement("div",{className:"contact-row"},a.createElement("div",{className:"contact-item"},a.createElement("div",{className:"icon-wrapper-small"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),a.createElement("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"}))),a.createElement("div",null,a.createElement("div",{className:"data-label"},d("EKYC_PHONE_NO")||"Contact"),a.createElement("div",{className:"address-text"},C.phoneNumber||d("CS_NA")))),a.createElement("div",{className:"contact-item"},a.createElement("div",{className:"icon-wrapper-small"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#6B7B8E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("circle",{cx:"12",cy:"12",r:"4"}),a.createElement("path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"}))),a.createElement("div",null,a.createElement("div",{className:"data-label"},d("EKYC_EMAIL")||"Email Address"),a.createElement("div",{className:"address-text"},C.email||d("CS_NA")))))))),a.createElement("div",{className:"details-card-footer"},a.createElement("div",{className:"footer-meta-text"},null!=s&&s.lastVerified?`${d("EKYC_LAST_VERIFIED")||"Last verified:"} ${s.lastVerified}`:""),a.createElement("div",{className:"action-btns-container",style:{fontSize:"12px"}},a.createElement("button",{onClick:()=>p(!0),className:"primary-action-btn",style:{fontSize:"12px"}},d("EKYC_START_REVIEW")||"Start Review",a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),a.createElement("polyline",{points:"12 5 19 12 12 19"}))))))),E&&a.createElement(r.Modal,{headerBarMain:d("EKYC_SELECT_VERIFICATION_TYPE"),headerBarEnd:a.createElement("span",{onClick:()=>p(!1),style:{cursor:"pointer",padding:"8px"}},"X"),actionSaveLabel:d("ES_COMMON_CONFIRM"),actionSaveOnSubmit:()=>{const e=u.includes("/create-kyc")?u.replace("/create-kyc",""):u.replace("/k-details","");m.push(e+"/consumer-details",{kNumber:o,selectedOption:v,connectionDetails:s}),p(!1)},actionCancelLabel:d("ES_COMMON_CANCEL"),actionCancelOnSubmit:()=>p(!1),style:{borderRadius:"12px"}},a.createElement("div",{style:{padding:"24px"}},a.createElement(r.RadioButtons,{name:"verificationType",options:[{code:"SELF",name:"EKYC_SELF"},{code:"OTHER",name:"EKYC_OTHER"}],optionsKey:"name",selectedOption:v,onSelect:g,style:{display:"flex",flexDirection:"column",gap:"12px",buttonStyle:{borderRadius:"5px"}},t:d}))))},P=()=>{const{t:e}=l.useTranslation(),[n,o]=t.useState(()=>{const e=sessionStorage.getItem("EKYC_CREATE_SEARCH_PARAMS");return e?JSON.parse(e):{kNumber:"",kName:""}}),[i,s]=t.useState(()=>"true"===sessionStorage.getItem("EKYC_CREATE_SEARCH_PERFORMED")),[c,m]=t.useState(null),[u,E,p]=Digit.Hooks.useSessionStorage("EKYC_CREATE",{}),v=Digit.ULBService.getCurrentTenantId(),{isLoading:g,data:C}=Digit.Hooks.ekyc.useSearchConnection({tenantId:v,details:{kno:n.kNumber,name:n.kName}},{enabled:i&&!!n.kNumber&&!!n.kName,onError:t=>{var a,l,n,r;m({error:!0,label:(null==t||null===(a=t.response)||void 0===a||null===(l=a.data)||void 0===l||null===(n=l.Errors)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.message)||e("EKYC_SEARCH_ERROR_PLEASE_ENTER_THE_CORRECT_CREDENTIALS")}),s(!1),sessionStorage.removeItem("EKYC_CREATE_SEARCH_PERFORMED")}});return a.createElement(d,{onSearch:t=>{if(!t.kNumber&&!t.kName)return o({kNumber:"",kName:""}),s(!1),sessionStorage.removeItem("EKYC_CREATE_SEARCH_PARAMS"),sessionStorage.removeItem("EKYC_CREATE_SEARCH_PERFORMED"),void p();t.kNumber&&t.kName?(o(t),s(!0),sessionStorage.getItem("EKYC_K_NUMBER")!==t.kNumber&&(p(),Object.keys(sessionStorage).forEach(e=>{e.startsWith("EKYC_")&&"EKYC_CREATE"!==e&&sessionStorage.removeItem(e)})),sessionStorage.setItem("EKYC_CREATE_SEARCH_PARAMS",JSON.stringify(t)),sessionStorage.setItem("EKYC_CREATE_SEARCH_PERFORMED","true"),sessionStorage.setItem("EKYC_K_NUMBER",t.kNumber)):m({error:!0,label:e("EKYC_FILL_ALL_FIELDS")})},searchParams:n},i&&a.createElement(M,{kNumber:n.kNumber,kName:n.kName,connectionDetails:C,isLoading:g}),!i&&!g&&a.createElement(r.Card,{style:{textAlign:"center",padding:"40px"}},a.createElement("div",{style:{color:"#667085"}},e("EKYC_SEARCH_TO_VIEW_DETAILS"))),c&&a.createElement(r.Toast,{error:c.error,label:c.label,onClose:()=>{m(null)},isDsc:!0}))},B=e=>{let{jumpTo:t,state:o}=e;l.useTranslation();const i=n.useHistory();return a.createElement(r.LinkButton,{label:a.createElement(r.EditIcon,{style:{marginTop:"-30px",float:"right",position:"relative",bottom:"32px"}}),className:"check-page-link-button",onClick:function(){i.push(t,{...o,isEditing:!0})}})},z=e=>null!=e&&""!==e?e:"N/A",U=(e,t)=>!0===e||"true"===e||"yes"===String(e).toLowerCase()?t("CORE_COMMON_YES"):!1===e||"false"===e||"no"===String(e).toLowerCase()?t("CORE_COMMON_NO"):"N/A",H=()=>{var e,o,i,s,c,d,m;const{t:u}=l.useTranslation(),p=n.useHistory(),v=n.useLocation(),[g,C]=t.useState(!1),[b,S]=t.useState(!1),f=v.state||{},{kNumber:N,kno:y,edits:h={}}=f,_=N||y,{aadhaarData:x={},addressDetails:T={},propertyDetails:I={},meterDetails:R={}}=h,k=Digit.ULBService.getCurrentTenantId(),{data:D,isLoading:A}=Digit.Hooks.ekyc.useEkycSearchReview({kno:_,fetchType:"REVIEW"},k,{enabled:!!_}),L=((e,t)=>{const a=e&&Object.keys(e).length>0?e:(null==t?void 0:t.reviewData)||{},l=(null==a?void 0:a.applicationReview)||a,n=(Array.isArray(l)?l[0]:l)||{};return(null==n?void 0:n.newData)||n})(D,f),w=(null==L?void 0:L.connectionDetails)||L||{},O=(null==L?void 0:L.addressDetails)||L||{},F=(null==L?void 0:L.propertyInfo)||L||{},K=(null==L?void 0:L.meterDetails)||L||{},Y={consumerName:(null==x?void 0:x.name)||(null==w?void 0:w.consumerName),address:(null==w?void 0:w.address)||(null==w?void 0:w.addressRaw),connectionType:(null==w?void 0:w.connectionType)||(null==w?void 0:w.connectionCategory),meterNumber:(null==w?void 0:w.meterNumber)||(null==w?void 0:w.meterNo),phoneNumber:(null==x?void 0:x.mobileNumber)||(null==w?void 0:w.phoneNumber)||(null==w?void 0:w.mobileNo),email:null==w?void 0:w.email,statusflag:(null==w?void 0:w.statusflag)||(null==w?void 0:w.statusFlag),ekycStatus:null==w?void 0:w.ekycStatus,knumber:(null==w?void 0:w.knumber)||(null==w?void 0:w.kno)||_},M={fullAddress:(null==T?void 0:T.fullAddress)||(null==O?void 0:O.fullAddress)||(null==O?void 0:O.addressRaw),flatHouseNumber:(null==T?void 0:T.flatHouseNumber)||(null==T?void 0:T.flatNo)||(null==O?void 0:O.flatHouseNumber),buildingTower:(null==T?void 0:T.buildingTower)||(null==T?void 0:T.building)||(null==O?void 0:O.buildingTower),landmark:(null==T?void 0:T.landmark)||(null==O?void 0:O.landmark),pinCode:(null==T?void 0:T.pinCode)||(null==T?void 0:T.pincode)||(null==O?void 0:O.pinCode)||(null==O?void 0:O.pincode),ward:(null==T?void 0:T.ward)||(null==O?void 0:O.ward)||(null==O?void 0:O.locality),assembly:(null==T?void 0:T.assembly)||(null==O?void 0:O.assembly),gpsValid:void 0!==(null==T?void 0:T.gpsValid)?T.gpsValid:null==O?void 0:O.gpsValid,latitude:(null==T?void 0:T.latitude)||(null==O?void 0:O.latitude),longitude:(null==T?void 0:T.longitude)||(null==O?void 0:O.longitude),mobileNo:(null==T?void 0:T.mobileNo)||(null==x?void 0:x.mobileNumber)||(null==O?void 0:O.mobileNo),whatsappNo:(null==T?void 0:T.whatsappNo)||(null==x?void 0:x.whatsappNumber)||(null==O?void 0:O.whatsappNo),email:(null==T?void 0:T.email)||(null==O?void 0:O.email),noOfPerson:(null==T?void 0:T.noOfPerson)||(null==x?void 0:x.noOfPersons)||(null==O?void 0:O.noOfPerson),knumber:(null==T?void 0:T.knumber)||(null==O?void 0:O.knumber)||(null==O?void 0:O.kno)||_,doorPhotoFilestoreId:(null==T?void 0:T.doorPhotoFileStoreId)||(null==O?void 0:O.doorPhotoFilestoreId)},P={kno:(null==F?void 0:F.kno)||_,pidNumber:(null==I?void 0:I.pidNumber)||(null==F?void 0:F.pidNumber),typeOfConnection:(null==I||null===(e=I.connectionTypeData)||void 0===e?void 0:e.label)||(null==F?void 0:F.typeOfConnection),connectionCategory:(null==I||null===(o=I.connectionCategoryData)||void 0===o?void 0:o.label)||(null==F?void 0:F.connectionCategory),userType:(null==I||null===(i=I.userTypeData)||void 0===i?void 0:i.label)||(null==F?void 0:F.userType),numberOfFloors:(null==I||null===(s=I.noOfFloorsData)||void 0===s?void 0:s.label)||(null==F?void 0:F.numberOfFloors),tenantName:null==F?void 0:F.tenantName,tenantMobile:null==F?void 0:F.tenantMobile,ekycStatus:null==F?void 0:F.ekycStatus,propertyDocumentFileStoreId:(null==I?void 0:I.propertyDocumentFileStoreId)||(null==F?void 0:F.propertyDocumentFileStoreId),buildingImageFileStoreId:null==F?void 0:F.buildingImageFileStoreId},H={kno:(null==R?void 0:R.kno)||(null==K?void 0:K.kno)||_,metered:"Metered"===(null==R||null===(c=R.meterStatusData)||void 0===c?void 0:c.value)||(null==K?void 0:K.metered),meterNumber:(null==K?void 0:K.meterNumber)||(null==K?void 0:K.meterNo),meterMake:(null==R?void 0:R.meterMake)||(null==K?void 0:K.meterMake),meterLocationAddress:(null==R?void 0:R.meterLocation)||(null==K?void 0:K.meterLocationAddress),meterLatitude:null==K?void 0:K.meterLatitude,meterLongitude:null==K?void 0:K.meterLongitude,workingStatus:"Working"===(null==R||null===(d=R.workingStatusData)||void 0===d?void 0:d.value)||(null==K?void 0:K.workingStatus),lastBillRaised:"Yes"===(null==R||null===(m=R.lastBillRaisedData)||void 0===m?void 0:m.value)||(null==K?void 0:K.lastBillRaised),systemMeterId:null==K?void 0:K.systemMeterId,meterPhotoFileStoreId:(null==R?void 0:R.meterPhotoFileStoreId)||(null==K?void 0:K.meterPhotoFileStoreId)};if(A||b)return a.createElement(r.Loader,null);const V="/digit-ui/employee/ekyc";return a.createElement("div",{className:"review-container"},a.createElement(r.Card,null,a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"}},a.createElement(r.CardHeader,{style:{margin:0}},u("EKYC_REVIEW_APPLICATION")),a.createElement("div",{style:{background:"#F9FAFB",border:"0.5px solid #EAECF0",borderRadius:"20px",padding:"4px 14px",fontSize:"12px",color:"#667085"}},u("EKYC_K_NUMBER"),": ",a.createElement("span",{style:{color:"#0B0C0C",fontWeight:"600"}},_))),a.createElement(r.CardSubHeader,null,u("EKYC_CONNECTION_DETAILS")),a.createElement(r.StatusTable,{style:{marginTop:"20px",marginBottom:"30px"}},a.createElement(r.Row,{label:u("EKYC_K_NUMBER"),text:z(Y.knumber)}),a.createElement(r.Row,{label:u("EKYC_CONSUMER_NAME"),text:z(Y.consumerName)}),a.createElement(r.Row,{label:u("EKYC_ADDRESS"),text:z(Y.address)}),a.createElement(r.Row,{label:u("EKYC_CONNECTION_TYPE"),text:z(Y.connectionType)}),a.createElement(r.Row,{label:u("EKYC_METER_NO"),text:z(Y.meterNumber)}),a.createElement(r.Row,{label:u("EKYC_MOBILE_NO"),text:z(Y.phoneNumber)}),a.createElement(r.Row,{label:u("EKYC_EMAIL"),text:z(Y.email)}),a.createElement(r.Row,{label:u("EKYC_STATUS_FLAG"),text:z(Y.statusflag)}),a.createElement(r.Row,{label:u("EKYC_STATUS"),text:z(Y.ekycStatus)})),a.createElement(r.CardSubHeader,null,u("EKYC_ADDRESS_DETAILS")),a.createElement(r.StatusTable,{style:{marginTop:"20px",marginBottom:"30px"}},a.createElement(r.Row,{label:u("EKYC_FULL_ADDRESS"),text:z(M.fullAddress),actionButton:a.createElement(B,{jumpTo:V+"/address-details",state:{...f,reviewData:D,edits:h}})}),a.createElement(r.Row,{label:u("EKYC_FLAT_HOUSE_NO"),text:z(M.flatHouseNumber)}),a.createElement(r.Row,{label:u("EKYC_BUILDING_TOWER"),text:z(M.buildingTower)}),a.createElement(r.Row,{label:u("EKYC_LANDMARK"),text:z(M.landmark)}),a.createElement(r.Row,{label:u("EKYC_PINCODE"),text:z(M.pinCode)}),a.createElement(r.Row,{label:u("EKYC_LOCALITY"),text:z(M.ward)}),a.createElement(r.Row,{label:u("EKYC_ASSEMBLY"),text:z(M.assembly)}),a.createElement(r.Row,{label:u("EKYC_GPS_VALID"),text:U(M.gpsValid,u)}),a.createElement(r.Row,{label:u("EKYC_LATITUDE"),text:z(M.latitude)}),a.createElement(r.Row,{label:u("EKYC_LONGITUDE"),text:z(M.longitude)}),a.createElement(r.Row,{label:u("EKYC_MOBILE_NO"),text:z(M.mobileNo)}),a.createElement(r.Row,{label:u("EKYC_WHATSAPP_NO"),text:z(M.whatsappNo)}),a.createElement(r.Row,{label:u("EKYC_EMAIL"),text:z(M.email)}),a.createElement(r.Row,{label:u("EKYC_NO_OF_PERSONS"),text:z(M.noOfPerson)}),a.createElement(r.Row,{label:u("EKYC_K_NUMBER"),text:z(M.knumber)})),a.createElement(r.CardSubHeader,null,u("EKYC_PROPERTY_INFO")),a.createElement(r.StatusTable,{style:{marginTop:"20px",marginBottom:"30px"}},a.createElement(r.Row,{label:u("EKYC_CONNECTION_CATEGORY"),text:z(P.connectionCategory),actionButton:a.createElement(B,{jumpTo:V+"/property-info",state:{...f,reviewData:D,edits:h}})}),a.createElement(r.Row,{label:u("EKYC_PID_NUMBER"),text:z(P.pidNumber)}),a.createElement(r.Row,{label:u("EKYC_TYPE_OF_CONNECTION"),text:z(P.typeOfConnection)}),a.createElement(r.Row,{label:u("EKYC_USER_TYPE"),text:z(P.userType)}),a.createElement(r.Row,{label:u("EKYC_FLOOR_COUNT"),text:z(P.numberOfFloors)}),a.createElement(r.Row,{label:u("EKYC_TENANT_NAME"),text:z(P.tenantName)}),a.createElement(r.Row,{label:u("EKYC_TENANT_MOBILE"),text:z(P.tenantMobile)}),a.createElement(r.Row,{label:u("EKYC_STATUS"),text:z(P.ekycStatus)})),a.createElement(r.CardSubHeader,null,u("EKYC_METER_DETAILS")),a.createElement(r.StatusTable,{style:{marginTop:"20px",marginBottom:"30px"}},a.createElement(r.Row,{label:u("EKYC_METERED"),text:U(H.metered,u),actionButton:a.createElement(B,{jumpTo:V+"/meter-details",state:{...f,reviewData:D,edits:h}})}),a.createElement(r.Row,{label:u("EKYC_METER_NO"),text:z(H.meterNumber)}),a.createElement(r.Row,{label:u("EKYC_METER_MAKE"),text:z(H.meterMake)}),a.createElement(r.Row,{label:u("EKYC_METER_LOCATION_ADDRESS"),text:z(H.meterLocationAddress)}),a.createElement(r.Row,{label:u("EKYC_METER_LATITUDE"),text:z(H.meterLatitude)}),a.createElement(r.Row,{label:u("EKYC_METER_LONGITUDE"),text:z(H.meterLongitude)}),a.createElement(r.Row,{label:u("EKYC_WORKING_STATUS"),text:U(H.workingStatus,u)}),a.createElement(r.Row,{label:u("EKYC_LAST_BILL_RAISED"),text:U(H.lastBillRaised,u)}),a.createElement(r.Row,{label:u("EKYC_SYSTEM_METER_ID"),text:z(H.systemMeterId)})),a.createElement(r.CardSubHeader,null,u("EKYC_DOCUMENTS")),a.createElement(r.StatusTable,{style:{marginTop:"20px",marginBottom:"30px"}},a.createElement(r.Row,{label:u("EKYC_DOOR_PHOTO"),text:u(M.doorPhotoFilestoreId?"EKYC_PHOTO_AVAILABLE":"CS_NA"),actionButton:M.doorPhotoFilestoreId&&a.createElement(r.GenericFileIcon,{style:{cursor:"pointer"}})}),a.createElement(r.Row,{label:u("EKYC_METER_PHOTO"),text:u(H.meterPhotoFileStoreId?"EKYC_PHOTO_AVAILABLE":"CS_NA"),actionButton:H.meterPhotoFileStoreId&&a.createElement(r.GenericFileIcon,{style:{cursor:"pointer"}})}),a.createElement(r.Row,{label:u("EKYC_BUILDING_IMAGE"),text:u(P.buildingImageFileStoreId?"EKYC_PHOTO_AVAILABLE":"CS_NA"),actionButton:P.buildingImageFileStoreId&&a.createElement(r.GenericFileIcon,{style:{cursor:"pointer"}})}),a.createElement(r.Row,{label:u("EKYC_PROPERTY_DOCUMENTS"),text:u(P.propertyDocumentFileStoreId?"EKYC_DOCS_AVAILABLE":"CS_NA"),actionButton:P.propertyDocumentFileStoreId&&a.createElement(r.GenericFileIcon,{style:{cursor:"pointer"}})})),a.createElement(r.CheckBox,{id:"agreeDeclaration",name:"agreeDeclaration",label:u("EKYC_FINAL_DECLARATION"),onChange:()=>C(!g),checked:g,style:{marginTop:"20px"}})),a.createElement(r.ActionBar,{style:{position:"static",marginTop:"24px"}},a.createElement(r.SubmitBar,{label:u("EKYC_SUBMIT_APPLICATION"),onSubmit:function(){try{S(!0);const e=function(e,t){try{var a=E(function(){return Promise.resolve(Digit.EkycService.application_update({kno:_,tenantId:k,newData:{connectionDetails:Y,addressDetails:M,propertyInfo:P,meterDetails:H}},k)).then(function(e){e&&p.push("/digit-ui/employee/ekyc/response",{success:!0,result:e})})},function(e){console.error("Submit Error:",e)})}catch(e){return t(!0,e)}return a&&a.then?a.then(t.bind(null,!1),t.bind(null,!0)):t(!1,a)}(0,function(e,t){if(S(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!g})))};var V,W=(V=a.createContext(void 0),"undefined"!=typeof window&&(window.ReactQueryClientContext=V),V);const j=e=>{let{config:l,onSelect:n}=e;const[o,i]=t.useState(""),[s,c]=t.useState(null),[d,m]=t.useState(null),[u,p]=t.useState(null),[v,g]=t.useState(""),[C,b]=t.useState(""),[S,f]=t.useState(""),[N,y]=t.useState(""),[h,_]=t.useState(null),[x,T]=t.useState(""),[I,R]=t.useState(""),[k,D]=t.useState(""),[A,L]=t.useState(""),[w,O]=t.useState(""),[F,K]=t.useState(null),[Y,M]=t.useState(null),[P,B]=t.useState(""),[z,U]=t.useState(""),[H,V]=t.useState(""),[W,j]=t.useState(""),[G,$]=t.useState(""),[q,X]=t.useState(""),[Z,Q]=t.useState(""),[J,ee]=t.useState(""),[te,ae]=t.useState(""),[le,ne]=t.useState(null),[re,oe]=t.useState(""),[ie,se]=t.useState(null),[ce,de]=t.useState(!1),[me,ue]=t.useState(!0),[Ee,pe]=t.useState(""),[ve,ge]=t.useState(""),[Ce,be]=t.useState(null);return a.createElement(t.Fragment,null,a.createElement(r.FormStep,{onSelect:()=>{o&&s&&d&&u&&C&&I&&w&&!(Number(w)<=0)&&("Tenanted"!==(null==d?void 0:d.name)||Y||P)&&ce?n(l.key,{kno:o,consumerType:null==s?void 0:s.name,occupantType:null==d?void 0:d.name,categoryType:null==u?void 0:u.name,consumerName:v,firstName:C,middleName:S,lastName:N,gender:null==h?void 0:h.name,relation:x,mobile:I,whatsapp:k,email:A,residents:w,documentId:Y,ownerMobile:P,tenantVerification:z,designation:H,department:W,employeeId:G,landline:q,entityRelation:Z,contactPerson:J,entityName:te,idProof:null==le?void 0:le.name,idNumber:re,consent:ce,informantIsConsumer:me,informantName:Ee,informantRelation:ve}):be({type:"error",message:"Fill required fields"})},config:l},a.createElement("div",null,a.createElement(r.CardLabel,null,"K Number *"),a.createElement(r.TextInput,{value:o,onChange:e=>i(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Consumer Type *"),a.createElement(r.Dropdown,{option:[{name:"Individual"},{name:"Govt"},{name:"Company_Society_Org"}],selected:s,select:c})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Occupant Type *"),a.createElement(r.Dropdown,{option:[{name:"Self"},{name:"Tenanted"}],selected:d,select:m})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Category Type *"),a.createElement(r.Dropdown,{option:[],selected:u,select:p})),a.createElement("div",null,a.createElement(r.CardLabel,null,"First Name *"),a.createElement(r.TextInput,{value:C,onChange:e=>b(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Middle Name"),a.createElement(r.TextInput,{value:S,onChange:e=>f(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Last Name"),a.createElement(r.TextInput,{value:N,onChange:e=>y(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Gender"),a.createElement(r.Dropdown,{option:[{name:"Male"},{name:"Female"},{name:"Others"},{name:"Not prefer to say"}],selected:h,select:_})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Mobile *"),a.createElement(r.TextInput,{value:I,onChange:e=>R(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"WhatsApp"),a.createElement(r.TextInput,{value:k,onChange:e=>D(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Email"),a.createElement(r.TextInput,{value:A,onChange:e=>L(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Residents *"),a.createElement(r.TextInput,{value:w,onChange:e=>O(e.target.value)})),"Tenanted"===(null==d?void 0:d.name)&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Document Proof"),a.createElement(r.UploadFile,{onUpload:e=>function(e,t,a){try{const l=e.target.files[0];if(!l)return Promise.resolve();const n=E(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",l)).then(function(e){var n,r,o;const i=null==e||null===(n=e.data)||void 0===n||null===(r=n.files)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.fileStoreId;i&&(t(l.name),a(i))})},function(){be({type:"error",message:"Upload failed"})});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(e,K,M)})),!Y&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Owner Mobile *"),a.createElement(r.TextInput,{value:P,onChange:e=>B(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Tenant Verification"),a.createElement(r.TextInput,{value:z,onChange:e=>U(e.target.value)})))),"Govt"===(null==s?void 0:s.name)&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Designation"),a.createElement(r.TextInput,{value:H,onChange:e=>V(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Department"),a.createElement(r.TextInput,{value:W,onChange:e=>j(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Employee ID"),a.createElement(r.TextInput,{value:G,onChange:e=>$(e.target.value)}))),"Company_Society_Org"===(null==s?void 0:s.name)&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Entity Name"),a.createElement(r.TextInput,{value:te,onChange:e=>ae(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Contact Person"),a.createElement(r.TextInput,{value:J,onChange:e=>ee(e.target.value)})))))},G=[{body:[{route:"consumer-details",component:j,key:"aadhaarVerification",texts:{header:"EKYC_CONSUMER_CONNECTION",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:1,actions:"EKYC_CONSUMER_CONNECTION"}]},{route:"address-details",component:"AddressDetails",key:"addressDetails",doorImage:!0,texts:{header:"EKYC_ADDRESS_DETAILS",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:2,actions:"EKYC_ADDRESS_DETAILS"}]},{route:"property-info",component:"PropertyInfo",key:"propertyDetails",texts:{header:"EKYC_PROPERTY_INFO",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:3,actions:"EKYC_PROPERTY_INFO"}]},{route:"meter-details",component:"MeterDetails",key:"meterDetails",texts:{header:"EKYC_METER_DETAILS",submitBarLabel:"COMMON_SAVE_NEXT"},timeLine:[{currentStep:4,actions:"EKYC_METER_DETAILS"}]}]}],$=e=>{let{path:o}=e;!function(){var e;if(!a.useContext("undefined"!=typeof window&&null!=(e=window.ReactQueryClientContext)?e:W))throw new Error("No QueryClient set, use QueryClientProvider to set one")}();const i=n.useRouteMatch(),{t:s}=l.useTranslation(),c=n.useLocation(),{pathname:d}=c,m=n.useHistory();let u=[];const[E,p,v]=Digit.Hooks.useSessionStorage("EKYC_CREATE",{});function g(e,t,a,l,n){void 0===n&&(n=!1),p({...E,[e]:{...E[e],...t}}),((e,t,a,l)=>{let n=d.split("/").pop(),r=u.find(e=>l?e.key===l:e.route===n);r||(r=u.find(e=>e.route===n));let s=null;const c=u.findIndex(e=>e.route===r.route);c>-1&&c<u.length-1&&(s=u[c+1].route);let p=m.push;e&&(p=m.replace);const v=o||i.path.split("/").slice(0,-1).join("/");if(null===s)return p(v+"/review",{...E,edits:E});p(`${v}/${s}`,{...E})})(a,0,0,e)}Digit.UserService.getUser(),Digit.ULBService.getCurrentTenantId(),t.useEffect(()=>{if(c.state&&Object.keys(c.state).length>0){const{edits:e,...t}=c.state;p({...E,...t,...e})}},[c.state]),G.forEach(e=>{u=u.concat(e.body)}),u.indexRoute="consumer-details";const C=u.map(e=>e.route),b=C.some(e=>d.includes(e)),S=t.useRef({});return t.useEffect(()=>{if(b){const e=d.split("/").pop();S.current[e]&&S.current[e].scrollIntoView({behavior:"smooth",block:"start"})}},[d,b]),a.createElement(a.Fragment,null,a.createElement("div",{className:"employee-form-section-wrapper"},a.createElement(r.VerticalTimeline,{config:u,showFinalStep:!0}),a.createElement("div",{className:"employee-form-section"},a.createElement(n.Switch,null,a.createElement(n.Route,{path:C.map(e=>`${o||i.path.split("/").slice(0,-1).join("/")}/${e}`)},a.createElement("div",{className:"single-page-form-container"},u.map((e,t)=>{const{component:l}=e,n="string"==typeof l?Digit.ComponentRegistryService.getComponent(l):l;return a.createElement("div",{key:t,ref:t=>S.current[e.route]=t,className:"form-section-unit"},a.createElement(n,{config:{...e,isCollapsible:!0,defaultOpen:!0},onSelect:g,t:s,formData:E}))}))),a.createElement(n.Route,null,a.createElement(n.Redirect,{to:`${o||i.path.split("/").slice(0,-1).join("/")}/${u.indexRoute}`}))))))},q=e=>{let{path:t}=e;const{t:o}=l.useTranslation(),i=n.useLocation();sessionStorage.removeItem("revalidateddone");const s=[{icon:r.HomeIcon,path:"/digit-ui/employee"},{label:o((()=>{const e=i.pathname;return e.includes("/dashboard")?"ES_COMMON_INBOX":e.includes("/create-kyc")?"EKYC_CREATE_KYC":e.includes("/k-details")?"EKYC_K_DETAILS":e.includes("/consumer-details")?"EKYC_CONSUMER_DETAILS":e.includes("/address-details")?"EKYC_ADDRESS_DETAILS":e.includes("/property-info")?"EKYC_PROPERTY_INFO":e.includes("/meter-details")?"EKYC_METER_DETAILS":e.includes("/review")?"EKYC_REVIEW":"ES_COMMON_INBOX"})())}];return a.createElement(r.AppContainer,null,a.createElement("div",{className:"ground-container employee-app-container form-container"},a.createElement(r.ModuleHeader,{leftContent:a.createElement(a.Fragment,null,a.createElement(r.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:s}),a.createElement("div",{className:"employee-form"},a.createElement("div",{className:"employee-form-content"},a.createElement(n.Switch,null,a.createElement(r.PrivateRoute,{path:t+"/dashboard",component:()=>a.createElement(c,{parentRoute:t,businessService:"EKYC",moduleCode:"EKYC",isInbox:!0})}),a.createElement(r.PrivateRoute,{path:t+"/inbox",component:()=>a.createElement(_,{parentRoute:t,businessService:"EKYC",moduleCode:"EKYC",isInbox:!0})}),a.createElement(r.PrivateRoute,{path:t+"/create-kyc",component:()=>a.createElement(P,null)}),a.createElement(r.PrivateRoute,{path:t+"/mapping",component:()=>a.createElement(Y,null)}),a.createElement(r.PrivateRoute,{path:["consumer-details","address-details","property-info","meter-details"].map(e=>`${t}/${e}`),component:e=>a.createElement($,u({},e,{path:t}))}),a.createElement(r.PrivateRoute,{path:t+"/review",component:()=>a.createElement(H,null)}))))))},X=e=>{var n,o,i,s,c;let{config:d,onSelect:m}=e;const{t:u}=l.useTranslation(),p=Digit.ULBService.getCurrentTenantId(),[v,g]=t.useState(""),[C,b]=t.useState(""),[S,f]=t.useState(""),[N,y]=t.useState(""),[h,_]=t.useState(null),[x,T]=t.useState(""),[I,R]=t.useState(null),[k,D]=t.useState(null),[A,L]=t.useState(null),[w,O]=t.useState(""),[F,K]=t.useState(""),[Y,M]=t.useState(null),[P,B]=t.useState(null),[z,U]=t.useState(null),[H,V]=t.useState(null),{data:W,isLoading:j}=Digit.Hooks.useCommonMDMS(p,"egov-location",["TenantBoundary"]),G=(null==W||null===(n=W.MdmsRes)||void 0===n||null===(o=n["egov-location"])||void 0===o||null===(i=o.TenantBoundary)||void 0===i||null===(s=i[0])||void 0===s||null===(c=s.boundary)||void 0===c?void 0:c.children)||[];return t.useEffect(()=>{let e=!0;return navigator.geolocation&&navigator.geolocation.getCurrentPosition(t=>{e&&(O(t.coords.latitude),K(t.coords.longitude))},()=>{e&&V({type:"error",message:"GPS access denied"})}),()=>{e=!1}},[]),j?a.createElement(r.Loader,null):a.createElement(t.Fragment,null,a.createElement(r.FormStep,{t:u,onSelect:()=>{v&&C&&6===x.length&&I&&k&&A&&w&&F&&z?m(d.key,{houseNo:v,street:C,locality:S,landmark:N,subLocality:h,pinCode:x,assembly:null==I?void 0:I.name,ward:null==k?void 0:k.name,zone:null==A?void 0:A.name,latitude:w,longitude:F,addressType:null==Y?void 0:Y.name,doorPhotoFilestoreId:z}):V({type:"error",message:"Please fill all mandatory fields"})},config:d,label:u("ES_COMMON_CONTINUE")},a.createElement(r.CardLabel,null,"House No / Flat No *"),a.createElement(r.TextInput,{value:v,onChange:e=>g(e.target.value)}),a.createElement(r.CardLabel,null,"Street / Address Line *"),a.createElement(r.TextInput,{value:C,onChange:e=>b(e.target.value)}),a.createElement(r.CardLabel,null,"Locality"),a.createElement(r.TextInput,{value:S,onChange:e=>f(e.target.value)}),a.createElement(r.CardLabel,null,"Landmark"),a.createElement(r.TextInput,{value:N,onChange:e=>y(e.target.value)}),a.createElement(r.CardLabel,null,"Sub Locality"),a.createElement(r.Dropdown,{option:[],selected:h,select:_}),a.createElement(r.CardLabel,null,"PIN Code *"),a.createElement(r.TextInput,{value:x,onChange:e=>{const t=e.target.value;/^\d{0,6}$/.test(t)&&(T(t),6===t.length&&console.log("Fetching location for PIN:",t))},maxLength:6}),a.createElement(r.CardLabel,null,"Assembly *"),a.createElement(r.Dropdown,{option:G,selected:I,select:R}),a.createElement(r.CardLabel,null,"Ward *"),a.createElement(r.Dropdown,{option:(null==I?void 0:I.children)||[],selected:k,select:D}),a.createElement(r.CardLabel,null,"Zone *"),a.createElement(r.Dropdown,{option:(null==k?void 0:k.children)||[],selected:A,select:L}),a.createElement(r.CardLabel,null,"Latitude"),a.createElement(r.TextInput,{value:w,disabled:!0}),a.createElement(r.CardLabel,null,"Longitude"),a.createElement(r.TextInput,{value:F,disabled:!0}),a.createElement(r.CardLabel,null,"Address Type"),a.createElement(r.Dropdown,{option:[{name:"Permanent"},{name:"Correspondence"},{name:"Other"}],selected:Y,select:M}),a.createElement(r.CardLabel,null,"Door Image *"),a.createElement(r.UploadFile,{onUpload:function(e){try{let a=!1;function t(e){return a?e:()=>{l=!1}}let l=!0;const n=e.target.files[0];if(!n)return Promise.resolve();if(n.size>=2e6)return V({type:"error",message:"Max size 2MB exceeded"}),Promise.resolve();const r=E(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",n,p)).then(function(e){var t,r,o;if(!l)return void(a=!0);const i=null==e||null===(t=e.data)||void 0===t||null===(r=t.files)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.fileStoreId;if(i){U(i);const e=new FileReader;e.onloadend=()=>{l&&B(e.result)},e.readAsDataURL(n),V({type:"success",message:"Upload successful"})}})},function(){l?V({type:"error",message:"Upload failed"}):a=!0});return Promise.resolve(r&&r.then?r.then(t):t(r))}catch(e){return Promise.reject(e)}},onDelete:()=>{B(null),U(null)},message:z?"Uploaded":"No file selected"}),P&&a.createElement("img",{src:P,alt:"preview",style:{width:"100%",marginTop:"10px"}}),H&&a.createElement(r.Toast,{label:H.message,error:"error"===H.type,onClose:()=>V(null)})))},Z=e=>{let{config:n,onSelect:o}=e;const{t:i}=l.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,d]=t.useState(""),[m,u]=t.useState(null),[p,v]=t.useState(null),[g,C]=t.useState(""),[b,S]=t.useState(""),[f,N]=t.useState(""),[y,h]=t.useState(""),[_,x]=t.useState(""),[T,I]=t.useState(null),[R,k]=t.useState(null),[D,A]=t.useState(null);return a.createElement(t.Fragment,null,a.createElement(r.FormStep,{t:i,onSelect:()=>{!g||Number(g)<1||!R||"Hotel"===(null==m?void 0:m.name)&&!f||!("Hospital"!==(null==m?void 0:m.name)&&"Nursing Home"!==(null==m?void 0:m.name)||y)?A({type:"error",message:"Fill all required fields"}):o(n.key,{pidNumber:c,propertyType:null==m?void 0:m.name,subPropertyCategory:null==p?void 0:p.name,noOfFloors:g,floorNo:b,noOfRooms:f,noOfBeds:y,dwellingUnits:_,buildingImageId:R})},config:n,label:i("ES_COMMON_CONTINUE")},a.createElement("div",null,a.createElement(r.CardLabel,null,"PID Number"),a.createElement(r.TextInput,{value:c,onChange:e=>d(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Property Type"),a.createElement(r.Dropdown,{option:[{name:"Residential"},{name:"Commercial"},{name:"Hotel"},{name:"Hospital"},{name:"Nursing Home"}],selected:m,select:u})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Sub Property Category"),a.createElement(r.Dropdown,{option:[],selected:p,select:v})),a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Floors *"),a.createElement(r.TextInput,{type:"number",value:g,onChange:e=>C(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Floor No. of this KNO"),a.createElement(r.TextInput,{value:b,onChange:e=>S(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"No of Beds"),a.createElement(r.TextInput,{type:"number",value:y,onChange:e=>h(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Rooms"),a.createElement(r.TextInput,{type:"number",value:f,onChange:e=>N(e.target.value)})),"Hotel"===(null==m?void 0:m.name)&&a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Rooms *"),a.createElement(r.TextInput,{type:"number",value:f,onChange:e=>N(e.target.value)})),("Hospital"===(null==m?void 0:m.name)||"Nursing Home"===(null==m?void 0:m.name))&&a.createElement("div",null,a.createElement(r.CardLabel,null,"No. of Beds *"),a.createElement(r.TextInput,{type:"number",value:y,onChange:e=>h(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Number of Dwelling Units"),a.createElement(r.TextInput,{type:"number",value:_,onChange:e=>x(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Building Image *"),a.createElement(r.UploadFile,{onUpload:function(e){try{const t=e.target.files[0];if(!t)return Promise.resolve();if(t.size>2e6)return A({type:"error",message:"Max size 2MB exceeded"}),Promise.resolve();const a=E(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",t,s)).then(function(e){var a,l,n;const r=null==e||null===(a=e.data)||void 0===a||null===(l=a.files)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.fileStoreId;if(r){k(r);const e=new FileReader;e.onloadend=()=>I(e.result),e.readAsDataURL(t),A({type:"success",message:"Upload successful"})}})},function(){A({type:"error",message:"Upload failed"})});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onDelete:()=>{I(null),k(null)},message:R?"Uploaded":"No file selected"})),T&&a.createElement("div",{style:{gridColumn:"span 2"}},a.createElement("img",{src:T,alt:"preview",style:{width:"100%",marginTop:"10px"}})),D&&a.createElement(r.Toast,{label:D.message,error:"error"===D.type,onClose:()=>A(null)})))},Q=e=>{let{config:l,onSelect:n}=e;const o=Digit.ULBService.getCurrentTenantId(),[i,s]=t.useState(""),[c,d]=t.useState(""),[m,u]=t.useState(""),[p,v]=t.useState(""),[g,C]=t.useState(""),[b,S]=t.useState(""),[f,N]=t.useState(""),[y,h]=t.useState(""),[_,x]=t.useState(null),[T,I]=t.useState(null),[R,k]=t.useState(null),[D,A]=t.useState(null),[L,w]=t.useState(null),[O,F]=t.useState(""),[K,Y]=t.useState(null),[M,P]=t.useState(null),[B,z]=t.useState(null),[U,H]=t.useState(null),[V,W]=t.useState(null),[j,G]=t.useState(null),$=[{name:"Yes"},{name:"No"}],q=[];for(let e=1998;e<=2026;e++)for(let t=1;t<=12;t++)q.push({name:`${t}/${e}`});const X="Can not be identified"===(null==_?void 0:_.name);return a.createElement(t.Fragment,null,a.createElement(r.FormStep,{onSelect:()=>{i&&_&&R&&D&&M&&("Metered"!==(null==_?void 0:_.name)||V)&&("No"!==(null==D?void 0:D.name)||O)&&("No"!==(null==M?void 0:M.name)||B)?n(l.key,{connectionCategory:i,saType:c,status:m,mrCode:p,areaCode:g,mrKey:b,meterNumber:f,meterMaker:y,meterStatus:null==_?void 0:_.name,meterCondition:null==T?void 0:T.name,meterLocation:null==R?void 0:R.name,lastBillReceived:null==D?void 0:D.name,billMonthYear:null==L?void 0:L.name,reason:O,accessToMeter:null==K?void 0:K.name,sewerConnection:null==M?void 0:M.name,septicTank:null==B?void 0:B.name,meterPhotoId:V}):G({type:"error",message:"Fill all mandatory fields"})},config:l},a.createElement("div",null,a.createElement(r.CardLabel,null,"Connection Category *"),a.createElement(r.TextInput,{value:i,onChange:e=>s(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"SA Type"),a.createElement(r.TextInput,{value:c,onChange:e=>d(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Status"),a.createElement(r.TextInput,{value:m,onChange:e=>u(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"MR Code"),a.createElement(r.TextInput,{value:p,onChange:e=>v(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Area Code"),a.createElement(r.TextInput,{value:g,onChange:e=>C(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"MR Key"),a.createElement(r.TextInput,{value:b,onChange:e=>S(e.target.value)})),!X&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Number"),a.createElement(r.TextInput,{value:f,onChange:e=>N(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Maker"),a.createElement(r.TextInput,{value:y,onChange:e=>h(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Condition"),a.createElement(r.Dropdown,{option:[{name:"Damaged"},{name:"Not-Damaged"}],selected:T,select:I})),"Metered"===(null==_?void 0:_.name)&&a.createElement(t.Fragment,null,a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Photo *"),a.createElement(r.UploadFile,{onUpload:function(e){try{const t=e.target.files[0];if(!t)return Promise.resolve();const a=E(function(){return Promise.resolve(Digit.UploadServices.Filestorage("EKYC",t,o)).then(function(e){var a,l,n;const r=null==e||null===(a=e.data)||void 0===a||null===(l=a.files)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.fileStoreId;if(r){W(r);const e=new FileReader;e.onloadend=()=>H(e.result),e.readAsDataURL(t)}})},function(){G({type:"error",message:"Upload failed"})});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},message:V?"Uploaded":"No file"})),U&&a.createElement("div",{style:{gridColumn:"span 2"}},a.createElement("img",{src:U,style:{width:"100%"}})))),a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Status *"),a.createElement(r.Dropdown,{option:[{name:"Metered"},{name:"Unmetered"},{name:"Can not be identified"}],selected:_,select:x})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Meter Location *"),a.createElement(r.Dropdown,{option:[{name:"Inside"},{name:"Outside"}],selected:R,select:k})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Last Bill Received *"),a.createElement(r.Dropdown,{option:$,selected:D,select:A})),"Yes"===(null==D?void 0:D.name)&&a.createElement("div",null,a.createElement(r.CardLabel,null,"When was the last bill received *"),a.createElement(r.Dropdown,{option:q,selected:L,select:w})),"No"===(null==D?void 0:D.name)&&a.createElement("div",null,a.createElement(r.CardLabel,null,"Reason *"),a.createElement(r.TextInput,{value:O,onChange:e=>F(e.target.value)})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Access to Meter"),a.createElement(r.Dropdown,{option:$,selected:K,select:Y})),a.createElement("div",null,a.createElement(r.CardLabel,null,"Sewer Connection *"),a.createElement(r.Dropdown,{option:$,selected:M,select:P})),"No"===(null==M?void 0:M.name)&&a.createElement("div",null,a.createElement(r.CardLabel,null,"Septic Tank *"),a.createElement(r.Dropdown,{option:$,selected:B,select:z})),j&&a.createElement(r.Toast,{label:j.message,error:"error"===j.type,onClose:()=>G(null)})))},J=()=>{const{t:e}=l.useTranslation(),t=n.useLocation(),{path:o}=n.useRouteMatch();sessionStorage.removeItem("revalidateddone");const i=[{icon:r.HomeIcon,path:"/digit-ui/citizen"},{label:e((()=>{const e=t.pathname;return e.includes("/create-kyc")?"EKYC_CREATE_KYC":e.includes("/aadhaar-verification")?"EKYC_AADHAAR_VERIFICATION":e.includes("/address-details")?"EKYC_ADDRESS_DETAILS":e.includes("/property-info")?"EKYC_PROPERTY_INFO":e.includes("/meter-details")?"EKYC_METER_DETAILS":e.includes("/review")?"EKYC_REVIEW":"EKYC_HOME"})())}];return a.createElement(r.AppContainer,null,a.createElement("div",{className:"ground-container employee-app-container form-container"},a.createElement(r.ModuleHeader,{leftContent:a.createElement(a.Fragment,null,a.createElement(r.ArrowLeft,{className:"icon"}),e("CS_COMMON_BACK")),onLeftClick:()=>window.history.back(),breadcrumbs:i}),a.createElement(n.Switch,null,a.createElement(r.PrivateRoute,{path:o+"/create-kyc",component:()=>a.createElement(P,null)}),a.createElement(r.PrivateRoute,{path:o+"/aadhaar-verification",component:()=>a.createElement(j,null)}),a.createElement(r.PrivateRoute,{path:o+"/address-details",component:()=>a.createElement(X,null)}),a.createElement(r.PrivateRoute,{path:o+"/property-info",component:()=>a.createElement(Z,null)}),a.createElement(r.PrivateRoute,{path:o+"/meter-details",component:()=>a.createElement(Q,null)}),a.createElement(r.PrivateRoute,{path:o+"/review",component:()=>a.createElement(H,null)}),a.createElement(r.PrivateRoute,{path:o+"/",component:()=>a.createElement(P,null)}))))},ee=e=>{let{stateCode:t,userType:l,tenants:r}=e;const{path:o,url:i}=n.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage(),{isLoading:c}=Digit.Services.useStore({stateCode:t,moduleCode:"EKYC",language:s});return Digit.SessionStorage.set("EKYC_TENANTS",r),c?null:"employee"===l?a.createElement(q,{path:o,url:i,userType:l,tenants:r}):a.createElement(J,null)},te=e=>{let{matchPath:t}=e;const{t:n}=l.useTranslation(),o=[{link:t+"/create-kyc",i18nKey:n("EKYC_CREATE_KYC")},{link:t+"/update-kyc",i18nKey:n("EKYC_UPDATE_KYC")}];return a.createElement(r.CitizenHomeCard,{header:n("EKYC_MODULE_NAME"),links:o,Icon:()=>a.createElement(r.DocumentIcon,{className:"fill-path-primary-main"})})},ae={EKYCModule:ee,EKYCCard:()=>{const{t:e}=l.useTranslation(),t={Icon:a.createElement(r.PersonIcon,null),moduleName:e("ACTION_TEST_EKYC"),kpis:[{count:"-",label:e("TOTAL_EKYC"),link:"/digit-ui/employee/ekyc/dashboard"}],links:[{label:e("EKYC_DASHBOARD"),link:"/digit-ui/employee/ekyc/dashboard"},{label:e("EKYC_INBOX"),link:"/digit-ui/employee/ekyc/inbox"},{label:e("EKYC_MAPPING"),link:"/digit-ui/employee/ekyc/mapping"}]};return a.createElement(r.EmployeeModuleCard,t)},EKYCInbox:c,EKYCDesktopInbox:e=>{var o;let{filterComponent:i,...c}=e;const{data:d,isLoading:m,onSort:u,onNextPage:E,onPrevPage:p,currentPage:v,pageSizeLimit:g,onPageSizeChange:C,parentRoute:b,searchParams:S,sortParams:f,totalRecords:N,countData:y}=c,{t:h}=l.useTranslation(),_=n.useHistory(),x=Digit.ULBService.getCurrentTenantId(),T=null===(o=Digit.ComponentRegistryService)||void 0===o?void 0:o.getComponent(i),[I,R]=t.useState(""),{data:k,getReview:D}=Digit.Hooks.ekyc.useEkycAPI("review",x),A=e=>{R(e),D({kno:e})};a.useEffect(()=>{k&&_.push("/digit-ui/employee/ekyc/review",{kNumber:I,aadhaarData:null==k?void 0:k.aadhaarData,reviewData:k})},[k]);const L=t.useMemo(()=>[{Header:h("EKYC_APPLICATION_NO"),accessor:"applicationNumber",Cell:e=>{var t,l;let{row:n}=e;const r=(null===(t=n.original)||void 0===t?void 0:t.kno)||(null===(l=n.original)||void 0===l?void 0:l.applicationNumber)||"NA";return a.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>A(r)},r)}},{Header:h("EKYC_CITIZEN_NAME"),accessor:"citizenName",Cell:e=>{var t;let{row:l}=e;return a.createElement("span",null,(null===(t=l.original)||void 0===t?void 0:t.citizenName)||"NA")}},{Header:h("EKYC_STATUS"),accessor:"actionStatus",Cell:e=>{var t;let{row:l}=e;const n=(null===(t=l.original)||void 0===t?void 0:t.status)||"DEFAULT";return a.createElement("span",{className:"ekyc-status-tag "+n},h(""+n))}},{Header:h("EKYC_ACTION"),accessor:"status",Cell:e=>{var t,l;let{row:n}=e;const r=(null===(t=n.original)||void 0===t?void 0:t.kno)||(null===(l=n.original)||void 0===l?void 0:l.applicationNumber)||"NA";return a.createElement("span",{className:"ekyc-application-link",style:{color:"#add8f7",cursor:"pointer",fontWeight:"bold"},onClick:()=>A(r)},h("EKYC_REVIEW"))}}],[h,b]),w=t.useMemo(()=>(null==d?void 0:d.items)||[],[d]);return a.createElement("div",{className:"app-container"},a.createElement("div",{className:"inbox-container"},m&&a.createElement(r.Loader,null),a.createElement("div",{className:"side-panel-item"},a.createElement(r.InboxLinks,{headerText:c.moduleCode}),T&&a.createElement(T,{defaultSearchParams:c.defaultSearchParams,onFilterChange:c.onSearch,searchParams:S,type:"desktop",moduleCode:"EKYC"})),a.createElement("div",{className:"employee-form-content",style:{flex:1}},a.createElement(r.Card,{className:"ekyc-metrics-card"},a.createElement(s,{countData:y})),a.createElement("div",{className:"result",style:{flex:1}},a.createElement(r.Card,{className:"ekyc-table-card",style:{padding:0}},a.createElement(r.Table,{t:h,data:w,columns:L,isLoading:m,onSort:u,sortParams:f,totalRecords:N,onNextPage:E,onPrevPage:p,currentPage:v,pageSizeLimit:g,onPageSizeChange:C,getCellProps:e=>({className:"ekyc-table-cell"})}))))))},EKYCMobileInbox:e=>{var t;let{data:o,isLoading:i,onSearch:c,searchParams:m,parentRoute:u,countData:E}=e;const{t:p}=l.useTranslation(),v=(null==o||null===(t=o.items)||void 0===t?void 0:t.map(e=>({[p("EKYC_APPLICATION_NO")]:e.applicationNumber,[p("EKYC_CITIZEN_NAME")]:e.citizenName,[p("EKYC_MOBILE_NO")]:e.mobileNumber,[p("EKYC_STATUS")]:a.createElement("span",{className:"ekyc-status-tag "+e.status},p("EKYC_STATUS_"+e.status))})))||[];return a.createElement("div",{className:"inbox-wrapper"},a.createElement("div",{className:"ekyc-header-container module-header"},a.createElement(r.Header,{className:"title"},p("EKYC_INBOX_HEADER")),a.createElement(n.Link,{to:u+"/create-kyc"},a.createElement(r.SubmitBar,{label:p("EKYC_CREATE_KYC")}))),a.createElement("div",{className:"ekyc-metrics-section"},a.createElement(s,{countData:E})),a.createElement(d,{onSearch:c,searchParams:m}),a.createElement("div",{className:"mobile-data-container"},i?a.createElement(r.Loader,null):(null==v?void 0:v.length)>0?a.createElement(r.DetailsCard,{data:v,t:p,serviceRequestIdKey:p("EKYC_APPLICATION_NO"),linkPrefix:u+"/application-details/"}):a.createElement(r.Card,null,p("ES_COMMON_NO_DATA").split("\\n").map((e,t)=>a.createElement("p",{key:t,style:{textAlign:"center"}},e)))))},EKYC_INBOX_FILTER:e=>a.createElement(m,e),EkycLinks:te,AadhaarVerification:j,AddressDetails:X,PropertyInfo:Z,MeterDetails:Q};exports.EkycLinks=te,exports.EkycModule=ee,exports.default=ee,exports.initEkycComponents=()=>{Object.entries(ae).forEach(e=>{let[t,a]=e;Digit.ComponentRegistryService.setComponent(t,a)})};