@egovernments/digit-ui-module-core 1.8.2-beta.26 → 1.8.2-beta.28
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/CHANGELOG.md +3 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@egovernments/digit-ui-components"),n=require("react"),o=e(n),l=require("react-i18next"),r=require("react-query"),i=require("react-redux"),a=require("react-router-dom"),s=require("@egovernments/digit-ui-react-components"),c=require("@egovernments/digit-ui-svg-components"),u=require("redux"),d=e(require("redux-thunk"));const m={error:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoMessage:"CORE_SOMETHING_WENT_WRONG",buttonInfo:"ACTION_TEST_HOME"},maintenance:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/maintainence-image.png",infoMessage:"CORE_UNDER_MAINTENANCE",buttonInfo:"ACTION_TEST_HOME"},notfound:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/PageNotFound.png",infoMessage:"MODULE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},p={sandbox:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoMessage:"WRONG_TENANT_SIGN_UP",buttonInfo:"CREATE_TENANT_ERROR_BUTTON"}},v=e=>{var t;const{type:n="error"}=Digit.Hooks.useQueryParams(),r=null==e||null===(t=e.errorData)||void 0===t?void 0:t.module,{t:i}=l.useTranslation(),a=r?p[r]:m[n];return o.createElement("div",{className:"error-boundary"},o.createElement("div",{className:"error-container"},o.createElement("img",{src:a.imgUrl,alt:"error"}),o.createElement("h1",null,i(a.infoMessage)),o.createElement("button",{onClick:()=>{var t;r?null==e||null===(t=e.errorData)||void 0===t||t.action():e.goToHome()}},i(a.buttonInfo))))},f=()=>{var e,t;const n="employee"===Digit.UserService.getType()?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/error`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/error`;return window.location.href.includes("employee/user/error")||window.location.href.includes("citizen/error")||"development"===process.env.NODE_ENV||(window.location.href=n),o.createElement("span",null)};class g extends o.Component{constructor(e){super(e),this.state={error:null,errorStack:null,hasError:!1,module:null,action:null,info:null}}static getDerivedStateFromError(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack,module:null==e?void 0:e.module,action:null==e?void 0:e.action,info:null==e?void 0:e.info}}componentDidCatch(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})}render(){return this.state.hasError?o.createElement("div",{className:"error-boundary"},o.createElement(f,null),o.createElement(v,{initData:this.props.initData,errorData:this.state})):this.props.children}}function E(){return(E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(null,arguments)}const y=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web","sandbox-ui"],h=e=>{var r;const{isLoading:i,data:s}=Digit.Hooks.useAccessControl(),c=Digit.Utils.getMultiRootTenant(),{t:u}=l.useTranslation(),d=a.useHistory(),m=Digit.ULBService.getStateId();let p=null;const[v,f]=n.useState([{}]),{data:g}=Digit.Hooks.useCustomMDMS(m,"HomeScreenOrder",[{name:"CardsAndLinksOrder"}],{select:e=>{var t;return null==e||null===(t=e.HomeScreenOrder)||void 0===t?void 0:t.CardsAndLinksOrder}}),{data:h}=Digit.Hooks.useCustomMDMS(m,"SandBoxLanding",[{name:"AdditionalModuleLinks"}],{select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.AdditionalModuleLinks}});n.useEffect(()=>{f(g)},[g]);const _=(e,t)=>{if(!e||!t)return null;const n=null==h?void 0:h.find(t=>t.moduleName===e.module),o=null==n?void 0:n[t],l=null==e?void 0:e.links;return(null==l?void 0:l.find(e=>(null==e?void 0:e.displayName)===o))||null},S=e=>{var t;const n=null==h?void 0:h.find(t=>t.moduleName===e.module);return null==e||null===(t=e.links)||void 0===t?void 0:t.filter(e=>{const t=e.displayName;return"Configure_master"!==t&&t!==(null==n?void 0:n.howItWorksLink)&&t!==(null==n?void 0:n.userManualLink)})},b=null==s?void 0:s.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,t)=>{const n=t.parentModule;e[n]||(e[n]={module:n,kpis:[],icon:t.leftIcon?Digit.Utils.iconRender(t.leftIcon,"white"):"",label:Digit.Utils.locale.getTransformedLocale(n+"_CARD_HEADER"),links:[]});const o=function(e){var t,n;if(void 0===e&&(e=""),"/"!=e){if(-1===(null===(t=e)||void 0===t?void 0:t.indexOf("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)))){let t=null;return t=c?e=e.replace("/sandbox-ui/employee",`/sandbox-ui/${m}/employee`):null!=y&&y.every(t=>{var n;return-1===(null===(n=e)||void 0===n?void 0:n.indexOf("/"+t))})?"/employee/"+e:e,t}return e}}(t.navigationURL),l=o.indexOf("?");return e[n].links.push({link:o,icon:t.leftIcon,queryParams:-1===l?null:o.substring(l),label:u(Digit.Utils.locale.getTransformedLocale(`${n}_LINK_${t.displayName}`)),displayName:t.displayName}),e},{});if(i)return o.createElement(t.Loader,null);if(!b)return"";p=c?(e=>Object.keys(e).sort((e,t)=>{var n,o;return((null==v||null===(n=v.find(t=>"card"===t.moduleType&&t.name===e))||void 0===n?void 0:n.order)||null)-((null==v||null===(o=v.find(e=>"card"===e.moduleType&&e.name===t))||void 0===o?void 0:o.order)||null)}).reduce((t,n)=>{var o,l;const r=null==e||null===(o=e[n])||void 0===o||null===(l=o.links)||void 0===l?void 0:l.sort((e,t)=>{var o,l;const r=null==e?void 0:e.displayName,i=null==t?void 0:t.displayName;return((null==v||null===(o=v.find(e=>"link"===e.moduleType&&e.name===`${n}.${r.replace(/\s+/g,"_")}`))||void 0===o?void 0:o.order)||null)-((null==v||null===(l=v.find(e=>"link"===e.moduleType&&e.name===`${n}.${i.replace(/\s+/g,"_")}`))||void 0===l?void 0:l.order)||null)});return t[n]={...e[n],links:r},t},{}))(b):b;const O=null===(r=Object.keys(p))||void 0===r?void 0:r.map((e,n)=>{var l,r;const i=null===(l=p)||void 0===l?void 0:l[e],a=null==i||null===(r=i.links)||void 0===r?void 0:r.find(e=>"Configure_master"===(null==e?void 0:e.displayName)),s=_(i,"howItWorksLink"),c=_(i,"userManualLink"),m={icon:"SupervisorAccount",moduleName:u(null==i?void 0:i.label),metrics:[],links:Digit.Utils.getMultiRootTenant()?S(i):null==i?void 0:i.links,centreChildren:[o.createElement("div",null,u(Digit.Utils.locale.getTransformedLocale("MODULE_CARD_DESC_"+e))),s&&o.createElement(t.Button,{variation:"teritiary",label:null==s?void 0:s.label,icon:null==s?void 0:s.icon,type:"button",size:"medium",onClick:()=>window.open(null==s?void 0:s.link,"_blank"),style:{padding:"0px"}})],endChildren:Digit.Utils.getMultiRootTenant()?[a&&o.createElement(t.Button,{variation:"teritiary",label:null==a?void 0:a.label,icon:null==a?void 0:a.icon,type:"button",size:"medium",onClick:()=>null==d?void 0:d.push(null==a?void 0:a.link),style:{padding:"0px"}}),c&&o.createElement(t.Button,{variation:"teritiary",label:null==c?void 0:c.label,icon:null==c?void 0:c.icon,type:"button",size:"medium",onClick:()=>window.open(null==c?void 0:c.link,"_blank"),style:{padding:"0px"}})]:null};return o.createElement(t.LandingPageCard,E({buttonSize:"medium"},m))});return o.createElement(n.Fragment,null,o.createElement(t.LandingPageWrapper,null,o.Children.map(O,e=>o.cloneElement(e))))},_=e=>{const{question:r,isLabelLink:i,type:a,actions:u,content:d,lastIndex:m}=e,[p,v]=n.useState(!1),{t:f}=l.useTranslation(),g=Digit.ULBService.getStateId(),E="number"===a?"ol":"ul";return o.createElement("div",{className:"faqs border-none",onClick:()=>v(!p)},o.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},o.createElement("span",null,f(r)),o.createElement("span",{className:p?"faqicon rotate":"faqicon",style:{float:"right"}},o.createElement(c.ArrowForward,null))),o.createElement("div",{className:"faq-answer",style:p?{display:"block"}:{display:"none"}},o.createElement(s.CardSectionSubText,{style:{marginTop:"1rem"}},f(d)),o.createElement("div",{style:{marginTop:"1rem"}},u&&o.createElement(E,null,u.map((e,n)=>o.createElement("li",{key:n,style:{listStyleType:"ul"===E?"disc":"auto",margin:"8px 0"}},i?null!=e&&e.label?o.createElement(t.Button,{variation:"teritiary",label:f(null==e?void 0:e.label),type:"button",size:"medium",onClick:()=>{if(null!=e&&e.fulllink)window.open(null==e?void 0:e.link,"_blank");else{var t;const n=`https://${window.location.hostname}/${null===(t=window)||void 0===t?void 0:t.globalPath}/${g}`;window.open(`${n}/${null==e?void 0:e.link}`,"_blank")}},style:{padding:"0px"}}):null:null!=e&&e.label?o.createElement("strong",null,f(null==e?void 0:e.label),":"):null,f(null==e?void 0:e.description)))))),m?null:o.createElement("div",{className:"cs-box-border"}))},S=e=>{let{type:t,title:n,content:r,actions:i}=e;const{t:a}=l.useTranslation(),c="number"===t?"ol":"ul";return o.createElement("div",null,o.createElement(s.CardSectionHeader,null,a(n)),o.createElement(s.CardSectionSubText,{style:{marginTop:"1rem"}},a(r)),o.createElement("div",{style:{marginTop:"1rem"}},i&&o.createElement(c,null,i.map((e,t)=>o.createElement("li",{key:t,style:{listStyleType:"ul"===c?"disc":"auto",margin:"8px 0"}},null!=e&&e.label?o.createElement("strong",null,a(null==e?void 0:e.label),":"):null," ",a(null==e?void 0:e.description))))))},b=e=>{let{faqs:t,type:n}=e;return l.useTranslation(),o.createElement("div",{style:{width:"100%"}},o.createElement("div",{style:{width:"100%"}},t.map((e,l)=>o.createElement(_,{key:"faq_"+l,question:e.question,answer:e.answer,isLabelLink:e.isLabelLink,type:n,actions:e.answer,content:e.content,lastIndex:l===(null==t?void 0:t.length)-1}))))},O=e=>{let{cardConfig:n}=e;const{t:r}=l.useTranslation();return o.createElement(t.Card,{className:"sandbox-guide",style:{width:"25rem",height:"47rem",overflowY:"scroll"}},o.createElement(t.CardHeader,null,r("GUIDE_TO_SETUP")),o.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},n.map((e,t)=>"faqs"===(null==e?void 0:e.type)?o.createElement(b,{key:e.id,title:e.title,type:null==e?void 0:e.type,content:e.content,faqs:e.actions}):o.createElement(o.Fragment,null,o.createElement(S,{type:null==e?void 0:e.type,key:e.id,title:e.title,content:e.content,actions:e.actions,style:e.style}),t!==(null==n?void 0:n.length)-1&&o.createElement(s.BreakLine,{style:{width:"100%",border:"1px solid #d6d5d4"}})))))},N=e=>{const{t:t}=l.useTranslation(),{data:n}=Digit.Hooks.useAccessControl(),r=(Digit.Utils.getMultiRootTenant(),Digit.ULBService.getStateId());return(null==n?void 0:n.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,n)=>{const o=n.parentModule;e[o]||(e[o]={module:o,label:Digit.Utils.locale.getTransformedLocale(o+"_CARD_HEADER"),links:[]});const l=Digit.Utils.transformURL(n.navigationURL,r),i=l.indexOf("?");return e[o].links.push({link:-1===i?l:l.substring(0,i),label:t(Digit.Utils.locale.getTransformedLocale(`${o}_LINK_${n.displayName}`)),queryParams:-1===i?null:l.substring(i),description:t(Digit.Utils.locale.getTransformedLocale(`${o}_LINK_${n.displayName}_DESCRIPTION`))}),e},{}))?o.createElement(O,{cardConfig:[{id:1,type:"faqs",actions:[{question:"SANDBOX_FAQ_QUES_14",isLabelLink:!0,answer:[{label:"SANDBOX_FAQ_ANS_14_LABEL_1",fulllink:!0,link:"https://egov-digit.gitbook.io/digit-sandbox/specifications/user-manual/walkthrough-videos"}]},{question:"SANDBOX_FAQ_QUES_1",content:"SANDBOX_FAQ_CONTENT_1",isLabelLink:!0,answer:[{label:"SANDBOX_FAQ_ANS_1_LABEL_1",link:"citizen/login",description:"SANDBOX_FAQ_ANS_1_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_1_LABEL_2",link:"employee/user/login",description:"SANDBOX_FAQ_ANS_1_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_2",content:"SANDBOX_FAQ_CONTENT_2",answer:[{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_3",content:"SANDBOX_FAQ_CONTENT_3",answer:[{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_4",content:"SANDBOX_FAQ_CONTENT_4",answer:[{label:null,description:"SANDBOX_FAQ_ANS_4_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_4_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_5",content:"SANDBOX_FAQ_CONTENT_5",answer:[{label:"SANDBOX_FAQ_ANS_5_LABEL_1",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_5_LABEL_2",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_2"},{label:"SANDBOX_FAQ_ANS_5_LABEL_3",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_3"},{label:"SANDBOX_FAQ_ANS_5_LABEL_4",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_4"},{label:"SANDBOX_FAQ_ANS_5_LABEL_5",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_5"}]},{question:"SANDBOX_FAQ_QUES_6",content:"SANDBOX_FAQ_CONTENT_6"},{question:"SANDBOX_FAQ_QUES_7",content:"SANDBOX_FAQ_CONTENT_7",answer:[{label:null,description:"SANDBOX_FAQ_ANS_7_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_7_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_8",content:"SANDBOX_FAQ_CONTENT_8",answer:[{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_9",content:"SANDBOX_FAQ_CONTENT_9",answer:[{label:"SANDBOX_FAQ_ANS_9_LABEL_1",description:"SANDBOX_FAQ_ANS_9_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_9_LABEL_2",description:"SANDBOX_FAQ_ANS_9_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_10",content:"SANDBOX_FAQ_CONTENT_10",answer:[{label:"SANDBOX_FAQ_ANS_10_LABEL_1",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_10_LABEL_2",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_2"},{label:"SANDBOX_FAQ_ANS_10_LABEL_3",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_3"},{label:"SANDBOX_FAQ_ANS_10_LABEL_4",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_11",content:"SANDBOX_FAQ_CONTENT_11"},{question:"SANDBOX_FAQ_QUES_12",content:"SANDBOX_FAQ_CONTENT_12"},{question:"SANDBOX_FAQ_QUES_13",content:"SANDBOX_FAQ_CONTENT_13"}]}]}):""},C=(e,t,n)=>{const o=null==e?void 0:e[""+t];o&&o.map(e=>{Digit.Utils.getMultiRootTenant()&&(e.navigationURL=e.navigationURL.replace("/sandbox-ui/citizen",`/sandbox-ui/${Digit.ULBService.getStateId()}/citizen`)),e.link=e.navigationURL,e.i18nKey=n(e.name)});const l={links:null==o?void 0:o.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:`CITIZEN_${t}_ICON`};var r;return"FSM"===t&&[{role:"FSM_DSO",from:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/fsm/dso-dashboard`,dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,o,r;let{role:i,from:a,loginLink:s,dashoardLink:c}=e;Digit.UserService.hasAccess(i)?null==l||null===(t=l.links)||void 0===t||t.push({link:a,i18nKey:n(c)}):null==l||null===(o=l.links)||void 0===o||o.push({link:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/login`,state:{role:"FSM_DSO",from:a},i18nKey:n(s)})}),l},I=e=>{let{modules:n,getCitizenMenu:r,fetchedCitizen:i,isLoading:a}=e;const c=[n.filter(e=>{let{code:t}=e;return"Payment"===t})[0],...n.filter(e=>{let{code:t}=e;return"Payment"!==t})],{t:u}=l.useTranslation();return a?o.createElement(s.Loader,null):o.createElement(o.Fragment,null,o.createElement("div",{className:"citizen-all-services-wrapper"},location.pathname.includes("sanitation-ui/citizen/all-services")||location.pathname.includes("sandbox-ui")&&location.pathname.includes("all-services")?null:o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement("div",{className:"citizenAllServiceGrid"},c.filter(e=>e).map((e,n)=>{var l,a;let c,{code:d}=e;var m,p,v,f;return i&&(c=i?C(r,d,u):void 0),(null===(l=c)||void 0===l||null===(a=l.links)||void 0===a?void 0:a.length)>0?o.createElement(s.CitizenHomeCard,{header:u(null===(m=c)||void 0===m?void 0:m.header),links:null===(p=c)||void 0===p||null===(v=p.links)||void 0===v||null===(f=v.filter(e=>null==e?void 0:e.link))||void 0===f?void 0:f.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)),Icon:()=>(e=>{switch(e){case"PT":return o.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"});case"WS":return o.createElement(t.CustomSVG.WSICon,{className:"fill-path-primary-main"});case"FSM":return o.createElement(t.CustomSVG.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return o.createElement(t.CustomSVG.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return o.createElement(t.CustomSVG.PGRIcon,{className:"fill-path-primary-main"});case"TL":return o.createElement(t.CustomSVG.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return o.createElement(t.CustomSVG.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return o.createElement(t.CustomSVG.BillsIcon,{className:"fill-path-primary-main"});default:return o.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"})}})(d),Info:"OBPS"===d?()=>o.createElement(s.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:u("CS_FILE_APPLICATION_INFO_LABEL"),text:u("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===d}):o.createElement(o.Fragment,null)}))))},D=e=>{let{modules:t,additionalComponent:l}=e;return o.createElement(n.Fragment,null,o.createElement("div",{className:"employee-app-container digit-home-employee-app"},o.createElement("div",{className:"ground-container moduleCardWrapper gridModuleWrapper digit-home-moduleCardWrapper"},null==t?void 0:t.map((e,t)=>{let{code:n}=e;const l=Digit.ComponentRegistryService.getComponent(n+"Card")||(()=>o.createElement(o.Fragment,null));return o.createElement(l,{key:t})}))),l&&(null==l?void 0:l.length)>0&&l.map(e=>{const t="string"==typeof e?Digit.ComponentRegistryService.getComponent(e):null;return t?o.createElement("div",{className:"additional-component-wrapper"},o.createElement(t,null)):null}))},w=e=>{let{userType:t,modules:n,getCitizenMenu:l,fetchedCitizen:r,isLoading:i,additionalComponent:a}=e;if("citizen"===t)return o.createElement(I,{modules:n,getCitizenMenu:l,fetchedCitizen:r,isLoading:i});const s=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return Digit.Utils.getRoleBasedHomeCard()?o.createElement("div",{className:s?"homeWrapper":""},o.createElement(h,{modules:n,additionalComponent:a}),s&&!window.Digit.Utils.browser.isMobile()?o.createElement(N,null):null):o.createElement(D,{modules:n,additionalComponent:a})},T=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(o=e)&&void 0!==o&&o.includes(t);){var o,l;e=null===(l=e)||void 0===l?void 0:l.replace(t,n)}return e},A=e=>{var l;const[r,i]=n.useState(null),[s,c]=n.useState([]),[u,d]=n.useState([]),m=a.useHistory();let p=[];return n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let o=[],l=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>o.push(e.tenantId));let r=o.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;l.push({label:"TENANT_TENANTS_"+(null===(t=T(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),p=null==l?void 0:l.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),c(l)},[r]),o.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},o.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:s,selected:s.find(e=>e.value===(null==r?void 0:r.value)),optionKey:"label",select:e=>{var t,n,o,l;const r=Digit.SessionStorage.get("citizen.userRequestObject"),a=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.filter(t=>t.tenantId===e.value);if((null==a?void 0:a.length)>0&&(r.info.roles=a,r.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(r),i(e),window.location.href.includes(`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee/`)){var s,c;const e=(null===(s=location.state)||void 0===s?void 0:s.from)||`/${null===(c=window)||void 0===c?void 0:c.contextPath}/employee`;m.replace(e)}window.location.reload()},freeze:!0,customSelector:o.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(l=T(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===l?void 0:l.toUpperCase())))}))},R=e=>{const r=e.dropdown||!1,{data:i,isLoading:a}=Digit.Hooks.useStore.getInitData(),{languages:s,stateInfo:c}=i||{},{t:u}=l.useTranslation(),d=Digit.StoreData.getCurrentLanguage(),[m,p]=n.useState(d),v=e=>{p(e.value),Digit.LocalizationService.changeLanguage(e.value,c.code)};return a?null:r?o.createElement("div",null,o.createElement(t.Dropdown,{className:"language-dropdown",option:s,selected:null==s?void 0:s.find(e=>(null==e?void 0:e.value)===d),optionKey:"label",select:v,freeze:!0,customSelector:o.createElement("label",{className:"cp"},u(null==s||null===(f=s.find(e=>(null==e?void 0:e.value)===m))||void 0===f?void 0:f.label))})):o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:"5px"}},"Language"),o.createElement("div",{className:"language-selector"},s.map((e,n)=>o.createElement("div",{className:"language-button-container",key:n},o.createElement(t.Button,{label:e.label,onClick:()=>v(e),variation:e.value===m?"primary":""})))));var f},L=e=>{var l,r,i,c,u,d,m,p;let{t:v,stateInfo:f,toggleSidebar:g,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:_,cityDetails:S,mobileView:b,userOptions:O,handleUserDropdownSelection:N,logoUrl:C,logoUrlWhite:I,showLanguageChange:D=!0}=e;const[w,T]=o.useState(null);o.useEffect(function(){try{var e;const t=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCurrentTenantId(),n=null==h||null===(e=h.info)||void 0===e?void 0:e.uuid,o=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t;const n=e.user[0],o=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");T(null==o?void 0:o.at(0))}})}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==w,null==h||null===(l=h.info)||void 0===l?void 0:l.uuid]);const L=Digit.ULBService.getCitizenCurrentTenant(!0);let P=a.useHistory();const{pathname:x}=a.useLocation(),{data:{unreadCount:M}={},isSuccess:k}=Digit.Hooks.useNotificationCount({tenantId:L,config:{enabled:"EMPLOYEE"!==(null===(U=Digit.UserService)||void 0===U||null===(B=U.getUser())||void 0===B||null===(F=B.info)||void 0===F?void 0:F.type)&&"CITIZEN"===(null===(j=Digit.UserService)||void 0===j||null===(H=j.getUser())||void 0===H||null===(G=H.info)||void 0===G?void 0:G.type)&&!!L}});var U,B,F,j,H,G;if(_)return o.createElement("div",null,o.createElement(s.TopBar,{img:null==f?void 0:f.logoUrlWhite,isMobile:!0,toggleSidebar:()=>{Digit.clikOusideFired?Digit.clikOusideFired=!1:g(!0)},logoUrl:null==f?void 0:f.logoUrlWhite,onLogout:y,userDetails:h,notificationCount:M<99?M:99,notificationCountLoaded:k,cityOfCitizenShownBesideLogo:v(L),onNotificationIconClick:function(){var e;P.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/engagement/notifications`)},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:(e=>{var t,n,o,l;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&[`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/select-language`,`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen/select-location`].includes(e)})(x),changeLanguage:b?null:o.createElement(R,{dropdown:!0})}));const V=!(null==h||!h.access_token),$=null===(r=Digit.ComponentRegistryService)||void 0===r?void 0:r.getComponent("CustomEmployeeTopBar");return $?o.createElement($,{t:v,stateInfo:f,toggleSidebar:g,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:_,cityDetails:S,mobileView:b,userOptions:O,handleUserDropdownSelection:N,logoUrl:C,showLanguageChange:D,loggedin:V}):o.createElement(t.TopBar,{actionFields:[o.createElement(A,{dropdown:!0,t:v}),D&&o.createElement(R,{dropdown:!0}),(null==h?void 0:h.access_token)&&o.createElement(t.Dropdown,{option:O,optionKey:"name",profilePic:w||(null==h||null===(i=h.info)||void 0===i?void 0:i.name)||(null==h||null===(c=h.info)||void 0===c||null===(u=c.userInfo)||void 0===u?void 0:u.name)||"Employee",select:N,showArrow:!0,menuStyles:{marginTop:"1rem"},theme:"light"})],onHamburgerClick:()=>{g()},className:"",img:C,logoWidth:"48px",logoHeight:"48px",logo:V?null==S?void 0:S.logoId:null==f?void 0:f.statelogo,onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:"light",ulb:V?null!=S&&null!==(d=S.city)&&void 0!==d&&d.ulbGrade?o.createElement(n.Fragment,null,v(null==S?void 0:S.i18nKey).toUpperCase()," ",v("ULBGRADE_"+(null==S||null===(m=S.city)||void 0===m?void 0:m.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):o.createElement("img",{className:"state",src:I,alt:"State Logo"}):o.createElement(n.Fragment,null,v(`MYCITY_${null==f||null===(p=f.code)||void 0===p?void 0:p.toUpperCase()}_LABEL`)," ",v("MYCITY_STATECODE_LABEL"))})},P=(e,t,n,l)=>[{type:"component",element:"LANGUAGE",action:o.createElement(R,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:o.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:n}}],x=e=>{let{onSelect:n,onCancel:r,onDismiss:i,PopupStyles:a,isDisabled:s,hideSubmit:c}=e;const{t:u}=l.useTranslation(),d=[o.createElement("div",null,o.createElement(t.CardText,null,u("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",o.createElement("strong",null,u("CORE_LOGOUT_MESSAGE"))))],m=[o.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r}),o.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:u("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:n,isDisabled:s})],p=[o.createElement(t.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r})];return o.createElement(t.PopUp,{type:"default",children:d,heading:u("CORE_LOGOUT_WEB_HEADER"),footerChildren:c?p:m,sortFooterButtons:!0,onClose:i,className:"digit-logout-popup-wrapper",onOverlayClick:i,equalWidthButtons:!0,style:a})},M=e=>{let{info:t,t:n}=e;return o.createElement("div",{className:"profile-section"},o.createElement("div",{className:"imageloader imageloader-loaded"},o.createElement("img",{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC"})),o.createElement("div",{id:"profile-name",className:"label-container name-Profile"},o.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),o.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},o.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&o.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},o.createElement("div",{className:"label-text"}," ",t.emailId," ")),o.createElement("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&o.createElement(A,{t:n,mobileView:!0}))},k={CommonPTIcon:o.createElement(s.PTIcon,{className:"icon"}),OBPSIcon:o.createElement(s.OBPSIcon,{className:"icon"}),propertyIcon:o.createElement(s.PropertyHouse,{className:"icon"}),TLIcon:o.createElement(s.CaseIcon,{className:"icon"}),PGRIcon:o.createElement(s.PGRIcon,{className:"icon"}),FSMIcon:o.createElement(s.FSMIcon,{className:"icon"}),WSIcon:o.createElement(s.WSICon,{className:"icon"}),MCollectIcon:o.createElement(s.MCollectIcon,{className:"icon"}),BillsIcon:o.createElement(s.CollectionIcon,{className:"icon"}),BirthIcon:o.createElement(s.BirthIcon,{className:"icon"}),DeathIcon:o.createElement(s.DeathIcon,{className:"icon"}),FirenocIcon:o.createElement(s.FirenocIcon,{className:"icon"}),HomeIcon:o.createElement(s.HomeIcon,{className:"icon"}),EditPencilIcon:o.createElement(s.EditPencilIcon,{className:"icon"}),LogoutIcon:o.createElement(s.LogoutIcon,{className:"icon"}),Phone:o.createElement(s.Phone,{className:"icon"})},U=e=>{var t,r,i,c;let{linkData:u,islinkDataLoading:d}=e;const{t:m}=l.useTranslation(),p=a.useHistory(),v=a.useLocation(),{pathname:f}=v,{data:g,isFetched:y}=Digit.Hooks.useStore.getInitData(),{stateInfo:h}=g||{},_=Digit.UserService.getUser();let S=window.Digit.Utils.browser.isMobile();const[b,O]=n.useState(!1),[N,C]=n.useState(!1),[I,D]=n.useState(!1),w=()=>{D(!1)};if(d)return o.createElement(s.Loader,null);let T=[...P(m,0,()=>{var e;p.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`)})];T=T.filter(e=>"LANGUAGE"!==e.element),Digit.ULBService.getCurrentTenantId();const A=e=>{var t,n;let{item:l}=e;const r=(null==l?void 0:l.icon)||(null===(t=l.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),i=r?k[r]:k.BillsIcon;let s;s="component"===l.type?l.action:l.text;const c=()=>o.createElement("span",E({className:"menu-item"},l.populators),i,o.createElement("div",{className:"menu-label"},s));return"external-link"===l.type?o.createElement("a",{href:l.link},o.createElement(c,null)):"link"===l.type?o.createElement(a.Link,{to:null==l?void 0:l.link},o.createElement(c,null)):o.createElement(c,null)};let R;var L,U,B,F,j;return y&&_&&_.access_token&&"CITIZEN"===(null==_||null===(t=_.info)||void 0===t?void 0:t.type)&&(R=o.createElement(M,{info:null==_?void 0:_.info,stateName:null==h?void 0:h.name,t:m}),T=T.filter(e=>"login-btn"!==(null==e?void 0:e.id)),T=[...T,{type:"link",icon:"HomeIcon",element:"HOME",text:m("COMMON_BOTTOM_NAVIGATION_HOME"),link:b?`/${null===(L=window)||void 0===L?void 0:L.contextPath}/employee`:`/${null===(U=window)||void 0===U?void 0:U.contextPath}/citizen`,populators:{onClick:()=>{var e;p.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/all-services`)}}},{text:m("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:()=>{var e;p.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`)}}},{text:m("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{C(!1),D(!0)}}},{text:o.createElement(o.Fragment,null,m("CS_COMMON_HELPLINE"),o.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==g||null===(B=g.tenants)||void 0===B?void 0:B.map(e=>{}),o.createElement("div",{className:"link"},o.createElement("a",{href:"tel:"+(null==g||null===(F=g.tenants)||void 0===F?void 0:F[0].contactNumber)},null==g||null===(j=g.tenants)||void 0===j?void 0:j[0].contactNumber)))),element:"Helpline",icon:"Phone"}]),null===(r=Object.keys(u))||void 0===r||null===(i=r.sort((e,t)=>t.localeCompare(e)))||void 0===i||i.map(e=>{var t,n,o,l,r,i;(null===(t=u[e][0])||void 0===t?void 0:t.sidebar)===window.contextPath+"-links"&&T.splice(1,0,{type:null!==(n=u[e][0])&&void 0!==n&&null!==(o=n.sidebarURL)&&void 0!==o&&o.includes(null===(l=window)||void 0===l?void 0:l.contextPath)?"link":"external-link",text:m("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:u[e],icon:null===(r=u[e][0])||void 0===r?void 0:r.leftIcon,link:null===(i=u[e][0])||void 0===i?void 0:i.sidebarURL})}),o.createElement(o.Fragment,null,o.createElement("div",null,o.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),o.createElement("div",{style:{display:"flex",flexDirection:"column",height:S?"calc(100vh - 56px)":"auto",zIndex:"99"}},R,o.createElement("div",{className:"drawer-desktop"},null===(c=T)||void 0===c?void 0:c.map((e,t)=>o.createElement("div",{className:"sidebar-list "+(f===(null==e?void 0:e.link)||f===(null==e?void 0:e.sidebarURL)?"active":""),key:t},o.createElement(A,{item:e}))))),o.createElement("div",null,I&&o.createElement(x,{onSelect:()=>{var e;Digit.Utils.getMultiRootTenant()?(Digit.UserService.logout(),D(!1),window.location.href=`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`):(Digit.UserService.logout(),D(!1))},onCancel:w,onDismiss:w}))))},B=e=>{var r,i,c,u;let{isMobile:d=!1,toggleSidebar:m,onLogout:p,isEmployee:v=!1,linkData:f,islinkDataLoading:g,userProfile:E}=e;Digit.Utils.getMultiRootTenant();const{data:y,isFetched:h}=Digit.Hooks.useStore.getInitData(),_=Digit.StoreData.getCurrentLanguage(),[S,b]=n.useState(null),{languages:O,stateInfo:N}=y||{},C=Digit.UserService.getUser(),[I,D]=n.useState(""),[w,T]=n.useState(null),[A,R]=n.useState([]),[L,P]=n.useState([]),[x,M]=n.useState(_);let k=[];const{isLoading:B,data:F}=Digit.Hooks.useAccessControl(),j=Digit.ULBService.getCurrentTenantId(),{t:H}=l.useTranslation(),G=a.useHistory(),V=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(o=e)&&void 0!==o&&o.includes(t);){var o,l;e=null===(l=e)||void 0===l?void 0:l.replace(t,n)}return e};n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let o=[],l=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>o.push(e.tenantId));let r=o.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;l.push({label:H("TENANT_TENANTS_"+(null===(t=V(e,".","_"))||void 0===t?void 0:t.toUpperCase())),value:e})}),k=null==l?void 0:l.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),R(l)},[w]);const $=()=>{Digit.clikOusideFired=!0,m(!1)};n.useEffect(()=>{S||function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==C||null===(e=C.info)||void 0===e?void 0:e.uuid,o=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){var t;if(e&&e.user&&null!=e&&null!==(t=e.user)&&void 0!==t&&t.length){var n;const t=e.user[0],o=null==t||null===(n=t.photo)||void 0===n?void 0:n.split(",");b(null==o?void 0:o.at(0))}})}();Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[S]);const z=e=>{let t=null;var n,o;Digit.Utils.getMultiRootTenant()?(t=v?e.replace("/sandbox-ui/employee",`/sandbox-ui/${j}/employee`):e.replace("/sandbox-ui/citizen",`/sandbox-ui/${j}/citizen`),G.push(t),m()):(G.push("/"===e[0]?`/${null===(n=window)||void 0===n?void 0:n.contextPath}/${v?"employee":"citizen"}${e}`:`/${null===(o=window)||void 0===o?void 0:o.contextPath}/${v?"employee":"citizen"}/${e}`),m())};if(g||B)return o.createElement(t.Loader,null);let W=[{id:"login-btn",element:"LOGIN",text:H("CORE_COMMON_LOGIN"),icon:o.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:()=>{var e,t;G.push(v?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/language-selection`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/login`),$()}}}];h&&C&&C.access_token&&(W=W.filter(e=>"login-btn"!==(null==e?void 0:e.id)));let X={};if(v){var q;null==F||F.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==I&&""!==e.path){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),X[t]?X[t].push(e):X[t]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(I.toLowerCase())){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),X[t]?X[t].push(e):X[t]=[e]}});const e=Object.keys(X);for(let t=0;t<(null==e?void 0:e.length);t++){var Q,Z,Y,J,K;const n=null===(Q=X[e[t]][0])||void 0===Q||null===(Z=Q.displayName)||void 0===Z||null===(Y=Z.toUpperCase())||void 0===Y?void 0:Y.replace(/[ -]/g,"_"),o=null===(J=e[t])||void 0===J||null===(K=J.toUpperCase())||void 0===K?void 0:K.replace(/[ -]/g,"_");var ee,te,ne,oe;-1===X[e[t]][0].path.indexOf(".")?W.splice(1,0,{type:"link",text:H("ACTION_TEST_"+n),link:null===(ee=X[e[t]][0])||void 0===ee?void 0:ee.navigationURL,icon:null===(te=X[e[t]][0])||void 0===te?void 0:te.leftIcon,populators:{onClick:()=>{var n;G.push(null===(n=X[e[t]][0])||void 0===n?void 0:n.navigationURL),$()}}}):W.splice(1,0,{type:"dynamic",moduleName:H("ACTION_TEST_"+o),links:null===(ne=X[e[t]])||void 0===ne?void 0:ne.map(e=>{var t,n;return{...e,displayName:H("ACTION_TEST_"+(null==e||null===(t=e.displayName)||void 0===t||null===(n=t.toUpperCase())||void 0===n?void 0:n.replace(/[ -]/g,"_")))}}),icon:null===(oe=X[e[t]][1])||void 0===oe?void 0:oe.leftIcon})}const t=W.findIndex(e=>"HOME"===e.element),n=W.splice(t,1),o=W.findIndex(e=>"LANGUAGE"===e.element),l=W.splice(o,(null===(q=W)||void 0===q?void 0:q.length)-o);W.sort((e,t)=>("dynamic"===(null==e?void 0:e.type)?null==e?void 0:e.moduleName:null==e?void 0:e.text).localeCompare("dynamic"===(null==t?void 0:t.type)?null==t?void 0:t.moduleName:null==t?void 0:t.text)),(null==n?void 0:n[0])&&W.splice(0,0,n[0]),W=(null==l?void 0:l.length)>0?W.concat(l):W}else{var le,re;null===(le=Object.keys(f))||void 0===le||null===(re=le.sort((e,t)=>t.localeCompare(e)))||void 0===re||re.map(e=>{var t,n,o,l,r,i;"digit-ui-links"===(null===(t=f[e][0])||void 0===t?void 0:t.sidebar)&&W.splice(1,0,{type:null!==(n=f[e][0])&&void 0!==n&&null!==(o=n.sidebarURL)&&void 0!==o&&o.includes(null===(l=window)||void 0===l?void 0:l.contextPath)?"link":"external-link",text:H("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:f[e],icon:null===(r=f[e][0])||void 0===r?void 0:r.leftIcon,link:null===(i=f[e][0])||void 0===i?void 0:i.sidebarURL})})}G.location.pathname.includes("/openlink")&&(W=W.filter(e=>"LANGUAGE"===e.element)),W=null===(r=W)||void 0===r?void 0:r.map(e=>({...e,label:(null==e?void 0:e.text)||(null==e?void 0:e.moduleName)||"",icon:null!=e&&e.icon?null==e?void 0:e.icon:void 0}));let ie="";var ae;ie=Digit.Utils.getMultiRootTenant()?H("TENANT_TENANTS_"+j):H("TENANT_TENANTS_"+(null===(ae=V(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===ae?void 0:ae.toUpperCase()));const se=null===(i=W)||void 0===i?void 0:i.map(e=>{var t;return"dynamic"===(null==e?void 0:e.type)?{...e,children:null==e||null===(t=e.links)||void 0===t?void 0:t.map(e=>({...e,label:null==e?void 0:e.displayName,icon:null==e?void 0:e.leftIcon}))}:e}),ce=null==A?void 0:A.map(e=>({...e,type:"custom",key:"city"})),ue=null==O?void 0:O.map(e=>({...e,type:"custom",key:"language",icon:"Language"})),de=[{label:"HOME",value:"HOME",icon:"Home",type:"custom",key:"home"},{label:ie,value:ie,children:(null==ce?void 0:ce.length)>0?ce:void 0,type:"custom",icon:"LocationCity",key:"city"},{label:H("Language"),children:(null==ue?void 0:ue.length)>0?ue:void 0,type:"custom",icon:"Language",key:"language"},{label:H("EDIT_PROFILE"),type:"custom",icon:"Edit",key:"editProfile"},{label:H("Modules"),icon:"DriveFileMove",children:se}];return d?o.createElement(t.MobileSidebar,{items:de,profileName:null==C||null===(c=C.info)||void 0===c?void 0:c.name,profileNumber:null==C||null===(u=C.info)||void 0===u?void 0:u.mobileNumber,theme:"dark",transitionDuration:.3,styles:{marginTop:"64px",height:"93%"},onLogout:p,hideUserManuals:!0,profile:S||void 0,isSearchable:!0,onSelect:e=>{let{item:t,index:n,parentIndex:o}=e;return(e=>{let{item:t}=e;if(null!=t&&t.navigationURL)z(null==t?void 0:t.navigationURL);else if(null!=t&&t.link)z(null==t?void 0:t.link);else{if("custom"!==(null==t?void 0:t.type))return;switch(null==t?void 0:t.key){case"home":G.push(v?`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen`),m();break;case"editProfile":E(),m();break;case"language":M((n=t).value),Digit.LocalizationService.changeLanguage(n.value,N.code),m();break;case"city":(e=>{var t,n,o,l;const r=Digit.SessionStorage.get("citizen.userRequestObject"),i=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.filter(t=>t.tenantId===e.value);if((null==i?void 0:i.length)>0&&(r.info.roles=i,r.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(r),T(e),window.location.href.includes(`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee/`)){var a,s;const e=(null===(a=location.state)||void 0===a?void 0:a.from)||`/${null===(s=window)||void 0===s?void 0:s.contextPath}/employee`;G.replace(e)}window.location.reload()})(t),m()}}var n,o,l})({item:t,index:n,parentIndex:o})}}):o.createElement(U,{logout:p})};function F(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var j=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(F(function(e,t){var n;n=e=>(()=>{var t={"./node_modules/css-mediaquery/index.js":(e,t)=>{t.match=function(e,t){return a(e).some(function(e){var n=e.inverse,o="all"===e.type||t.type===e.type;if(o&&n||!o&&!n)return!1;var l=e.expressions.every(function(e){var n=e.feature,o=e.modifier,l=e.value,r=t[n];if(!r)return!1;switch(n){case"orientation":case"scan":return r.toLowerCase()===l.toLowerCase();case"width":case"height":case"device-width":case"device-height":l=u(l),r=u(r);break;case"resolution":l=c(l),r=c(r);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":l=s(l),r=s(r);break;case"grid":case"color":case"color-index":case"monochrome":l=parseInt(l,10)||1,r=parseInt(r,10)||0}switch(o){case"min":return r>=l;case"max":return r<=l;default:return r===l}});return l&&!n||!l&&n})},t.parse=a;var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,o=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,l=/^(?:(min|max)-)?(.+)/,r=/(em|rem|px|cm|mm|in|pt|pc)?$/,i=/(dpi|dpcm|dppx)?$/;function a(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(n),r=t[1],i=t[2],a=t[3]||"",s={};return s.inverse=!!r&&"not"===r.toLowerCase(),s.type=i?i.toLowerCase():"all",a=a.match(/\([^\)]+\)/g)||[],s.expressions=a.map(function(e){var t=e.match(o),n=t[1].toLowerCase().match(l);return{modifier:n[1],feature:n[2],value:t[2]}}),s})}function s(e){var t,n=Number(e);return n||(n=(t=e.match(/^(\d+)\s*\/\s*(\d+)$/))[1]/t[2]),n}function c(e){var t=parseFloat(e);switch(String(e).match(i)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function u(e){var t=parseFloat(e);switch(String(e).match(r)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}},"./node_modules/hyphenate-style-name/index.js":(e,t,n)=>{n.r(t),n.d(t,{default:()=>a});var o=/[A-Z]/g,l=/^ms-/,r={};function i(e){return"-"+e.toLowerCase()}const a=function(e){if(r.hasOwnProperty(e))return r[e];var t=e.replace(o,i);return r[e]=l.test(t)?"-"+t:t}},"./node_modules/matchmediaquery/index.js":(e,t,n)=>{var o=n("./node_modules/css-mediaquery/index.js").match,l="undefined"!=typeof window?window.matchMedia:null;function r(e,t,n){var r=this;if(l&&!n){var i=l.call(window,e);this.matches=i.matches,this.media=i.media,i.addListener(a)}else this.matches=o(e,t),this.media=e;function a(e){r.matches=e.matches,r.media=e.media}this.addListener=function(e){i&&i.addListener(e)},this.removeListener=function(e){i&&i.removeListener(e)},this.dispose=function(){i&&i.removeListener(a)}}e.exports=function(e,t,n){return new r(e,t,n)}},"./node_modules/object-assign/index.js":e=>{var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function l(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var i,a,s=l(e),c=1;c<arguments.length;c++){for(var u in i=Object(arguments[c]))n.call(i,u)&&(s[u]=i[u]);if(t){a=t(i);for(var d=0;d<a.length;d++)o.call(i,a[d])&&(s[a[d]]=i[a[d]])}}return s}},"./node_modules/prop-types/checkPropTypes.js":(e,t,n)=>{var o,l=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),r={},i=n("./node_modules/prop-types/lib/has.js");function a(e,t,n,a,s){for(var c in e)if(i(e,c)){var u;try{if("function"!=typeof e[c]){var d=Error((a||"React class")+": "+n+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=e[c](t,c,a,n,null,l)}catch(e){u=e}if(!u||u instanceof Error||o((a||"React class")+": type specification of "+n+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in r)){r[u.message]=!0;var m=s?s():"";o("Failed "+n+" type: "+u.message+(null!=m?m:""))}}}o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},a.resetWarningCache=function(){r={}},e.exports=a},"./node_modules/prop-types/factoryWithTypeCheckers.js":(e,t,n)=>{var o,l=n("./node_modules/react-is/index.js"),r=n("./node_modules/object-assign/index.js"),i=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),a=n("./node_modules/prop-types/lib/has.js"),s=n("./node_modules/prop-types/checkPropTypes.js");function c(){return null}o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,u={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:p(c),arrayOf:function(e){return p(function(t,n,o,l,r){if("function"!=typeof e)return new m("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new m("Invalid "+l+" `"+r+"` of type `"+E(a)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<a.length;s++){var c=e(a,s,o,l,r+"["+s+"]",i);if(c instanceof Error)return c}return null})},element:p(function(t,n,o,l,r){var i=t[n];return e(i)?null:new m("Invalid "+l+" `"+r+"` of type `"+E(i)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:p(function(e,t,n,o,r){var i=e[t];return l.isValidElementType(i)?null:new m("Invalid "+o+" `"+r+"` of type `"+E(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return p(function(t,n,o,l,r){var i;return t[n]instanceof e?null:new m("Invalid "+l+" `"+r+"` of type `"+((i=t[n]).constructor&&i.constructor.name?i.constructor.name:"<<anonymous>>")+"` supplied to `"+o+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:p(function(e,t,n,o,l){return g(e[t])?null:new m("Invalid "+o+" `"+l+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return p(function(t,n,o,l,r){if("function"!=typeof e)return new m("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var s=t[n],c=E(s);if("object"!==c)return new m("Invalid "+l+" `"+r+"` of type `"+c+"` supplied to `"+o+"`, expected an object.");for(var u in s)if(a(s,u)){var d=e(s,u,o,l,r+"."+u,i);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return o(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),c;function t(t,n,o,l,r){for(var i=t[n],a=0;a<e.length;a++)if(d(i,e[a]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===y(t)?String(t):t});return new m("Invalid "+l+" `"+r+"` of value `"+String(i)+"` supplied to `"+o+"`, expected one of "+s+".")}return p(t)},oneOfType:function(e){if(!Array.isArray(e))return o("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+h(n)+" at index "+t+"."),c}return p(function(t,n,o,l,r){for(var s=[],c=0;c<e.length;c++){var u=(0,e[c])(t,n,o,l,r,i);if(null==u)return null;u.data&&a(u.data,"expectedType")&&s.push(u.data.expectedType)}return new m("Invalid "+l+" `"+r+"` supplied to `"+o+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")})},shape:function(e){return p(function(t,n,o,l,r){var a=t[n],s=E(a);if("object"!==s)return new m("Invalid "+l+" `"+r+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return f(o,l,r,c,y(u));var d=u(a,c,o,l,r+"."+c,i);if(d)return d}return null})},exact:function(e){return p(function(t,n,o,l,s){var c=t[n],u=E(c);if("object"!==u)return new m("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");var d=r({},t[n],e);for(var p in d){var v=e[p];if(a(e,p)&&"function"!=typeof v)return f(o,l,s,p,y(v));if(!v)return new m("Invalid "+l+" `"+s+"` key `"+p+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=v(c,p,o,l,s+"."+p,i);if(g)return g}return null})}};function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function m(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){var n={},l=0;function r(r,a,s,c,u,d,p){if(c=c||"<<anonymous>>",d=d||s,p!==i){if(t){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("undefined"!=typeof console){var f=c+":"+s;!n[f]&&l<3&&(o("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[f]=!0,l++)}}return null==a[s]?r?new m(null===a[s]?"The "+u+" `"+d+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+u+" `"+d+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(a,s,c,u,d)}var a=r.bind(null,!1);return a.isRequired=r.bind(null,!0),a}function v(e){return p(function(t,n,o,l,r,i){var a=t[n];return E(a)!==e?new m("Invalid "+l+" `"+r+"` of type `"+y(a)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function f(e,t,n,o,l){return new m((e||"React class")+": "+t+" type `"+n+"."+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+l+"`.")}function g(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(g);if(null===t||e(t))return!0;var o=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!o)return!1;var l,r=o.call(t);if(o!==t.entries){for(;!(l=r.next()).done;)if(!g(l.value))return!1}else for(;!(l=r.next()).done;){var i=l.value;if(i&&!g(i[1]))return!1}return!0;default:return!1}}function E(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function y(e){if(null==e)return""+e;var t=E(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function h(e){var t=y(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return m.prototype=Error.prototype,u.checkPropTypes=s,u.resetWarningCache=s.resetWarningCache,u.PropTypes=u,u}},"./node_modules/prop-types/index.js":(e,t,n)=>{var o=n("./node_modules/react-is/index.js");e.exports=n("./node_modules/prop-types/factoryWithTypeCheckers.js")(o.isElement,!0)},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":e=>{e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},"./node_modules/prop-types/lib/has.js":e=>{e.exports=Function.call.bind(Object.prototype.hasOwnProperty)},"./node_modules/react-is/cjs/react-is.development.js":(e,t)=>{!function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case c:case u:case l:case i:case r:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case a:return g;default:return t}}case o:return t}}}var S=u,b=s,O=a,N=n,C=d,I=l,D=f,w=v,T=o,A=i,R=r,L=m,P=!1;function x(e){return _(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=b,t.ContextProvider=O,t.Element=N,t.ForwardRef=C,t.Fragment=I,t.Lazy=D,t.Memo=w,t.Portal=T,t.Profiler=A,t.StrictMode=R,t.Suspense=L,t.isAsyncMode=function(e){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),x(e)||_(e)===c},t.isConcurrentMode=x,t.isContextConsumer=function(e){return _(e)===s},t.isContextProvider=function(e){return _(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return _(e)===d},t.isFragment=function(e){return _(e)===l},t.isLazy=function(e){return _(e)===f},t.isMemo=function(e){return _(e)===v},t.isPortal=function(e){return _(e)===o},t.isProfiler=function(e){return _(e)===i},t.isStrictMode=function(e){return _(e)===r},t.isSuspense=function(e){return _(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===i||e===r||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=_}()},"./node_modules/react-is/index.js":(e,t,n)=>{e.exports=n("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(e,t,n)=>{function o(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),o=Object.keys(t),l=n.length;if(o.length!==l)return!1;for(var r=0;r<l;r++){var i=n[r];if(e[i]!==t[i]||!Object.prototype.hasOwnProperty.call(t,i))return!1}return!0}function l(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}n.r(t),n.d(t,{shallowEqualArrays:()=>l,shallowEqualObjects:()=>o})},"./src/Component.ts":function(e,t,n){var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=l(n("./src/useMediaQuery.ts"));t.default=function(e){var t=e.children,n=e.device,l=e.onChange,i=o(e,["children","device","onChange"]),a=(0,r.default)(i,n,l);return"function"==typeof t?t(a):a?t:null}},"./src/Context.ts":(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var o=(0,n("react").createContext)(void 0);t.default=o},"./src/index.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.toQuery=t.useMediaQuery=t.default=void 0;var l=o(n("./src/useMediaQuery.ts"));t.useMediaQuery=l.default;var r=o(n("./src/Component.ts"));t.default=r.default;var i=o(n("./src/toQuery.ts"));t.toQuery=i.default;var a=o(n("./src/Context.ts"));t.Context=a.default},"./src/mediaQuery.ts":function(e,t,n){var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)},l=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n("./node_modules/prop-types/index.js")),a=i.default.oneOfType([i.default.string,i.default.number]),s={all:i.default.bool,grid:i.default.bool,aural:i.default.bool,braille:i.default.bool,handheld:i.default.bool,print:i.default.bool,projection:i.default.bool,screen:i.default.bool,tty:i.default.bool,tv:i.default.bool,embossed:i.default.bool},c={orientation:i.default.oneOf(["portrait","landscape"]),scan:i.default.oneOf(["progressive","interlace"]),aspectRatio:i.default.string,deviceAspectRatio:i.default.string,height:a,deviceHeight:a,width:a,deviceWidth:a,color:i.default.bool,colorIndex:i.default.bool,monochrome:i.default.bool,resolution:a,type:Object.keys(s)},u=l(c,["type"]),d=o({minAspectRatio:i.default.string,maxAspectRatio:i.default.string,minDeviceAspectRatio:i.default.string,maxDeviceAspectRatio:i.default.string,minHeight:a,maxHeight:a,minDeviceHeight:a,maxDeviceHeight:a,minWidth:a,maxWidth:a,minDeviceWidth:a,maxDeviceWidth:a,minColor:i.default.number,maxColor:i.default.number,minColorIndex:i.default.number,maxColorIndex:i.default.number,minMonochrome:i.default.number,maxMonochrome:i.default.number,minResolution:a,maxResolution:a},u),m=o(o({},s),d);t.default={all:m,types:s,matchers:c,features:d}},"./src/toQuery.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=o(n("./node_modules/hyphenate-style-name/index.js")),r=o(n("./src/mediaQuery.ts"));t.default=function(e){var t=[];return Object.keys(r.default.all).forEach(function(n){var o=e[n];null!=o&&t.push(function(e,t){var n=(0,l.default)(e);return"number"==typeof t&&(t="".concat(t,"px")),!0===t?n:!1===t?"not ".concat(n):"(".concat(n,": ").concat(t,")")}(n,o))}),t.join(" and ")}},"./src/useMediaQuery.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=n("react"),r=o(n("./node_modules/matchmediaquery/index.js")),i=o(n("./node_modules/hyphenate-style-name/index.js")),a=n("./node_modules/shallow-equal/dist/index.esm.js"),s=o(n("./src/toQuery.ts")),c=o(n("./src/Context.ts")),u=function(e){if(e)return Object.keys(e).reduce(function(t,n){return t[(0,i.default)(n)]=e[n],t},{})},d=function(){var e=(0,l.useRef)(!1);return(0,l.useEffect)(function(){e.current=!0},[]),e.current};t.default=function(e,t,n){var o=function(e){var t=(0,l.useContext)(c.default),n=function(){return u(e)||u(t)},o=(0,l.useState)(n),r=o[0],i=o[1];return(0,l.useEffect)(function(){var e=n();(0,a.shallowEqualObjects)(r,e)||i(e)},[e,t]),r}(t),i=function(e){var t=function(){return function(e){return e.query||(0,s.default)(e)}(e)},n=(0,l.useState)(t),o=n[0],r=n[1];return(0,l.useEffect)(function(){var e=t();o!==e&&r(e)},[e]),o}(e);if(!i)throw new Error("Invalid or missing MediaQuery!");var m=function(e,t){var n=function(){return(0,r.default)(e,t||{},!!t)},o=(0,l.useState)(n),i=o[0],a=o[1],s=d();return(0,l.useEffect)(function(){if(s){var e=n();return a(e),function(){e&&e.dispose()}}},[e,t]),i}(i,o),p=function(e){var t=(0,l.useState)(e.matches),n=t[0],o=t[1];return(0,l.useEffect)(function(){var t=function(e){o(e.matches)};return e.addListener(t),o(e.matches),function(){e.removeListener(t)}},[e]),n}(m),v=d();return(0,l.useEffect)(function(){v&&n&&n(p)},[p]),(0,l.useEffect)(function(){return function(){m&&m.dispose()}},[]),p}},react:t=>{t.exports=e}},n={};function o(e){var l=n[e];if(void 0!==l)return l.exports;var r=n[e]={exports:{}};return t[e].call(r.exports,r,r.exports,o),r.exports}return o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o("./src/index.ts")})(),e.exports=n(o)}));const H=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web","sandbox-ui","kibana-v8"],G=()=>{const{isLoading:e,data:n}=Digit.Hooks.useAccessControl(),r=Digit.Utils.getMultiRootTenant(),{t:i}=l.useTranslation(),s=a.useHistory(),c=Digit.ULBService.getStateId(),u={};null==n||n.actions.filter(e=>"url"===e.url).forEach(e=>{var t;if(null==e||null===(t=e.path)||void 0===t||t.split("."),""!==(null==e?void 0:e.path)){var n;const t=null==e||null===(n=e.path)||void 0===n?void 0:n.split(".");let o={};t.reduce((n,o,l)=>{if(l!==t.length-1)return n[o]={},n[o];n[o]={item:e}},o),function e(t,n){for(const o in n)n.hasOwnProperty(o)&&("object"!=typeof n[o]||Array.isArray(n[o])?t[o]||(t[o]=n[o]):(t[o]||(t[o]={}),e(t[o],n[o])))}(u,o)}});const d=e=>(e.sort((e,t)=>(void 0!==e.orderNumber?e.orderNumber:Infinity)-(void 0!==t.orderNumber?t.orderNumber:Infinity)),e.forEach(e=>{e.children&&e.children.length>0&&d(e.children)}),e),m=function(e){const t=(e,n)=>{if(n.item)return{label:i(n.item.displayName),icon:{icon:n.item.leftIcon,width:"1.5rem",height:"1.5rem"},navigationUrl:n.item.navigationURL,orderNumber:n.item.orderNumber};const o=Object.keys(n).map(e=>t(e,n[e])),l=function e(t){void 0===t&&(t={});for(const n in t){const o=t[n];if("item"===n&&""!==(null==o?void 0:o.leftIcon))return null==o?void 0:o.leftIcon;if("object"==typeof t[n]&&!Array.isArray(t[n])){const o=e(t[n]);if(o)return o}}return null}(n);return{label:i(e),icon:{icon:l,width:"1.5rem",height:"1.5rem"},children:o}};return Object.keys(e).map(n=>t(n,e[n]))}((e=>{const t=Object.entries(e);return t.sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0),Object.fromEntries(t)})(u)),p=d(m);return e?o.createElement(t.Loader,null):u?o.createElement(j,{minWidth:768},o.createElement(t.Sidebar,{items:p,hideAccessbilityTools:!0,onSelect:e=>{let{item:t,index:n,parentIndex:o}=e;return(e=>{let{item:t}=e;null!=t&&t.navigationUrl&&function(e,t){var n,o;if(void 0===e&&(e={}),void 0===t&&(t=""),"/"!=t)if(-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+(null===(o=window)||void 0===o?void 0:o.contextPath)))){const n=window.location.origin;let o=null;r?(o=t=t.replace("/sandbox-ui/employee",`/sandbox-ui/${c}/employee`),e.push(o)):(o=null!=H&&H.every(e=>{var n;return-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+e))})?n+"/employee/"+t:n+t,window.location.href=o)}else e.push(t)}(s,null==t?void 0:t.navigationUrl)})({item:t,index:n,parentIndex:o})},theme:"dark",variant:"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}})):""},V=e=>{let{CITIZEN:t,isSidebarOpen:n,toggleSidebar:l,handleLogout:r,mobileView:i,userDetails:a,modules:s,linkData:c,islinkDataLoading:u,userProfile:d}=e;return t?o.createElement(B,{isOpen:n,isMobile:!0,toggleSidebar:l,onLogout:r,linkData:c,islinkDataLoading:u,userProfile:d,isEmployee:!1}):!n&&null!=a&&a.access_token?o.createElement("div",{className:"digit-employeeSidebar"},o.createElement(G,{mobileView:i,userDetails:a,modules:s})):o.createElement("div",{className:"digit-citizenSidebar"},o.createElement(B,{isOpen:n,isMobile:!0,toggleSidebar:l,onLogout:r,isEmployee:!0,userProfile:d}))},$=e=>{let{t:t,stateInfo:l,userDetails:r,CITIZEN:i,cityDetails:s,mobileView:c,handleUserDropdownSelection:u,logoUrl:d,logoUrlWhite:m,showSidebar:p=!0,showLanguageChange:v,linkData:f,islinkDataLoading:g}=e;const[E,y]=n.useState(!1),h=a.useHistory(),[_,S]=n.useState(!1),b=()=>{y(!1),S(!0)},O=()=>{S(!1)},N=()=>{y(!E)},C=()=>{var e,t;h.push(i?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/profile`)},I=[{name:t("EDIT_PROFILE"),icon:"Edit",func:C},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:b}];return o.createElement(o.Fragment,null,o.createElement(L,{t:t,stateInfo:l,toggleSidebar:N,isSidebarOpen:E,handleLogout:b,userDetails:r,CITIZEN:i,cityDetails:s,mobileView:c,userOptions:I,handleUserDropdownSelection:u,logoUrl:d,logoUrlWhite:m,showLanguageChange:v}),_&&o.createElement(x,{onSelect:()=>{Digit.UserService.logout(),S(!1)},onCancel:O,onDismiss:O}),i?i?p&&E&&o.createElement(V,{t:t,CITIZEN:i,isSidebarOpen:E,toggleSidebar:N,handleLogout:b,mobileView:c,userDetails:r,linkData:f,userProfile:C,islinkDataLoading:g}):null:p&&o.createElement(V,{t:t,CITIZEN:i,isSidebarOpen:E,toggleSidebar:N,handleLogout:b,mobileView:c,userDetails:r,linkData:f,userProfile:C,islinkDataLoading:g}))},z=e=>{const{question:t,answer:r,lastIndex:i}=e,[a,s]=n.useState(!1),{t:u}=l.useTranslation();return o.createElement("div",{className:"faqs border-none",onClick:()=>s(!a)},o.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},o.createElement("span",null,u(t)),o.createElement("span",{className:a?"faqicon rotate":"faqicon",style:{float:"right"}},o.createElement(c.ArrowForward,null))),o.createElement("div",{className:"faq-answer",style:a?{display:"block"}:{display:"none"}},o.createElement("span",null,u(r))),i?null:o.createElement("div",{className:"cs-box-border"}))},W=e=>{var r,i,a;let{module:s}=e;const c=Digit.UserService.getUser(),{t:u}=((null==c||null===(r=c.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation()),{isLoading:d,data:m}=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),p=null==m||null===(i=m.MdmsRes["common-masters"])||void 0===i||null===(a=i.faqs[0])||void 0===a?void 0:a[""+s].faqs;return d?o.createElement(t.Loader,null):o.createElement(n.Fragment,null,o.createElement("div",{className:"faq-page"},o.createElement(t.BackButton,{style:{marginLeft:"unset"}}),o.createElement("div",{style:{marginBottom:"15px"}},o.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},u("FAQ_S"))),o.createElement("div",{className:"faq-list"},p.map((e,t)=>o.createElement(z,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==p?void 0:p.length)-1})))))},X=()=>{var e,t,n,r,i,c,u,d,m,p,v,f,g,y,h,_,S,b,O,N,C,I,D,w,T,A,R;const{t:L}=l.useTranslation(),P=a.useHistory(),x=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCitizenCurrentTenant(!0),{data:{uiHomePage:M}={},isLoading:k}=Digit.Hooks.useStore.getInitData();let U=window.Digit.Utils.browser.isMobile();const B=()=>{var e,t,n,o,l;return"EMPLOYEE"!==(null===(e=Digit.UserService)||void 0===e||null===(t=e.getUser())||void 0===t||null===(n=t.info)||void 0===n?void 0:n.type)&&!(null===(o=Digit.UserService)||void 0===o||null===(l=o.getUser())||void 0===l||!l.access_token)},{data:F,isLoading:j}=Digit.Hooks.useEvents({tenantId:x,variant:"whats-new",config:{enabled:B()}});var H;x||P.push(`/${null===(H=window)||void 0===H?void 0:H.contextPath}/citizen/select-language`);const G=null==M?void 0:M.appBannerDesktop,V=null==M?void 0:M.appBannerMobile,$=null==M?void 0:M.citizenServicesCard,z=null==M?void 0:M.informationAndUpdatesCard,W=null==M?void 0:M.whatsAppBannerDesktop,X=null==M?void 0:M.whatsAppBannerMobile,q=null==M?void 0:M.whatsNewSection,Q=null==M?void 0:M.redirectURL;var Z,Y;Q&&P.push(`/${null===(Z=window)||void 0===Z?void 0:Z.contextPath}/citizen/${Q}`),(null!==(e=window)&&void 0!==e&&null!==(t=e.location)&&void 0!==t&&null!==(n=t.href)&&void 0!==n&&null!==(r=n.includes)&&void 0!==r&&r.call(n,"sanitation-ui")||null!==(i=window)&&void 0!==i&&null!==(c=i.location)&&void 0!==c&&null!==(u=c.href)&&void 0!==u&&null!==(d=u.includes)&&void 0!==d&&d.call(u,"sandbox-ui"))&&P.push(`/${null===(Y=window)||void 0===Y?void 0:Y.contextPath}/citizen/all-services`);const J=e=>{window.open(null==e?void 0:e.navigationUrl)},K={header:L(null==$?void 0:$.headerLabel),sideOption:{name:L(null==$||null===(m=$.sideOption)||void 0===m?void 0:m.name),onClick:()=>{var e;return P.push(null==$||null===(e=$.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:L(null==$||null===(p=$.props)||void 0===p||null===(v=p[0])||void 0===v?void 0:v.label),Icon:o.createElement(s.ComplaintIcon,null),onClick:()=>{var e,t;return P.push(null==$||null===(e=$.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==$||null===(f=$.props)||void 0===f||null===(g=f[1])||void 0===g?void 0:g.label),Icon:o.createElement(s.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return P.push(null==$||null===(e=$.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==$||null===(y=$.props)||void 0===y||null===(h=y[2])||void 0===h?void 0:h.label),Icon:o.createElement(s.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return P.push(null==$||null===(e=$.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==$||null===(_=$.props)||void 0===_||null===(S=_[3])||void 0===S?void 0:S.label),Icon:o.createElement(s.OBPSIcon,null),onClick:()=>{var e,t;return P.push(null==$||null===(e=$.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}},ee={header:L(null==z?void 0:z.headerLabel),sideOption:{name:L(null==z||null===(b=z.sideOption)||void 0===b?void 0:b.name),onClick:()=>{var e;return P.push(null==z||null===(e=z.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:L(null==z||null===(O=z.props)||void 0===O||null===(N=O[0])||void 0===N?void 0:N.label),Icon:o.createElement(s.HomeIcon,null),onClick:()=>{var e,t;return P.push(null==z||null===(e=z.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==z||null===(C=z.props)||void 0===C||null===(I=C[1])||void 0===I?void 0:I.label),Icon:o.createElement(s.Calender,null),onClick:()=>{var e,t;return P.push(null==z||null===(e=z.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==z||null===(D=z.props)||void 0===D||null===(w=D[2])||void 0===w?void 0:w.label),Icon:o.createElement(s.DocumentIcon,null),onClick:()=>{var e,t;return P.push(null==z||null===(e=z.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==z||null===(T=z.props)||void 0===T||null===(A=T[3])||void 0===A?void 0:A.label),Icon:o.createElement(s.DocumentIcon,null),onClick:()=>{var e,t;return P.push(null==z||null===(e=z.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}};return k?o.createElement(s.Loader,null):o.createElement("div",{className:"HomePageContainer"},o.createElement("div",{className:"HomePageWrapper"},o.createElement("div",{className:"BannerWithSearch"},o.createElement("img",U?{src:null==V?void 0:V.bannerUrl}:{src:null==G?void 0:G.bannerUrl}),o.createElement("div",{className:"ServicesSection"},o.createElement(s.CardBasedOptions,E({style:{marginTop:"-30px"}},K)),o.createElement(s.CardBasedOptions,E({style:U?{}:{marginTop:"-30px"}},ee)))),(X||W)&&o.createElement("div",{className:"WhatsAppBanner"},o.createElement("img",U?{src:null==X?void 0:X.bannerUrl,onClick:()=>J(X)}:{src:null==W?void 0:W.bannerUrl,onClick:()=>J(W)})),B()?j?o.createElement(s.Loader,null):o.createElement("div",{className:"WhatsNewSection"},o.createElement("div",{className:"headSection"},o.createElement("h2",null,L(null==q?void 0:q.headerLabel)),o.createElement("p",{onClick:()=>{var e;return P.push(null==q||null===(e=q.sideOption)||void 0===e?void 0:e.navigationUrl)}},L(null==q||null===(R=q.sideOption)||void 0===R?void 0:R.name))),o.createElement(s.WhatsNewCard,null==F?void 0:F[0])):null))},q=()=>{const{t:e}=l.useTranslation(),r=a.useHistory(),{data:{languages:i,stateInfo:s}={},isLoading:c}=Digit.Hooks.useStore.getInitData(),u=Digit.StoreData.getCurrentLanguage(),d=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]),m=n.useMemo(()=>({options:i,optionsKey:"label",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:e=>Digit.LocalizationService.changeLanguage(e.value,s.code),selectedOption:null==i?void 0:i.filter(e=>e.value===u)[0]}),[u,i]);return c?o.createElement(t.Loader,null):o.createElement("div",{className:"selection-card-wrapper"},o.createElement(t.PageBasedInput,{texts:d,onSubmit:function(){var e;r.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/select-location`)}},o.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),o.createElement(t.RadioButtons,m)))},Q=()=>{const{t:e}=l.useTranslation(),r=a.useHistory(),i=a.useLocation(),{data:{uiHomePage:c}={}}=Digit.Hooks.useStore.getInitData(),u=null==c?void 0:c.redirectURL,{data:d,isLoading:m}=Digit.Hooks.useTenants(),[p,v]=n.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[f,g]=n.useState(!1),y=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function h(e){v(e),g(!1)}const _=n.useMemo(()=>({options:d,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:h,selectedOption:p}),[d,e,p]);return m?o.createElement("loader",null):o.createElement("div",{className:"selection-card-wrapper"},o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement(s.PageBasedInput,{texts:y,onSubmit:function(){if(p){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",p);const o=null===(e=i.state)||void 0===e?void 0:e.redirectBackTo;var t,n;u?r.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/${u}`):o?r.replace(o):r.push(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen`)}else g(!0)},className:"location-selection-container"},o.createElement(s.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),o.createElement(s.SearchOnRadioButtons,E({},_,{placeholder:e("COMMON_TABLE_SEARCH")})),f?o.createElement(s.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},Z=function(){function e(){}return e.prototype.then=function(t,n){const o=new e,l=this.s;if(l){const e=1&l?t:n;if(e){try{Y(o,1,e(this.v))}catch(e){Y(o,2,e)}return o}return this}return this.o=function(e){try{const l=e.v;1&e.s?Y(o,1,t?t(l):l):n?Y(o,1,n(l)):Y(o,2,l)}catch(e){Y(o,2,e)}},o},e}();function Y(e,t,n){if(!e.s){if(n instanceof Z){if(!n.s)return void(n.o=Y.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Y.bind(null,e,t),Y.bind(null,e,2));e.s=t,e.v=n;const o=e.o;o&&o(e)}}function J(e){return e instanceof Z&&1&e.s}const K="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function ee(e,t,n){if("function"==typeof e[K]){var o,l,r,i=e[K]();if(function e(a){try{for(;!((o=i.next()).done||n&&n());)if((a=t(o.value))&&a.then){if(!J(a))return void a.then(e,r||(r=Y.bind(null,l=new Z,2)));a=a.v}l?Y(l,1,a):l=a}catch(e){Y(l||(l=new Z),2,e)}}(),i.return){var a=function(e){try{o.done||i.return()}catch(e){}return e};if(l&&l.then)return l.then(a,function(e){throw a(e)});a()}return l}if(!("length"in e))throw new TypeError("Object is not iterable");for(var s=[],c=0;c<e.length;c++)s.push(e[c]);return function(e,t,n){var o,l,r=-1;return function i(a){try{for(;++r<e.length&&(!n||!n());)if((a=t(r))&&a.then){if(!J(a))return void a.then(i,l||(l=Y.bind(null,o=new Z,2)));a=a.v}o?Y(o,1,a):o=a}catch(e){Y(o||(o=new Z),2,e)}}(),o}(s,function(e){return t(s[e])},n)}function te(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function ne(e){let{setProfilePic:t,closeDrawer:r,userType:i,removeProfilePic:a,showToast:c}=e;const[u,d]=n.useState(null),[m,p]=n.useState(""),[v,f]=n.useState(null),{t:g}=l.useTranslation();return n.useEffect(()=>{!function(){try{f(null);const e=function(){if(m){const e=function(){if(m.size>=1e6)c("error",g("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),f(g("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=te(function(){return Promise.resolve(Digit.UploadServices.Filestorage(i+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var n,o;if((null==e||null===(n=e.data)||void 0===n||null===(o=n.files)||void 0===o?void 0:o.length)>0){var l,r;const n=null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId;d(n),t(n)}else c("error",g("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),f(g("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",g("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"))});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)}}()},[m]),o.createElement(o.Fragment,null,o.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:()=>r()}),o.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===i?"2.5rem":"0",zIndex:"1000"}},o.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},o.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",o.createElement(s.GalleryIcon,null)),o.createElement("label",{style:{cursor:"pointer"}}," Gallery"),o.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>p(e.target.files[0]),style:{display:"none"}})),o.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},o.createElement("button",{onClick:()=>{a(),r()}},o.createElement(s.RemoveIcon,null)),o.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const oe=e=>{var r,i,c,u,d,m,p,v,f,g,y;let{stateCode:h,userType:_,cityDetails:S}=e;a.useHistory();const{t:b}=l.useTranslation(),O=window.location.href,N=Digit.ULBService.getStateId(),C=Digit.ULBService.getCurrentTenantId(),I=(null===(r=Digit.UserService.getUser())||void 0===r?void 0:r.info)||{},[D,w]=n.useState(null),[T,A]=n.useState(null!=I&&I.name?I.name:""),[R,L]=n.useState(null!=I&&I.emailId?I.emailId:""),[P,x]=n.useState(null==D?void 0:D.gender),[M,k]=n.useState(null!=I&&I.permanentCity?I.permanentCity:S.name),[U,B]=n.useState(null!=I&&I.mobileNumber?I.mobileNumber:""),[F,j]=n.useState(null),[H,G]=n.useState(""),[V,$]=n.useState(!1),[z,W]=n.useState(!1),[X,q]=n.useState(""),[Q,Z]=n.useState(""),[Y,J]=n.useState(""),[K,ee]=n.useState(null),[oe,le]=n.useState(!1),[re,ie]=o.useState(window.innerWidth),[ae,se]=o.useState({}),ce=window.Digit.Utils.browser.isMobile();o.useEffect(()=>(window.addEventListener("resize",()=>ie(window.innerWidth)),()=>{window.removeEventListener("resize",()=>ie(window.innerWidth))})),n.useEffect(()=>{var e;le(!0),function(){try{const e=null==I?void 0:I.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(C,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&w(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),x({i18nKey:void 0,code:null==D?void 0:D.gender,value:null==D?void 0:D.gender});const t=null==D||null===(e=D.photo)||void 0===e?void 0:e.split(",");G(null==t?void 0:t.at(0)),le(!1)},[null!==D]);let ue={};const de=e=>x(e),me=()=>$(!1),pe=e=>{A(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?se({...ae,userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}}):se({...ae,userName:null})},ve=e=>{(null==I?void 0:I.userName)!==e?(L(e),!e.length||e.includes("@")&&e.includes(".")?se({...ae,emailAddress:null}):se({...ae,emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}})):se({...ae,emailAddress:null})},fe=function(e,t,n){void 0===n&&(n=5e3),ee({key:e,action:t}),setTimeout(()=>{ee(null)},n)},ge=function(){try{let t=!1;function e(e){if(t)return e;le(!1)}le(!0);const n=te(function(){const e={...I,name:T,gender:null==P?void 0:P.value,emailId:R,photo:F};if(!new RegExp(/^([a-zA-Z ])*$/).test(T)||""===T||T.length>50||T.length<1)throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===_&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(U))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(R.length&&(!R.includes("@")||!R.includes(".")))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_EMAIL_INVALID")});if(z&&(X.length||Q.length||Y.length)){if(Q!==Y)throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(X.length&&Q.length&&Y.length))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(Q)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(Y))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}return Promise.resolve(Digit.UserService.updateUser(e,h)).then(function(e){let{responseInfo:t}=e;if(t&&"200"===t.status){const e=Digit.UserService.getUser();e&&Digit.UserService.setUser({...e,info:{...e.info,name:T,mobileNumber:U,emailId:R,permanentCity:M}})}return function(){if(X.length&&Q.length&&Y.length){const e={existingPassword:X,newPassword:Q,tenantId:C,type:"EMPLOYEE",username:null==I?void 0:I.userName,confirmPassword:Y};return function(){if(Q===Y)return te(function(){return Promise.resolve(Digit.UserService.changePassword(e,C)).then(function(e){const{responseInfo:t}=e;if(null==t||!t.status||"200"!==t.status)throw"";fe("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3),setTimeout(()=>Digit.UserService.logout(),2e3)})},function(e){var t,n;throw JSON.stringify({type:"error",message:null!==(t=e.Errors)&&void 0!==t&&null!==(n=t.at(0))&&void 0!==n&&n.description?e.Errors.at(0).description:"CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"})});throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"})}()}null!=t&&t.status&&"200"===t.status&&fe("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){const t=JSON.parse(e);fe(t.type,b(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}};let Ee=[];const{data:ye}=Digit.Hooks.useGenderMDMS(N,"common-masters","GenderType");return ye&&ye.map(e=>{Ee.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),oe?o.createElement(t.Loader,null):o.createElement("div",{className:"user-profile"},o.createElement("section",{style:{margin:"citizen"===_||ce?"8px":"24px"}},"citizen"===_||ce?o.createElement(t.BackLink,{onClick:()=>window.history.back()}):o.createElement(t.BreadCrumb,{crumbs:[{path:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/employee`,content:b("ES_COMMON_HOME"),show:!0},{path:`/${null===(c=window)||void 0===c?void 0:c.contextPath}/employee/user/profile`,content:b("ES_COMMON_PAGE_1"),show:O.includes("/user/profile")}]})),o.createElement("div",{style:{display:"flex",flex:1,flexDirection:re<768||"citizen"===_?"column":"row",margin:"citizen"===_?"8px":"16px",gap:"citizen"===_?"":"0 24px",boxShadow:"citizen"===_?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===_?"white":"",borderRadius:"citizen"===_?"4px":"",maxWidth:"citizen"===_?"960px":""}},o.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===_?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===_?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===_?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===_?"8px":"16px"}},o.createElement("div",{style:{position:"relative",height:"citizen"===_?"114px":"150px",width:"citizen"===_?"114px":"150px",margin:"16px"}},o.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:H&&""!==H?H:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC"}),o.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>$(!V)},o.createElement(s.CameraIcon,null)))),o.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===_?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===_?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===_?"8px":"24px",paddingBottom:"20px"}},"citizen"===_?o.createElement(o.Fragment,null,o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),o.createElement("div",{style:{width:"40rem",maxWidth:"960px"}},o.createElement(t.TextInput,E({t:b,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:T,onChange:e=>pe(e.target.value)},ue={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==ae?void 0:ae.userName)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(u=ae.userName)||void 0===u?void 0:u.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+b("CORE_COMMON_PROFILE_GENDER")),o.createElement(t.Dropdown,{style:{width:"40rem",fontSize:"1rem"},className:"form-field profileDropdown",selected:1===(null==P?void 0:P.length)?P[0]:P,disable:1===(null==P?void 0:P.length)||!1,option:Ee,select:de,value:P,optionKey:"code",t:b,name:"gender"})),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+b("CORE_COMMON_PROFILE_EMAIL")),o.createElement("div",{style:{width:"40rem"}},o.createElement(t.TextInput,{t:b,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:R,onChange:e=>ve(e.target.value),disabled:!1}),(null==ae?void 0:ae.emailAddress)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(d=ae.emailAddress)||void 0===d?void 0:d.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement("button",{onClick:ge,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black"}},b("CORE_COMMON_SAVE"))):o.createElement(o.Fragment,null,o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,E({t:b,type:"text",isMandatory:!1,name:"name",value:T,onChange:e=>pe(e.target.value),placeholder:"Enter Your Name"},ue={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disabled:!1})),(null==ae?void 0:ae.userName)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(m=ae.userName)||void 0===m?void 0:m.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_GENDER")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.Dropdown,{className:"profileDropdown",selected:1===(null==P?void 0:P.length)?P[0]:P,disable:1===(null==P?void 0:P.length)||!1,option:Ee,select:de,value:P,optionKey:"code",t:b,name:"gender"}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CITY")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,E({t:b,type:"text",isMandatory:!1,name:"city",value:b(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+C)),onChange:e=>k(e.target.value),placeholder:"Enter Your City Name"},ue={isRequired:!0,type:"text",title:b("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disabled:!0})),o.createElement(t.ErrorMessage,null))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},b("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),o.createElement("div",{style:{width:"100%"}},o.createElement(t.MobileNumber,{value:U,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{B(e),"employee"!==_||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?se({...ae,mobileNumber:null}):se({...ae,mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}})})(e),disable:!Digit.Utils.getMultiRootTenant(),required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==ae?void 0:ae.mobileNumber)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(p=ae.mobileNumber)||void 0===p?void 0:p.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_EMAIL")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:b,type:"email",isMandatory:!1,placeholder:b("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:R,onChange:e=>ve(e.target.value),disabled:!!Digit.Utils.getMultiRootTenant()}),(null==ae?void 0:ae.emailAddress)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(v=ae.emailAddress)||void 0===v?void 0:v.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,null,o.createElement("div",{style:{width:"100%"}},0!=z||Digit.Utils.getOTPBasedLogin()?null:o.createElement(t.Button,{label:b("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>W(!z),style:{paddingLeft:"0rem"}}),z?o.createElement("div",{style:{marginTop:"10px"}},o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return q(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,currentPassword:null}):se({...ae,currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.currentPassword)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(f=ae.currentPassword)||void 0===f?void 0:f.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NEW_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return Z(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,newPassword:null}):se({...ae,newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.newPassword)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(g=ae.newPassword)||void 0===g?void 0:g.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return J(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,confirmPassword:null}):se({...ae,confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.confirmPassword)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(y=ae.confirmPassword)||void 0===y?void 0:y.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})))):"")),"employee"===_&&ce?o.createElement("button",{onClick:ge,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"}},b("CORE_COMMON_SAVE")):null))),"employee"!==_||ce?null:o.createElement(t.ActionBar,{actionFields:[o.createElement(t.SubmitBar,{t:b,label:b("CORE_COMMON_SAVE"),onSubmit:ge})],className:"",setactionFieldsToRight:!0}),K&&o.createElement(t.Toast,{type:K.key,label:b("success"===K.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":K.action),onClose:()=>ee(null),style:{maxWidth:"670px"}}),1==V?o.createElement(ne,{setProfilePic:function(e){try{function t(e){G(null==e?void 0:e.thumbs[0]),me()}return j(e),Promise.resolve(e?Promise.resolve(function(e,t){try{return Promise.resolve(Digit.UploadServices.Filefetch(e,t)).then(function(e){return e.data.fileStoreIds&&0!==e.data.fileStoreIds.length?{thumbs:e.data.fileStoreIds.map(e=>e.url.split(",")[3]),images:e.data.fileStoreIds.map(e=>Digit.Utils.getFileUrl(e.url))}:null})}catch(e){return Promise.reject(e)}}([e],N)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:me,userType:_,removeProfilePic:()=>{j(null),G(null)},showToast:fe}):"")},le=e=>{var r,i,a;let{module:c}=e;const u=Digit.UserService.getUser(),{t:d}=((null==u||null===(r=u.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation()),m=Digit.SessionStorage.get("initData").stateInfo,p=Digit.StoreData.getCurrentLanguage(),[v,f]=n.useState(p),[g,E]=n.useState(!1),[y,h]=n.useState(""),_=()=>o.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M12 24C5.38053 24 0 18.6143 0 12C0 5.38054 5.38053 1.90735e-06 12 1.90735e-06C18.6143 1.90735e-06 24 5.38054 24 12C24 18.6143 18.6143 24 12 24ZM16.3488 10.7852L11.3855 7.25251C11.1263 7.0701 10.8238 6.97889 10.5214 6.97889C10.291 6.97889 10.0557 7.03172 9.83976 7.14202C9.34054 7.40118 9.02857 7.91006 9.02857 8.46694L9.02877 15.5323C9.02877 16.0892 9.34076 16.5979 9.83996 16.8572C10.3344 17.1116 10.9296 17.0732 11.3857 16.7467L16.349 13.214C16.7426 12.9356 16.9778 12.4795 16.9778 11.9996C16.9776 11.5197 16.7426 11.0636 16.3489 10.7852L16.3488 10.7852Z",fill:"white"})),{isLoading:S,data:b}=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),O=null==b||null===(i=b.MdmsRes["common-masters"])||void 0===i||null===(a=i.howItWorks[0])||void 0===a?void 0:a[""+c];return S?o.createElement(t.Loader,null):o.createElement(n.Fragment,null,o.createElement("div",{className:"how-it-works-page"},o.createElement(t.BackButton,null),o.createElement("div",{className:"how-it-works-page-header"},o.createElement(t.Header,null,d(O.screenHeader?O.screenHeader:"HOW_IT_WORKS"))),o.createElement("div",{className:"language-selector",style:{margin:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map((e,t)=>o.createElement("div",{className:"language-button-container",key:t},o.createElement(s.CustomButton,{selected:e.value===v,text:e.label,onClick:()=>(e=>{f(e.value),Digit.LocalizationService.changeLanguage(e.value,m.code)})(e)})))),O.videosJson.map((e,t)=>o.createElement("div",null,o.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},o.createElement("div",{className:"video-icon",onClick:()=>{return t=e,h("hi_IN"===v?t.hi_IN:t.en_IN),void E(!0);var t}},o.createElement("div",{className:"vid-svg"},o.createElement(_,null))),o.createElement("div",{className:"how-it-works-header-description"},o.createElement("h2",null,d(e.headerLabel)),o.createElement("p",null,d(e.description)))))),O.pdfHeader&&O.pdfDesc&&o.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},o.createElement("div",{className:"how-it-works-pdf-section"},o.createElement("div",{className:"pdf-icon-header-desc"},o.createElement("div",{className:"pdf-icon"},o.createElement(t.PDFSvg,null)),o.createElement("div",{className:"pdf-header-desc"},o.createElement("h2",null,d(O.pdfHeader)),o.createElement("p",null,d(O.pdfDesc)))),o.createElement("div",{className:"download-icon"},o.createElement(t.DownloadImgIcon,null)))),g&&o.createElement("div",{className:"how-it-works-video-play"},o.createElement("div",{className:"close-button"},o.createElement(t.CloseSvg,{onClick:()=>{E(!1)}})),o.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},o.createElement("source",{src:y,type:"video/mp4"})))))},re=[{texts:{header:"CS_LOGIN_PROVIDE_MOBILE_NUMBER",cardText:"CS_LOGIN_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOB_NO",validation:{required:!0,minlength:10,maxlength:10}}]},{texts:{header:"CS_LOGIN_OTP",cardText:"CS_LOGIN_OTP_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"}},{texts:{header:"CS_LOGIN_PROVIDE_NAME",cardText:"CS_LOGIN_NAME_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_NAME",type:"text",name:"name",error:"CORE_COMMON_NAME_VALIDMSG",validation:{required:!0,minlength:1,maxlength:50,pattern:"^[A-Za-z]+( [A-Za-z]+)*$"}}]}],ie=e=>{let{t:n,onSelect:l,mobileNumber:r,onMobileChange:i,config:a,canSubmit:s}=e;return o.createElement(t.FormStep,{isDisabled:!(10===r.length&&s),onSelect:l,config:a,t:n,componentInFront:"+91",onChange:i,value:r})},ae=e=>{let{config:n,onSelect:l,t:r,isDisabled:i}=e;return o.createElement(t.FormStep,{config:n,onSelect:l,t:r,isDisabled:i})};function se(e,t){const o=n.useRef();n.useEffect(()=>{o.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){o.current()},t);return()=>clearInterval(e)}},[t])}const ce=e=>{let{config:l,otp:r,onOtpChange:i,onResend:a,onSelect:c,t:u,error:d,userType:m="citizen",canSubmit:p}=e;const[v,f]=n.useState(30);se(()=>{f(v-1)},v>0?1e3:null);const g=()=>{a(),f(2)};return"employee"===m?o.createElement(n.Fragment,null,o.createElement(s.OTPInput,{length:6,onChange:i,value:r}),v>0?o.createElement(t.CardText,null,`${u("CS_RESEND_ANOTHER_OTP")} ${v} ${u("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button resend-otp",onClick:g},u("CS_RESEND_OTP")),!d&&o.createElement(t.CardLabelError,null,u("CS_INVALID_OTP"))):o.createElement(t.FormStep,{onSelect:c,config:l,t:u,isDisabled:!(6===(null==r?void 0:r.length)&&p)},o.createElement(s.OTPInput,{length:6,onChange:i,value:r}),v>0?o.createElement(t.CardText,null,`${u("CS_RESEND_ANOTHER_OTP")} ${v} ${u("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button",onClick:g},u("CS_RESEND_OTP")),!d&&o.createElement(t.CardLabelError,null,u("CS_INVALID_OTP")))};var ue;const de={type:"register"},me={type:"login"},pe=`/${null===(ue=window)||void 0===ue?void 0:ue.contextPath}/citizen`,ve=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||pe,fe=e=>{var r,i;let{stateCode:s,isUserRegistered:c=!0}=e;const{t:u}=l.useTranslation(),d=a.useLocation(),{path:m}=a.useRouteMatch(),p=a.useHistory(),[v,f]=n.useState(null),[g,E]=n.useState(null),[y,h]=n.useState(!0),[_,S]=n.useState(null),[b,O]=n.useState(c?{}:null==d||null===(r=d.state)||void 0===r?void 0:r.data),[N,C]=n.useState(null),I=Digit.Hooks.useQueryParams(),[D,w]=n.useState(!1),[T,A]=n.useState(!0),[R,L]=n.useState(!0);n.useEffect(()=>{let e;return g&&(N&&(clearTimeout(N),C(null)),e=setTimeout(()=>{E("")},5e3),C(e)),()=>{e&&clearTimeout(e)}},[g]),n.useEffect(()=>{var e;if(!v)return;Digit.SessionStorage.set("citizen.userRequestObject",v),Digit.UserService.setUser(v),((e,t,n)=>{var o,l;if(Digit.Utils.getMultiRootTenant())return;let r=null===(o=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===o||null===(l=o.value)||void 0===l?void 0:l.selectedLanguage;localStorage.setItem("Citizen.tenant-id",n),localStorage.setItem("tenant-id",n),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",r),localStorage.setItem("Citizen.locale",r),localStorage.setItem("token",t),localStorage.setItem("Citizen.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Citizen.user-info",JSON.stringify(e))})(null==v?void 0:v.info,null==v?void 0:v.access_token,s);const t=(null===(e=d.state)||void 0===e?void 0:e.from)||pe;var n;Digit.ULBService.getCitizenCurrentTenant(!0)?p.replace(t):p.replace(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen/select-location`,{redirectBackTo:t})},[v]);const P=n.useMemo(()=>re.map(e=>{const t={};for(const n in e.texts)t[n]=u(e.texts[n]);return{...e,texts:t}},[re])),x=()=>Digit.UserService.getType(),M=function(e){return Promise.resolve(te(function(){return Promise.resolve(Digit.UserService.sendOtp(e,s)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return o.createElement("div",{className:"citizen-form-wrapper"},o.createElement(a.Switch,null,o.createElement(t.AppContainer,null,d.pathname.includes("login")?null:o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement(a.Route,{path:""+m,exact:!0},o.createElement(ie,{onSelect:function(e){try{L(!1),O({...b,...e});const t={...e,tenantId:s,userType:x()};return Promise.resolve(c?Promise.resolve(M({otp:{...t,...me}})).then(function(e){var n;let[o,l]=e;var r,i,a;if(!l)return L(!0),void p.replace(m+"/otp",{from:ve(d.state,I),role:null===(r=d.state)||void 0===r?void 0:r.role});L(!0),d.state&&"FSM_DSO"===d.state.role||p.push(`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen/register/name`,{from:ve(d.state,I),data:t}),null!==(n=d.state)&&void 0!==n&&n.role&&(L(!0),E("FSM_DSO"===(null===(a=d.state)||void 0===a?void 0:a.role)?u("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(M({otp:{...t,...de}})).then(function(e){let[t,n]=e;if(!n)return L(!0),void p.replace(m+"/otp",{from:ve(d.state,I)});L(!0)}))}catch(e){return Promise.reject(e)}},config:P[0],mobileNumber:b.mobileNumber||"",onMobileChange:e=>{const{value:t}=e.target;O({...b,mobileNumber:t})},canSubmit:R,showRegisterLink:c&&!(null!==(i=d.state)&&void 0!==i&&i.role),t:u})),o.createElement(a.Route,{path:m+"/otp"},o.createElement(ce,{config:{...P[1],texts:{...P[1].texts,cardText:`${P[1].texts.cardText} ${b.mobileNumber||""}`}},onOtpChange:e=>{O({...b,otp:e})},onResend:function(){try{const{mobileNumber:e}=b,t={mobileNumber:e,tenantId:s,userType:x()},n=function(){if(!c)return Promise.resolve(M({otp:{...t,...de}})).then(function(){});{const e=function(){if(c)return Promise.resolve(M({otp:{...t,...me}})).then(function(){})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(te(function(){h(!0),A(!1);const{mobileNumber:e,otp:t,name:n}=b;return function(){if(c){const n={username:e,password:t,tenantId:s,userType:x()};return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t,n,o;let{UserRequest:l,...r}=e;if(null!==(t=d.state)&&void 0!==t&&t.role){const e=l.roles.find(e=>e.code===d.state.role);if(!e||!e.code)return E(u("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>p.replace(pe),5e3)}null!==(n=window)&&void 0!==n&&null!==(o=n.globalConfigs)&&void 0!==o&&o.getConfig("ENABLE_SINGLEINSTANCE")&&(l.tenantId=Digit.ULBService.getStateId()),f({info:l,...r})})}{const o=function(){if(!c)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:s},s)).then(function(e){var t,n;let{UserRequest:o,...l}=e;null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(o.tenantId=Digit.ULBService.getStateId()),f({info:o,...l})})}();if(o&&o.then)return o.then(function(){})}}()},function(){A(!0),h(!1)}))}catch(e){return Promise.reject(e)}},otp:b.otp,error:y,canSubmit:T,t:u})),o.createElement(a.Route,{path:m+"/name"},o.createElement(ae,{config:P[2],onSelect:function(e){try{const t={...b,tenantId:s,userType:x(),...e};return O({...b,...e}),w(!0),Promise.resolve(M({otp:{...t,...de}})).then(function(e){let[t,n]=e;t?(w(!1),p.replace(m+"/otp",{from:ve(d.state,I)})):w(!1)})}catch(e){return Promise.reject(e)}},t:u,isDisabled:D})),g&&o.createElement(t.Toast,{type:"error",label:g,onClose:()=>E(null)}))))};var ge=e=>e instanceof HTMLElement;const Ee={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};var ye=e=>null==e;const he=e=>"object"==typeof e;var _e=e=>!ye(e)&&!Array.isArray(e)&&he(e)&&!(e instanceof Date),Se=e=>/^\w*$/.test(e),be=e=>e.filter(Boolean),Oe=e=>be(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function Ne(e,t,n){let o=-1;const l=Se(t)?[t]:Oe(t),r=l.length,i=r-1;for(;++o<r;){const t=l[o];let r=n;if(o!==i){const n=e[t];r=_e(n)||Array.isArray(n)?n:isNaN(+l[o+1])?{}:[]}e[t]=r,e=e[t]}return e}var Ce=function(e,t){void 0===t&&(t={});for(const n in e)Se(n)?t[n]=e[n]:Ne(t,n,e[n]);return t},Ie=e=>void 0===e,De=function(e,t,n){void 0===e&&(e={});const o=be(t.split(/[,[\].]+?/)).reduce((e,t)=>ye(e)?e:e[t],e);return Ie(o)||o===e?Ie(e[t])?n:e[t]:o},we=(e,t)=>{ge(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))};const Te={isValid:!1,value:null};var Ae=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e,Te):Te,Re=e=>"radio"===e.type,Le=e=>"file"===e.type,Pe=e=>"checkbox"===e.type,xe=e=>"select-multiple"===e.type;const Me={value:!1,isValid:!1},ke={value:!0,isValid:!0};var Ue=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.ref.checked).map(e=>{let{ref:{value:t}}=e;return t});return{value:t,isValid:!!t.length}}const{checked:t,value:n,attributes:o}=e[0].ref;return t?o&&!Ie(o.value)?Ie(n)||""===n?ke:{value:n,isValid:!0}:ke:Me}return Me};function Be(e,t,n,o,l){const r=e.current[t];if(r){const{ref:{value:e,disabled:t},ref:n,valueAsNumber:a,valueAsDate:s,setValueAs:c}=r;if(t&&o)return;return Le(n)?n.files:Re(n)?Ae(r.options).value:xe(n)?(i=n.options,[...i].filter(e=>{let{selected:t}=e;return t}).map(e=>{let{value:t}=e;return t})):Pe(n)?Ue(r.options).value:l?e:a?""===e?NaN:+e:s?n.valueAsDate:c?c(e):e}var i;if(n)return De(n.current,t)}function Fe(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&Fe(e.parentNode)}var je=e=>_e(e)&&!Object.keys(e).length,He=e=>"boolean"==typeof e;function Ge(e,t){const n=Se(t)?[t]:Oe(t),o=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let o=0;for(;o<n;)e=Ie(e)?o++:e[t[o++]];return e}(e,n);let l;o&&delete o[n[n.length-1]];for(let t=0;t<n.slice(0,-1).length;t++){let o,r=-1;const i=n.slice(0,-(t+1)),a=i.length-1;for(t>0&&(l=e);++r<i.length;){const t=i[r];o=o?o[t]:e[t],a===r&&(_e(o)&&je(o)||Array.isArray(o)&&!o.filter(e=>_e(e)&&!je(e)||He(e)).length)&&(l?delete l[t]:delete e[t]),l=o}}return e}const Ve=(e,t)=>e&&e.ref===t;var $e=e=>ye(e)||!he(e);function ze(e,t){if($e(e)||$e(t))return t;for(const n in t){const o=e[n],l=t[n];try{e[n]=_e(o)&&_e(l)||Array.isArray(o)&&Array.isArray(l)?ze(o,l):l}catch(e){}}return e}function We(e,t,o){if($e(e)||$e(t)||e instanceof Date||t instanceof Date)return e===t;if(!n.isValidElement(e)){const n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(const l of n){const n=e[l];if(!o||"ref"!==l){const e=t[l];if((_e(n)||Array.isArray(n))&&(_e(e)||Array.isArray(e))?!We(n,e,o):n!==e)return!1}}}return!0}function Xe(e,t,n,o,l){let r=-1;for(;++r<e.length;){for(const o in e[r])Array.isArray(e[r][o])?(!n[r]&&(n[r]={}),n[r][o]=[],Xe(e[r][o],De(t[r]||{},o,[]),n[r][o],n[r],o)):We(De(t[r]||{},o),e[r][o])?Ne(n[r]||{},o):n[r]=Object.assign(Object.assign({},n[r]),{[o]:!0});o&&!n.length&&delete o[l]}return n}var qe=e=>"string"==typeof e,Qe=(e,t,n,o,l)=>{const r={};for(const t in e.current)(Ie(l)||(qe(l)?t.startsWith(l):Array.isArray(l)&&l.find(e=>t.startsWith(e))))&&(r[t]=Be(e,t,void 0,o));return n?Ce(r):ze(t,Ce(r))},Ze=e=>e instanceof RegExp,Ye=e=>_e(e)&&!Ze(e)?e:{value:e,message:""},Je=e=>"function"==typeof e,Ke=e=>qe(e)||n.isValidElement(e);function et(e,t,n){if(void 0===n&&(n="validate"),Ke(e)||He(e)&&!e)return{type:n,message:Ke(e)?e:"",ref:t}}var tt=(e,t,n,o,l)=>t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),{[o]:l||!0})}):{},nt=function(e,t,n,o){let{ref:l,ref:{value:r},options:i,required:a,maxLength:s,minLength:c,min:u,max:d,pattern:m,validate:p}=n;try{let n=!1;const v=l.name,f={},g=Re(l),E=Pe(l),y=g||E,h=""===r,_=tt.bind(null,v,t,f),S=function(e,t,n,o,r){void 0===o&&(o="maxLength"),void 0===r&&(r="minLength");const i=e?t:n;f[v]=Object.assign({type:e?o:r,message:i,ref:l},_(e?o:r,i))};if(a&&(!g&&!E&&(h||ye(r))||He(r)&&!r||E&&!Ue(i).isValid||g&&!Ae(i).isValid)){const{value:n,message:o}=Ke(a)?{value:!!a,message:a}:Ye(a);if(n&&(f[v]=Object.assign({type:"required",message:o,ref:y?((e.current[v].options||[])[0]||{}).ref:l},_("required",o)),!t))return Promise.resolve(f)}if(!(ye(u)&&ye(d)||""===r)){let e,n;const o=Ye(d),i=Ye(u);if(isNaN(r)){const t=l.valueAsDate||new Date(r);qe(o.value)&&(e=t>new Date(o.value)),qe(i.value)&&(n=t<new Date(i.value))}else{const t=l.valueAsNumber||parseFloat(r);ye(o.value)||(e=t>o.value),ye(i.value)||(n=t<i.value)}if((e||n)&&(S(!!e,o.message,i.message,"max","min"),!t))return Promise.resolve(f)}if(qe(r)&&!h&&(s||c)){const e=Ye(s),n=Ye(c),o=!ye(e.value)&&r.length>e.value,l=!ye(n.value)&&r.length<n.value;if((o||l)&&(S(o,e.message,n.message),!t))return Promise.resolve(f)}if(qe(r)&&m&&!h){const{value:e,message:n}=Ye(m);if(Ze(e)&&!e.test(r)&&(f[v]=Object.assign({type:"pattern",message:n,ref:l},_("pattern",n)),!t))return Promise.resolve(f)}const b=function(){if(p){const r=Be(e,v,o,!1,!0),a=y&&i?i[0].ref:l;return Je(p)?Promise.resolve(p(r)).then(function(e){const o=et(e,a);if(o&&(f[v]=Object.assign(Object.assign({},o),_("validate",o.message)),!t))return n=!0,f}):function(){if(_e(p)){let o=!1;function e(){if(!je(l)&&(f[v]=Object.assign({ref:a},l),!t))return n=!0,f}let l={};const i=ee(Object.entries(p),function(e){let[n,i]=e;if(je(l)||t)return Promise.resolve(i(r)).then(function(e){const o=et(e,a,n);o&&(l=Object.assign(Object.assign({},o),_(n,o.message)),t&&(f[v]=l))});o=!0},function(){return o});return i&&i.then?i.then(e):e()}}()}}();return Promise.resolve(b&&b.then?b.then(function(e){return n?e:f}):n?b:f)}catch(e){return Promise.reject(e)}};const ot=function(e,t,n){void 0===n&&(n=[]);for(const o in t){const l=e+(_e(t)?"."+o:`[${o}]`);$e(t[o])?n.push(l):ot(l,t[o],n)}return n};var lt=(e,t,n,o,l)=>{let r=void 0;return n.add(t),je(e)||(r=De(e,t),(_e(r)||Array.isArray(r))&&ot(t,r).forEach(e=>n.add(e))),Ie(r)?l?o:De(o,t):r},rt=e=>{let{isOnBlur:t,isOnChange:n,isOnTouch:o,isTouched:l,isReValidateOnBlur:r,isReValidateOnChange:i,isBlurEvent:a,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&o?!(l||a):(s?r:t)?!a:!(s?i:n)||a)},it=e=>e.substring(0,e.indexOf("[")),at=(e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)),st="undefined"!=typeof window&&"undefined"!=typeof document;function ct(e){var t;let n;if($e(e)||st&&(e instanceof File||ge(e)))return e;if(!["Set","Map","Object","Date","Array"].includes(null===(t=e.constructor)||void 0===t?void 0:t.name))return e;if(e instanceof Date)return n=new Date(e.getTime()),n;if(e instanceof Set){n=new Set;for(const t of e)n.add(t);return n}if(e instanceof Map){n=new Map;for(const t of e.keys())n.set(t,ct(e.get(t)));return n}n=Array.isArray(e)?[]:{};for(const t in e)n[t]=ct(e[t]);return n}var ut=e=>({isOnSubmit:!e||e===Ee.onSubmit,isOnBlur:e===Ee.onBlur,isOnChange:e===Ee.onChange,isOnAll:e===Ee.all,isOnTouch:e===Ee.onTouched}),dt=e=>Re(e)||Pe(e);const mt="undefined"==typeof window,pt=st?"Proxy"in window:"undefined"!=typeof Proxy,vt=n.createContext(null);vt.displayName="RHFContext";const ft=e=>{const{as:t,render:o}=e,l=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:r,meta:i}=function(e){let{name:t,rules:o,defaultValue:l,control:r,onFocus:i}=e;const a=n.useContext(vt);if("production"!==process.env.NODE_ENV&&!r&&!a)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:s,setValue:c,register:u,unregister:d,trigger:m,mode:p,reValidateMode:{isReValidateOnBlur:v,isReValidateOnChange:f},formState:g,formStateRef:{current:{isSubmitted:E,touched:y,errors:h}},updateFormState:_,readFormStateRef:S,fieldsRef:b,fieldArrayNamesRef:O,shallowFieldsStateRef:N}=r||a.control,C=!at(O.current,t),I=()=>!Ie(De(N.current,t))&&C?De(N.current,t):Ie(l)?De(s.current,t):l,[D,w]=n.useState(I()),T=n.useRef(D),A=n.useRef({focus:()=>null}),R=n.useRef(i||(()=>{Je(A.current.focus)&&A.current.focus(),"production"!==process.env.NODE_ENV&&(Je(A.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"))})),L=n.useCallback(e=>!rt(Object.assign({isBlurEvent:e,isReValidateOnBlur:v,isReValidateOnChange:f,isSubmitted:E,isTouched:!!De(y,t)},p)),[v,f,E,y,t,p]),P=n.useCallback(e=>{let[t]=e;const n=(e=>$e(e)||!_e(e.target)||_e(e.target)&&!e.type?e:Ie(e.target.value)?e.target.checked:e.target.value)(t);return w(n),T.current=n,n},[]),x=n.useCallback(e=>{if("production"!==process.env.NODE_ENV&&!t)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");b.current[t]?b.current[t]=Object.assign({ref:b.current[t].ref},o):(u(Object.defineProperties({name:t,focus:R.current},{value:{set(e){w(e),T.current=e},get:()=>T.current}}),o),e=Ie(De(s.current,t))),e&&C&&w(I())},[o,t,u]);n.useEffect(()=>()=>d(t),[t]),n.useEffect(()=>{"production"!==process.env.NODE_ENV&&(Ie(D)&&console.warn(`📋 ${t} 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)`),!C&&Ie(l)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),x()},[x]),n.useEffect(()=>{!b.current[t]&&x(!0)});const M=n.useCallback(()=>{S.current.touched&&!De(y,t)&&(Ne(y,t,!0),_({touched:y})),L(!0)&&m(t)},[t,_,L,m,S]);return{field:{onChange:n.useCallback(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return c(t,P(n),{shouldValidate:L(),shouldDirty:!0})},[c,t,L]),onBlur:M,name:t,value:D,ref:A},meta:Object.defineProperties({invalid:!!De(h,t)},{isDirty:{get:()=>!!De(g.dirtyFields,t)},isTouched:{get:()=>!!De(g.touched,t)}})}}(e),a=Object.assign(Object.assign({},l),r);return t?n.isValidElement(t)?n.cloneElement(t,a):n.createElement(t,a):o?o(r,i):null},gt=e=>{let{control:n,t:l}=e;const r=window.Digit.Utils.browser.isMobile();return o.createElement(Fragment,null,o.createElement(t.SearchField,{className:"pt-form-field"},o.createElement("label",null,l("AUDIT_FROM_DATE_LABEL")),o.createElement(ft,{render:e=>o.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:n})),o.createElement(t.SearchField,{className:"pt-form-field"},o.createElement("label",null,l("AUDIT_TO_DATE_LABEL")),o.createElement(ft,{render:e=>o.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:n})),o.createElement(t.SearchField,{className:"pt-search-action-submit"},o.createElement(t.Button,{style:{marginTop:r?"510px":"25px",marginLeft:r?"0":"-30px",maxWidth:r?"100%":"240px"},label:l("ES_COMMON_APPLY"),submit:!0})))},Et=e=>{var l;let{Controller:r,register:i,control:a,t:s,reset:c,previousPage:u,handleSubmit:d,tenantId:m,data:p,onSubmit:v,isLoading:f}=e;const[g,y]=n.useState([]),h=e=>o.createElement("div",{onClick:e.onClick},o.createElement(t.DownloadBtnCommon,null));n.useEffect(()=>{(null==p?void 0:p.length)>0&&y([null==p?void 0:p.map(e=>{let t={};return t[s("AUDIT_DATE_LABEL")]=_(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=S(null==e?void 0:e.timestamp),t[s("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[s("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[s("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[p]);const _=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,o=t.getDate();return n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${o}/${n}/${t.getFullYear()}`},S=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),o=t.getMinutes(),l=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${n}:${o} ${l}`},[b,O]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),N=()=>{O({type:"remove"})},C=()=>o.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:N},o.createElement(t.CloseSvg,null)),I={Controller:r,register:i,control:a,t:s,reset:c,previousPage:u},D=n.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:r,...i}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:r,...i}=e;const{closeMobilePopupModal:a}=i;switch(n){case"SearchFormComponent":return o.createElement(t.SearchForm,i,o.createElement(C,null),o.createElement("div",{className:"MobilePopupHeadingWrapper"},o.createElement("h2",null,s("PRIVACY_AUDIT_REPORT"),":")),o.createElement(gt,E({},l,{closeMobilePopupModal:a,tenantId:r,t:s})));default:return o.createElement("span",null)}})({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:r,...i})},[b]);null==p||null===(l=p.roles)||void 0===l||l.forEach(e=>{});const w=n.useMemo(()=>null!=p&&p.display||""===p?[]:null==p?void 0:p.map(e=>{var t;return{[s("AUDIT_DATE_LABEL")]:_(e.timestamp),[s("AUDIT_TIME_LABEL")]:S(e.timestamp),[s("AUDIT_DATAVIEWED_LABEL")]:e.dataView[0]+","+e.dataView[1],[s("AUDIT_DATAVIEWED_BY_LABEL")]:e.dataViewedBy,[s("AUDIT_ROLE_LABEL")]:null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name).join(",")}}),[p]);return o.createElement(o.Fragment,null,o.createElement(t.BackButton,null),o.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},o.createElement(h,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(g)})),o.createElement(t.Header,null,s("PRIVACY_AUDIT_REPORT"),":"),o.createElement("div",{className:"digit-search-box"},o.createElement(t.SearchAction,{text:s("ES_COMMON_SEARCH"),handleActionClick:()=>O({type:"set",payload:"SearchFormComponent"}),tenantId:m,t:s})),b?o.createElement(t.PopUp,null,o.createElement(D,{onSubmit:e=>{O({type:"remove"}),v(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:I,currentlyActiveMobileModal:b,closeMobilePopupModal:N,tenantId:m})):null,f&&o.createElement(t.Loader,null),o.createElement(t.DetailsCard,{data:w}))},yt=e=>{let{tenantId:l,t:r,onSubmit:i,data:a,count:c}=e;const u=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"},{register:d,control:m,handleSubmit:p,setValue:v,getValues:f,reset:g}=function(e){let{mode:t=Ee.onSubmit,reValidateMode:o=Ee.onChange,resolver:l,context:r,defaultValues:i={},shouldFocusError:a=!0,shouldUnregister:s=!0,criteriaMode:c}=void 0===e?{}:e;const u=n.useRef({}),d=n.useRef({}),m=n.useRef({}),p=n.useRef(new Set),v=n.useRef({}),f=n.useRef({}),g=n.useRef({}),E=n.useRef({}),y=n.useRef(i),h=n.useRef(!1),_=n.useRef(!1),S=n.useRef(),b=n.useRef({}),O=n.useRef({}),N=n.useRef(r),C=n.useRef(l),I=n.useRef(new Set),D=n.useRef(ut(t)),{isOnSubmit:w,isOnTouch:T}=D.current,A=c===Ee.all,[R,L]=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!w,errors:{}}),P=n.useRef({isDirty:!pt,dirtyFields:!pt,touched:!pt||T,isValidating:!pt,isSubmitting:!pt,isValid:!pt}),x=n.useRef(R),M=n.useRef(),{isOnBlur:k,isOnChange:U}=n.useRef(ut(o)).current;N.current=r,C.current=l,x.current=R,b.current=s?{}:je(b.current)?ct(i):b.current;const B=n.useCallback(function(e){void 0===e&&(e={}),h.current||(x.current=Object.assign(Object.assign({},x.current),e),L(x.current))},[]),F=()=>P.current.isValidating&&B({isValidating:!0}),j=n.useCallback(function(e,t,n,o,l){void 0===n&&(n=!1),void 0===o&&(o={});let r=n||(e=>{let{errors:t,name:n,error:o,validFields:l,fieldsWithValidation:r}=e;const i=Ie(o),a=De(t,n);return i&&!!a||!i&&!We(a,o,!0)||i&&De(r,n)&&!De(l,n)})({errors:x.current.errors,error:t,name:e,validFields:E.current,fieldsWithValidation:g.current});const i=De(x.current.errors,e);t?(Ge(E.current,e),r=r||!i||!We(i,t,!0),Ne(x.current.errors,e,t)):((De(g.current,e)||C.current)&&(Ne(E.current,e,!0),r=r||i),Ge(x.current.errors,e)),(r&&!ye(n)||!je(o)||P.current.isValidating)&&B(Object.assign(Object.assign(Object.assign({},o),C.current?{isValid:!!l}:{}),{isValidating:!1}))},[]),H=n.useCallback((e,t)=>{const{ref:n,options:o}=u.current[e],l=st&&ge(n)&&ye(t)?"":t;Re(n)?(o||[]).forEach(e=>{let{ref:t}=e;return t.checked=t.value===l}):Le(n)&&!qe(l)?n.files=l:xe(n)?[...n.options].forEach(e=>e.selected=l.includes(e.value)):Pe(n)&&o?o.length>1?o.forEach(e=>{let{ref:t}=e;return t.checked=Array.isArray(l)?!!l.find(e=>e===t.value):l===t.value}):o[0].ref.checked=!!l:n.value=l},[]),G=n.useCallback((e,t)=>{if(P.current.isDirty){const n=J();return e&&t&&Ne(n,e,t),!We(n,y.current)}return!1},[]),V=n.useCallback(function(e,t){if(void 0===t&&(t=!0),P.current.isDirty||P.current.dirtyFields){const n=!We(De(y.current,e),Be(u,e,b)),o=De(x.current.dirtyFields,e),l=x.current.isDirty;n?Ne(x.current.dirtyFields,e,!0):Ge(x.current.dirtyFields,e);const r={isDirty:G(),dirtyFields:x.current.dirtyFields},i=P.current.isDirty&&l!==r.isDirty||P.current.dirtyFields&&o!==De(x.current.dirtyFields,e);return i&&t&&B(r),i?r:{}}return{}},[]),$=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||u.current[e]?Promise.resolve(nt(u,A,u.current[e],b)).then(function(n){const o=n[e];return j(e,o,t),Ie(o)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[j,A]),z=n.useCallback(function(e){try{return Promise.resolve(C.current(J(),N.current,A)).then(function(t){let{errors:n}=t;const o=x.current.isValid;if(Array.isArray(e)){const t=e.map(e=>{const t=De(n,e);return t?Ne(x.current.errors,e,t):Ge(x.current.errors,e),!t}).every(Boolean);return B({isValid:je(n),isValidating:!1}),t}{const t=De(n,e);return j(e,t,o!==je(n),{},je(n)),!t}})}catch(e){return Promise.reject(e)}},[j,A]),W=n.useCallback(function(e){try{let n=!1;function t(e){return n?e:Promise.resolve($(o))}const o=e||Object.keys(u.current);if(F(),C.current)return Promise.resolve(z(o));const l=function(){if(Array.isArray(o))return!e&&(x.current.errors={}),Promise.resolve(Promise.all(o.map(function(e){try{return Promise.resolve($(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){B({isValidating:!1});const t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(l&&l.then?l.then(t):t(l))}catch(e){return Promise.reject(e)}},[z,$]),X=n.useCallback((e,t,n)=>{let{shouldDirty:o,shouldValidate:l}=n;const r={};Ne(r,e,t);for(const n of ot(e,t))u.current[n]&&(H(n,De(r,n)),o&&V(n),l&&W(n))},[W,H,V]),q=n.useCallback((e,t,n)=>{if(!s&&!$e(t)&&Ne(b.current,e,Array.isArray(t)?[...t]:Object.assign({},t)),u.current[e])H(e,t),n.shouldDirty&&V(e),n.shouldValidate&&W(e);else if(!$e(t)&&(X(e,t,n),I.current.has(e))){const o=it(e)||e;Ne(d.current,e,t),O.current[o]({[o]:De(d.current,o)}),(P.current.isDirty||P.current.dirtyFields)&&n.shouldDirty&&(Ne(x.current.dirtyFields,e,((e,t,n)=>ze(Xe(e,t,n.slice(0,e.length)),Xe(t,e,n.slice(0,e.length))))(t,De(y.current,e,[]),De(x.current.dirtyFields,e,[]))),B({isDirty:!We(Object.assign(Object.assign({},J()),{[e]:t}),y.current)}))}!s&&Ne(b.current,e,t)},[V,H,X]),Q=e=>_.current||p.current.has(e)||p.current.has((e.match(/\w+/)||[])[0]),Z=e=>{let t=!0;if(!je(v.current))for(const n in v.current)e&&v.current[n].size&&!v.current[n].has(e)&&!v.current[n].has(it(e))||(f.current[n](),t=!1);return t};function Y(e){if(!s){let t=ct(e);for(const e of I.current)Se(e)&&!t[e]&&(t=Object.assign(Object.assign({},t),{[e]:[]}));return t}return e}function J(e){if(qe(e))return Be(u,e,b);if(Array.isArray(e)){const t={};for(const n of e)Ne(t,n,Be(u,n,b));return t}return Y(Qe(u,ct(b.current),s))}S.current=S.current?S.current:function(e){let{type:t,target:n}=e;try{let e=n.name;const o=u.current[e];let l,r;return Promise.resolve(function(){if(o){function i(){!a&&Z(e),j(e,l,m,d,r)}const a="blur"===t,c=rt(Object.assign({isBlurEvent:a,isReValidateOnChange:U,isReValidateOnBlur:k,isTouched:!!De(x.current.touched,e),isSubmitted:x.current.isSubmitted},D.current));let d=V(e,!1),m=!je(d)||!a&&Q(e);if(a&&!De(x.current.touched,e)&&P.current.touched&&(Ne(x.current.touched,e,!0),d=Object.assign(Object.assign({},d),{touched:x.current.touched})),!s&&Pe(n)&&Ne(b.current,e,Be(u,e)),c)return!a&&Z(e),(!je(d)||m&&je(d))&&B(d);F();const p=C.current?Promise.resolve(C.current(J(),N.current,A)).then(function(t){let{errors:o}=t;const i=x.current.isValid;if(l=De(o,e),Pe(n)&&!l&&C.current){const t=it(e),n=De(o,t,{});n.type&&n.message&&(l=n),t&&(n||De(x.current.errors,t))&&(e=t)}r=je(o),i!==r&&(m=!0)}):Promise.resolve(nt(u,A,o,b)).then(function(t){l=t[e]});return p&&p.then?p.then(i):i()}}())}catch(e){return Promise.reject(e)}};const K=n.useCallback(function(e){void 0===e&&(e={});try{const t=je(u.current)?y.current:{};return Promise.resolve(C.current(Object.assign(Object.assign(Object.assign({},t),J()),e),N.current,A)).then(function(e){let{errors:t}=e;const n=je(t);x.current.isValid!==n&&B({isValid:n})})}catch(e){return Promise.reject(e)}},[A]),te=n.useCallback((e,t)=>{!function(e,t,n,o,l,r){const{ref:i,ref:{name:a}}=n,s=e.current[a];if(!l){const t=Be(e,a,o);!Ie(t)&&Ne(o.current,a,t)}i.type&&s?Re(i)||Pe(i)?Array.isArray(s.options)&&s.options.length?(be(s.options).forEach(function(e,n){void 0===e&&(e={}),(Fe(e.ref)&&Ve(e,e.ref)||r)&&(we(e.ref,t),Ge(s.options,`[${n}]`))}),s.options&&!be(s.options).length&&delete e.current[a]):delete e.current[a]:(Fe(i)&&Ve(s,i)||r)&&(we(i,t),delete e.current[a]):delete e.current[a]}(u,S.current,e,b,s,t),s&&(Ge(E.current,e.ref.name),Ge(g.current,e.ref.name))},[s]),ne=n.useCallback(e=>{if(_.current)B();else{for(const t of p.current)if(t.startsWith(e)){B();break}Z(e)}},[]),oe=n.useCallback((e,t)=>{e&&(te(e,t),s&&!be(e.options||[]).length&&(Ge(x.current.errors,e.ref.name),Ne(x.current.dirtyFields,e.ref.name,!0),B({isDirty:G()}),P.current.isValid&&C.current&&K(),ne(e.ref.name)))},[K,te]),le=n.useCallback((e,t,n)=>{const o=n?v.current[n]:p.current;let l=Qe(u,ct(b.current),s,!1,e);if(qe(e)){const n=it(e)||e;return I.current.has(n)&&(l=Object.assign(Object.assign({},m.current),l)),lt(l,e,o,Ie(De(y.current,e))?t:De(y.current,e),!0)}const r=Ie(t)?y.current:t;return Array.isArray(e)?e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:lt(l,t,o,r)}),{}):(_.current=Ie(n),Ce(!je(l)&&l||r))},[]);function re(e,t){if(void 0===t&&(t={}),"production"!==process.env.NODE_ENV){if(!e.name)return console.warn("📋 Field is missing `name` attribute",e,"https://react-hook-form.com/api#useForm");if(I.current.has(e.name.split(/\[\d+\]$/)[0])&&!RegExp(`^${e.name.split(/\[\d+\]$/)[0]}[\\d+].\\w+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e.name))return console.warn('📋 `name` prop should be in object shape: name="test[index].name"',e,"https://react-hook-form.com/api#useFieldArray")}const{name:n,type:o,value:l}=e,r=Object.assign({ref:e},t),i=u.current,a=dt(e),c=at(I.current,n),d=t=>st&&(!ge(e)||t===e);let m,p=i[n],v=!0;if(p&&(a?Array.isArray(p.options)&&be(p.options).find(e=>l===e.ref.value&&d(e.ref)):d(p.ref)))return void(i[n]=Object.assign(Object.assign({},p),t));p=o?a?Object.assign({options:[...be(p&&p.options||[]),{ref:e}],ref:{type:o,name:n}},t):Object.assign({},r):r,i[n]=p;const f=Ie(De(b.current,n));je(y.current)&&f||(m=De(f?y.current:b.current,n),v=Ie(m),v||c||H(n,m)),je(t)||(Ne(g.current,n,!0),!w&&P.current.isValid&&nt(u,A,p,b).then(e=>{const t=x.current.isValid;je(e)?Ne(E.current,n,!0):Ge(E.current,n),t!==je(e)&&B()})),!s||c&&v||!c&&Ge(x.current.dirtyFields,n),o&&function(e,t,n){let{ref:o}=e;ge(o)&&n&&(o.addEventListener(t?"change":"input",n),o.addEventListener("blur",n))}(a&&p.options?p.options[p.options.length-1]:p,a||"select-one"===e.type,S.current)}const ie=n.useCallback((e,t)=>function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());let o={},l=Y(Qe(u,ct(b.current),s,!0));return P.current.isSubmitting&&B({isSubmitting:!0}),Promise.resolve(function(r,i){try{var s=function(){function r(){const r=function(){if(je(o)&&Object.keys(x.current.errors).every(e=>e in u.current))return B({errors:{},isSubmitting:!0}),Promise.resolve(e(l,n)).then(function(){});{function r(e){a&&((e,t)=>{for(const n in e)if(De(t,n)){const t=e[n];if(t){if(t.ref.focus&&Ie(t.ref.focus()))break;if(t.options){t.options[0].ref.focus();break}}}})(u.current,x.current.errors)}return x.current.errors=Object.assign(Object.assign({},x.current.errors),o),t?Promise.resolve(t(x.current.errors,n)).then(r):r()}}();if(r&&r.then)return r.then(function(){})}const i=C.current?Promise.resolve(C.current(l,N.current,A)).then(function(e){let{errors:t,values:n}=e;x.current.errors=o=t,l=n}):ee(Object.values(u.current),function(e){const t=function(){if(e){const{name:t}=e.ref;return Promise.resolve(nt(u,A,e,b)).then(function(e){e[t]?(Ne(o,t,e[t]),Ge(E.current,t)):De(g.current,t)&&(Ge(x.current.errors,t),Ne(E.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return i&&i.then?i.then(r):r()}()}catch(e){return i(!0,e)}return s&&s.then?s.then(i.bind(null,!1),i.bind(null,!0)):i(!1,s)}(0,function(e,t){if(x.current.isSubmitting=!1,B({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:je(x.current.errors),submitCount:x.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}},[a,A]);n.useEffect(()=>{l&&P.current.isValid&&K(),M.current=M.current||!st?M.current:function(e,t){const n=new MutationObserver(()=>{for(const n of Object.values(e.current))if(n&&n.options)for(const e of n.options)e&&e.ref&&Fe(e.ref)&&t(n);else n&&Fe(n.ref)&&t(n)});return n.observe(window.document,{childList:!0,subtree:!0}),n}(u,oe)},[oe,y.current]),n.useEffect(()=>()=>{M.current&&M.current.disconnect(),h.current=!0,"production"===process.env.NODE_ENV&&Object.values(u.current).forEach(e=>oe(e,!0))},[]),!l&&P.current.isValid&&(R.isValid=We(E.current,g.current)&&je(x.current.errors));const ae={trigger:W,setValue:n.useCallback(function(e,t,n){q(e,t,n||{}),Q(e)&&B(),Z(e)},[q,W]),getValues:n.useCallback(J,[]),register:n.useCallback(function(e,t){if(!mt)if(qe(e))re({name:e},t);else{if(!_e(e)||!("name"in e))return t=>t&&re(t,e);re(e,t)}},[y.current]),unregister:n.useCallback(function(e){for(const t of Array.isArray(e)?e:[e])oe(u.current[t],!0)},[]),formState:pt?new Proxy(R,{get:(e,t)=>{if("production"!==process.env.NODE_ENV&&"isValid"===t&&w&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return P.current[t]=!0,e[t]}}):R},se=n.useMemo(()=>Object.assign({isFormDirty:G,updateWatchedValue:ne,shouldUnregister:s,updateFormState:B,removeFieldEventListener:te,watchInternal:le,mode:D.current,reValidateMode:{isReValidateOnBlur:k,isReValidateOnChange:U},validateResolver:l?K:void 0,fieldsRef:u,resetFieldArrayFunctionRef:O,useWatchFieldsRef:v,useWatchRenderFunctionsRef:f,fieldArrayDefaultValuesRef:d,validFieldsRef:E,fieldsWithValidationRef:g,fieldArrayNamesRef:I,readFormStateRef:P,formStateRef:x,defaultValuesRef:y,shallowFieldsStateRef:b,fieldArrayValuesRef:m},ae),[y.current,ne,s,te,le]);return Object.assign({watch:function(e,t){return le(e,t)},control:se,handleSubmit:ie,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),st)for(const e of Object.values(u.current))if(e){const{ref:t,options:n}=e,o=dt(t)&&Array.isArray(n)?n[0].ref:t;if(ge(o))try{o.closest("form").reset();break}catch(e){}}u.current={},y.current=Object.assign({},e||y.current),e&&Z(""),Object.values(O.current).forEach(e=>Je(e)&&e()),b.current=s?{}:ct(e||y.current),(e=>{let{errors:t,isDirty:n,isSubmitted:o,touched:l,isValid:r,submitCount:i,dirtyFields:a}=e;r||(E.current={},g.current={}),d.current={},p.current=new Set,_.current=!1,B({submitCount:i?x.current.submitCount:0,isDirty:!!n&&x.current.isDirty,isSubmitted:!!o&&x.current.isSubmitted,isValid:!!r&&x.current.isValid,dirtyFields:a?x.current.dirtyFields:{},touched:l?x.current.touched:{},errors:t?x.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(t)},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>u.current[e]&&Se(e)?delete x.current.errors[e]:Ge(x.current.errors,e)),B({errors:e?x.current.errors:{}})},[]),setError:n.useCallback(function(e,t){const n=(u.current[e]||{}).ref;Ne(x.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),B({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:R.errors},ae)}({defaultValues:u}),E=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,o=t.getDate();return n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${o}/${n}/${t.getFullYear()}`},y=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),o=t.getMinutes(),l=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${n}:${o} ${l}`},[h,_]=n.useState([]),S=e=>o.createElement("div",{onClick:e.onClick},o.createElement(s.DownloadBtnCommon,null));n.useEffect(()=>{d("offset",0),d("limit",5),d("sortOrder","DESC")},[d]),n.useEffect(()=>{(null==a?void 0:a.length)>0&&_([null==a?void 0:a.map(e=>{let t={};return t[r("AUDIT_DATE_LABEL")]=E(null==e?void 0:e.timestamp),t[r("AUDIT_TIME_LABEL")]=y(null==e?void 0:e.timestamp),t[r("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[r("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[r("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[a]);const b=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function O(){v("offset",f("offset")-f("limit")),p(i)()}const N=window.Digit.Utils.browser.isMobile();if(N)return o.createElement(Et,{Controller:ft,register:d,control:m,t:r,reset:g,previousPage:O,handleSubmit:p,tenantId:l,data:a,onSubmit:i});const C=e=>o.createElement("span",{className:"cell-text"},e),I=n.useMemo(()=>[{Header:r("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):E(e.timestamp);return C(""+t)}},{Header:r("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):y(e.timestamp);return C(""+t)}},{Header:r(N?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>C(""+(null==e?void 0:e.dataView))},{Header:r(N?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>C(""+(null==e?void 0:e.dataViewedBy))},{Header:r("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return C(""+(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name)))}}],[]);return o.createElement(o.Fragment,null,o.createElement("div",{style:{marginRight:"-70px"}}," ",o.createElement(t.BackButton,null)," "),o.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",o.createElement(t.Header,null,r("PRIVACY_AUDIT_REPORT"))," "),o.createElement(t.SearchForm,{className:"audit-card",onSubmit:i,handleSubmit:p},o.createElement(gt,{register:d,control:m,reset:g,tenantId:l,t:r,previousPage:O})),o.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=a&&a.display?o.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},r(a.display).split("\\n").map((e,t)=>o.createElement("p",{key:t,style:{textAlign:"center"}},e))):""!==a?o.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},o.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},o.createElement(S,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(h)})),o.createElement(s.Table,{t:r,data:a,totalRecords:c,columns:I,getCellProps:e=>({style:{minWidth:e.column.Header===r("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){v("limit",Number(e.target.value)),p(i)()},currentPage:f("offset")/f("limit"),onNextPage:function(){v("offset",f("offset")+f("limit")),p(i)()},onPrevPage:O,manualPagination:!1,pageSizeLimit:f("limit"),onSort:b,disableSort:!1,sortParams:[{id:f("sortBy"),desc:"DESC"===f("sortOrder")}]})):o.createElement(t.Loader,null)))},ht=e=>{var t,r;const{t:i}=l.useTranslation(),a=Digit.ULBService.getCitizenCurrentTenant(),[s,c]=n.useState({}),u=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),o=new Date(Date.UTC(n[1],n[2]-1,n[3]));return o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),"dayend"===t&&(o.setHours(o.getHours()+24),o.setSeconds(o.getSeconds()-1)),o.getTime()}catch(t){return e}};n.useEffect(()=>{const e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){const t={...e};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);const d={enabled:!!(s&&Object.keys(s).length>0)},m={...s},{isLoading:p,data:v}=Digit.Hooks.useAudit({tenantId:a,filters:{...m},config:d});return o.createElement(yt,{t:i,tenantId:a,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});const t={...e,fromDate:u(null==e?void 0:e.fromDate),toDate:u(null==e?void 0:e.toDate)};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:t[n]}),{}))},data:p?"":(null==v||null===(t=v.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==v?void 0:v.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==v||null===(r=v.ElasticSearchData)||void 0===r?void 0:r.length})},_t=e=>{var n,r,i,a,s,c,u,d,m,p,v,f,g,E,y,h;let{moduleCode:_}=e;const{t:S}=l.useTranslation(),b=Digit.ULBService.getCitizenCurrentTenant(),{isLoading:O,data:N}=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),{isLoading:C,error:I,data:D}=Digit.Hooks.useDynamicData({moduleCode:_,tenantId:b,filters:{},t:S}),w=e=>{let{module:n,styles:l}=e;switch(n){case"TL":return o.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:l});case"PT":return o.createElement(t.PTIcon,{className:"fill-path-primary-main",styles:l});case"MCOLLECT":return o.createElement(t.MCollectIcon,{className:"fill-path-primary-main",styles:l});case"PGR":return o.createElement(t.ComplaintIcon,{className:"fill-path-primary-main",styles:l});default:return o.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:l})}},T=null==N||null===(n=N.MdmsRes["common-masters"])||void 0===n||null===(r=n.StaticData[0])||void 0===r?void 0:r[""+_],A=e=>{let{module:n}=e;switch(n){case"PT":case"WS":return o.createElement("span",{className:"timerIcon"},o.createElement(t.TimerIcon,null));default:return null}},R=e=>{let{module:n}=e;switch(n){case"PT":return o.createElement("span",{className:"rupeeSymbol"},o.createElement(t.RupeeSymbol,null));case"WS":return o.createElement("span",{className:"timerIcon"},o.createElement(t.TimerIcon,null));default:return null}},L=e=>{switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:S("COMMON_VALIDITY"),validity:(null==T?void 0:T.validity)+S("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};case"PGR":return{staticCommonContent:S("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:S("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==T?void 0:T.validity)+" "+S("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},P=e=>{switch(e){case"PT":return{staticDataOne:(null==T?void 0:T.staticDataOne)+" "+S("COMMON_DAYS"),staticDataOneHeader:S("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==T?void 0:T.staticDataTwo,staticDataTwoHeader:S("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:S("PAY_WATER_CHARGES_BY")+" "+(null==T?void 0:T.staticDataOne)+" "+S("COMMON_DAYS")+" "+S("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==T?void 0:T.staticDataTwo)+" "+S("COMMON_DAYS"),staticDataTwoHeader:S("APPLICATION_PROCESSING_TIME")};default:return{}}};return O||C?o.createElement(t.Loader,null):T?o.createElement(o.Fragment,null,T&&null!=T&&T.payViaWhatsApp?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"pay-whatsapp-card",onClick:()=>{window.open(null==T?void 0:T.payViaWhatsApp)}},o.createElement("div",{className:"pay-whatsapp-text"},S("PAY_VIA_WHATSAPP")),o.createElement("div",{className:"whatsAppIconG"},o.createElement(t.WhatsappIconGreen,null)))):null,T&&null!=T&&T.helpline?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"static-home-Card"},o.createElement("div",{className:"static-home-Card-header"},S("CALL_CENTER_HELPLINE")),o.createElement("div",{className:"helplineIcon"},o.createElement(t.HelpLineIcon,null))),o.createElement("div",{className:"call-center-card-text"},null!=T&&null!==(i=T.helpline)&&void 0!==i&&i.contactOne?o.createElement("div",{className:"call-center-card-content"},o.createElement("a",{href:"tel:"+(null==T||null===(a=T.helpline)||void 0===a?void 0:a.contactOne)},null==T||null===(s=T.helpline)||void 0===s?void 0:s.contactOne)):null,null!=T&&null!==(c=T.helpline)&&void 0!==c&&c.contactTwo?o.createElement("div",{className:"call-center-card-content"},o.createElement("a",{href:"tel:"+(null==T||null===(u=T.helpline)||void 0===u?void 0:u.contactTwo)},null==T||null===(d=T.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,T&&null!=T&&T.serviceCenter?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"static-home-Card"},o.createElement("div",{className:"static-home-Card-header"},S("CITIZEN_SERVICE_CENTER")),o.createElement("div",{className:"serviceCentrIcon"},o.createElement(t.ServiceCenterIcon,null))),o.createElement("div",{className:"service-center-details-card"},o.createElement("div",{className:"service-center-details-text"},null==T?void 0:T.serviceCenter)),null!=T&&T.viewMapLocation?o.createElement("div",{className:"link"},o.createElement("a",{href:null==T?void 0:T.viewMapLocation},S("VIEW_ON_MAP"))):null):o.createElement("div",null),o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},I||null==D||null===(null==D?void 0:D.dynamicDataOne)?o.createElement("div",null):o.createElement("div",{className:"dynamicDataCard"},o.createElement("div",{className:"dynamicData"},o.createElement(w,{module:_,styles:{width:"24px",height:"24px"}}),o.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataOne))),I||null==D||null===(null==D?void 0:D.dynamicDataTwo)?o.createElement("div",null):o.createElement("div",{className:"dynamicDataCard"},o.createElement("div",{className:"dynamicData"},o.createElement(w,{module:_,styles:{width:"24px",height:"24px"}}),o.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataTwo))),T&&null!=T&&T.staticDataOne?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement(A,{module:_}),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=P(_))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(p=P(_))||void 0===p?void 0:p.staticDataOneHeader),o.createElement("span",{className:"static-data-content-second"},""+(null===(v=P(_))||void 0===v?void 0:v.staticDataOne))))):o.createElement("div",null),T&&null!=T&&T.staticDataTwo?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement(R,{module:_}),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(f=P(_))||void 0===f?void 0:f.staticDataTwoHeader),o.createElement("span",{className:"static-data-content-second"},null===(g=P(_))||void 0===g?void 0:g.staticDataTwo)))):o.createElement("div",null),T&&null!=T&&T.validity?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement("span",{className:"validityIcon"},o.createElement(t.ValidityTimeIcon,null)),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(E=L(_))||void 0===E?void 0:E.staticCommonContent),o.createElement("span",{className:"static-data-content-second"},null===(y=L(_))||void 0===y?void 0:y.validity)))):o.createElement("div",null),I||null==D||null==D||!D.staticData||null===(null==D?void 0:D.staticData)?o.createElement("div",null):o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},"PGR"===_?o.createElement(w,{module:_,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):o.createElement("span",{className:"validityIcon"},o.createElement(t.ValidityTimeIcon,null)),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(h=L(_))||void 0===h?void 0:h.staticCommonContent),o.createElement("span",{className:"static-data-content-second"},null==D?void 0:D.staticData)))))):o.createElement(o.Fragment,null)};var St,bt,Ot,Nt,Ct;const It=[(null===(St=window)||void 0===St?void 0:St.contextPath)+"/citizen/register/name",`/${null===(bt=window)||void 0===bt?void 0:bt.contextPath}/citizen/select-language`,`/${null===(Ot=window)||void 0===Ot?void 0:Ot.contextPath}/citizen/select-location`,`/${null===(Nt=window)||void 0===Nt?void 0:Nt.contextPath}/citizen/login`,`/${null===(Ct=window)||void 0===Ct?void 0:Ct.contextPath}/citizen/register/otp`],Dt=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code)),wt=e=>{var n,r,i;let{stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:f,stateCode:E,modules:y,appTenants:h,pathname:_,initData:S}=e;const{isLoading:b,data:O,isFetched:N}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:`[?(@.url == '${Digit.Utils.getMultiRootTenant()?window.globalPath:window.contextPath}-card')]`}],{select:e=>{var t,n;return null==e||null===(t=e["ACCESSCONTROL-ACTIONS-TEST"])||void 0===t||null===(n=t["actions-test"])||void 0===n?void 0:n.filter(e=>!0===e.enabled).reduce((e,t)=>{var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t,...e[t.parentModule]]:[t],e},{})}}),I=Digit.Hooks.useRouteSubscription(_),{t:D}=l.useTranslation(),{path:T}=a.useRouteMatch(),A=a.useHistory(),R=It.some(e=>window.location.href.includes(e)),L=y.map((e,t)=>{let{code:n,tenants:l}=e;const r=Digit.ComponentRegistryService.getComponent(n+"Module");return r?o.createElement(a.Route,{key:t,path:`${T}/${n.toLowerCase()}`},o.createElement(r,{stateCode:E,moduleCode:n,userType:"citizen",tenants:Dt(l,h)})):null}),P=y.map((e,n)=>{let{code:l,bannerImage:r}=e,i=(Digit.ComponentRegistryService.getComponent(l+"Links"),N?C(O,l,D):void 0);return"ACTION_TEST_WS"===(null==i?void 0:i.header)&&(null==i||i.links.sort((e,t)=>t.orderNumber-e.orderNumber)),o.createElement(o.Fragment,null,o.createElement(a.Route,{key:n,path:`${T}/${l.toLowerCase()}-home`},o.createElement("div",{className:"moduleLinkHomePage"},o.createElement("img",{src:r||(null==s?void 0:s.bannerUrl),alt:"noimagefound"}),o.createElement(t.BackLink,{className:"moduleLinkHomePageBackButton",onClick:()=>window.history.back()}),o.createElement("h1",null,D("MODULE_"+l.toUpperCase())),o.createElement("div",{className:"moduleLinkHomePageModuleLinks"},i&&o.createElement(t.CitizenHomeCard,{header:D(null==i?void 0:i.header),links:null==i?void 0:i.links,Icon:()=>o.createElement("span",null),Info:"OBPS"===l?()=>o.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:D("CS_FILE_APPLICATION_INFO_LABEL"),text:D("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===l})),o.createElement(_t,{moduleCode:null==l?void 0:l.toUpperCase()}))),o.createElement(a.Route,{key:"faq"+n,path:`${T}/${l.toLowerCase()}-faq`},o.createElement(W,{module:null==l?void 0:l.toUpperCase()})),o.createElement(a.Route,{key:"hiw"+n,path:`${T}/${l.toLowerCase()}-how-it-works`},o.createElement(le,{module:null==l?void 0:l.toUpperCase()})))});return o.createElement("div",{className:I},o.createElement($,{t:D,stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:f,showSidebar:!!u,linkData:O,islinkDataLoading:b}),o.createElement("div",{className:"main center-container citizen-home-container mb-25"},R?null:o.createElement("div",{className:"SideBarStatic"},o.createElement(U,{linkData:O,islinkDataLoading:b})),o.createElement(a.Switch,null,o.createElement(a.Route,{exact:!0,path:T},o.createElement(X,null)),o.createElement(a.Route,{exact:!0,path:T+"/select-language"},o.createElement(q,null)),o.createElement(a.Route,{exact:!0,path:T+"/select-location"},o.createElement(Q,null)),o.createElement(a.Route,{path:T+"/error"},o.createElement(v,{initData:S,goToHome:()=>{var e,t,n,o;A.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(o=n.getType)||void 0===o?void 0:o.call(n)}`)}})),o.createElement(a.Route,{path:T+"/all-services"},o.createElement(w,{userType:"citizen",modules:y,getCitizenMenu:O,fetchedCitizen:N,isLoading:b})),o.createElement(a.Route,{path:T+"/login"},o.createElement(fe,{stateCode:E})),o.createElement(a.Route,{path:T+"/register"},o.createElement(fe,{stateCode:E,isUserRegistered:!1})),o.createElement(a.Route,{path:T+"/user/profile"},o.createElement(oe,{stateCode:E,userType:"citizen",cityDetails:d})),o.createElement(a.Route,{path:T+"/Audit"},o.createElement(ht,null)),o.createElement(g,{initData:S},L,P))),o.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},o.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(r=n.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};var Tt="function"==typeof Symbol&&Symbol.for,At=Tt?Symbol.for("react.element"):60103,Rt=Tt?Symbol.for("react.portal"):60106,Lt=Tt?Symbol.for("react.fragment"):60107,Pt=Tt?Symbol.for("react.strict_mode"):60108,xt=Tt?Symbol.for("react.profiler"):60114,Mt=Tt?Symbol.for("react.provider"):60109,kt=Tt?Symbol.for("react.context"):60110,Ut=Tt?Symbol.for("react.async_mode"):60111,Bt=Tt?Symbol.for("react.concurrent_mode"):60111,Ft=Tt?Symbol.for("react.forward_ref"):60112,jt=Tt?Symbol.for("react.suspense"):60113,Ht=Tt?Symbol.for("react.suspense_list"):60120,Gt=Tt?Symbol.for("react.memo"):60115,Vt=Tt?Symbol.for("react.lazy"):60116,$t=Tt?Symbol.for("react.block"):60121,zt=Tt?Symbol.for("react.fundamental"):60117,Wt=Tt?Symbol.for("react.responder"):60118,Xt=Tt?Symbol.for("react.scope"):60119;function qt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case At:switch(e=e.type){case Ut:case Bt:case Lt:case xt:case Pt:case jt:return e;default:switch(e=e&&e.$$typeof){case kt:case Ft:case Vt:case Gt:case Mt:return e;default:return t}}case Rt:return t}}}function Qt(e){return qt(e)===Bt}var Zt={AsyncMode:Ut,ConcurrentMode:Bt,ContextConsumer:kt,ContextProvider:Mt,Element:At,ForwardRef:Ft,Fragment:Lt,Lazy:Vt,Memo:Gt,Portal:Rt,Profiler:xt,StrictMode:Pt,Suspense:jt,isAsyncMode:function(e){return Qt(e)||qt(e)===Ut},isConcurrentMode:Qt,isContextConsumer:function(e){return qt(e)===kt},isContextProvider:function(e){return qt(e)===Mt},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===At},isForwardRef:function(e){return qt(e)===Ft},isFragment:function(e){return qt(e)===Lt},isLazy:function(e){return qt(e)===Vt},isMemo:function(e){return qt(e)===Gt},isPortal:function(e){return qt(e)===Rt},isProfiler:function(e){return qt(e)===xt},isStrictMode:function(e){return qt(e)===Pt},isSuspense:function(e){return qt(e)===jt},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Lt||e===Bt||e===xt||e===Pt||e===jt||e===Ht||"object"==typeof e&&null!==e&&(e.$$typeof===Vt||e.$$typeof===Gt||e.$$typeof===Mt||e.$$typeof===kt||e.$$typeof===Ft||e.$$typeof===zt||e.$$typeof===Wt||e.$$typeof===Xt||e.$$typeof===$t)},typeOf:qt},Yt=F(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case c:case u:case l:case i:case r:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case a:return g;default:return t}}case o:return t}}}var S=u,b=s,O=a,N=n,C=d,I=l,D=f,w=v,T=o,A=i,R=r,L=m,P=!1;function x(e){return _(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=b,t.ContextProvider=O,t.Element=N,t.ForwardRef=C,t.Fragment=I,t.Lazy=D,t.Memo=w,t.Portal=T,t.Profiler=A,t.StrictMode=R,t.Suspense=L,t.isAsyncMode=function(e){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),x(e)||_(e)===c},t.isConcurrentMode=x,t.isContextConsumer=function(e){return _(e)===s},t.isContextProvider=function(e){return _(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return _(e)===d},t.isFragment=function(e){return _(e)===l},t.isLazy=function(e){return _(e)===f},t.isMemo=function(e){return _(e)===v},t.isPortal=function(e){return _(e)===o},t.isProfiler=function(e){return _(e)===i},t.isStrictMode=function(e){return _(e)===r},t.isSuspense=function(e){return _(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===i||e===r||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=_}()}),Jt=F(function(e){e.exports="production"===process.env.NODE_ENV?Zt:Yt}),Kt=Object.getOwnPropertySymbols,en=Object.prototype.hasOwnProperty,tn=Object.prototype.propertyIsEnumerable;function nn(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var on=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,o,l=nn(e),r=1;r<arguments.length;r++){for(var i in n=Object(arguments[r]))en.call(n,i)&&(l[i]=n[i]);if(Kt){o=Kt(n);for(var a=0;a<o.length;a++)tn.call(n,o[a])&&(l[o[a]]=n[o[a]])}}return l},ln="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",rn=Function.call.bind(Object.prototype.hasOwnProperty),an=function(){};if("production"!==process.env.NODE_ENV){var sn=ln,cn={},un=rn;an=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function dn(e,t,n,o,l){if("production"!==process.env.NODE_ENV)for(var r in e)if(un(e,r)){var i;try{if("function"!=typeof e[r]){var a=Error((o||"React class")+": "+n+" type `"+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[r]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}i=e[r](t,r,o,n,null,sn)}catch(e){i=e}if(!i||i instanceof Error||an((o||"React class")+": type specification of "+n+" `"+r+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in cn)){cn[i.message]=!0;var s=l?l():"";an("Failed "+n+" type: "+i.message+(null!=s?s:""))}}}dn.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(cn={})};var mn=dn,pn=function(){};function vn(){return null}function fn(){}function gn(){}"production"!==process.env.NODE_ENV&&(pn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),gn.resetWarningCache=fn;var En=F(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,o={array:a("array"),bigint:a("bigint"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:i(vn),arrayOf:function(e){return i(function(t,n,o,l,i){if("function"!=typeof e)return new r("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new r("Invalid "+l+" `"+i+"` of type `"+u(a)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<a.length;s++){var c=e(a,s,o,l,i+"["+s+"]",ln);if(c instanceof Error)return c}return null})},element:i(function(t,n,o,l,i){var a=t[n];return e(a)?null:new r("Invalid "+l+" `"+i+"` of type `"+u(a)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:i(function(e,t,n,o,l){var i=e[t];return Jt.isValidElementType(i)?null:new r("Invalid "+o+" `"+l+"` of type `"+u(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return i(function(t,n,o,l,i){var a;return t[n]instanceof e?null:new r("Invalid "+l+" `"+i+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+o+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:i(function(e,t,n,o,l){return c(e[t])?null:new r("Invalid "+o+" `"+l+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return i(function(t,n,o,l,i){if("function"!=typeof e)return new r("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var a=t[n],s=u(a);if("object"!==s)return new r("Invalid "+l+" `"+i+"` of type `"+s+"` supplied to `"+o+"`, expected an object.");for(var c in a)if(rn(a,c)){var d=e(a,c,o,l,i+"."+c,ln);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&pn(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),vn;function t(t,n,o,i,a){for(var s=t[n],c=0;c<e.length;c++)if(l(s,e[c]))return null;var u=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new r("Invalid "+i+" `"+a+"` of value `"+String(s)+"` supplied to `"+o+"`, expected one of "+u+".")}return i(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&pn("Invalid argument supplied to oneOfType, expected an instance of array."),vn;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return pn("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),vn}return i(function(t,n,o,l,i){for(var a=[],s=0;s<e.length;s++){var c=(0,e[s])(t,n,o,l,i,ln);if(null==c)return null;c.data&&rn(c.data,"expectedType")&&a.push(c.data.expectedType)}return new r("Invalid "+l+" `"+i+"` supplied to `"+o+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return i(function(t,n,o,l,i){var a=t[n],c=u(a);if("object"!==c)return new r("Invalid "+l+" `"+i+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var m in e){var p=e[m];if("function"!=typeof p)return s(o,l,i,m,d(p));var v=p(a,m,o,l,i+"."+m,ln);if(v)return v}return null})},exact:function(e){return i(function(t,n,o,l,i){var a=t[n],c=u(a);if("object"!==c)return new r("Invalid "+l+" `"+i+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");var m=on({},t[n],e);for(var p in m){var v=e[p];if(rn(e,p)&&"function"!=typeof v)return s(o,l,i,p,d(v));if(!v)return new r("Invalid "+l+" `"+i+"` key `"+p+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=v(a,p,o,l,i+"."+p,ln);if(f)return f}return null})}};function l(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function r(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function i(e){function t(t,n,o,l,i,a,s){if(l=l||"<<anonymous>>",a=a||o,s!==ln){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}return null==n[o]?t?new r(null===n[o]?"The "+i+" `"+a+"` is marked as required in `"+l+"`, but its value is `null`.":"The "+i+" `"+a+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:e(n,o,l,i,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return i(function(t,n,o,l,i,a){var s=t[n];return u(s)!==e?new r("Invalid "+l+" `"+i+"` of type `"+d(s)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,o,l){return new r((e||"React class")+": "+t+" type `"+n+"."+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+l+"`.")}function c(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(c);if(null===t||e(t))return!0;var o=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!o)return!1;var l,r=o.call(t);if(o!==t.entries){for(;!(l=r.next()).done;)if(!c(l.value))return!1}else for(;!(l=r.next()).done;){var i=l.value;if(i&&!c(i[1]))return!1}return!0;default:return!1}}function u(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function d(e){if(null==e)return""+e;var t=u(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function m(e){var t=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return r.prototype=Error.prototype,o.checkPropTypes=mn,o.resetWarningCache=mn.resetWarningCache,o.PropTypes=o,o}(Jt.isElement):function(){function e(e,t,n,o,l,r){if(r!==ln){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:gn,resetWarningCache:fn};return n.PropTypes=n,n}()});const yn=e=>{let{children:t}=e;return o.createElement("div",{className:"banner banner-container"},t)},hn=e=>{var n;let{showTenant:r=!0}=e;const{data:i,isLoading:a}=Digit.Hooks.useStore.getInitData(),{stateInfo:s}=i||{},{t:c}=l.useTranslation();return a?o.createElement(t.Loader,null):o.createElement("div",{className:"bannerHeader"},o.createElement("img",{className:"bannerLogo",src:null==s?void 0:s.logoUrl,style:r?{}:{borderRight:"unset"}}),r&&(null==s?void 0:s.code)&&o.createElement("p",null,c("TENANT_TENANTS_"+(null==s||null===(n=s.code)||void 0===n?void 0:n.toUpperCase()))))},_n=e=>{var l,r,i;let{config:c,t:u}=e;const[d,m]=n.useState(null),{mobile_number:p,tenantId:v}=Digit.Hooks.useQueryParams(),f=a.useHistory(),[g,E]=n.useState(""),[y,h]=n.useState(!0),[_,S]=n.useState(null),b=()=>Digit.UserService.getType();n.useEffect(()=>{var e,t;if(!d)return void Digit.UserService.setType("employee");Digit.UserService.setUser(d);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;f.replace(n)},[d]);const O=()=>{S(null)},[N,C,I]=c.inputs,D=[{body:[{label:u(N.label),type:N.type,populators:{name:N.name},isMandatory:!0},{label:u(C.label),type:C.type,populators:{name:C.name},isMandatory:!0},{label:u(I.label),type:I.type,populators:{name:I.name},isMandatory:!0}]}];return o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{variant:"primary",style:{borderBottom:"none"}})),o.createElement(s.FormComposer,{onSubmit:function(e){try{return Promise.resolve(te(function(){if(e.newPassword!==e.confirmPassword)return S(u("ERR_PASSWORD_DO_NOT_MATCH"));const t={...e,otpReference:g,tenantId:v,type:b().toUpperCase()};return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){(()=>{var e;f.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/login`)})()})},function(e){var t,n,o,l,r;S((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.error)||void 0===o||null===(l=o.fields)||void 0===l||null===(r=l[0])||void 0===r?void 0:r.message)||u("ES_SOMETHING_WRONG")),setTimeout(O,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:D,label:c.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},o.createElement(hn,null),o.createElement(s.CardSubHeader,{style:{textAlign:"center"}}," ",c.texts.header," "),o.createElement(s.CardText,null,u("CS_LOGIN_OTP_TEXT")+" ",o.createElement("b",null," ",""+u("+ 91 - ")," ",p)),o.createElement(ce,{t:u,userType:"employee",otp:g,onOtpChange:E,error:y,onResend:function(){try{function e(){setTimeout(O,5e3)}const t={otp:{mobileNumber:p,userType:b().toUpperCase(),type:"passwordreset",tenantId:v}},n=te(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){S(u("ES_OTP_RESEND"))})},function(e){var t,n;S((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||u("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),_&&o.createElement(t.Toast,{type:"error",label:u(_),onClose:O}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(r=l.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};_n.propTypes={loginParams:En.any},_n.defaultProps={loginParams:null};const Sn=[{texts:{header:"CORE_COMMON_RESET_PASSWORD_LABEL",submitButtonLabel:"CORE_COMMON_CHANGE_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",name:"userName",error:"ERR_HRMS_INVALID_USERNAME"},{label:"CORE_LOGIN_NEW_PASSWORD",type:"password",name:"newPassword",error:"CORE_COMMON_REQUIRED_ERRMSG"},{label:"CORE_LOGIN_CONFIRM_NEW_PASSWORD",type:"password",name:"confirmPassword",error:"CORE_COMMON_REQUIRED_ERRMSG"}]}],bn=()=>{const{t:e}=l.useTranslation(),{path:t}=a.useRouteMatch(),r=n.useMemo(()=>Sn.map(t=>{const n={};for(const o in t.texts)n[o]=e(t.texts[o]);return{...t,texts:n}},[Sn]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+t,exact:!0},o.createElement(_n,{config:r[0],t:e})))},On=[{texts:{header:"CORE_COMMON_FORGOT_PASSWORD_LABEL",description:"ES_FORGOT_PASSWORD_DESC",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"mobileNumber",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOBILE_NUMBER"},{label:"CORE_COMMON_CITY",type:"dropdown",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],Nn=e=>{var l,r,i;let{config:s,t:c}=e;const{data:u,isLoading:d}=Digit.Hooks.useTenants(),[m,p]=n.useState(null),v=a.useHistory(),[f,g]=n.useState(null);n.useEffect(()=>{var e,t;if(!m)return void Digit.UserService.setType("employee");Digit.UserService.setUser(m);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;v.replace(n)},[m]);const E=()=>{g(null)},[y,h]=s.inputs,_=[{body:[{label:c(y.label),type:y.type,populators:{name:y.name},isMandatory:!0},{label:c(h.label),type:h.type,populators:{name:h.name,optionsKey:"name",required:!0,options:u},isMandatory:!0}]}];return d?o.createElement(t.Loader,null):o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();const t={otp:{mobileNumber:e.mobileNumber,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=te(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;v.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/change-password?mobile_number=${e.mobileNumber}&tenantId=${e.city.code}`)})},function(e){var t,n,o,l,r;g((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.error)||void 0===o||null===(l=o.fields)||void 0===l||null===(r=l[0])||void 0===r?void 0:r.message)||"Invalid login credentials!"),setTimeout(E,5e3)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:_,label:s.texts.submitButtonLabel,secondaryActionLabel:s.texts.secondaryButtonLabel,onSecondayActionClick:()=>{var e;v.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/login`)},heading:s.texts.header,description:s.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},o.createElement(hn,null)),f&&o.createElement(t.Toast,{type:"error",label:c(f),onClose:E}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(r=l.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Nn.propTypes={loginParams:En.any},Nn.defaultProps={loginParams:null};const Cn=()=>{const{t:e}=l.useTranslation(),{path:t}=a.useRouteMatch(),r=n.useMemo(()=>On.map(t=>{const n={};for(const o in t.texts)n[o]=e(t.texts[o]);return{...t,texts:n}},[On]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+t,exact:!0},o.createElement(Nn,{config:r[0],t:e})))},In=(e,t)=>t.filter(t=>{var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,e=>e.code).includes(t.code)}),Dn=e=>{var t;let{stateCode:n,userType:l,modules:r,appTenants:i,additionalComponent:s}=e;Digit;const{path:c}=a.useRouteMatch(),u=a.useLocation(),d=Digit.UserService.getUser();var m;if(!d||null==d||!d.access_token||null==d||!d.info)return o.createElement(a.Redirect,{to:{pathname:`/${null===(m=window)||void 0===m?void 0:m.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}});const p=null==r?void 0:r.map((e,t)=>{var r;let{code:s,tenants:u}=e;const d=Digit.ComponentRegistryService.getComponent(s+"Module");return o.createElement(a.Route,{key:t,path:`${c}/${s.toLowerCase()}`},d?o.createElement(d,{stateCode:n,moduleCode:s,userType:l,tenants:In(u,i)}):o.createElement(a.Redirect,{to:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee/user/error?type=notfound&module=${s}`}))});return o.createElement("div",{className:"ground-container digit-home-ground"},o.createElement(a.Switch,null,p,o.createElement(a.Route,{path:c+"/login"},o.createElement(a.Redirect,{to:{pathname:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}})),o.createElement(a.Route,{path:c+"/forgot-password"},o.createElement(Cn,null)),o.createElement(a.Route,{path:c+"/change-password"},o.createElement(bn,null)),o.createElement(a.Route,null,o.createElement(w,{userType:l,modules:r,additionalComponent:s}))))},wn={label:"English",value:Digit.Utils.getDefaultLanguage()},Tn=()=>{var e,r,i,c,u;const{data:d,isLoading:m}=Digit.Hooks.useStore.getInitData(),{t:p}=l.useTranslation(),v=a.useHistory(),{languages:f,stateInfo:g}=d||{};let E=f;E&&0!=(null===(e=E)||void 0===e?void 0:e.length)||(E=[wn]);const y=Digit.StoreData.getCurrentLanguage(),[h,_]=n.useState(y);return m?o.createElement(t.Loader,null):o.createElement(yn,null,o.createElement(t.Card,{className:"bannerCard removeBottomMargin languageSelection"},o.createElement("div",{className:"bannerHeader"},o.createElement("img",{className:"bannerLogo",src:null==g?void 0:g.logoUrl,alt:"Digit"}),o.createElement("p",null,p("TENANT_TENANTS_"+(null==g||null===(r=g.code)||void 0===r?void 0:r.toUpperCase())))),o.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},E.map((e,t)=>o.createElement("div",{className:"language-button-container",key:t},o.createElement(s.CustomButton,{selected:e.value===h,text:p(e.label),onClick:()=>(e=>{_(e.value),Digit.LocalizationService.changeLanguage(e.value,g.code)})(e)})))),o.createElement(t.SubmitBar,{style:{width:"100%"},label:p("CORE_COMMON_CONTINUE"),onSubmit:e=>{var t;v.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`)}})),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(c=i.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))},An=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",key:"username",isMandatory:!0,populators:{name:"username",validation:{required:!0},error:"ERR_USERNAME_REQUIRED"}},{label:"CORE_LOGIN_PASSWORD",type:"password",key:"password",isMandatory:!0,populators:{name:"password",validation:{required:!0},error:"ERR_PASSWORD_REQUIRED"}},{isMandatory:!0,type:"dropdown",key:"city",label:"CORE_COMMON_CITY",disable:!1,populators:{name:"city",optionsKey:"name",error:"ERR_HRMS_INVALID_CITY",mdmsConfig:{masterName:"tenants",moduleName:"tenant",localePrefix:"TENANT_TENANTS",select:"(data)=>{ return Array.isArray(data['tenant'].tenants) && Digit.Utils.getUnique(data['tenant'].tenants).map(ele=>({code:ele.code,name:Digit.Utils.locale.getTransformedLocale('TENANT_TENANTS_'+ele.code)}))}"}}}]}],Rn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"Sandbox"},populators:{name:"check"}}]}],Ln=e=>{var l,r,i,s,c,u,d,m,p,v,f,g,E;let{config:y,t:h,isDisabled:_,loginOTPBased:S}=e;const{isLoading:b}=Digit.Hooks.useTenants(),{data:O,isLoading:N}=Digit.Hooks.useStore.getInitData(),{stateInfo:C}=O||{},[I,D]=n.useState(null),[w,T]=n.useState(null),[A,R]=n.useState(!1),L=a.useHistory();n.useEffect(()=>{var e,t,n,o,l,r,i,a,s,c,u,d,m,p,v,f,g,E;if(!I)return;Digit.SessionStorage.set("citizen.userRequestObject",I);const y=null==I||null===(e=I.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==I||null===(n=I.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.length)>0&&(I.info.roles=y),Digit.UserService.setUser(I),((e,t)=>{var n;if(Digit.Utils.getMultiRootTenant())return;let o=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",o),localStorage.setItem("Employee.locale",o),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==I?void 0:I.info,null==I?void 0:I.access_token);let h=`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee`;var _,S,b,O,N,C,D;null!==(r=window)&&void 0!==r&&null!==(i=r.location)&&void 0!==i&&null!==(a=i.href)&&void 0!==a&&a.includes("from=")&&(h=decodeURIComponent(null===(_=window)||void 0===_||null===(S=_.location)||void 0===S||null===(b=S.href)||void 0===b||null===(O=b.split("from="))||void 0===O?void 0:O[1])||`/${null===(N=window)||void 0===N?void 0:N.contextPath}/employee`),null!=I&&null!==(s=I.info)&&void 0!==s&&s.roles&&(null==I||null===(c=I.info)||void 0===c||null===(u=c.roles)||void 0===u?void 0:u.length)>0&&null!=I&&null!==(d=I.info)&&void 0!==d&&null!==(m=d.roles)&&void 0!==m&&m.every(e=>"NATADMIN"===e.code)&&(h=`/${null===(C=window)||void 0===C?void 0:C.contextPath}/employee/dss/landing/NURT_DASHBOARD`),null!=I&&null!==(p=I.info)&&void 0!==p&&p.roles&&(null==I||null===(v=I.info)||void 0===v||null===(f=v.roles)||void 0===f?void 0:f.length)>0&&null!=I&&null!==(g=I.info)&&void 0!==g&&null!==(E=g.roles)&&void 0!==E&&E.every(e=>"STADMIN"===e.code)&&(h=`/${null===(D=window)||void 0===D?void 0:D.contextPath}/employee/dss/landing/home`),L.replace(h)},[I]);const P={url:"/user-otp/v1/_send",params:{tenantId:Digit.ULBService.getStateId()},body:{},config:{enable:!1}},x=Digit.Hooks.useCustomAPIMutationHook(P),M=()=>{T(null)},k={code:Digit.ULBService.getStateId(),name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+Digit.ULBService.getStateId())};let U=[{body:null==y?void 0:y.inputs}];const{mode:B}=Digit.Hooks.useQueryParams();return"admin"===B&&0==(null==U||null===(l=U[0])||void 0===l||null===(r=l.body)||void 0===r||null===(i=r[2])||void 0===i?void 0:i.disable)&&null==(null==U||null===(s=U[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(U[0].body[2].disable=!0,U[0].body[2].isMandatory=!1,U[0].body[2].populators.defaultValue=k),b||N?o.createElement(t.Loader,null):o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:S?function(e){try{const t=e.email;return Promise.resolve(x.mutate({body:{otp:{userName:e.email,type:"login",tenantId:Digit.ULBService.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,r,i,a,s;T(null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&l[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i||null===(a=i.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"),setTimeout(M,5e3)},onSuccess:function(e){try{var n;return L.push({pathname:`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee/user/login/otp`,state:{email:t,tenant:Digit.ULBService.getStateId()}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}:function(e){try{var t;function n(){R(!1)}R(!0);const o={...e,userType:"EMPLOYEE"};o.tenantId=(null==e||null===(t=e.city)||void 0===t?void 0:t.code)||Digit.ULBService.getStateId(),delete o.city;const l=te(function(){return Promise.resolve(Digit.UserService.authenticate(o)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),D({info:t,...n})})},function(e){var t,n;T((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&h("ES_ERROR_USER_NOT_PERMITTED")||h("INVALID_LOGIN_CREDENTIALS")),setTimeout(M,5e3)});return Promise.resolve(l&&l.then?l.then(n):n())}catch(e){return Promise.reject(e)}},isDisabled:_||A,noBoxShadow:!0,inline:!0,submitInForm:!0,config:U,label:null==y||null===(m=y.texts)||void 0===m?void 0:m.submitButtonLabel,secondaryActionLabel:null==y||null===(p=y.texts)||void 0===p?void 0:p.secondaryButtonLabel,onSecondayActionClick:()=>{var e;L.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/forgot-password`)},onFormValueChange:(e,t,n)=>{const o=U[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});R(o)},heading:null==y||null===(v=y.texts)||void 0===v?void 0:v.header,className:"loginFormStyleEmployee "+(S?"sandbox-onboarding-wrapper":""),cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:"loginCardClassName",buttonClassName:"buttonClassName"},o.createElement(hn,null!=C&&C.code?null:{showTenant:!1})),w&&o.createElement(t.Toast,{type:"error",label:h(w),onClose:M}),o.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},o.createElement("img",{alt:"Powered by DIGIT",src:null===(f=window)||void 0===f||null===(g=f.globalConfigs)||void 0===g||null===(E=g.getConfig)||void 0===E?void 0:E.call(g,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Ln.propTypes={loginParams:En.any},Ln.defaultProps={loginParams:null};const Pn=e=>{var t,r;let{stateCode:i}=e;const{t:s}=l.useTranslation(),{path:c}=a.useRouteMatch(),[u,d]=n.useState(An),[m,p]=n.useState(Rn),v=Digit.StoreData.getCurrentLanguage(),f=(null===(t=window)||void 0===t||null===(r=t.globalConfigs)||void 0===r?void 0:r.getConfig("OTP_BASED_LOGIN"))||!1,{data:g,isLoading:E}=(Digit.Services.useStore({stateCode:i,moduleCode:["privacy-policy"],language:v,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(i,"commonUiConfig",["LoginConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.LoginConfig}},retry:!1}));n.useEffect(()=>{d(0==E&&null!=g&&g.config?null==g?void 0:g.config:An)},[g,E]);const y=n.useMemo(()=>u.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}},[u])),h=n.useMemo(()=>m.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}},[m]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+c,exact:!0},o.createElement(Ln,f?{config:h[0],t:s,loginOTPBased:f}:{config:y[0],t:s})))},xn=e=>{let{embedId:t}=e;return o.createElement("iframe",{className:"player-iframe",width:"480",height:"270",src:"https://www.youtube.com/embed/"+t,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Embedded youtube"})},Mn=e=>{const[t,l]=n.useState(""),[r,i]=n.useState(!1);return n.useEffect(()=>{let t=e.link;t.startsWith("https://www.youtube.com/watch?v=")&&(t=t.split("https://www.youtube.com/watch?v=")[1]),l(t)},[e.link]),o.createElement("div",null,r&&o.createElement("div",{className:"overlay",onClick:()=>i(!1)},o.createElement("div",{onClick:e=>e.stopPropagation()},o.createElement(xn,{embedId:t}))),e.overlay?o.createElement("div",{className:"player-wrapper"},o.createElement("div",{className:"player-click-area",onClick:()=>{e.overlay&&i(!0)}}),o.createElement(xn,{embedId:t})):o.createElement(xn,{embedId:t}))},kn=e=>{var r;let{config:i}=e;const{t:s}=l.useTranslation(),{heading:c,subsections:u,url:d}=i;let m=`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee/user/landing/select-role`;const p=a.useHistory();return o.createElement("div",{className:"custom-landing-container"},o.createElement(t.Card,{className:"custom-landing-card"},o.createElement(t.Header,{className:"custom-landing-header"},s(c)),o.createElement("div",{className:"custom-video-section"},o.createElement(Mn,{link:d,overlay:!0})),u.map((e,l)=>o.createElement("div",{key:l,className:"custom-section-container"},o.createElement(t.CardHeader,{className:"custom-section-header"},s(e.title)),"paragraph"===e.type&&e.content&&o.createElement(n.Fragment,null,e.content.map((e,n)=>o.createElement(t.CardText,{className:"custom-section-paragraph",key:n},o.createElement("p",null,s(e.text))))),"steps"===e.type&&e.content&&o.createElement("ul",{className:"custom-steps-list"}," ",e.content.map((e,t)=>o.createElement("li",{key:t,className:"custom-step-item"}," ",s(e.text)))),"both"===e.type&&e.content&&o.createElement(n.Fragment,null,e.content.map((e,n)=>"paragraph"===e.type?o.createElement(t.CardText,{className:"custom-section-paragraph",key:n},o.createElement("p",null,s(e.text))):"step"===e.type?o.createElement("li",{key:n,className:"custom-step-item"}," ",s(e.text)):null)))),o.createElement("div",{className:"custom-continue-button-container"},o.createElement(t.Button,{className:"custom-continue-button",label:s("CONTINUE_LANDING"),variation:"primary",icon:"ArrowForward",isSuffix:!0,onClick:e=>{e.preventDefault(),p.push(m)}}))))},Un={heading:"SANDBOX_HEADING",url:"https://www.youtube.com/watch?v=0wcuD67MVt8",subsections:[{title:"SANDBOX_INTRODUCTION_TITLE",type:"paragraph",content:[{text:"SANDBOX_INTRODUCTION_TEXT"}]},{title:"SANDBOX_PRODUCTS_TITLE",type:"both",content:[{type:"paragraph",text:"SANDBOX_PRODUCTS_DESCRIPTION"},{type:"step",id:1,text:"SANDBOX_PRODUCTS_STEP_1"},{type:"step",id:2,text:"SANDBOX_PRODUCTS_STEP_2"},{type:"step",id:3,text:"SANDBOX_PRODUCTS_STEP_3"},{type:"step",id:4,text:"SANDBOX_PRODUCTS_STEP_4"}]},{title:"SANDBOX_USER_CAPABILITIES_TITLE",type:"both",content:[{type:"step",id:1,text:"SANDBOX_USER_CAPABILITIES_STEP_1"},{type:"step",id:2,text:"SANDBOX_USER_CAPABILITIES_STEP_2"},{type:"step",id:3,text:"SANDBOX_USER_CAPABILITIES_STEP_3"},{type:"step",id:4,text:"SANDBOX_USER_CAPABILITIES_STEP_4"},{type:"step",id:5,text:"SANDBOX_USER_CAPABILITIES_STEP_5"},{type:"step",id:6,text:"SANDBOX_USER_CAPABILITIES_STEP_6"},{type:"paragraph",text:"SANDBOX_CLICK_CONTINUE"}]}]},Bn=()=>o.createElement(kn,{config:Un}),Fn=[{texts:{header:"CORE_COMMON_SIGN_UP",submitButtonLabel:"CORE_COMMON_SIGN_UP_BUTTON"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,pattern:/^[A-Za-z]+( [A-Za-z]+)*$/},error:"ERR_ACCOUNT_NAME_REQUIRED"},infoMessage:"SANDBOX_SIGNUP_ACCOUNT_NAME_TOOLTIP"},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check"}}]}],jn=e=>{var l,r,i,s,c,u,d,m,p,v,f,g,E;let{config:y,t:h,isDisabled:_}=e;const{isLoading:S}=Digit.Hooks.useTenants(),{isLoading:b}=Digit.Hooks.useStore.getInitData(),[O,N]=n.useState(null),[C,I]=n.useState(!1),D=a.useHistory(),w=Digit.Hooks.useCustomAPIMutationHook({url:"/tenant-management/tenant/_create",params:{},body:{},config:{enable:!1}});let T=[{body:null==y?void 0:y.inputs}];const{mode:A}=Digit.Hooks.useQueryParams();return"admin"===A&&0==(null==T||null===(l=T[0])||void 0===l||null===(r=l.body)||void 0===r||null===(i=r[2])||void 0===i?void 0:i.disable)&&null==(null==T||null===(s=T[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(T[0].body[2].disable=!0,T[0].body[2].isMandatory=!1,T[0].body[2].populators.defaultValue=defaultValue),S||b?o.createElement(t.Loader,null):o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:function(e){try{return Promise.resolve(w.mutate({body:{tenant:{name:e.accountName,email:e.email}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,r,i,a,s,c;N({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&null!==(r=l[0])&&void 0!==r&&r.code?"SANDBOX_SIGNUP_"+(null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(s=a.Errors)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.code):"SANDBOX_SIGNUP_ERROR"})},onSuccess:function(e){try{var t,n,o;return D.push({pathname:`/${null===(t=window)||void 0===t?void 0:t.globalPath}/user/otp`,state:{email:null==e||null===(n=e.Tenants[0])||void 0===n?void 0:n.email,tenant:null==e||null===(o=e.Tenants[0])||void 0===o?void 0:o.code}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},isDisabled:_||C,noBoxShadow:!0,inline:!0,submitInForm:!0,config:T,label:null==y||null===(m=y.texts)||void 0===m?void 0:m.submitButtonLabel,secondaryActionLabel:null==y||null===(p=y.texts)||void 0===p?void 0:p.secondaryButtonLabel,onFormValueChange:(e,t,n)=>{const o=T[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});I(o)},heading:null==y||null===(v=y.texts)||void 0===v?void 0:v.header,className:"sandbox-signup-form",cardSubHeaderClassName:"signupCardSubHeaderClassName",cardClassName:"signupCardClassName sandbox-onboarding-wrapper",buttonClassName:"buttonClassName"},o.createElement(hn,{showTenant:!1})),O&&o.createElement(t.Toast,{type:"error",label:h(null==O?void 0:O.label),onClose:()=>{N(null)}}),o.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},o.createElement("img",{alt:"Powered by DIGIT",src:null===(f=window)||void 0===f||null===(g=f.globalConfigs)||void 0===g||null===(E=g.getConfig)||void 0===E?void 0:E.call(g,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};jn.propTypes={loginParams:En.any},jn.defaultProps={loginParams:null};const Hn=e=>{let{stateCode:t}=e;const{t:r}=l.useTranslation(),{path:i}=a.useRouteMatch(),[s,c]=n.useState(Fn),u=Digit.StoreData.getCurrentLanguage(),{data:d,isLoading:m}=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:u,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(t,"commonUiConfig",["SignUpConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.SignUpConfig}},retry:!1}));n.useEffect(()=>{c(0==m&&null!=d&&d.config?null==d?void 0:d.config:Fn)},[d,m]);const p=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=r(e.texts[n]);return{...e,texts:t}},[s]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+i,exact:!0},o.createElement(jn,{config:p[0],t:r})))},Gn=e=>{var r,i,c,u;let{isLogin:d=!1}=e;const{t:m}=l.useTranslation(),p=(a.useRouteMatch(),a.useHistory()),v=a.useLocation(),[f,g]=n.useState(null),[E,y]=n.useState(!1),[h,_]=n.useState(null),[S,b]=n.useState((null==v||null===(r=v.state)||void 0===r?void 0:r.data)||{}),[O,N]=n.useState(!1),{email:C,tenant:I}=v.state||{},{data:D}=Digit.Hooks.useCustomMDMS(I,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}}),w=null==D?void 0:D[0].url,T=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:C,tenant:I},populators:{required:!0}}]}],A=[{texts:{header:m("SANDBOX_OTP_VERIFICATION"),submitButtonLabel:"CORE_COMMON_SUBMIT"}}],R=()=>{g(null)};return n.useEffect(()=>{var e,t,n,o,l;if(!h)return;Digit.SessionStorage.set("citizen.userRequestObject",h);const r=null==h||null===(e=h.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==h||null===(n=h.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.length)>0&&(h.info.roles=r),Digit.UserService.setUser(h),((e,t)=>{var n;if(Digit.Utils.getMultiRootTenant())return;let o=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",o),localStorage.setItem("Employee.locale",o),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==h?void 0:h.info,null==h?void 0:h.access_token);let i=`/${null===(l=window)||void 0===l?void 0:l.globalPath}/user/setup`;const a=((e,t,n,o)=>{var l,r,i,a,s,c;const u="SUPERUSER"===(null==t||null===(l=t.info)||void 0===l||null===(r=l.roles)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.code),d=null===(a=window)||void 0===a?void 0:a.contextPath;switch(!0){case"/sandbox-ui/user/otp"===e&&u:return`/${d}/employee/user/landing`;case u&&(null==n||null===(s=n[0])||void 0===s||null===(c=s.rolesForLandingPage)||void 0===c?void 0:c.includes("SUPERUSER")):return`/${d}${o}`;default:return`/${d}/employee`}})(v.pathname,h,D,w);return d?void p.push(a):void p.push({pathname:i,state:{tenant:I}})},[h]),o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(s.FormComposerV2,{onSubmit:function(e){try{var t;const n={username:C,password:null==e||null===(t=e.OtpComponent)||void 0===t?void 0:t.otp,tenantId:I,userType:"EMPLOYEE"},o=te(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),_({info:t,...n})})},function(e){var t,n;g((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&m("ES_ERROR_USER_NOT_PERMITTED")||m("INVALID_LOGIN_CREDENTIALS")),setTimeout(R,5e3)});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,onFormValueChange:(e,t)=>{var n;const o=t.OtpComponent;6===(null==o||null===(n=o.otp)||void 0===n?void 0:n.length)?y(!0):y(!1)},isDisabled:!E,config:T,label:A[0].texts.submitButtonLabel,heading:A[0].texts.header,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper"},o.createElement(hn,{showTenant:!1})),f&&o.createElement(t.Toast,{type:"error",label:m(f),onClose:R}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(c=i.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))},Vn=()=>{var e,r,i,s,c,u;const{t:d}=l.useTranslation(),m=a.useLocation(),{tenant:p}=m.state||{},v=(a.useHistory(),n.useRef(null)),f=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(r=e.info)||void 0===r?void 0:r.roles,[g,E]=n.useState(!0),{data:y}=Digit.Hooks.useCustomMDMS(p,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}});n.useEffect(()=>{null!=y&&y[0].url&&E(!1)},[y]);const h=null==y?void 0:y[0].url;return o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.Card,{className:"card-sandbox"},o.createElement(hn,{showTenant:!1}),o.createElement("div",{className:"sandbox-success-signup"},o.createElement(t.SVG.TickMark,{fill:"#fff",height:30,width:70})),o.createElement(t.CardHeader,{className:"cardHeader-sandbox",styles:{color:"#00703c"}},d("SANDBOX_HEADER")),o.createElement(t.CardText,{className:"cardText-sandbox"},d("SAMDBOX_URL_SUB")),o.createElement(t.CardLabel,null," ",d("SANDBOX_URL")," "),o.createElement("div",{className:"sandbox-url-wrapper"},o.createElement(t.TextInput,{inputRef:v,className:"urlInputText",onChange:()=>{},nonEditable:!0,value:`${window.location.host}/${null===(i=window)||void 0===i?void 0:i.globalPath}/${p}/employee`}),o.createElement(t.Button,{className:"copyButton",variation:"secondary",onClick:()=>{navigator.clipboard.writeText(v.current.value)},label:d("COPY_URL")})),o.createElement("div",{className:"sandbox-url-footer"},d("SANDBOX_URL_FOOT")),o.createElement(t.Button,{isDisabled:g,onClick:()=>{var e,t;((e,t)=>{var n;return"SUPERUSER"===(null==e||null===(n=e[0])||void 0===n?void 0:n.code)&&t.some(e=>e.rolesForLandingPage.includes("SUPERUSER"))})(f,y)?window.location.href=`/${null===(e=window)||void 0===e?void 0:e.globalPath}/${p}${h}`:window.location.href=`/${null===(t=window)||void 0===t?void 0:t.globalPath}/${p}/employee`},label:d("SIGN_IN")})),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(s=window)||void 0===s||null===(c=s.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))},$n=[{type:"link",url:"https://www.youtube.com/watch?v=IBJDxxP3rDc"},{type:"text",heading:"ROLE_LANDING_ROLE_SECTION_ONE",paragraphs:["ROLE_LANDING_SELECT_ROLE_PARAGRAPH_1","ROLE_LANDING_SELECT_ROLE_PARAGRAPH_2"],steps:[{description:"ROLE_LANDING_STEP_1"},{description:"ROLE_LANDING_STEP_2"}]},{type:"text",heading:"ROLE_LANDING_ROLE_SECTION_TWO",paragraphs:["ROLE_LANDING_ANOTHER_ROLE_PARAGRAPH_1"],steps:[{description:"ROLE_LANDING_ANOTHER_ROLE_STEP_1"},{description:"ROLE_LANDING_ANOTHER_ROLE_STEP_2"},{description:"ROLE_LANDING_ANOTHER_ROLE_STEP_3"},{description:"ROLE_LANDING_ANOTHER_ROLE_STEP_4"}]},{type:"text",heading:"ROLE_LANDING_ROLE_SECTION_THREE",paragraphs:["ROLE_LANDING_THREE_PARAGRAPH_1"],steps:[{description:"ROLE_LANDING_THREE_ROLE_STEP_1"},{description:"ROLE_LANDING_THREE_ROLE_STEP_2"},{description:"ROLE_LANDING_THREE_ROLE_STEP_3"},{description:"ROLE_LANDING_THREE_ROLE_STEP_4"}]},{type:"card",icon:c.People,heading:"ROLE_LANDING_CITIZEN",description:"ROLE_LANDING_CITIZEN_DESCRIPTION",buttonName:"ROLE_LANDING_CITIZEN_BUTTON",action:"/citizen/login"},{type:"card",icon:c.People,heading:"ROLE_LANDING_GOV_ADMIN",description:"ROLE_LANDING_GOV_ADMIN_DESCRIPTION",buttonName:"ROLE_LANDING_GOV_ADMIN_BUTTON",action:"/employee"}],zn=()=>{const{t:e}=l.useTranslation();return a.useHistory(),o.createElement("div",{className:"role-landing-container"},o.createElement(t.Card,{className:"role-landing-card"},$n.filter(e=>"link"===e.type).map((n,l)=>o.createElement("div",{key:l,className:"header-video-section"},o.createElement(t.Header,{className:"role-header"},e("ROLE_BASED_LANDING_HEADER")),o.createElement(Mn,{link:n.url,overlay:!0,className:"role-video"}))),$n.filter(e=>"text"===e.type).map((n,l)=>o.createElement("div",{key:l,className:"config-section"},o.createElement(t.CardHeader,{className:"role-section-header"},e(n.heading)),n.paragraphs.map((n,l)=>o.createElement(t.CardText,{className:"role-paragraph",key:l},e(n))),o.createElement("ul",{className:"role-list"},n.steps.map((t,n)=>o.createElement("li",{key:n,className:"role-list-item"},e(t.description)," "))))),o.createElement("div",{className:"role-action-container"},$n.filter(e=>"card"===e.type).map((n,l)=>{const r=n.icon;return o.createElement("div",{key:l,className:"role-card"},o.createElement("div",{className:"icon-container"},r&&o.createElement(r,null)," "),o.createElement(t.CardHeader,{className:"role-section-header"},e(n.heading)),o.createElement(t.Button,{className:"role-button",label:e(n.buttonName),variation:"primary",onClick:()=>(e=>{const t="/"+window.contextPath+e;window.open(t,"_blank")})(n.action)}),o.createElement(t.CardText,{className:"role-paragraph"},e(n.description)))}))))},Wn=()=>o.createElement(zn,null),Xn=["user/landing","user/profile","user/error"],qn=e=>{var r,i,s,c,u,d;let{stateInfo:m,userDetails:p,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:_,logoUrlWhite:S,DSO:b,stateCode:O,modules:N,appTenants:C,initData:I}=e;const D=a.useHistory(),{t:w}=l.useTranslation(),{path:T}=a.useRouteMatch(),A=a.useLocation(),R=null==A||null===(r=A.pathname)||void 0===r?void 0:r.includes("language-selection"),L=Xn.some(e=>{var t;return null==A||null===(t=A.pathname)||void 0===t?void 0:t.includes(e)});n.useEffect(()=>{Digit.UserService.setType("employee")},[]);const P=null==I||null===(i=I.modules)||void 0===i||null===(s=i.filter(e=>null==e?void 0:e.additionalComponent))||void 0===s?void 0:s.map(e=>null==e?void 0:e.additionalComponent);return o.createElement("div",{className:"employee"},o.createElement(a.Switch,null,o.createElement(a.Route,{path:T+"/user"},L&&o.createElement($,{t:w,stateInfo:m,userDetails:p,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:_,logoUrlWhite:S,showSidebar:!!L,showLanguageChange:!R}),o.createElement("div",{className:L?"grounded-container":"loginContainer",style:L?{padding:0,paddingTop:"0",marginLeft:"0"}:{"--banner-url":`url(${null==m?void 0:m.bannerUrl})`,padding:"0px"}},o.createElement(a.Switch,null,o.createElement(a.Route,{exact:!0,path:T+"/user/login"},o.createElement(Pn,{stateCode:O})),o.createElement(a.Route,{exact:!0,path:T+"/user/login/otp"},o.createElement(Gn,{isLogin:!0})),o.createElement(a.Route,{path:T+"/user/forgot-password"},o.createElement(Cn,null)),o.createElement(a.Route,{path:T+"/user/change-password"},o.createElement(bn,null)),o.createElement(t.PrivateRoute,{path:T+"/user/profile"},o.createElement(oe,{stateCode:O,userType:"employee",cityDetails:E})),o.createElement(t.PrivateRoute,{path:T+"/user/landing/select-role"},o.createElement("div",{className:"employee-app-wrapper sandbox-landing-wrapper"},o.createElement(Wn,null))),o.createElement(t.PrivateRoute,{path:T+"/user/landing"},o.createElement("div",{className:"employee-app-wrapper sandbox-landing-wrapper"},o.createElement(Bn,null))),o.createElement(a.Route,{path:T+"/user/error"},o.createElement(v,{initData:I,goToHome:()=>{var e,t,n,o;D.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(o=n.getType)||void 0===o?void 0:o.call(n)}`)}})),o.createElement(a.Route,{path:T+"/user/language-selection"},o.createElement(Tn,null)),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:T+"/user/language-selection"}))))),o.createElement(a.Route,null,o.createElement($,{t:w,stateInfo:m,userDetails:p,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:_,logoUrlWhite:S,modules:N}),o.createElement("div",{className:`main ${b?"m-auto":""} digit-home-main`},o.createElement("div",{className:"employee-app-wrapper digit-home-app-wrapper"},o.createElement(g,{initData:I},o.createElement(Dn,{stateCode:O,userType:"employee",modules:N,appTenants:C,additionalComponent:P}))),o.createElement("div",{className:"employee-home-footer"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(c=window)||void 0===c||null===(u=c.globalConfigs)||void 0===u||null===(d=u.getConfig)||void 0===d?void 0:d.call(u,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:T+"/user/language-selection"}))))},Qn=e=>{const{state:n={}}=a.useLocation(),{t:r}=l.useTranslation(),i=a.useHistory(),s={imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoHeader:"WRONG_TENANT_SIGN_UP",infoMessage:"WRONG_TENANT_SIGN_UP_MESSAGE",buttonInfo:"WRONG_TENANT_SIGN_UP_BUTTON",action:()=>{i.push(`/${window.globalPath}/`)}};return o.createElement(yn,null,o.createElement(t.Card,{className:"digit-employee-card customError"},o.createElement(hn,{showTenant:!1}),o.createElement(t.CardHeader,{className:"center"},r(s.infoHeader)),o.createElement(t.CardText,{className:"center"},r(s.infoMessage)),o.createElement(t.Button,{className:"customErrorButton",label:r(null==s?void 0:s.buttonInfo),variation:"primary",isSuffix:!0,onClick:e=>{e.preventDefault(),null==s||s.action()}})))},Zn=()=>{const[e,t]=n.useState(0),r=a.useHistory(),i=a.useLocation(),{t:s}=l.useTranslation(),{tenant:u}=i.state||{},d=["SANDBOX_GUIDE_SETUP_ACCOUNT","SANDBOX_GUIDE_DEFAULT_MASTER_DATA","SANDBOX_GUIDE_CONFIGURING_COMPLAINTS","SANDBOX_GUIDE_CONFIGURING_EMPLOYEE_MANAGEMENT","SANDBOX_GUIDE_SETTING_UP_CITIZEN_PORTAL","SANDBOX_GUIDE_SETTING_UP_EMPLOYEE_PORTAL","SANDBOX_GUIDE_LOADING_CONFIGURATION_INTERFACE","SANDBOX_GUIDE_CREATING_DASHBOARD","SANDBOX_GUIDE_ALL_SETUP_DONE"];return n.useEffect(()=>{const n=setInterval(()=>{e<d.length&&t(e=>e+1)},2e3);if(e===d.length){clearInterval(n);const e=setTimeout(()=>{var e;r.push({pathname:`/${null===(e=window)||void 0===e?void 0:e.globalPath}/user/url`,state:{tenant:u}})},1e3);return()=>clearTimeout(e)}return()=>{clearInterval(n)}},[e]),o.createElement("div",{className:"sandbox-loader-screen"},o.createElement("div",{className:"sandbox-loader"}),o.createElement("ul",{className:"sandbox-installation-steps"},d.map((t,n)=>o.createElement("li",{key:n,className:"sandbox-step "+(n<e?"sandbox-visible":"")},o.createElement("span",{className:"sandbox-step-text"},s(t)),n<e&&o.createElement(c.CheckCircle,{fill:"#00703C"})))))},Yn=e=>{var t,l,r,i;let{stateCode:s,modules:c,appTenants:u,logoUrl:d,logoUrlWhite:m,initData:p,defaultLanding:v="citizen"}=e;const f=a.useHistory(),{pathname:g}=a.useLocation(),E=window.innerWidth,y=Digit.ULBService.getCurrentUlb(),h=Digit.UserService.getUser(),{data:_}=Digit.Hooks.useStore.getInitData(),{stateInfo:S}=_||{},b=Digit.UserService.hasAccess(["FSM_DSO"]);let O="CITIZEN"===(null==h||null===(t=h.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(O=!1),n.useEffect(()=>{var e,t,n;null!=g&&g.includes("application-details")||(null!=g&&g.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=g&&g.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=g&&g.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==g?void 0:g.toString())===`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee`&&(Digit.SessionStorage.del("SEARCH_APPLICATION_DETAIL"),Digit.SessionStorage.del("WS_EDIT_APPLICATION_DETAILS")),(null==g?void 0:g.toString())!==`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`&&(null==g?void 0:g.toString())!==`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee`||Digit.SessionStorage.del("WS_DISCONNECTION")},[g]),f.listen(()=>{var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});const N={stateInfo:S,userDetails:h,CITIZEN:O,cityDetails:y,mobileView:E<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:d,logoUrlWhite:m,DSO:b,stateCode:s,modules:c,appTenants:u,sourceUrl:window.location.origin+"/citizen",pathname:g,initData:p};return o.createElement(a.Switch,null,o.createElement(a.Route,{path:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee`},o.createElement(qn,N)),o.createElement(a.Route,{path:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen`},o.createElement(wt,N)),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/${v}`})))},Jn=e=>{var t,n,l,r,i,s,c,u,d,m;let{stateCode:p,modules:v,appTenants:f,logoUrl:g,logoUrlWhite:E,initData:y,defaultLanding:h="citizen"}=e;const{data:_}=Digit.Hooks.useStore.getInitData(),{stateInfo:S}=_||{},b=["user/profile","user/error"].some(e=>{var t,n;return null===(t=location)||void 0===t||null===(n=t.pathname)||void 0===n?void 0:n.includes(e)}),O=Digit.UserService.getUser();let N="CITIZEN"===(null==O||null===(t=O.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");const C=window.innerWidth<=640;return o.createElement("div",{className:b?"grounded-container":"loginContainer",style:b?{padding:0,paddingTop:N?"0":C&&!N?"3rem":"80px",marginLeft:N||C?"0":"40px"}:{"--banner-url":`url(${null==S?void 0:S.bannerUrl})`,padding:"0px"}},o.createElement(a.Switch,null,o.createElement(a.Route,{exact:!0,path:`/${null===(n=window)||void 0===n?void 0:n.globalPath}/user/invalid-url`},o.createElement(Qn,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(l=window)||void 0===l?void 0:l.globalPath}/user/sign-up`},o.createElement(Hn,{stateCode:p})),o.createElement(a.Route,{exact:!0,path:`/${null===(r=window)||void 0===r?void 0:r.globalPath}/user/otp`},o.createElement(Gn,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(i=window)||void 0===i?void 0:i.globalPath}/user/setup`},o.createElement(Zn,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(s=window)||void 0===s?void 0:s.globalPath}/user/url`},o.createElement(Vn,null)),(null===(c=window)||void 0===c?void 0:c.globalPath)!==(null===(u=window)||void 0===u?void 0:u.contextPath)&&o.createElement(a.Route,{path:"/"+(null===(d=window)||void 0===d?void 0:d.contextPath)},o.createElement(Yn,{stateCode:p,modules:v,appTenants:f,logoUrl:g,logoUrlWhite:E,initData:y,defaultLanding:h})),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:`/${null===(m=window)||void 0===m?void 0:m.globalPath}/user/sign-up`}))))},Kn=[d],eo=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):u.compose)(u.applyMiddleware(...Kn)),to=e=>{let{onSelect:r,...i}=e;const{t:a}=l.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,u]=n.useState(!1),[d,m]=n.useState(!1),{data:p}=Digit.Hooks.useCustomMDMS(s,"commonUiConfig",[{name:"PrivacyPolicy"}],{select:e=>{var t;return null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.PrivacyPolicy.find(e=>{var t;return e.module===(null==i||null===(t=i.props)||void 0===t?void 0:t.module)})}});return n.useEffect(()=>{r("check",c)},[c]),o.createElement(o.Fragment,null,o.createElement("div",{className:"digit-privacy-checkbox"},o.createElement(t.CheckBox,{label:a("ES_BY_CLICKING"),checked:c,onChange:e=>{u(e.target.checked)}}),o.createElement(t.Button,{label:a("ES_PRIVACY_POLICY"),variation:"link",size:"medium",onClick:()=>{m(!0)},style:{marginBottom:"1.18rem",paddingLeft:"0.2rem"}})),d&&o.createElement(t.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:a(null==p?void 0:p.header),onOverlayClick:()=>{m(!1)},footerChildren:[o.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:a("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{u(!1),m(!1)}}),o.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:a("DIGIT_I_ACCEPT"),className:"accept-class",onClick:()=>{u(!0),m(!1)}})],sortFooterChildren:!0,onClose:()=>{m(!1)}},o.createElement("div",null,o.createElement("div",{className:"privacy-table"},a("DIGIT_TABLE_OF_CONTENTS")),o.createElement("ul",null,null==p?void 0:p.contents.map((e,n)=>o.createElement("li",{key:n,style:{display:"flex",alignItems:"center"}},o.createElement("span",{style:{marginRight:"0.5rem"}},n+1,". "),o.createElement(t.Button,{label:a(e.header),variation:"link",size:"medium",onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})})(null==e?void 0:e.header)}}))))),null==p?void 0:p.contents.map((e,t)=>o.createElement("div",{key:t,id:null==e?void 0:e.header},o.createElement("div",{style:{fontWeight:"bold",paddingLeft:null!=e&&e.isSpaceRequired?"1rem":"0"}},a(e.header)),e.descriptions.map((e,t)=>o.createElement("div",{key:t,style:{paddingLeft:e.isSpaceRequired?"1rem":"0",marginBottom:"0.5rem"}},o.createElement("div",{style:{fontWeight:null!=e&&e.isBold?700:400,display:"flex",alignItems:"center"}},"points"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc"}},"•"),"step"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal"}},t+1,". "),a(e.text)),(null==e?void 0:e.subDescriptions)&&(null==e?void 0:e.subDescriptions.length)>0&&o.createElement("div",{className:"policy-subdescription"},e.subDescriptions.map((e,t)=>o.createElement("div",{key:t,className:"policy-subdescription-points"},"points"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc",paddingLeft:"1rem"}},"•"),"step"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal",paddingLeft:"1rem"}},t+1,". "),null===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",paddingLeft:"1rem"}}," "),a(e.text))))))))))},no=e=>{var n,r,s;let{stateCode:c,enabledModules:d,moduleReducers:m,defaultLanding:p}=e;const{isLoading:v,data:f={}}=Digit.Hooks.useInitStore(c,d);if(v)return o.createElement(t.Loader,{page:!0});const g=function(e,t){return void 0===t&&(t={}),u.createStore(((e,t)=>{return u.combineReducers({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return{...e,selectedLanguage:t.payload};default:return e}}),...t});var n})(e,t),eo)}(f,m(f))||{};return l.getI18n(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",to),o.createElement(i.Provider,{store:g},o.createElement(a.BrowserRouter,null,o.createElement(t.BodyContainer,null,Digit.Utils.getMultiRootTenant()?o.createElement(Jn,{initData:f,stateCode:c,modules:null==f?void 0:f.modules,appTenants:f.tenants,logoUrl:null==f||null===(n=f.stateInfo)||void 0===n?void 0:n.logoUrl,logoUrlWhite:null==f||null===(r=f.stateInfo)||void 0===r?void 0:r.logoUrlWhite,defaultLanding:p}):o.createElement(Yn,{initData:f,stateCode:c,modules:null==f?void 0:f.modules,appTenants:f.tenants,logoUrl:null==f||null===(s=f.stateInfo)||void 0===s?void 0:s.logoUrl,defaultLanding:p}))))},oo={SelectOtp:ce,ChangeCity:A,ChangeLanguage:R,PrivacyComponent:to,OtpComponent:e=>{var r,i;let{onSelect:c,...u}=e;const{t:d}=l.useTranslation(),[m,p]=(a.useLocation(),n.useState(null)),[v,f]=n.useState({}),[g,E]=n.useState(!0),[y,h]=n.useState(30),_=()=>{p(null)};se(()=>{h(y-1)},y>0?1e3:null),n.useEffect(()=>{c("OtpComponent",v)},[v]);const S={url:"/user-otp/v1/_send",params:{tenantId:null==u||null===(r=u.props)||void 0===r?void 0:r.code},body:{},config:{enable:!1}},b=Digit.Hooks.useCustomAPIMutationHook(S);return o.createElement(n.Fragment,null,o.createElement(t.CardLabel,{className:"sandbox-custom-otp-header"},d("CS_OTP_EMAIL")),o.createElement(t.CardLabel,{className:"sandbox-custom-otp-email"},null==u||null===(i=u.props)||void 0===i?void 0:i.email),o.createElement(t.CardLabel,{className:"sandbox-custom-otp-subheader"},d("SANDBOX_ENTER_OTP")),o.createElement(s.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{f({...v,otp:e})},value:null==v?void 0:v.otp}),y>0?o.createElement(t.CardText,{className:"sandbox-resend-otp"},`${d("CS_RESEND_ANOTHER_OTP")} ${y} ${d("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button sandbox-otp-input",onClick:function(){try{var e,t;return h(30),Promise.resolve(b.mutate({body:{otp:{userName:null==u||null===(e=u.props)||void 0===e?void 0:e.email,type:"login",tenantId:null==u||null===(t=u.props)||void 0===t?void 0:t.tenant,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,r,i,a,s;p({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&l[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i||null===(a=i.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(_,5e3)},onSuccess:function(e){try{return p({key:"info",label:d("OTP_RESNED_SUCCESFULL")}),setTimeout(_,5e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}},d("CS_RESEND_OTP")),!g&&o.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")),m&&o.createElement(t.Toast,{type:null==m?void 0:m.key,label:d(null==m?void 0:m.label),onClose:_}))}};exports.DigitUI=e=>{let{stateCode:t,registry:l,enabledModules:i,moduleReducers:a,defaultLanding:s}=e;const[c,u]=n.useState(Digit.Utils.getPrivacyObject()||{}),d=(Digit.UserService.getType(),new r.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retry:!1,retryDelay:e=>Infinity}}})),m=Digit.Contexts.ComponentProvider,p=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),o.createElement("div",null,o.createElement(g,null,o.createElement(r.QueryClientProvider,{client:d},o.createElement(m.Provider,{value:l},o.createElement(p.Provider,{value:{privacy:null==c?void 0:c[window.location.pathname],resetPrivacy:e=>{Digit.Utils.setPrivacyObject({}),u({})},getPrivacy:()=>{const e=Digit.Utils.getPrivacyObject();return u(e),e},updatePrivacyDescoped:e=>{const t=Digit.Utils.getAllPrivacyObject(),n={...t,[window.location.pathname]:e};Digit.Utils.setPrivacyObject({...n}),u((null==t?void 0:t[window.location.pathname])||{})},updatePrivacy:(e,t)=>{u(Digit.Utils.updatePrivacy(e,t)||{})}}},o.createElement(no,{stateCode:t,enabledModules:i,moduleReducers:a,defaultLanding:s}))))))},exports.initCoreComponents=()=>{Object.entries(oo).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|
|
1
|
+
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@egovernments/digit-ui-components"),n=require("react"),o=e(n),l=require("react-i18next"),r=require("react-query"),i=require("react-redux"),a=require("react-router-dom"),s=require("@egovernments/digit-ui-react-components"),c=require("@egovernments/digit-ui-svg-components"),u=require("redux"),d=e(require("redux-thunk"));const m={error:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoMessage:"CORE_SOMETHING_WENT_WRONG",buttonInfo:"ACTION_TEST_HOME"},maintenance:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/maintainence-image.png",infoMessage:"CORE_UNDER_MAINTENANCE",buttonInfo:"ACTION_TEST_HOME"},notfound:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/PageNotFound.png",infoMessage:"MODULE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},p={sandbox:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoMessage:"WRONG_TENANT_SIGN_UP",buttonInfo:"CREATE_TENANT_ERROR_BUTTON"}},v=e=>{var t;const{type:n="error"}=Digit.Hooks.useQueryParams(),r=null==e||null===(t=e.errorData)||void 0===t?void 0:t.module,{t:i}=l.useTranslation(),a=r?p[r]:m[n];return o.createElement("div",{className:"error-boundary"},o.createElement("div",{className:"error-container"},o.createElement("img",{src:a.imgUrl,alt:"error"}),o.createElement("h1",null,i(a.infoMessage)),o.createElement("button",{onClick:()=>{var t;r?null==e||null===(t=e.errorData)||void 0===t||t.action():e.goToHome()}},i(a.buttonInfo))))},f=()=>{var e,t;const n="employee"===Digit.UserService.getType()?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/error`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/error`;return window.location.href.includes("employee/user/error")||window.location.href.includes("citizen/error")||"development"===process.env.NODE_ENV||(window.location.href=n),o.createElement("span",null)};class g extends o.Component{constructor(e){super(e),this.state={error:null,errorStack:null,hasError:!1,module:null,action:null,info:null}}static getDerivedStateFromError(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack,module:null==e?void 0:e.module,action:null==e?void 0:e.action,info:null==e?void 0:e.info}}componentDidCatch(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})}render(){return this.state.hasError?o.createElement("div",{className:"error-boundary"},o.createElement(f,null),o.createElement(v,{initData:this.props.initData,errorData:this.state})):this.props.children}}function E(){return(E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(null,arguments)}const y=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web","sandbox-ui"],h=e=>{var r;const{isLoading:i,data:s}=Digit.Hooks.useAccessControl(),c=Digit.Utils.getMultiRootTenant(),{t:u}=l.useTranslation(),d=a.useHistory(),m=Digit.ULBService.getStateId();let p=null;const[v,f]=n.useState([{}]),{data:g}=Digit.Hooks.useCustomMDMS(m,"HomeScreenOrder",[{name:"CardsAndLinksOrder"}],{select:e=>{var t;return null==e||null===(t=e.HomeScreenOrder)||void 0===t?void 0:t.CardsAndLinksOrder}}),{data:h}=Digit.Hooks.useCustomMDMS(m,"SandBoxLanding",[{name:"AdditionalModuleLinks"}],{select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.AdditionalModuleLinks}});n.useEffect(()=>{f(g)},[g]);const _=(e,t)=>{if(!e||!t)return null;const n=null==h?void 0:h.find(t=>t.moduleName===e.module),o=null==n?void 0:n[t],l=null==e?void 0:e.links;return(null==l?void 0:l.find(e=>(null==e?void 0:e.displayName)===o))||null},S=e=>{var t;const n=null==h?void 0:h.find(t=>t.moduleName===e.module);return null==e||null===(t=e.links)||void 0===t?void 0:t.filter(e=>{const t=e.displayName;return"Configure_master"!==t&&t!==(null==n?void 0:n.howItWorksLink)&&t!==(null==n?void 0:n.userManualLink)})},b=null==s?void 0:s.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,t)=>{const n=t.parentModule;e[n]||(e[n]={module:n,kpis:[],icon:t.leftIcon?Digit.Utils.iconRender(t.leftIcon,"white"):"",label:Digit.Utils.locale.getTransformedLocale(n+"_CARD_HEADER"),links:[]});const o=function(e){var t,n;if(void 0===e&&(e=""),"/"!=e){if(-1===(null===(t=e)||void 0===t?void 0:t.indexOf("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)))){let t=null;return t=c?e=e.replace("/sandbox-ui/employee",`/sandbox-ui/${m}/employee`):null!=y&&y.every(t=>{var n;return-1===(null===(n=e)||void 0===n?void 0:n.indexOf("/"+t))})?"/employee/"+e:e,t}return e}}(t.navigationURL),l=o.indexOf("?");return e[n].links.push({link:o,icon:t.leftIcon,queryParams:-1===l?null:o.substring(l),label:u(Digit.Utils.locale.getTransformedLocale(`${n}_LINK_${t.displayName}`)),displayName:t.displayName}),e},{});if(i)return o.createElement(t.Loader,null);if(!b)return"";p=c?(e=>Object.keys(e).sort((e,t)=>{var n,o;return((null==v||null===(n=v.find(t=>"card"===t.moduleType&&t.name===e))||void 0===n?void 0:n.order)||null)-((null==v||null===(o=v.find(e=>"card"===e.moduleType&&e.name===t))||void 0===o?void 0:o.order)||null)}).reduce((t,n)=>{var o,l;const r=null==e||null===(o=e[n])||void 0===o||null===(l=o.links)||void 0===l?void 0:l.sort((e,t)=>{var o,l;const r=null==e?void 0:e.displayName,i=null==t?void 0:t.displayName;return((null==v||null===(o=v.find(e=>"link"===e.moduleType&&e.name===`${n}.${r.replace(/\s+/g,"_")}`))||void 0===o?void 0:o.order)||null)-((null==v||null===(l=v.find(e=>"link"===e.moduleType&&e.name===`${n}.${i.replace(/\s+/g,"_")}`))||void 0===l?void 0:l.order)||null)});return t[n]={...e[n],links:r},t},{}))(b):b;const O=null===(r=Object.keys(p))||void 0===r?void 0:r.map((e,n)=>{var l,r;const i=null===(l=p)||void 0===l?void 0:l[e],a=null==i||null===(r=i.links)||void 0===r?void 0:r.find(e=>"Configure_master"===(null==e?void 0:e.displayName)),s=_(i,"howItWorksLink"),c=_(i,"userManualLink"),m={icon:"SupervisorAccount",moduleName:u(null==i?void 0:i.label),metrics:[],links:Digit.Utils.getMultiRootTenant()?S(i):null==i?void 0:i.links,centreChildren:[o.createElement("div",null,u(Digit.Utils.locale.getTransformedLocale("MODULE_CARD_DESC_"+e))),s&&o.createElement(t.Button,{variation:"teritiary",label:null==s?void 0:s.label,icon:null==s?void 0:s.icon,type:"button",size:"medium",onClick:()=>window.open(null==s?void 0:s.link,"_blank"),style:{padding:"0px"}})],endChildren:Digit.Utils.getMultiRootTenant()?[a&&o.createElement(t.Button,{variation:"teritiary",label:null==a?void 0:a.label,icon:null==a?void 0:a.icon,type:"button",size:"medium",onClick:()=>null==d?void 0:d.push(null==a?void 0:a.link),style:{padding:"0px"}}),c&&o.createElement(t.Button,{variation:"teritiary",label:null==c?void 0:c.label,icon:null==c?void 0:c.icon,type:"button",size:"medium",onClick:()=>window.open(null==c?void 0:c.link,"_blank"),style:{padding:"0px"}})]:null};return o.createElement(t.LandingPageCard,E({buttonSize:"medium"},m))});return o.createElement(n.Fragment,null,o.createElement(t.LandingPageWrapper,null,o.Children.map(O,e=>o.cloneElement(e))))},_=e=>{const{question:r,isLabelLink:i,type:a,actions:u,content:d,lastIndex:m}=e,[p,v]=n.useState(!1),{t:f}=l.useTranslation(),g=Digit.ULBService.getStateId(),E="number"===a?"ol":"ul";return o.createElement("div",{className:"faqs border-none",onClick:()=>v(!p)},o.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},o.createElement("span",null,f(r)),o.createElement("span",{className:p?"faqicon rotate":"faqicon",style:{float:"right"}},o.createElement(c.ArrowForward,null))),o.createElement("div",{className:"faq-answer",style:p?{display:"block"}:{display:"none"}},o.createElement(s.CardSectionSubText,{style:{marginTop:"1rem"}},f(d)),o.createElement("div",{style:{marginTop:"1rem"}},u&&o.createElement(E,null,u.map((e,n)=>o.createElement("li",{key:n,style:{listStyleType:"ul"===E?"disc":"auto",margin:"8px 0"}},i?null!=e&&e.label?o.createElement(t.Button,{variation:"teritiary",label:f(null==e?void 0:e.label),type:"button",size:"medium",onClick:()=>{if(null!=e&&e.fulllink)window.open(null==e?void 0:e.link,"_blank");else{var t;const n=`https://${window.location.hostname}/${null===(t=window)||void 0===t?void 0:t.globalPath}/${g}`;window.open(`${n}/${null==e?void 0:e.link}`,"_blank")}},style:{padding:"0px"}}):null:null!=e&&e.label?o.createElement("strong",null,f(null==e?void 0:e.label),":"):null,f(null==e?void 0:e.description)))))),m?null:o.createElement("div",{className:"cs-box-border"}))},S=e=>{let{type:t,title:n,content:r,actions:i}=e;const{t:a}=l.useTranslation(),c="number"===t?"ol":"ul";return o.createElement("div",null,o.createElement(s.CardSectionHeader,null,a(n)),o.createElement(s.CardSectionSubText,{style:{marginTop:"1rem"}},a(r)),o.createElement("div",{style:{marginTop:"1rem"}},i&&o.createElement(c,null,i.map((e,t)=>o.createElement("li",{key:t,style:{listStyleType:"ul"===c?"disc":"auto",margin:"8px 0"}},null!=e&&e.label?o.createElement("strong",null,a(null==e?void 0:e.label),":"):null," ",a(null==e?void 0:e.description))))))},b=e=>{let{faqs:t,type:n}=e;return l.useTranslation(),o.createElement("div",{style:{width:"100%"}},o.createElement("div",{style:{width:"100%"}},t.map((e,l)=>o.createElement(_,{key:"faq_"+l,question:e.question,answer:e.answer,isLabelLink:e.isLabelLink,type:n,actions:e.answer,content:e.content,lastIndex:l===(null==t?void 0:t.length)-1}))))},O=e=>{let{cardConfig:n}=e;const{t:r}=l.useTranslation();return o.createElement(t.Card,{className:"sandbox-guide",style:{width:"25rem",height:"47rem",overflowY:"scroll"}},o.createElement(t.CardHeader,null,r("GUIDE_TO_SETUP")),o.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},n.map((e,t)=>"faqs"===(null==e?void 0:e.type)?o.createElement(b,{key:e.id,title:e.title,type:null==e?void 0:e.type,content:e.content,faqs:e.actions}):o.createElement(o.Fragment,null,o.createElement(S,{type:null==e?void 0:e.type,key:e.id,title:e.title,content:e.content,actions:e.actions,style:e.style}),t!==(null==n?void 0:n.length)-1&&o.createElement(s.BreakLine,{style:{width:"100%",border:"1px solid #d6d5d4"}})))))},N=e=>{const{t:t}=l.useTranslation(),{data:n}=Digit.Hooks.useAccessControl(),r=(Digit.Utils.getMultiRootTenant(),Digit.ULBService.getStateId());return(null==n?void 0:n.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,n)=>{const o=n.parentModule;e[o]||(e[o]={module:o,label:Digit.Utils.locale.getTransformedLocale(o+"_CARD_HEADER"),links:[]});const l=Digit.Utils.transformURL(n.navigationURL,r),i=l.indexOf("?");return e[o].links.push({link:-1===i?l:l.substring(0,i),label:t(Digit.Utils.locale.getTransformedLocale(`${o}_LINK_${n.displayName}`)),queryParams:-1===i?null:l.substring(i),description:t(Digit.Utils.locale.getTransformedLocale(`${o}_LINK_${n.displayName}_DESCRIPTION`))}),e},{}))?o.createElement(O,{cardConfig:[{id:1,type:"faqs",actions:[{question:"SANDBOX_FAQ_QUES_14",isLabelLink:!0,answer:[{label:"SANDBOX_FAQ_ANS_14_LABEL_1",fulllink:!0,link:"https://egov-digit.gitbook.io/digit-sandbox/specifications/user-manual/walkthrough-videos"}]},{question:"SANDBOX_FAQ_QUES_1",content:"SANDBOX_FAQ_CONTENT_1",isLabelLink:!0,answer:[{label:"SANDBOX_FAQ_ANS_1_LABEL_1",link:"citizen/login",description:"SANDBOX_FAQ_ANS_1_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_1_LABEL_2",link:"employee/user/login",description:"SANDBOX_FAQ_ANS_1_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_2",content:"SANDBOX_FAQ_CONTENT_2",answer:[{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_2_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_3",content:"SANDBOX_FAQ_CONTENT_3",answer:[{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_3_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_4",content:"SANDBOX_FAQ_CONTENT_4",answer:[{label:null,description:"SANDBOX_FAQ_ANS_4_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_4_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_5",content:"SANDBOX_FAQ_CONTENT_5",answer:[{label:"SANDBOX_FAQ_ANS_5_LABEL_1",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_5_LABEL_2",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_2"},{label:"SANDBOX_FAQ_ANS_5_LABEL_3",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_3"},{label:"SANDBOX_FAQ_ANS_5_LABEL_4",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_4"},{label:"SANDBOX_FAQ_ANS_5_LABEL_5",description:"SANDBOX_FAQ_ANS_5_DESCRIPTION_5"}]},{question:"SANDBOX_FAQ_QUES_6",content:"SANDBOX_FAQ_CONTENT_6"},{question:"SANDBOX_FAQ_QUES_7",content:"SANDBOX_FAQ_CONTENT_7",answer:[{label:null,description:"SANDBOX_FAQ_ANS_7_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_7_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_8",content:"SANDBOX_FAQ_CONTENT_8",answer:[{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_1"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_2"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_3"},{label:null,description:"SANDBOX_FAQ_ANS_8_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_9",content:"SANDBOX_FAQ_CONTENT_9",answer:[{label:"SANDBOX_FAQ_ANS_9_LABEL_1",description:"SANDBOX_FAQ_ANS_9_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_9_LABEL_2",description:"SANDBOX_FAQ_ANS_9_DESCRIPTION_2"}]},{question:"SANDBOX_FAQ_QUES_10",content:"SANDBOX_FAQ_CONTENT_10",answer:[{label:"SANDBOX_FAQ_ANS_10_LABEL_1",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_1"},{label:"SANDBOX_FAQ_ANS_10_LABEL_2",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_2"},{label:"SANDBOX_FAQ_ANS_10_LABEL_3",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_3"},{label:"SANDBOX_FAQ_ANS_10_LABEL_4",description:"SANDBOX_FAQ_ANS_10_DESCRIPTION_4"}]},{question:"SANDBOX_FAQ_QUES_11",content:"SANDBOX_FAQ_CONTENT_11"},{question:"SANDBOX_FAQ_QUES_12",content:"SANDBOX_FAQ_CONTENT_12"},{question:"SANDBOX_FAQ_QUES_13",content:"SANDBOX_FAQ_CONTENT_13"}]}]}):""},C=(e,t,n)=>{const o=null==e?void 0:e[""+t];o&&o.map(e=>{Digit.Utils.getMultiRootTenant()&&(e.navigationURL=e.navigationURL.replace("/sandbox-ui/citizen",`/sandbox-ui/${Digit.ULBService.getStateId()}/citizen`)),e.link=e.navigationURL,e.i18nKey=n(e.name)});const l={links:null==o?void 0:o.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:`CITIZEN_${t}_ICON`};var r;return"FSM"===t&&[{role:"FSM_DSO",from:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/fsm/dso-dashboard`,dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,o,r;let{role:i,from:a,loginLink:s,dashoardLink:c}=e;Digit.UserService.hasAccess(i)?null==l||null===(t=l.links)||void 0===t||t.push({link:a,i18nKey:n(c)}):null==l||null===(o=l.links)||void 0===o||o.push({link:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/login`,state:{role:"FSM_DSO",from:a},i18nKey:n(s)})}),l},I=e=>{let{modules:n,getCitizenMenu:r,fetchedCitizen:i,isLoading:a}=e;const c=[n.filter(e=>{let{code:t}=e;return"Payment"===t})[0],...n.filter(e=>{let{code:t}=e;return"Payment"!==t})],{t:u}=l.useTranslation();return a?o.createElement(s.Loader,null):o.createElement(o.Fragment,null,o.createElement("div",{className:"citizen-all-services-wrapper"},location.pathname.includes("sanitation-ui/citizen/all-services")||location.pathname.includes("sandbox-ui")&&location.pathname.includes("all-services")?null:o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement("div",{className:"citizenAllServiceGrid"},c.filter(e=>e).map((e,n)=>{var l,a;let c,{code:d}=e;var m,p,v,f;return i&&(c=i?C(r,d,u):void 0),(null===(l=c)||void 0===l||null===(a=l.links)||void 0===a?void 0:a.length)>0?o.createElement(s.CitizenHomeCard,{header:u(null===(m=c)||void 0===m?void 0:m.header),links:null===(p=c)||void 0===p||null===(v=p.links)||void 0===v||null===(f=v.filter(e=>null==e?void 0:e.link))||void 0===f?void 0:f.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)),Icon:()=>(e=>{switch(e){case"PT":return o.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"});case"WS":return o.createElement(t.CustomSVG.WSICon,{className:"fill-path-primary-main"});case"FSM":return o.createElement(t.CustomSVG.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return o.createElement(t.CustomSVG.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return o.createElement(t.CustomSVG.PGRIcon,{className:"fill-path-primary-main"});case"TL":return o.createElement(t.CustomSVG.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return o.createElement(t.CustomSVG.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return o.createElement(t.CustomSVG.BillsIcon,{className:"fill-path-primary-main"});default:return o.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"})}})(d),Info:"OBPS"===d?()=>o.createElement(s.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:u("CS_FILE_APPLICATION_INFO_LABEL"),text:u("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===d}):o.createElement(o.Fragment,null)}))))},D=e=>{let{modules:t,additionalComponent:l}=e;return o.createElement(n.Fragment,null,o.createElement("div",{className:"employee-app-container digit-home-employee-app"},o.createElement(LandingPageWrapper,null,null==t?void 0:t.map((e,t)=>{let{code:n}=e;const l=Digit.ComponentRegistryService.getComponent(n+"Card")||(()=>o.createElement(o.Fragment,null));return o.createElement(l,{key:t})}))),l&&(null==l?void 0:l.length)>0&&l.map(e=>{const t="string"==typeof e?Digit.ComponentRegistryService.getComponent(e):null;return t?o.createElement("div",{className:"additional-component-wrapper"},o.createElement(t,null)):null}))},w=e=>{let{userType:t,modules:n,getCitizenMenu:l,fetchedCitizen:r,isLoading:i,additionalComponent:a}=e;if("citizen"===t)return o.createElement(I,{modules:n,getCitizenMenu:l,fetchedCitizen:r,isLoading:i});const s=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return Digit.Utils.getRoleBasedHomeCard()?o.createElement("div",{className:s?"homeWrapper":""},o.createElement(h,{modules:n,additionalComponent:a}),s&&!window.Digit.Utils.browser.isMobile()?o.createElement(N,null):null):o.createElement(D,{modules:n,additionalComponent:a})},T=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(o=e)&&void 0!==o&&o.includes(t);){var o,l;e=null===(l=e)||void 0===l?void 0:l.replace(t,n)}return e},A=e=>{var l;const[r,i]=n.useState(null),[s,c]=n.useState([]),[u,d]=n.useState([]),m=a.useHistory();let p=[];return n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let o=[],l=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>o.push(e.tenantId));let r=o.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;l.push({label:"TENANT_TENANTS_"+(null===(t=T(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),p=null==l?void 0:l.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),c(l)},[r]),o.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},o.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:s,selected:s.find(e=>e.value===(null==r?void 0:r.value)),optionKey:"label",select:e=>{var t,n,o,l;const r=Digit.SessionStorage.get("citizen.userRequestObject"),a=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.filter(t=>t.tenantId===e.value);if((null==a?void 0:a.length)>0&&(r.info.roles=a,r.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(r),i(e),window.location.href.includes(`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee/`)){var s,c;const e=(null===(s=location.state)||void 0===s?void 0:s.from)||`/${null===(c=window)||void 0===c?void 0:c.contextPath}/employee`;m.replace(e)}window.location.reload()},freeze:!0,customSelector:o.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(l=T(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===l?void 0:l.toUpperCase())))}))},L=e=>{const r=e.dropdown||!1,{data:i,isLoading:a}=Digit.Hooks.useStore.getInitData(),{languages:s,stateInfo:c}=i||{},{t:u}=l.useTranslation(),d=Digit.StoreData.getCurrentLanguage(),[m,p]=n.useState(d),v=e=>{p(e.value),Digit.LocalizationService.changeLanguage(e.value,c.code)};return a?null:r?o.createElement("div",null,o.createElement(t.Dropdown,{className:"language-dropdown",option:s,selected:null==s?void 0:s.find(e=>(null==e?void 0:e.value)===d),optionKey:"label",select:v,freeze:!0,customSelector:o.createElement("label",{className:"cp"},u(null==s||null===(f=s.find(e=>(null==e?void 0:e.value)===m))||void 0===f?void 0:f.label))})):o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:"5px"}},"Language"),o.createElement("div",{className:"language-selector"},s.map((e,n)=>o.createElement("div",{className:"language-button-container",key:n},o.createElement(t.Button,{label:e.label,onClick:()=>v(e),variation:e.value===m?"primary":""})))));var f},R=e=>{var l,r,i,c,u,d,m,p;let{t:v,stateInfo:f,toggleSidebar:g,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:_,cityDetails:S,mobileView:b,userOptions:O,handleUserDropdownSelection:N,logoUrl:C,logoUrlWhite:I,showLanguageChange:D=!0}=e;const[w,T]=o.useState(null);o.useEffect(function(){try{var e;const t=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCurrentTenantId(),n=null==h||null===(e=h.info)||void 0===e?void 0:e.uuid,o=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t;const n=e.user[0],o=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");T(null==o?void 0:o.at(0))}})}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==w,null==h||null===(l=h.info)||void 0===l?void 0:l.uuid]);const R=Digit.ULBService.getCitizenCurrentTenant(!0);let P=a.useHistory();const{pathname:x}=a.useLocation(),{data:{unreadCount:M}={},isSuccess:k}=Digit.Hooks.useNotificationCount({tenantId:R,config:{enabled:"EMPLOYEE"!==(null===(U=Digit.UserService)||void 0===U||null===(B=U.getUser())||void 0===B||null===(F=B.info)||void 0===F?void 0:F.type)&&"CITIZEN"===(null===(j=Digit.UserService)||void 0===j||null===(H=j.getUser())||void 0===H||null===(G=H.info)||void 0===G?void 0:G.type)&&!!R}});var U,B,F,j,H,G;if(_)return o.createElement("div",null,o.createElement(s.TopBar,{img:null==f?void 0:f.logoUrlWhite,isMobile:!0,toggleSidebar:()=>{Digit.clikOusideFired?Digit.clikOusideFired=!1:g(!0)},logoUrl:null==f?void 0:f.logoUrlWhite,onLogout:y,userDetails:h,notificationCount:M<99?M:99,notificationCountLoaded:k,cityOfCitizenShownBesideLogo:v(R),onNotificationIconClick:function(){var e;P.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/engagement/notifications`)},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:(e=>{var t,n,o,l;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&[`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/select-language`,`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen/select-location`].includes(e)})(x),changeLanguage:b?null:o.createElement(L,{dropdown:!0})}));const V=!(null==h||!h.access_token),$=null===(r=Digit.ComponentRegistryService)||void 0===r?void 0:r.getComponent("CustomEmployeeTopBar");return $?o.createElement($,{t:v,stateInfo:f,toggleSidebar:g,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:_,cityDetails:S,mobileView:b,userOptions:O,handleUserDropdownSelection:N,logoUrl:C,showLanguageChange:D,loggedin:V}):o.createElement(t.TopBar,{actionFields:[o.createElement(A,{dropdown:!0,t:v}),D&&o.createElement(L,{dropdown:!0}),(null==h?void 0:h.access_token)&&o.createElement(t.Dropdown,{option:O,optionKey:"name",profilePic:w||(null==h||null===(i=h.info)||void 0===i?void 0:i.name)||(null==h||null===(c=h.info)||void 0===c||null===(u=c.userInfo)||void 0===u?void 0:u.name)||"Employee",select:N,showArrow:!0,menuStyles:{marginTop:"1rem"},theme:"light"})],onHamburgerClick:()=>{g()},className:"",img:C,logoWidth:"48px",logoHeight:"48px",logo:V?null==S?void 0:S.logoId:null==f?void 0:f.statelogo,onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:"light",ulb:V?null!=S&&null!==(d=S.city)&&void 0!==d&&d.ulbGrade?o.createElement(n.Fragment,null,v(null==S?void 0:S.i18nKey).toUpperCase()," ",v("ULBGRADE_"+(null==S||null===(m=S.city)||void 0===m?void 0:m.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):o.createElement("img",{className:"state",src:I,alt:"State Logo"}):o.createElement(n.Fragment,null,v(`MYCITY_${null==f||null===(p=f.code)||void 0===p?void 0:p.toUpperCase()}_LABEL`)," ",v("MYCITY_STATECODE_LABEL"))})},P=(e,t,n,l)=>[{type:"component",element:"LANGUAGE",action:o.createElement(L,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:o.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:n}}],x=e=>{let{onSelect:n,onCancel:r,onDismiss:i,PopupStyles:a,isDisabled:s,hideSubmit:c}=e;const{t:u}=l.useTranslation(),d=[o.createElement("div",null,o.createElement(t.CardText,null,u("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",o.createElement("strong",null,u("CORE_LOGOUT_MESSAGE"))))],m=[o.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r}),o.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:u("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:n,isDisabled:s})],p=[o.createElement(t.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r})];return o.createElement(t.PopUp,{type:"default",children:d,heading:u("CORE_LOGOUT_WEB_HEADER"),footerChildren:c?p:m,sortFooterButtons:!0,onClose:i,className:"digit-logout-popup-wrapper",onOverlayClick:i,equalWidthButtons:!0,style:a})},M=e=>{let{info:t,t:n}=e;return o.createElement("div",{className:"profile-section"},o.createElement("div",{className:"imageloader imageloader-loaded"},o.createElement("img",{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC"})),o.createElement("div",{id:"profile-name",className:"label-container name-Profile"},o.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),o.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},o.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&o.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},o.createElement("div",{className:"label-text"}," ",t.emailId," ")),o.createElement("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&o.createElement(A,{t:n,mobileView:!0}))},k={CommonPTIcon:o.createElement(s.PTIcon,{className:"icon"}),OBPSIcon:o.createElement(s.OBPSIcon,{className:"icon"}),propertyIcon:o.createElement(s.PropertyHouse,{className:"icon"}),TLIcon:o.createElement(s.CaseIcon,{className:"icon"}),PGRIcon:o.createElement(s.PGRIcon,{className:"icon"}),FSMIcon:o.createElement(s.FSMIcon,{className:"icon"}),WSIcon:o.createElement(s.WSICon,{className:"icon"}),MCollectIcon:o.createElement(s.MCollectIcon,{className:"icon"}),BillsIcon:o.createElement(s.CollectionIcon,{className:"icon"}),BirthIcon:o.createElement(s.BirthIcon,{className:"icon"}),DeathIcon:o.createElement(s.DeathIcon,{className:"icon"}),FirenocIcon:o.createElement(s.FirenocIcon,{className:"icon"}),HomeIcon:o.createElement(s.HomeIcon,{className:"icon"}),EditPencilIcon:o.createElement(s.EditPencilIcon,{className:"icon"}),LogoutIcon:o.createElement(s.LogoutIcon,{className:"icon"}),Phone:o.createElement(s.Phone,{className:"icon"})},U=e=>{var t,r,i,c;let{linkData:u,islinkDataLoading:d}=e;const{t:m}=l.useTranslation(),p=a.useHistory(),v=a.useLocation(),{pathname:f}=v,{data:g,isFetched:y}=Digit.Hooks.useStore.getInitData(),{stateInfo:h}=g||{},_=Digit.UserService.getUser();let S=window.Digit.Utils.browser.isMobile();const[b,O]=n.useState(!1),[N,C]=n.useState(!1),[I,D]=n.useState(!1),w=()=>{D(!1)};if(d)return o.createElement(s.Loader,null);let T=[...P(m,0,()=>{var e;p.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`)})];T=T.filter(e=>"LANGUAGE"!==e.element),Digit.ULBService.getCurrentTenantId();const A=e=>{var t,n;let{item:l}=e;const r=(null==l?void 0:l.icon)||(null===(t=l.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),i=r?k[r]:k.BillsIcon;let s;s="component"===l.type?l.action:l.text;const c=()=>o.createElement("span",E({className:"menu-item"},l.populators),i,o.createElement("div",{className:"menu-label"},s));return"external-link"===l.type?o.createElement("a",{href:l.link},o.createElement(c,null)):"link"===l.type?o.createElement(a.Link,{to:null==l?void 0:l.link},o.createElement(c,null)):o.createElement(c,null)};let L;var R,U,B,F,j;return y&&_&&_.access_token&&"CITIZEN"===(null==_||null===(t=_.info)||void 0===t?void 0:t.type)&&(L=o.createElement(M,{info:null==_?void 0:_.info,stateName:null==h?void 0:h.name,t:m}),T=T.filter(e=>"login-btn"!==(null==e?void 0:e.id)),T=[...T,{type:"link",icon:"HomeIcon",element:"HOME",text:m("COMMON_BOTTOM_NAVIGATION_HOME"),link:b?`/${null===(R=window)||void 0===R?void 0:R.contextPath}/employee`:`/${null===(U=window)||void 0===U?void 0:U.contextPath}/citizen`,populators:{onClick:()=>{var e;p.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/all-services`)}}},{text:m("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:()=>{var e;p.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`)}}},{text:m("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{C(!1),D(!0)}}},{text:o.createElement(o.Fragment,null,m("CS_COMMON_HELPLINE"),o.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==g||null===(B=g.tenants)||void 0===B?void 0:B.map(e=>{}),o.createElement("div",{className:"link"},o.createElement("a",{href:"tel:"+(null==g||null===(F=g.tenants)||void 0===F?void 0:F[0].contactNumber)},null==g||null===(j=g.tenants)||void 0===j?void 0:j[0].contactNumber)))),element:"Helpline",icon:"Phone"}]),null===(r=Object.keys(u))||void 0===r||null===(i=r.sort((e,t)=>t.localeCompare(e)))||void 0===i||i.map(e=>{var t,n,o,l,r,i;(null===(t=u[e][0])||void 0===t?void 0:t.sidebar)===window.contextPath+"-links"&&T.splice(1,0,{type:null!==(n=u[e][0])&&void 0!==n&&null!==(o=n.sidebarURL)&&void 0!==o&&o.includes(null===(l=window)||void 0===l?void 0:l.contextPath)?"link":"external-link",text:m("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:u[e],icon:null===(r=u[e][0])||void 0===r?void 0:r.leftIcon,link:null===(i=u[e][0])||void 0===i?void 0:i.sidebarURL})}),o.createElement(o.Fragment,null,o.createElement("div",null,o.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),o.createElement("div",{style:{display:"flex",flexDirection:"column",height:S?"calc(100vh - 56px)":"auto",zIndex:"99"}},L,o.createElement("div",{className:"drawer-desktop"},null===(c=T)||void 0===c?void 0:c.map((e,t)=>o.createElement("div",{className:"sidebar-list "+(f===(null==e?void 0:e.link)||f===(null==e?void 0:e.sidebarURL)?"active":""),key:t},o.createElement(A,{item:e}))))),o.createElement("div",null,I&&o.createElement(x,{onSelect:()=>{var e;Digit.Utils.getMultiRootTenant()?(Digit.UserService.logout(),D(!1),window.location.href=`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`):(Digit.UserService.logout(),D(!1))},onCancel:w,onDismiss:w}))))},B=e=>{var r,i,c,u;let{isMobile:d=!1,toggleSidebar:m,onLogout:p,isEmployee:v=!1,linkData:f,islinkDataLoading:g,userProfile:E}=e;Digit.Utils.getMultiRootTenant();const{data:y,isFetched:h}=Digit.Hooks.useStore.getInitData(),_=Digit.StoreData.getCurrentLanguage(),[S,b]=n.useState(null),{languages:O,stateInfo:N}=y||{},C=Digit.UserService.getUser(),[I,D]=n.useState(""),[w,T]=n.useState(null),[A,L]=n.useState([]),[R,P]=n.useState([]),[x,M]=n.useState(_);let k=[];const{isLoading:B,data:F}=Digit.Hooks.useAccessControl(),j=Digit.ULBService.getCurrentTenantId(),{t:H}=l.useTranslation(),G=a.useHistory(),V=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(o=e)&&void 0!==o&&o.includes(t);){var o,l;e=null===(l=e)||void 0===l?void 0:l.replace(t,n)}return e};n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let o=[],l=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>o.push(e.tenantId));let r=o.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;l.push({label:H("TENANT_TENANTS_"+(null===(t=V(e,".","_"))||void 0===t?void 0:t.toUpperCase())),value:e})}),k=null==l?void 0:l.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),L(l)},[w]);const $=()=>{Digit.clikOusideFired=!0,m(!1)};n.useEffect(()=>{S||function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==C||null===(e=C.info)||void 0===e?void 0:e.uuid,o=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){var t;if(e&&e.user&&null!=e&&null!==(t=e.user)&&void 0!==t&&t.length){var n;const t=e.user[0],o=null==t||null===(n=t.photo)||void 0===n?void 0:n.split(",");b(null==o?void 0:o.at(0))}})}();Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[S]);const z=e=>{let t=null;var n,o;Digit.Utils.getMultiRootTenant()?(t=v?e.replace("/sandbox-ui/employee",`/sandbox-ui/${j}/employee`):e.replace("/sandbox-ui/citizen",`/sandbox-ui/${j}/citizen`),G.push(t),m()):(G.push("/"===e[0]?`/${null===(n=window)||void 0===n?void 0:n.contextPath}/${v?"employee":"citizen"}${e}`:`/${null===(o=window)||void 0===o?void 0:o.contextPath}/${v?"employee":"citizen"}/${e}`),m())};if(g||B)return o.createElement(t.Loader,null);let W=[{id:"login-btn",element:"LOGIN",text:H("CORE_COMMON_LOGIN"),icon:o.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:()=>{var e,t;G.push(v?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/language-selection`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/login`),$()}}}];h&&C&&C.access_token&&(W=W.filter(e=>"login-btn"!==(null==e?void 0:e.id)));let X={};if(v){var q;null==F||F.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==I&&""!==e.path){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),X[t]?X[t].push(e):X[t]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(I.toLowerCase())){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),X[t]?X[t].push(e):X[t]=[e]}});const e=Object.keys(X);for(let t=0;t<(null==e?void 0:e.length);t++){var Q,Z,Y,J,K;const n=null===(Q=X[e[t]][0])||void 0===Q||null===(Z=Q.displayName)||void 0===Z||null===(Y=Z.toUpperCase())||void 0===Y?void 0:Y.replace(/[ -]/g,"_"),o=null===(J=e[t])||void 0===J||null===(K=J.toUpperCase())||void 0===K?void 0:K.replace(/[ -]/g,"_");var ee,te,ne,oe;-1===X[e[t]][0].path.indexOf(".")?W.splice(1,0,{type:"link",text:H("ACTION_TEST_"+n),link:null===(ee=X[e[t]][0])||void 0===ee?void 0:ee.navigationURL,icon:null===(te=X[e[t]][0])||void 0===te?void 0:te.leftIcon,populators:{onClick:()=>{var n;G.push(null===(n=X[e[t]][0])||void 0===n?void 0:n.navigationURL),$()}}}):W.splice(1,0,{type:"dynamic",moduleName:H("ACTION_TEST_"+o),links:null===(ne=X[e[t]])||void 0===ne?void 0:ne.map(e=>{var t,n;return{...e,displayName:H("ACTION_TEST_"+(null==e||null===(t=e.displayName)||void 0===t||null===(n=t.toUpperCase())||void 0===n?void 0:n.replace(/[ -]/g,"_")))}}),icon:null===(oe=X[e[t]][1])||void 0===oe?void 0:oe.leftIcon})}const t=W.findIndex(e=>"HOME"===e.element),n=W.splice(t,1),o=W.findIndex(e=>"LANGUAGE"===e.element),l=W.splice(o,(null===(q=W)||void 0===q?void 0:q.length)-o);W.sort((e,t)=>("dynamic"===(null==e?void 0:e.type)?null==e?void 0:e.moduleName:null==e?void 0:e.text).localeCompare("dynamic"===(null==t?void 0:t.type)?null==t?void 0:t.moduleName:null==t?void 0:t.text)),(null==n?void 0:n[0])&&W.splice(0,0,n[0]),W=(null==l?void 0:l.length)>0?W.concat(l):W}else{var le,re;null===(le=Object.keys(f))||void 0===le||null===(re=le.sort((e,t)=>t.localeCompare(e)))||void 0===re||re.map(e=>{var t,n,o,l,r,i;"digit-ui-links"===(null===(t=f[e][0])||void 0===t?void 0:t.sidebar)&&W.splice(1,0,{type:null!==(n=f[e][0])&&void 0!==n&&null!==(o=n.sidebarURL)&&void 0!==o&&o.includes(null===(l=window)||void 0===l?void 0:l.contextPath)?"link":"external-link",text:H("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:f[e],icon:null===(r=f[e][0])||void 0===r?void 0:r.leftIcon,link:null===(i=f[e][0])||void 0===i?void 0:i.sidebarURL})})}G.location.pathname.includes("/openlink")&&(W=W.filter(e=>"LANGUAGE"===e.element)),W=null===(r=W)||void 0===r?void 0:r.map(e=>({...e,label:(null==e?void 0:e.text)||(null==e?void 0:e.moduleName)||"",icon:null!=e&&e.icon?null==e?void 0:e.icon:void 0}));let ie="";var ae;ie=Digit.Utils.getMultiRootTenant()?H("TENANT_TENANTS_"+j):H("TENANT_TENANTS_"+(null===(ae=V(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===ae?void 0:ae.toUpperCase()));const se=null===(i=W)||void 0===i?void 0:i.map(e=>{var t;return"dynamic"===(null==e?void 0:e.type)?{...e,children:null==e||null===(t=e.links)||void 0===t?void 0:t.map(e=>({...e,label:null==e?void 0:e.displayName,icon:null==e?void 0:e.leftIcon}))}:e}),ce=null==A?void 0:A.map(e=>({...e,type:"custom",key:"city"})),ue=null==O?void 0:O.map(e=>({...e,type:"custom",key:"language",icon:"Language"})),de=[{label:"HOME",value:"HOME",icon:"Home",type:"custom",key:"home"},{label:ie,value:ie,children:(null==ce?void 0:ce.length)>0?ce:void 0,type:"custom",icon:"LocationCity",key:"city"},{label:H("Language"),children:(null==ue?void 0:ue.length)>0?ue:void 0,type:"custom",icon:"Language",key:"language"},{label:H("EDIT_PROFILE"),type:"custom",icon:"Edit",key:"editProfile"},{label:H("Modules"),icon:"DriveFileMove",children:se}];return d?o.createElement(t.MobileSidebar,{items:de,profileName:null==C||null===(c=C.info)||void 0===c?void 0:c.name,profileNumber:null==C||null===(u=C.info)||void 0===u?void 0:u.mobileNumber,theme:"dark",transitionDuration:.3,styles:{marginTop:"64px",height:"93%"},onLogout:p,hideUserManuals:!0,profile:S||void 0,isSearchable:!0,onSelect:e=>{let{item:t,index:n,parentIndex:o}=e;return(e=>{let{item:t}=e;if(null!=t&&t.navigationURL)z(null==t?void 0:t.navigationURL);else if(null!=t&&t.link)z(null==t?void 0:t.link);else{if("custom"!==(null==t?void 0:t.type))return;switch(null==t?void 0:t.key){case"home":G.push(v?`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen`),m();break;case"editProfile":E(),m();break;case"language":M((n=t).value),Digit.LocalizationService.changeLanguage(n.value,N.code),m();break;case"city":(e=>{var t,n,o,l;const r=Digit.SessionStorage.get("citizen.userRequestObject"),i=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.filter(t=>t.tenantId===e.value);if((null==i?void 0:i.length)>0&&(r.info.roles=i,r.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(r),T(e),window.location.href.includes(`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee/`)){var a,s;const e=(null===(a=location.state)||void 0===a?void 0:a.from)||`/${null===(s=window)||void 0===s?void 0:s.contextPath}/employee`;G.replace(e)}window.location.reload()})(t),m()}}var n,o,l})({item:t,index:n,parentIndex:o})}}):o.createElement(U,{logout:p})};function F(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var j=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(F(function(e,t){var n;n=e=>(()=>{var t={"./node_modules/css-mediaquery/index.js":(e,t)=>{t.match=function(e,t){return a(e).some(function(e){var n=e.inverse,o="all"===e.type||t.type===e.type;if(o&&n||!o&&!n)return!1;var l=e.expressions.every(function(e){var n=e.feature,o=e.modifier,l=e.value,r=t[n];if(!r)return!1;switch(n){case"orientation":case"scan":return r.toLowerCase()===l.toLowerCase();case"width":case"height":case"device-width":case"device-height":l=u(l),r=u(r);break;case"resolution":l=c(l),r=c(r);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":l=s(l),r=s(r);break;case"grid":case"color":case"color-index":case"monochrome":l=parseInt(l,10)||1,r=parseInt(r,10)||0}switch(o){case"min":return r>=l;case"max":return r<=l;default:return r===l}});return l&&!n||!l&&n})},t.parse=a;var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,o=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,l=/^(?:(min|max)-)?(.+)/,r=/(em|rem|px|cm|mm|in|pt|pc)?$/,i=/(dpi|dpcm|dppx)?$/;function a(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(n),r=t[1],i=t[2],a=t[3]||"",s={};return s.inverse=!!r&&"not"===r.toLowerCase(),s.type=i?i.toLowerCase():"all",a=a.match(/\([^\)]+\)/g)||[],s.expressions=a.map(function(e){var t=e.match(o),n=t[1].toLowerCase().match(l);return{modifier:n[1],feature:n[2],value:t[2]}}),s})}function s(e){var t,n=Number(e);return n||(n=(t=e.match(/^(\d+)\s*\/\s*(\d+)$/))[1]/t[2]),n}function c(e){var t=parseFloat(e);switch(String(e).match(i)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function u(e){var t=parseFloat(e);switch(String(e).match(r)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}},"./node_modules/hyphenate-style-name/index.js":(e,t,n)=>{n.r(t),n.d(t,{default:()=>a});var o=/[A-Z]/g,l=/^ms-/,r={};function i(e){return"-"+e.toLowerCase()}const a=function(e){if(r.hasOwnProperty(e))return r[e];var t=e.replace(o,i);return r[e]=l.test(t)?"-"+t:t}},"./node_modules/matchmediaquery/index.js":(e,t,n)=>{var o=n("./node_modules/css-mediaquery/index.js").match,l="undefined"!=typeof window?window.matchMedia:null;function r(e,t,n){var r=this;if(l&&!n){var i=l.call(window,e);this.matches=i.matches,this.media=i.media,i.addListener(a)}else this.matches=o(e,t),this.media=e;function a(e){r.matches=e.matches,r.media=e.media}this.addListener=function(e){i&&i.addListener(e)},this.removeListener=function(e){i&&i.removeListener(e)},this.dispose=function(){i&&i.removeListener(a)}}e.exports=function(e,t,n){return new r(e,t,n)}},"./node_modules/object-assign/index.js":e=>{var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function l(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var i,a,s=l(e),c=1;c<arguments.length;c++){for(var u in i=Object(arguments[c]))n.call(i,u)&&(s[u]=i[u]);if(t){a=t(i);for(var d=0;d<a.length;d++)o.call(i,a[d])&&(s[a[d]]=i[a[d]])}}return s}},"./node_modules/prop-types/checkPropTypes.js":(e,t,n)=>{var o,l=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),r={},i=n("./node_modules/prop-types/lib/has.js");function a(e,t,n,a,s){for(var c in e)if(i(e,c)){var u;try{if("function"!=typeof e[c]){var d=Error((a||"React class")+": "+n+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=e[c](t,c,a,n,null,l)}catch(e){u=e}if(!u||u instanceof Error||o((a||"React class")+": type specification of "+n+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in r)){r[u.message]=!0;var m=s?s():"";o("Failed "+n+" type: "+u.message+(null!=m?m:""))}}}o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},a.resetWarningCache=function(){r={}},e.exports=a},"./node_modules/prop-types/factoryWithTypeCheckers.js":(e,t,n)=>{var o,l=n("./node_modules/react-is/index.js"),r=n("./node_modules/object-assign/index.js"),i=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),a=n("./node_modules/prop-types/lib/has.js"),s=n("./node_modules/prop-types/checkPropTypes.js");function c(){return null}o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,u={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:p(c),arrayOf:function(e){return p(function(t,n,o,l,r){if("function"!=typeof e)return new m("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new m("Invalid "+l+" `"+r+"` of type `"+E(a)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<a.length;s++){var c=e(a,s,o,l,r+"["+s+"]",i);if(c instanceof Error)return c}return null})},element:p(function(t,n,o,l,r){var i=t[n];return e(i)?null:new m("Invalid "+l+" `"+r+"` of type `"+E(i)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:p(function(e,t,n,o,r){var i=e[t];return l.isValidElementType(i)?null:new m("Invalid "+o+" `"+r+"` of type `"+E(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return p(function(t,n,o,l,r){var i;return t[n]instanceof e?null:new m("Invalid "+l+" `"+r+"` of type `"+((i=t[n]).constructor&&i.constructor.name?i.constructor.name:"<<anonymous>>")+"` supplied to `"+o+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:p(function(e,t,n,o,l){return g(e[t])?null:new m("Invalid "+o+" `"+l+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return p(function(t,n,o,l,r){if("function"!=typeof e)return new m("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var s=t[n],c=E(s);if("object"!==c)return new m("Invalid "+l+" `"+r+"` of type `"+c+"` supplied to `"+o+"`, expected an object.");for(var u in s)if(a(s,u)){var d=e(s,u,o,l,r+"."+u,i);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return o(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),c;function t(t,n,o,l,r){for(var i=t[n],a=0;a<e.length;a++)if(d(i,e[a]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===y(t)?String(t):t});return new m("Invalid "+l+" `"+r+"` of value `"+String(i)+"` supplied to `"+o+"`, expected one of "+s+".")}return p(t)},oneOfType:function(e){if(!Array.isArray(e))return o("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+h(n)+" at index "+t+"."),c}return p(function(t,n,o,l,r){for(var s=[],c=0;c<e.length;c++){var u=(0,e[c])(t,n,o,l,r,i);if(null==u)return null;u.data&&a(u.data,"expectedType")&&s.push(u.data.expectedType)}return new m("Invalid "+l+" `"+r+"` supplied to `"+o+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")})},shape:function(e){return p(function(t,n,o,l,r){var a=t[n],s=E(a);if("object"!==s)return new m("Invalid "+l+" `"+r+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return f(o,l,r,c,y(u));var d=u(a,c,o,l,r+"."+c,i);if(d)return d}return null})},exact:function(e){return p(function(t,n,o,l,s){var c=t[n],u=E(c);if("object"!==u)return new m("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");var d=r({},t[n],e);for(var p in d){var v=e[p];if(a(e,p)&&"function"!=typeof v)return f(o,l,s,p,y(v));if(!v)return new m("Invalid "+l+" `"+s+"` key `"+p+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=v(c,p,o,l,s+"."+p,i);if(g)return g}return null})}};function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function m(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){var n={},l=0;function r(r,a,s,c,u,d,p){if(c=c||"<<anonymous>>",d=d||s,p!==i){if(t){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("undefined"!=typeof console){var f=c+":"+s;!n[f]&&l<3&&(o("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[f]=!0,l++)}}return null==a[s]?r?new m(null===a[s]?"The "+u+" `"+d+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+u+" `"+d+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(a,s,c,u,d)}var a=r.bind(null,!1);return a.isRequired=r.bind(null,!0),a}function v(e){return p(function(t,n,o,l,r,i){var a=t[n];return E(a)!==e?new m("Invalid "+l+" `"+r+"` of type `"+y(a)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function f(e,t,n,o,l){return new m((e||"React class")+": "+t+" type `"+n+"."+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+l+"`.")}function g(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(g);if(null===t||e(t))return!0;var o=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!o)return!1;var l,r=o.call(t);if(o!==t.entries){for(;!(l=r.next()).done;)if(!g(l.value))return!1}else for(;!(l=r.next()).done;){var i=l.value;if(i&&!g(i[1]))return!1}return!0;default:return!1}}function E(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function y(e){if(null==e)return""+e;var t=E(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function h(e){var t=y(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return m.prototype=Error.prototype,u.checkPropTypes=s,u.resetWarningCache=s.resetWarningCache,u.PropTypes=u,u}},"./node_modules/prop-types/index.js":(e,t,n)=>{var o=n("./node_modules/react-is/index.js");e.exports=n("./node_modules/prop-types/factoryWithTypeCheckers.js")(o.isElement,!0)},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":e=>{e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},"./node_modules/prop-types/lib/has.js":e=>{e.exports=Function.call.bind(Object.prototype.hasOwnProperty)},"./node_modules/react-is/cjs/react-is.development.js":(e,t)=>{!function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case c:case u:case l:case i:case r:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case a:return g;default:return t}}case o:return t}}}var S=u,b=s,O=a,N=n,C=d,I=l,D=f,w=v,T=o,A=i,L=r,R=m,P=!1;function x(e){return _(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=b,t.ContextProvider=O,t.Element=N,t.ForwardRef=C,t.Fragment=I,t.Lazy=D,t.Memo=w,t.Portal=T,t.Profiler=A,t.StrictMode=L,t.Suspense=R,t.isAsyncMode=function(e){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),x(e)||_(e)===c},t.isConcurrentMode=x,t.isContextConsumer=function(e){return _(e)===s},t.isContextProvider=function(e){return _(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return _(e)===d},t.isFragment=function(e){return _(e)===l},t.isLazy=function(e){return _(e)===f},t.isMemo=function(e){return _(e)===v},t.isPortal=function(e){return _(e)===o},t.isProfiler=function(e){return _(e)===i},t.isStrictMode=function(e){return _(e)===r},t.isSuspense=function(e){return _(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===i||e===r||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=_}()},"./node_modules/react-is/index.js":(e,t,n)=>{e.exports=n("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(e,t,n)=>{function o(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),o=Object.keys(t),l=n.length;if(o.length!==l)return!1;for(var r=0;r<l;r++){var i=n[r];if(e[i]!==t[i]||!Object.prototype.hasOwnProperty.call(t,i))return!1}return!0}function l(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}n.r(t),n.d(t,{shallowEqualArrays:()=>l,shallowEqualObjects:()=>o})},"./src/Component.ts":function(e,t,n){var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=l(n("./src/useMediaQuery.ts"));t.default=function(e){var t=e.children,n=e.device,l=e.onChange,i=o(e,["children","device","onChange"]),a=(0,r.default)(i,n,l);return"function"==typeof t?t(a):a?t:null}},"./src/Context.ts":(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var o=(0,n("react").createContext)(void 0);t.default=o},"./src/index.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.toQuery=t.useMediaQuery=t.default=void 0;var l=o(n("./src/useMediaQuery.ts"));t.useMediaQuery=l.default;var r=o(n("./src/Component.ts"));t.default=r.default;var i=o(n("./src/toQuery.ts"));t.toQuery=i.default;var a=o(n("./src/Context.ts"));t.Context=a.default},"./src/mediaQuery.ts":function(e,t,n){var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)},l=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n("./node_modules/prop-types/index.js")),a=i.default.oneOfType([i.default.string,i.default.number]),s={all:i.default.bool,grid:i.default.bool,aural:i.default.bool,braille:i.default.bool,handheld:i.default.bool,print:i.default.bool,projection:i.default.bool,screen:i.default.bool,tty:i.default.bool,tv:i.default.bool,embossed:i.default.bool},c={orientation:i.default.oneOf(["portrait","landscape"]),scan:i.default.oneOf(["progressive","interlace"]),aspectRatio:i.default.string,deviceAspectRatio:i.default.string,height:a,deviceHeight:a,width:a,deviceWidth:a,color:i.default.bool,colorIndex:i.default.bool,monochrome:i.default.bool,resolution:a,type:Object.keys(s)},u=l(c,["type"]),d=o({minAspectRatio:i.default.string,maxAspectRatio:i.default.string,minDeviceAspectRatio:i.default.string,maxDeviceAspectRatio:i.default.string,minHeight:a,maxHeight:a,minDeviceHeight:a,maxDeviceHeight:a,minWidth:a,maxWidth:a,minDeviceWidth:a,maxDeviceWidth:a,minColor:i.default.number,maxColor:i.default.number,minColorIndex:i.default.number,maxColorIndex:i.default.number,minMonochrome:i.default.number,maxMonochrome:i.default.number,minResolution:a,maxResolution:a},u),m=o(o({},s),d);t.default={all:m,types:s,matchers:c,features:d}},"./src/toQuery.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=o(n("./node_modules/hyphenate-style-name/index.js")),r=o(n("./src/mediaQuery.ts"));t.default=function(e){var t=[];return Object.keys(r.default.all).forEach(function(n){var o=e[n];null!=o&&t.push(function(e,t){var n=(0,l.default)(e);return"number"==typeof t&&(t="".concat(t,"px")),!0===t?n:!1===t?"not ".concat(n):"(".concat(n,": ").concat(t,")")}(n,o))}),t.join(" and ")}},"./src/useMediaQuery.ts":function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=n("react"),r=o(n("./node_modules/matchmediaquery/index.js")),i=o(n("./node_modules/hyphenate-style-name/index.js")),a=n("./node_modules/shallow-equal/dist/index.esm.js"),s=o(n("./src/toQuery.ts")),c=o(n("./src/Context.ts")),u=function(e){if(e)return Object.keys(e).reduce(function(t,n){return t[(0,i.default)(n)]=e[n],t},{})},d=function(){var e=(0,l.useRef)(!1);return(0,l.useEffect)(function(){e.current=!0},[]),e.current};t.default=function(e,t,n){var o=function(e){var t=(0,l.useContext)(c.default),n=function(){return u(e)||u(t)},o=(0,l.useState)(n),r=o[0],i=o[1];return(0,l.useEffect)(function(){var e=n();(0,a.shallowEqualObjects)(r,e)||i(e)},[e,t]),r}(t),i=function(e){var t=function(){return function(e){return e.query||(0,s.default)(e)}(e)},n=(0,l.useState)(t),o=n[0],r=n[1];return(0,l.useEffect)(function(){var e=t();o!==e&&r(e)},[e]),o}(e);if(!i)throw new Error("Invalid or missing MediaQuery!");var m=function(e,t){var n=function(){return(0,r.default)(e,t||{},!!t)},o=(0,l.useState)(n),i=o[0],a=o[1],s=d();return(0,l.useEffect)(function(){if(s){var e=n();return a(e),function(){e&&e.dispose()}}},[e,t]),i}(i,o),p=function(e){var t=(0,l.useState)(e.matches),n=t[0],o=t[1];return(0,l.useEffect)(function(){var t=function(e){o(e.matches)};return e.addListener(t),o(e.matches),function(){e.removeListener(t)}},[e]),n}(m),v=d();return(0,l.useEffect)(function(){v&&n&&n(p)},[p]),(0,l.useEffect)(function(){return function(){m&&m.dispose()}},[]),p}},react:t=>{t.exports=e}},n={};function o(e){var l=n[e];if(void 0!==l)return l.exports;var r=n[e]={exports:{}};return t[e].call(r.exports,r,r.exports,o),r.exports}return o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o("./src/index.ts")})(),e.exports=n(o)}));const H=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web","sandbox-ui","kibana-v8"],G=()=>{const{isLoading:e,data:n}=Digit.Hooks.useAccessControl(),r=Digit.Utils.getMultiRootTenant(),{t:i}=l.useTranslation(),s=a.useHistory(),c=Digit.ULBService.getStateId(),u={};null==n||n.actions.filter(e=>"url"===e.url).forEach(e=>{var t;if(null==e||null===(t=e.path)||void 0===t||t.split("."),""!==(null==e?void 0:e.path)){var n;const t=null==e||null===(n=e.path)||void 0===n?void 0:n.split(".");let o={};t.reduce((n,o,l)=>{if(l!==t.length-1)return n[o]={},n[o];n[o]={item:e}},o),function e(t,n){for(const o in n)n.hasOwnProperty(o)&&("object"!=typeof n[o]||Array.isArray(n[o])?t[o]||(t[o]=n[o]):(t[o]||(t[o]={}),e(t[o],n[o])))}(u,o)}});const d=e=>(e.sort((e,t)=>(void 0!==e.orderNumber?e.orderNumber:Infinity)-(void 0!==t.orderNumber?t.orderNumber:Infinity)),e.forEach(e=>{e.children&&e.children.length>0&&d(e.children)}),e),m=function(e){const t=(e,n)=>{if(n.item)return{label:i(n.item.displayName),icon:{icon:n.item.leftIcon,width:"1.5rem",height:"1.5rem"},navigationUrl:n.item.navigationURL,orderNumber:n.item.orderNumber};const o=Object.keys(n).map(e=>t(e,n[e])),l=function e(t){void 0===t&&(t={});for(const n in t){const o=t[n];if("item"===n&&""!==(null==o?void 0:o.leftIcon))return null==o?void 0:o.leftIcon;if("object"==typeof t[n]&&!Array.isArray(t[n])){const o=e(t[n]);if(o)return o}}return null}(n);return{label:i(e),icon:{icon:l,width:"1.5rem",height:"1.5rem"},children:o}};return Object.keys(e).map(n=>t(n,e[n]))}((e=>{const t=Object.entries(e);return t.sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0),Object.fromEntries(t)})(u)),p=d(m);return e?o.createElement(t.Loader,null):u?o.createElement(j,{minWidth:768},o.createElement(t.Sidebar,{items:p,hideAccessbilityTools:!0,onSelect:e=>{let{item:t,index:n,parentIndex:o}=e;return(e=>{let{item:t}=e;null!=t&&t.navigationUrl&&function(e,t){var n,o;if(void 0===e&&(e={}),void 0===t&&(t=""),"/"!=t)if(-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+(null===(o=window)||void 0===o?void 0:o.contextPath)))){const n=window.location.origin;let o=null;r?(o=t=t.replace("/sandbox-ui/employee",`/sandbox-ui/${c}/employee`),e.push(o)):(o=null!=H&&H.every(e=>{var n;return-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+e))})?n+"/employee/"+t:n+t,window.location.href=o)}else e.push(t)}(s,null==t?void 0:t.navigationUrl)})({item:t,index:n,parentIndex:o})},theme:"dark",variant:"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}})):""},V=e=>{let{CITIZEN:t,isSidebarOpen:n,toggleSidebar:l,handleLogout:r,mobileView:i,userDetails:a,modules:s,linkData:c,islinkDataLoading:u,userProfile:d}=e;return t?o.createElement(B,{isOpen:n,isMobile:!0,toggleSidebar:l,onLogout:r,linkData:c,islinkDataLoading:u,userProfile:d,isEmployee:!1}):!n&&null!=a&&a.access_token?o.createElement("div",{className:"digit-employeeSidebar"},o.createElement(G,{mobileView:i,userDetails:a,modules:s})):o.createElement("div",{className:"digit-citizenSidebar"},o.createElement(B,{isOpen:n,isMobile:!0,toggleSidebar:l,onLogout:r,isEmployee:!0,userProfile:d}))},$=e=>{let{t:t,stateInfo:l,userDetails:r,CITIZEN:i,cityDetails:s,mobileView:c,handleUserDropdownSelection:u,logoUrl:d,logoUrlWhite:m,showSidebar:p=!0,showLanguageChange:v,linkData:f,islinkDataLoading:g}=e;const[E,y]=n.useState(!1),h=a.useHistory(),[_,S]=n.useState(!1),b=()=>{y(!1),S(!0)},O=()=>{S(!1)},N=()=>{y(!E)},C=()=>{var e,t;h.push(i?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/profile`)},I=[{name:t("EDIT_PROFILE"),icon:"Edit",func:C},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:b}];return o.createElement(o.Fragment,null,o.createElement(R,{t:t,stateInfo:l,toggleSidebar:N,isSidebarOpen:E,handleLogout:b,userDetails:r,CITIZEN:i,cityDetails:s,mobileView:c,userOptions:I,handleUserDropdownSelection:u,logoUrl:d,logoUrlWhite:m,showLanguageChange:v}),_&&o.createElement(x,{onSelect:()=>{Digit.UserService.logout(),S(!1)},onCancel:O,onDismiss:O}),i?i?p&&E&&o.createElement(V,{t:t,CITIZEN:i,isSidebarOpen:E,toggleSidebar:N,handleLogout:b,mobileView:c,userDetails:r,linkData:f,userProfile:C,islinkDataLoading:g}):null:p&&o.createElement(V,{t:t,CITIZEN:i,isSidebarOpen:E,toggleSidebar:N,handleLogout:b,mobileView:c,userDetails:r,linkData:f,userProfile:C,islinkDataLoading:g}))},z=e=>{const{question:t,answer:r,lastIndex:i}=e,[a,s]=n.useState(!1),{t:u}=l.useTranslation();return o.createElement("div",{className:"faqs border-none",onClick:()=>s(!a)},o.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},o.createElement("span",null,u(t)),o.createElement("span",{className:a?"faqicon rotate":"faqicon",style:{float:"right"}},o.createElement(c.ArrowForward,null))),o.createElement("div",{className:"faq-answer",style:a?{display:"block"}:{display:"none"}},o.createElement("span",null,u(r))),i?null:o.createElement("div",{className:"cs-box-border"}))},W=e=>{var r,i,a;let{module:s}=e;const c=Digit.UserService.getUser(),{t:u}=((null==c||null===(r=c.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation()),{isLoading:d,data:m}=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),p=null==m||null===(i=m.MdmsRes["common-masters"])||void 0===i||null===(a=i.faqs[0])||void 0===a?void 0:a[""+s].faqs;return d?o.createElement(t.Loader,null):o.createElement(n.Fragment,null,o.createElement("div",{className:"faq-page"},o.createElement(t.BackButton,{style:{marginLeft:"unset"}}),o.createElement("div",{style:{marginBottom:"15px"}},o.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},u("FAQ_S"))),o.createElement("div",{className:"faq-list"},p.map((e,t)=>o.createElement(z,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==p?void 0:p.length)-1})))))},X=()=>{var e,t,n,r,i,c,u,d,m,p,v,f,g,y,h,_,S,b,O,N,C,I,D,w,T,A,L;const{t:R}=l.useTranslation(),P=a.useHistory(),x=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCitizenCurrentTenant(!0),{data:{uiHomePage:M}={},isLoading:k}=Digit.Hooks.useStore.getInitData();let U=window.Digit.Utils.browser.isMobile();const B=()=>{var e,t,n,o,l;return"EMPLOYEE"!==(null===(e=Digit.UserService)||void 0===e||null===(t=e.getUser())||void 0===t||null===(n=t.info)||void 0===n?void 0:n.type)&&!(null===(o=Digit.UserService)||void 0===o||null===(l=o.getUser())||void 0===l||!l.access_token)},{data:F,isLoading:j}=Digit.Hooks.useEvents({tenantId:x,variant:"whats-new",config:{enabled:B()}});var H;x||P.push(`/${null===(H=window)||void 0===H?void 0:H.contextPath}/citizen/select-language`);const G=null==M?void 0:M.appBannerDesktop,V=null==M?void 0:M.appBannerMobile,$=null==M?void 0:M.citizenServicesCard,z=null==M?void 0:M.informationAndUpdatesCard,W=null==M?void 0:M.whatsAppBannerDesktop,X=null==M?void 0:M.whatsAppBannerMobile,q=null==M?void 0:M.whatsNewSection,Q=null==M?void 0:M.redirectURL;var Z,Y;Q&&P.push(`/${null===(Z=window)||void 0===Z?void 0:Z.contextPath}/citizen/${Q}`),(null!==(e=window)&&void 0!==e&&null!==(t=e.location)&&void 0!==t&&null!==(n=t.href)&&void 0!==n&&null!==(r=n.includes)&&void 0!==r&&r.call(n,"sanitation-ui")||null!==(i=window)&&void 0!==i&&null!==(c=i.location)&&void 0!==c&&null!==(u=c.href)&&void 0!==u&&null!==(d=u.includes)&&void 0!==d&&d.call(u,"sandbox-ui"))&&P.push(`/${null===(Y=window)||void 0===Y?void 0:Y.contextPath}/citizen/all-services`);const J=e=>{window.open(null==e?void 0:e.navigationUrl)},K={header:R(null==$?void 0:$.headerLabel),sideOption:{name:R(null==$||null===(m=$.sideOption)||void 0===m?void 0:m.name),onClick:()=>{var e;return P.push(null==$||null===(e=$.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:R(null==$||null===(p=$.props)||void 0===p||null===(v=p[0])||void 0===v?void 0:v.label),Icon:o.createElement(s.ComplaintIcon,null),onClick:()=>{var e,t;return P.push(null==$||null===(e=$.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==$||null===(f=$.props)||void 0===f||null===(g=f[1])||void 0===g?void 0:g.label),Icon:o.createElement(s.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return P.push(null==$||null===(e=$.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==$||null===(y=$.props)||void 0===y||null===(h=y[2])||void 0===h?void 0:h.label),Icon:o.createElement(s.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return P.push(null==$||null===(e=$.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==$||null===(_=$.props)||void 0===_||null===(S=_[3])||void 0===S?void 0:S.label),Icon:o.createElement(s.OBPSIcon,null),onClick:()=>{var e,t;return P.push(null==$||null===(e=$.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}},ee={header:R(null==z?void 0:z.headerLabel),sideOption:{name:R(null==z||null===(b=z.sideOption)||void 0===b?void 0:b.name),onClick:()=>{var e;return P.push(null==z||null===(e=z.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:R(null==z||null===(O=z.props)||void 0===O||null===(N=O[0])||void 0===N?void 0:N.label),Icon:o.createElement(s.HomeIcon,null),onClick:()=>{var e,t;return P.push(null==z||null===(e=z.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==z||null===(C=z.props)||void 0===C||null===(I=C[1])||void 0===I?void 0:I.label),Icon:o.createElement(s.Calender,null),onClick:()=>{var e,t;return P.push(null==z||null===(e=z.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==z||null===(D=z.props)||void 0===D||null===(w=D[2])||void 0===w?void 0:w.label),Icon:o.createElement(s.DocumentIcon,null),onClick:()=>{var e,t;return P.push(null==z||null===(e=z.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==z||null===(T=z.props)||void 0===T||null===(A=T[3])||void 0===A?void 0:A.label),Icon:o.createElement(s.DocumentIcon,null),onClick:()=>{var e,t;return P.push(null==z||null===(e=z.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}};return k?o.createElement(s.Loader,null):o.createElement("div",{className:"HomePageContainer"},o.createElement("div",{className:"HomePageWrapper"},o.createElement("div",{className:"BannerWithSearch"},o.createElement("img",U?{src:null==V?void 0:V.bannerUrl}:{src:null==G?void 0:G.bannerUrl}),o.createElement("div",{className:"ServicesSection"},o.createElement(s.CardBasedOptions,E({style:{marginTop:"-30px"}},K)),o.createElement(s.CardBasedOptions,E({style:U?{}:{marginTop:"-30px"}},ee)))),(X||W)&&o.createElement("div",{className:"WhatsAppBanner"},o.createElement("img",U?{src:null==X?void 0:X.bannerUrl,onClick:()=>J(X)}:{src:null==W?void 0:W.bannerUrl,onClick:()=>J(W)})),B()?j?o.createElement(s.Loader,null):o.createElement("div",{className:"WhatsNewSection"},o.createElement("div",{className:"headSection"},o.createElement("h2",null,R(null==q?void 0:q.headerLabel)),o.createElement("p",{onClick:()=>{var e;return P.push(null==q||null===(e=q.sideOption)||void 0===e?void 0:e.navigationUrl)}},R(null==q||null===(L=q.sideOption)||void 0===L?void 0:L.name))),o.createElement(s.WhatsNewCard,null==F?void 0:F[0])):null))},q=()=>{const{t:e}=l.useTranslation(),r=a.useHistory(),{data:{languages:i,stateInfo:s}={},isLoading:c}=Digit.Hooks.useStore.getInitData(),u=Digit.StoreData.getCurrentLanguage(),d=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]),m=n.useMemo(()=>({options:i,optionsKey:"label",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:e=>Digit.LocalizationService.changeLanguage(e.value,s.code),selectedOption:null==i?void 0:i.filter(e=>e.value===u)[0]}),[u,i]);return c?o.createElement(t.Loader,null):o.createElement("div",{className:"selection-card-wrapper"},o.createElement(t.PageBasedInput,{texts:d,onSubmit:function(){var e;r.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/select-location`)}},o.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),o.createElement(t.RadioButtons,m)))},Q=()=>{const{t:e}=l.useTranslation(),r=a.useHistory(),i=a.useLocation(),{data:{uiHomePage:c}={}}=Digit.Hooks.useStore.getInitData(),u=null==c?void 0:c.redirectURL,{data:d,isLoading:m}=Digit.Hooks.useTenants(),[p,v]=n.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[f,g]=n.useState(!1),y=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function h(e){v(e),g(!1)}const _=n.useMemo(()=>({options:d,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:h,selectedOption:p}),[d,e,p]);return m?o.createElement("loader",null):o.createElement("div",{className:"selection-card-wrapper"},o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement(s.PageBasedInput,{texts:y,onSubmit:function(){if(p){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",p);const o=null===(e=i.state)||void 0===e?void 0:e.redirectBackTo;var t,n;u?r.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/${u}`):o?r.replace(o):r.push(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen`)}else g(!0)},className:"location-selection-container"},o.createElement(s.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),o.createElement(s.SearchOnRadioButtons,E({},_,{placeholder:e("COMMON_TABLE_SEARCH")})),f?o.createElement(s.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},Z=function(){function e(){}return e.prototype.then=function(t,n){const o=new e,l=this.s;if(l){const e=1&l?t:n;if(e){try{Y(o,1,e(this.v))}catch(e){Y(o,2,e)}return o}return this}return this.o=function(e){try{const l=e.v;1&e.s?Y(o,1,t?t(l):l):n?Y(o,1,n(l)):Y(o,2,l)}catch(e){Y(o,2,e)}},o},e}();function Y(e,t,n){if(!e.s){if(n instanceof Z){if(!n.s)return void(n.o=Y.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Y.bind(null,e,t),Y.bind(null,e,2));e.s=t,e.v=n;const o=e.o;o&&o(e)}}function J(e){return e instanceof Z&&1&e.s}const K="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function ee(e,t,n){if("function"==typeof e[K]){var o,l,r,i=e[K]();if(function e(a){try{for(;!((o=i.next()).done||n&&n());)if((a=t(o.value))&&a.then){if(!J(a))return void a.then(e,r||(r=Y.bind(null,l=new Z,2)));a=a.v}l?Y(l,1,a):l=a}catch(e){Y(l||(l=new Z),2,e)}}(),i.return){var a=function(e){try{o.done||i.return()}catch(e){}return e};if(l&&l.then)return l.then(a,function(e){throw a(e)});a()}return l}if(!("length"in e))throw new TypeError("Object is not iterable");for(var s=[],c=0;c<e.length;c++)s.push(e[c]);return function(e,t,n){var o,l,r=-1;return function i(a){try{for(;++r<e.length&&(!n||!n());)if((a=t(r))&&a.then){if(!J(a))return void a.then(i,l||(l=Y.bind(null,o=new Z,2)));a=a.v}o?Y(o,1,a):o=a}catch(e){Y(o||(o=new Z),2,e)}}(),o}(s,function(e){return t(s[e])},n)}function te(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function ne(e){let{setProfilePic:t,closeDrawer:r,userType:i,removeProfilePic:a,showToast:c}=e;const[u,d]=n.useState(null),[m,p]=n.useState(""),[v,f]=n.useState(null),{t:g}=l.useTranslation();return n.useEffect(()=>{!function(){try{f(null);const e=function(){if(m){const e=function(){if(m.size>=1e6)c("error",g("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),f(g("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=te(function(){return Promise.resolve(Digit.UploadServices.Filestorage(i+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var n,o;if((null==e||null===(n=e.data)||void 0===n||null===(o=n.files)||void 0===o?void 0:o.length)>0){var l,r;const n=null==e||null===(l=e.data)||void 0===l||null===(r=l.files[0])||void 0===r?void 0:r.fileStoreId;d(n),t(n)}else c("error",g("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),f(g("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",g("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"))});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)}}()},[m]),o.createElement(o.Fragment,null,o.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:()=>r()}),o.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===i?"2.5rem":"0",zIndex:"1000"}},o.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},o.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",o.createElement(s.GalleryIcon,null)),o.createElement("label",{style:{cursor:"pointer"}}," Gallery"),o.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>p(e.target.files[0]),style:{display:"none"}})),o.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},o.createElement("button",{onClick:()=>{a(),r()}},o.createElement(s.RemoveIcon,null)),o.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const oe=e=>{var r,i,c,u,d,m,p,v,f,g,y;let{stateCode:h,userType:_,cityDetails:S}=e;a.useHistory();const{t:b}=l.useTranslation(),O=window.location.href,N=Digit.ULBService.getStateId(),C=Digit.ULBService.getCurrentTenantId(),I=(null===(r=Digit.UserService.getUser())||void 0===r?void 0:r.info)||{},[D,w]=n.useState(null),[T,A]=n.useState(null!=I&&I.name?I.name:""),[L,R]=n.useState(null!=I&&I.emailId?I.emailId:""),[P,x]=n.useState(null==D?void 0:D.gender),[M,k]=n.useState(null!=I&&I.permanentCity?I.permanentCity:S.name),[U,B]=n.useState(null!=I&&I.mobileNumber?I.mobileNumber:""),[F,j]=n.useState(null),[H,G]=n.useState(""),[V,$]=n.useState(!1),[z,W]=n.useState(!1),[X,q]=n.useState(""),[Q,Z]=n.useState(""),[Y,J]=n.useState(""),[K,ee]=n.useState(null),[oe,le]=n.useState(!1),[re,ie]=o.useState(window.innerWidth),[ae,se]=o.useState({}),ce=window.Digit.Utils.browser.isMobile();o.useEffect(()=>(window.addEventListener("resize",()=>ie(window.innerWidth)),()=>{window.removeEventListener("resize",()=>ie(window.innerWidth))})),n.useEffect(()=>{var e;le(!0),function(){try{const e=null==I?void 0:I.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(C,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&w(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),x({i18nKey:void 0,code:null==D?void 0:D.gender,value:null==D?void 0:D.gender});const t=null==D||null===(e=D.photo)||void 0===e?void 0:e.split(",");G(null==t?void 0:t.at(0)),le(!1)},[null!==D]);let ue={};const de=e=>x(e),me=()=>$(!1),pe=e=>{A(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?se({...ae,userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}}):se({...ae,userName:null})},ve=e=>{(null==I?void 0:I.userName)!==e?(R(e),!e.length||e.includes("@")&&e.includes(".")?se({...ae,emailAddress:null}):se({...ae,emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}})):se({...ae,emailAddress:null})},fe=function(e,t,n){void 0===n&&(n=5e3),ee({key:e,action:t}),setTimeout(()=>{ee(null)},n)},ge=function(){try{let t=!1;function e(e){if(t)return e;le(!1)}le(!0);const n=te(function(){const e={...I,name:T,gender:null==P?void 0:P.value,emailId:L,photo:F};if(!new RegExp(/^([a-zA-Z ])*$/).test(T)||""===T||T.length>50||T.length<1)throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===_&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(U))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(L.length&&(!L.includes("@")||!L.includes(".")))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_EMAIL_INVALID")});if(z&&(X.length||Q.length||Y.length)){if(Q!==Y)throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(X.length&&Q.length&&Y.length))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(Q)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(Y))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}return Promise.resolve(Digit.UserService.updateUser(e,h)).then(function(e){let{responseInfo:t}=e;if(t&&"200"===t.status){const e=Digit.UserService.getUser();e&&Digit.UserService.setUser({...e,info:{...e.info,name:T,mobileNumber:U,emailId:L,permanentCity:M}})}return function(){if(X.length&&Q.length&&Y.length){const e={existingPassword:X,newPassword:Q,tenantId:C,type:"EMPLOYEE",username:null==I?void 0:I.userName,confirmPassword:Y};return function(){if(Q===Y)return te(function(){return Promise.resolve(Digit.UserService.changePassword(e,C)).then(function(e){const{responseInfo:t}=e;if(null==t||!t.status||"200"!==t.status)throw"";fe("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3),setTimeout(()=>Digit.UserService.logout(),2e3)})},function(e){var t,n;throw JSON.stringify({type:"error",message:null!==(t=e.Errors)&&void 0!==t&&null!==(n=t.at(0))&&void 0!==n&&n.description?e.Errors.at(0).description:"CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"})});throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"})}()}null!=t&&t.status&&"200"===t.status&&fe("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){const t=JSON.parse(e);fe(t.type,b(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}};let Ee=[];const{data:ye}=Digit.Hooks.useGenderMDMS(N,"common-masters","GenderType");return ye&&ye.map(e=>{Ee.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),oe?o.createElement(t.Loader,null):o.createElement("div",{className:"user-profile"},o.createElement("section",{style:{margin:"citizen"===_||ce?"8px":"24px"}},"citizen"===_||ce?o.createElement(t.BackLink,{onClick:()=>window.history.back()}):o.createElement(t.BreadCrumb,{crumbs:[{path:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/employee`,content:b("ES_COMMON_HOME"),show:!0},{path:`/${null===(c=window)||void 0===c?void 0:c.contextPath}/employee/user/profile`,content:b("ES_COMMON_PAGE_1"),show:O.includes("/user/profile")}]})),o.createElement("div",{style:{display:"flex",flex:1,flexDirection:re<768||"citizen"===_?"column":"row",margin:"citizen"===_?"8px":"16px",gap:"citizen"===_?"":"0 24px",boxShadow:"citizen"===_?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===_?"white":"",borderRadius:"citizen"===_?"4px":"",maxWidth:"citizen"===_?"960px":""}},o.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===_?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===_?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===_?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===_?"8px":"16px"}},o.createElement("div",{style:{position:"relative",height:"citizen"===_?"114px":"150px",width:"citizen"===_?"114px":"150px",margin:"16px"}},o.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:H&&""!==H?H:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC"}),o.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>$(!V)},o.createElement(s.CameraIcon,null)))),o.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===_?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===_?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===_?"8px":"24px",paddingBottom:"20px"}},"citizen"===_?o.createElement(o.Fragment,null,o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),o.createElement("div",{style:{width:"40rem",maxWidth:"960px"}},o.createElement(t.TextInput,E({t:b,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:T,onChange:e=>pe(e.target.value)},ue={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==ae?void 0:ae.userName)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(u=ae.userName)||void 0===u?void 0:u.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+b("CORE_COMMON_PROFILE_GENDER")),o.createElement(t.Dropdown,{style:{width:"40rem",fontSize:"1rem"},className:"form-field profileDropdown",selected:1===(null==P?void 0:P.length)?P[0]:P,disable:1===(null==P?void 0:P.length)||!1,option:Ee,select:de,value:P,optionKey:"code",t:b,name:"gender"})),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+b("CORE_COMMON_PROFILE_EMAIL")),o.createElement("div",{style:{width:"40rem"}},o.createElement(t.TextInput,{t:b,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:L,onChange:e=>ve(e.target.value),disabled:!1}),(null==ae?void 0:ae.emailAddress)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(d=ae.emailAddress)||void 0===d?void 0:d.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement("button",{onClick:ge,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black"}},b("CORE_COMMON_SAVE"))):o.createElement(o.Fragment,null,o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,E({t:b,type:"text",isMandatory:!1,name:"name",value:T,onChange:e=>pe(e.target.value),placeholder:"Enter Your Name"},ue={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disabled:!1})),(null==ae?void 0:ae.userName)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(m=ae.userName)||void 0===m?void 0:m.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_GENDER")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.Dropdown,{className:"profileDropdown",selected:1===(null==P?void 0:P.length)?P[0]:P,disable:1===(null==P?void 0:P.length)||!1,option:Ee,select:de,value:P,optionKey:"code",t:b,name:"gender"}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CITY")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,E({t:b,type:"text",isMandatory:!1,name:"city",value:b(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+C)),onChange:e=>k(e.target.value),placeholder:"Enter Your City Name"},ue={isRequired:!0,type:"text",title:b("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disabled:!0})),o.createElement(t.ErrorMessage,null))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},b("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),o.createElement("div",{style:{width:"100%"}},o.createElement(t.MobileNumber,{value:U,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{B(e),"employee"!==_||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?se({...ae,mobileNumber:null}):se({...ae,mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}})})(e),disable:!Digit.Utils.getMultiRootTenant(),required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==ae?void 0:ae.mobileNumber)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(p=ae.mobileNumber)||void 0===p?void 0:p.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_EMAIL")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:b,type:"email",isMandatory:!1,placeholder:b("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:L,onChange:e=>ve(e.target.value),disabled:!!Digit.Utils.getMultiRootTenant()}),(null==ae?void 0:ae.emailAddress)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(v=ae.emailAddress)||void 0===v?void 0:v.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,null,o.createElement("div",{style:{width:"100%"}},0!=z||Digit.Utils.getOTPBasedLogin()?null:o.createElement(t.Button,{label:b("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>W(!z),style:{paddingLeft:"0rem"}}),z?o.createElement("div",{style:{marginTop:"10px"}},o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return q(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,currentPassword:null}):se({...ae,currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.currentPassword)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(f=ae.currentPassword)||void 0===f?void 0:f.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NEW_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return Z(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,newPassword:null}):se({...ae,newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.newPassword)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(g=ae.newPassword)||void 0===g?void 0:g.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return J(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,confirmPassword:null}):se({...ae,confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.confirmPassword)&&o.createElement(t.ErrorMessage,{message:b(null==ae||null===(y=ae.confirmPassword)||void 0===y?void 0:y.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})))):"")),"employee"===_&&ce?o.createElement("button",{onClick:ge,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"}},b("CORE_COMMON_SAVE")):null))),"employee"!==_||ce?null:o.createElement(t.ActionBar,{actionFields:[o.createElement(t.SubmitBar,{t:b,label:b("CORE_COMMON_SAVE"),onSubmit:ge})],className:"",setactionFieldsToRight:!0}),K&&o.createElement(t.Toast,{type:K.key,label:b("success"===K.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":K.action),onClose:()=>ee(null),style:{maxWidth:"670px"}}),1==V?o.createElement(ne,{setProfilePic:function(e){try{function t(e){G(null==e?void 0:e.thumbs[0]),me()}return j(e),Promise.resolve(e?Promise.resolve(function(e,t){try{return Promise.resolve(Digit.UploadServices.Filefetch(e,t)).then(function(e){return e.data.fileStoreIds&&0!==e.data.fileStoreIds.length?{thumbs:e.data.fileStoreIds.map(e=>e.url.split(",")[3]),images:e.data.fileStoreIds.map(e=>Digit.Utils.getFileUrl(e.url))}:null})}catch(e){return Promise.reject(e)}}([e],N)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:me,userType:_,removeProfilePic:()=>{j(null),G(null)},showToast:fe}):"")},le=e=>{var r,i,a;let{module:c}=e;const u=Digit.UserService.getUser(),{t:d}=((null==u||null===(r=u.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation()),m=Digit.SessionStorage.get("initData").stateInfo,p=Digit.StoreData.getCurrentLanguage(),[v,f]=n.useState(p),[g,E]=n.useState(!1),[y,h]=n.useState(""),_=()=>o.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{d:"M12 24C5.38053 24 0 18.6143 0 12C0 5.38054 5.38053 1.90735e-06 12 1.90735e-06C18.6143 1.90735e-06 24 5.38054 24 12C24 18.6143 18.6143 24 12 24ZM16.3488 10.7852L11.3855 7.25251C11.1263 7.0701 10.8238 6.97889 10.5214 6.97889C10.291 6.97889 10.0557 7.03172 9.83976 7.14202C9.34054 7.40118 9.02857 7.91006 9.02857 8.46694L9.02877 15.5323C9.02877 16.0892 9.34076 16.5979 9.83996 16.8572C10.3344 17.1116 10.9296 17.0732 11.3857 16.7467L16.349 13.214C16.7426 12.9356 16.9778 12.4795 16.9778 11.9996C16.9776 11.5197 16.7426 11.0636 16.3489 10.7852L16.3488 10.7852Z",fill:"white"})),{isLoading:S,data:b}=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),O=null==b||null===(i=b.MdmsRes["common-masters"])||void 0===i||null===(a=i.howItWorks[0])||void 0===a?void 0:a[""+c];return S?o.createElement(t.Loader,null):o.createElement(n.Fragment,null,o.createElement("div",{className:"how-it-works-page"},o.createElement(t.BackButton,null),o.createElement("div",{className:"how-it-works-page-header"},o.createElement(t.Header,null,d(O.screenHeader?O.screenHeader:"HOW_IT_WORKS"))),o.createElement("div",{className:"language-selector",style:{margin:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map((e,t)=>o.createElement("div",{className:"language-button-container",key:t},o.createElement(s.CustomButton,{selected:e.value===v,text:e.label,onClick:()=>(e=>{f(e.value),Digit.LocalizationService.changeLanguage(e.value,m.code)})(e)})))),O.videosJson.map((e,t)=>o.createElement("div",null,o.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},o.createElement("div",{className:"video-icon",onClick:()=>{return t=e,h("hi_IN"===v?t.hi_IN:t.en_IN),void E(!0);var t}},o.createElement("div",{className:"vid-svg"},o.createElement(_,null))),o.createElement("div",{className:"how-it-works-header-description"},o.createElement("h2",null,d(e.headerLabel)),o.createElement("p",null,d(e.description)))))),O.pdfHeader&&O.pdfDesc&&o.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},o.createElement("div",{className:"how-it-works-pdf-section"},o.createElement("div",{className:"pdf-icon-header-desc"},o.createElement("div",{className:"pdf-icon"},o.createElement(t.PDFSvg,null)),o.createElement("div",{className:"pdf-header-desc"},o.createElement("h2",null,d(O.pdfHeader)),o.createElement("p",null,d(O.pdfDesc)))),o.createElement("div",{className:"download-icon"},o.createElement(t.DownloadImgIcon,null)))),g&&o.createElement("div",{className:"how-it-works-video-play"},o.createElement("div",{className:"close-button"},o.createElement(t.CloseSvg,{onClick:()=>{E(!1)}})),o.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},o.createElement("source",{src:y,type:"video/mp4"})))))},re=[{texts:{header:"CS_LOGIN_PROVIDE_MOBILE_NUMBER",cardText:"CS_LOGIN_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOB_NO",validation:{required:!0,minlength:10,maxlength:10}}]},{texts:{header:"CS_LOGIN_OTP",cardText:"CS_LOGIN_OTP_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"}},{texts:{header:"CS_LOGIN_PROVIDE_NAME",cardText:"CS_LOGIN_NAME_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_NAME",type:"text",name:"name",error:"CORE_COMMON_NAME_VALIDMSG",validation:{required:!0,minlength:1,maxlength:50,pattern:"^[A-Za-z]+( [A-Za-z]+)*$"}}]}],ie=e=>{let{t:n,onSelect:l,mobileNumber:r,onMobileChange:i,config:a,canSubmit:s}=e;return o.createElement(t.FormStep,{isDisabled:!(10===r.length&&s),onSelect:l,config:a,t:n,componentInFront:"+91",onChange:i,value:r})},ae=e=>{let{config:n,onSelect:l,t:r,isDisabled:i}=e;return o.createElement(t.FormStep,{config:n,onSelect:l,t:r,isDisabled:i})};function se(e,t){const o=n.useRef();n.useEffect(()=>{o.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){o.current()},t);return()=>clearInterval(e)}},[t])}const ce=e=>{let{config:l,otp:r,onOtpChange:i,onResend:a,onSelect:c,t:u,error:d,userType:m="citizen",canSubmit:p}=e;const[v,f]=n.useState(30);se(()=>{f(v-1)},v>0?1e3:null);const g=()=>{a(),f(2)};return"employee"===m?o.createElement(n.Fragment,null,o.createElement(s.OTPInput,{length:6,onChange:i,value:r}),v>0?o.createElement(t.CardText,null,`${u("CS_RESEND_ANOTHER_OTP")} ${v} ${u("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button resend-otp",onClick:g},u("CS_RESEND_OTP")),!d&&o.createElement(t.CardLabelError,null,u("CS_INVALID_OTP"))):o.createElement(t.FormStep,{onSelect:c,config:l,t:u,isDisabled:!(6===(null==r?void 0:r.length)&&p)},o.createElement(s.OTPInput,{length:6,onChange:i,value:r}),v>0?o.createElement(t.CardText,null,`${u("CS_RESEND_ANOTHER_OTP")} ${v} ${u("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button",onClick:g},u("CS_RESEND_OTP")),!d&&o.createElement(t.CardLabelError,null,u("CS_INVALID_OTP")))};var ue;const de={type:"register"},me={type:"login"},pe=`/${null===(ue=window)||void 0===ue?void 0:ue.contextPath}/citizen`,ve=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||pe,fe=e=>{var r,i;let{stateCode:s,isUserRegistered:c=!0}=e;const{t:u}=l.useTranslation(),d=a.useLocation(),{path:m}=a.useRouteMatch(),p=a.useHistory(),[v,f]=n.useState(null),[g,E]=n.useState(null),[y,h]=n.useState(!0),[_,S]=n.useState(null),[b,O]=n.useState(c?{}:null==d||null===(r=d.state)||void 0===r?void 0:r.data),[N,C]=n.useState(null),I=Digit.Hooks.useQueryParams(),[D,w]=n.useState(!1),[T,A]=n.useState(!0),[L,R]=n.useState(!0);n.useEffect(()=>{let e;return g&&(N&&(clearTimeout(N),C(null)),e=setTimeout(()=>{E("")},5e3),C(e)),()=>{e&&clearTimeout(e)}},[g]),n.useEffect(()=>{var e;if(!v)return;Digit.SessionStorage.set("citizen.userRequestObject",v),Digit.UserService.setUser(v),((e,t,n)=>{var o,l;if(Digit.Utils.getMultiRootTenant())return;let r=null===(o=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===o||null===(l=o.value)||void 0===l?void 0:l.selectedLanguage;localStorage.setItem("Citizen.tenant-id",n),localStorage.setItem("tenant-id",n),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",r),localStorage.setItem("Citizen.locale",r),localStorage.setItem("token",t),localStorage.setItem("Citizen.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Citizen.user-info",JSON.stringify(e))})(null==v?void 0:v.info,null==v?void 0:v.access_token,s);const t=(null===(e=d.state)||void 0===e?void 0:e.from)||pe;var n;Digit.ULBService.getCitizenCurrentTenant(!0)?p.replace(t):p.replace(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen/select-location`,{redirectBackTo:t})},[v]);const P=n.useMemo(()=>re.map(e=>{const t={};for(const n in e.texts)t[n]=u(e.texts[n]);return{...e,texts:t}},[re])),x=()=>Digit.UserService.getType(),M=function(e){return Promise.resolve(te(function(){return Promise.resolve(Digit.UserService.sendOtp(e,s)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return o.createElement("div",{className:"citizen-form-wrapper"},o.createElement(a.Switch,null,o.createElement(t.AppContainer,null,d.pathname.includes("login")?null:o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement(a.Route,{path:""+m,exact:!0},o.createElement(ie,{onSelect:function(e){try{R(!1),O({...b,...e});const t={...e,tenantId:s,userType:x()};return Promise.resolve(c?Promise.resolve(M({otp:{...t,...me}})).then(function(e){var n;let[o,l]=e;var r,i,a;if(!l)return R(!0),void p.replace(m+"/otp",{from:ve(d.state,I),role:null===(r=d.state)||void 0===r?void 0:r.role});R(!0),d.state&&"FSM_DSO"===d.state.role||p.push(`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen/register/name`,{from:ve(d.state,I),data:t}),null!==(n=d.state)&&void 0!==n&&n.role&&(R(!0),E("FSM_DSO"===(null===(a=d.state)||void 0===a?void 0:a.role)?u("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(M({otp:{...t,...de}})).then(function(e){let[t,n]=e;if(!n)return R(!0),void p.replace(m+"/otp",{from:ve(d.state,I)});R(!0)}))}catch(e){return Promise.reject(e)}},config:P[0],mobileNumber:b.mobileNumber||"",onMobileChange:e=>{const{value:t}=e.target;O({...b,mobileNumber:t})},canSubmit:L,showRegisterLink:c&&!(null!==(i=d.state)&&void 0!==i&&i.role),t:u})),o.createElement(a.Route,{path:m+"/otp"},o.createElement(ce,{config:{...P[1],texts:{...P[1].texts,cardText:`${P[1].texts.cardText} ${b.mobileNumber||""}`}},onOtpChange:e=>{O({...b,otp:e})},onResend:function(){try{const{mobileNumber:e}=b,t={mobileNumber:e,tenantId:s,userType:x()},n=function(){if(!c)return Promise.resolve(M({otp:{...t,...de}})).then(function(){});{const e=function(){if(c)return Promise.resolve(M({otp:{...t,...me}})).then(function(){})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(te(function(){h(!0),A(!1);const{mobileNumber:e,otp:t,name:n}=b;return function(){if(c){const n={username:e,password:t,tenantId:s,userType:x()};return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t,n,o;let{UserRequest:l,...r}=e;if(null!==(t=d.state)&&void 0!==t&&t.role){const e=l.roles.find(e=>e.code===d.state.role);if(!e||!e.code)return E(u("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>p.replace(pe),5e3)}null!==(n=window)&&void 0!==n&&null!==(o=n.globalConfigs)&&void 0!==o&&o.getConfig("ENABLE_SINGLEINSTANCE")&&(l.tenantId=Digit.ULBService.getStateId()),f({info:l,...r})})}{const o=function(){if(!c)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:s},s)).then(function(e){var t,n;let{UserRequest:o,...l}=e;null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(o.tenantId=Digit.ULBService.getStateId()),f({info:o,...l})})}();if(o&&o.then)return o.then(function(){})}}()},function(){A(!0),h(!1)}))}catch(e){return Promise.reject(e)}},otp:b.otp,error:y,canSubmit:T,t:u})),o.createElement(a.Route,{path:m+"/name"},o.createElement(ae,{config:P[2],onSelect:function(e){try{const t={...b,tenantId:s,userType:x(),...e};return O({...b,...e}),w(!0),Promise.resolve(M({otp:{...t,...de}})).then(function(e){let[t,n]=e;t?(w(!1),p.replace(m+"/otp",{from:ve(d.state,I)})):w(!1)})}catch(e){return Promise.reject(e)}},t:u,isDisabled:D})),g&&o.createElement(t.Toast,{type:"error",label:g,onClose:()=>E(null)}))))};var ge=e=>e instanceof HTMLElement;const Ee={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};var ye=e=>null==e;const he=e=>"object"==typeof e;var _e=e=>!ye(e)&&!Array.isArray(e)&&he(e)&&!(e instanceof Date),Se=e=>/^\w*$/.test(e),be=e=>e.filter(Boolean),Oe=e=>be(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function Ne(e,t,n){let o=-1;const l=Se(t)?[t]:Oe(t),r=l.length,i=r-1;for(;++o<r;){const t=l[o];let r=n;if(o!==i){const n=e[t];r=_e(n)||Array.isArray(n)?n:isNaN(+l[o+1])?{}:[]}e[t]=r,e=e[t]}return e}var Ce=function(e,t){void 0===t&&(t={});for(const n in e)Se(n)?t[n]=e[n]:Ne(t,n,e[n]);return t},Ie=e=>void 0===e,De=function(e,t,n){void 0===e&&(e={});const o=be(t.split(/[,[\].]+?/)).reduce((e,t)=>ye(e)?e:e[t],e);return Ie(o)||o===e?Ie(e[t])?n:e[t]:o},we=(e,t)=>{ge(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))};const Te={isValid:!1,value:null};var Ae=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e,Te):Te,Le=e=>"radio"===e.type,Re=e=>"file"===e.type,Pe=e=>"checkbox"===e.type,xe=e=>"select-multiple"===e.type;const Me={value:!1,isValid:!1},ke={value:!0,isValid:!0};var Ue=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.ref.checked).map(e=>{let{ref:{value:t}}=e;return t});return{value:t,isValid:!!t.length}}const{checked:t,value:n,attributes:o}=e[0].ref;return t?o&&!Ie(o.value)?Ie(n)||""===n?ke:{value:n,isValid:!0}:ke:Me}return Me};function Be(e,t,n,o,l){const r=e.current[t];if(r){const{ref:{value:e,disabled:t},ref:n,valueAsNumber:a,valueAsDate:s,setValueAs:c}=r;if(t&&o)return;return Re(n)?n.files:Le(n)?Ae(r.options).value:xe(n)?(i=n.options,[...i].filter(e=>{let{selected:t}=e;return t}).map(e=>{let{value:t}=e;return t})):Pe(n)?Ue(r.options).value:l?e:a?""===e?NaN:+e:s?n.valueAsDate:c?c(e):e}var i;if(n)return De(n.current,t)}function Fe(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&Fe(e.parentNode)}var je=e=>_e(e)&&!Object.keys(e).length,He=e=>"boolean"==typeof e;function Ge(e,t){const n=Se(t)?[t]:Oe(t),o=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let o=0;for(;o<n;)e=Ie(e)?o++:e[t[o++]];return e}(e,n);let l;o&&delete o[n[n.length-1]];for(let t=0;t<n.slice(0,-1).length;t++){let o,r=-1;const i=n.slice(0,-(t+1)),a=i.length-1;for(t>0&&(l=e);++r<i.length;){const t=i[r];o=o?o[t]:e[t],a===r&&(_e(o)&&je(o)||Array.isArray(o)&&!o.filter(e=>_e(e)&&!je(e)||He(e)).length)&&(l?delete l[t]:delete e[t]),l=o}}return e}const Ve=(e,t)=>e&&e.ref===t;var $e=e=>ye(e)||!he(e);function ze(e,t){if($e(e)||$e(t))return t;for(const n in t){const o=e[n],l=t[n];try{e[n]=_e(o)&&_e(l)||Array.isArray(o)&&Array.isArray(l)?ze(o,l):l}catch(e){}}return e}function We(e,t,o){if($e(e)||$e(t)||e instanceof Date||t instanceof Date)return e===t;if(!n.isValidElement(e)){const n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(const l of n){const n=e[l];if(!o||"ref"!==l){const e=t[l];if((_e(n)||Array.isArray(n))&&(_e(e)||Array.isArray(e))?!We(n,e,o):n!==e)return!1}}}return!0}function Xe(e,t,n,o,l){let r=-1;for(;++r<e.length;){for(const o in e[r])Array.isArray(e[r][o])?(!n[r]&&(n[r]={}),n[r][o]=[],Xe(e[r][o],De(t[r]||{},o,[]),n[r][o],n[r],o)):We(De(t[r]||{},o),e[r][o])?Ne(n[r]||{},o):n[r]=Object.assign(Object.assign({},n[r]),{[o]:!0});o&&!n.length&&delete o[l]}return n}var qe=e=>"string"==typeof e,Qe=(e,t,n,o,l)=>{const r={};for(const t in e.current)(Ie(l)||(qe(l)?t.startsWith(l):Array.isArray(l)&&l.find(e=>t.startsWith(e))))&&(r[t]=Be(e,t,void 0,o));return n?Ce(r):ze(t,Ce(r))},Ze=e=>e instanceof RegExp,Ye=e=>_e(e)&&!Ze(e)?e:{value:e,message:""},Je=e=>"function"==typeof e,Ke=e=>qe(e)||n.isValidElement(e);function et(e,t,n){if(void 0===n&&(n="validate"),Ke(e)||He(e)&&!e)return{type:n,message:Ke(e)?e:"",ref:t}}var tt=(e,t,n,o,l)=>t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),{[o]:l||!0})}):{},nt=function(e,t,n,o){let{ref:l,ref:{value:r},options:i,required:a,maxLength:s,minLength:c,min:u,max:d,pattern:m,validate:p}=n;try{let n=!1;const v=l.name,f={},g=Le(l),E=Pe(l),y=g||E,h=""===r,_=tt.bind(null,v,t,f),S=function(e,t,n,o,r){void 0===o&&(o="maxLength"),void 0===r&&(r="minLength");const i=e?t:n;f[v]=Object.assign({type:e?o:r,message:i,ref:l},_(e?o:r,i))};if(a&&(!g&&!E&&(h||ye(r))||He(r)&&!r||E&&!Ue(i).isValid||g&&!Ae(i).isValid)){const{value:n,message:o}=Ke(a)?{value:!!a,message:a}:Ye(a);if(n&&(f[v]=Object.assign({type:"required",message:o,ref:y?((e.current[v].options||[])[0]||{}).ref:l},_("required",o)),!t))return Promise.resolve(f)}if(!(ye(u)&&ye(d)||""===r)){let e,n;const o=Ye(d),i=Ye(u);if(isNaN(r)){const t=l.valueAsDate||new Date(r);qe(o.value)&&(e=t>new Date(o.value)),qe(i.value)&&(n=t<new Date(i.value))}else{const t=l.valueAsNumber||parseFloat(r);ye(o.value)||(e=t>o.value),ye(i.value)||(n=t<i.value)}if((e||n)&&(S(!!e,o.message,i.message,"max","min"),!t))return Promise.resolve(f)}if(qe(r)&&!h&&(s||c)){const e=Ye(s),n=Ye(c),o=!ye(e.value)&&r.length>e.value,l=!ye(n.value)&&r.length<n.value;if((o||l)&&(S(o,e.message,n.message),!t))return Promise.resolve(f)}if(qe(r)&&m&&!h){const{value:e,message:n}=Ye(m);if(Ze(e)&&!e.test(r)&&(f[v]=Object.assign({type:"pattern",message:n,ref:l},_("pattern",n)),!t))return Promise.resolve(f)}const b=function(){if(p){const r=Be(e,v,o,!1,!0),a=y&&i?i[0].ref:l;return Je(p)?Promise.resolve(p(r)).then(function(e){const o=et(e,a);if(o&&(f[v]=Object.assign(Object.assign({},o),_("validate",o.message)),!t))return n=!0,f}):function(){if(_e(p)){let o=!1;function e(){if(!je(l)&&(f[v]=Object.assign({ref:a},l),!t))return n=!0,f}let l={};const i=ee(Object.entries(p),function(e){let[n,i]=e;if(je(l)||t)return Promise.resolve(i(r)).then(function(e){const o=et(e,a,n);o&&(l=Object.assign(Object.assign({},o),_(n,o.message)),t&&(f[v]=l))});o=!0},function(){return o});return i&&i.then?i.then(e):e()}}()}}();return Promise.resolve(b&&b.then?b.then(function(e){return n?e:f}):n?b:f)}catch(e){return Promise.reject(e)}};const ot=function(e,t,n){void 0===n&&(n=[]);for(const o in t){const l=e+(_e(t)?"."+o:`[${o}]`);$e(t[o])?n.push(l):ot(l,t[o],n)}return n};var lt=(e,t,n,o,l)=>{let r=void 0;return n.add(t),je(e)||(r=De(e,t),(_e(r)||Array.isArray(r))&&ot(t,r).forEach(e=>n.add(e))),Ie(r)?l?o:De(o,t):r},rt=e=>{let{isOnBlur:t,isOnChange:n,isOnTouch:o,isTouched:l,isReValidateOnBlur:r,isReValidateOnChange:i,isBlurEvent:a,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&o?!(l||a):(s?r:t)?!a:!(s?i:n)||a)},it=e=>e.substring(0,e.indexOf("[")),at=(e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)),st="undefined"!=typeof window&&"undefined"!=typeof document;function ct(e){var t;let n;if($e(e)||st&&(e instanceof File||ge(e)))return e;if(!["Set","Map","Object","Date","Array"].includes(null===(t=e.constructor)||void 0===t?void 0:t.name))return e;if(e instanceof Date)return n=new Date(e.getTime()),n;if(e instanceof Set){n=new Set;for(const t of e)n.add(t);return n}if(e instanceof Map){n=new Map;for(const t of e.keys())n.set(t,ct(e.get(t)));return n}n=Array.isArray(e)?[]:{};for(const t in e)n[t]=ct(e[t]);return n}var ut=e=>({isOnSubmit:!e||e===Ee.onSubmit,isOnBlur:e===Ee.onBlur,isOnChange:e===Ee.onChange,isOnAll:e===Ee.all,isOnTouch:e===Ee.onTouched}),dt=e=>Le(e)||Pe(e);const mt="undefined"==typeof window,pt=st?"Proxy"in window:"undefined"!=typeof Proxy,vt=n.createContext(null);vt.displayName="RHFContext";const ft=e=>{const{as:t,render:o}=e,l=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:r,meta:i}=function(e){let{name:t,rules:o,defaultValue:l,control:r,onFocus:i}=e;const a=n.useContext(vt);if("production"!==process.env.NODE_ENV&&!r&&!a)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:s,setValue:c,register:u,unregister:d,trigger:m,mode:p,reValidateMode:{isReValidateOnBlur:v,isReValidateOnChange:f},formState:g,formStateRef:{current:{isSubmitted:E,touched:y,errors:h}},updateFormState:_,readFormStateRef:S,fieldsRef:b,fieldArrayNamesRef:O,shallowFieldsStateRef:N}=r||a.control,C=!at(O.current,t),I=()=>!Ie(De(N.current,t))&&C?De(N.current,t):Ie(l)?De(s.current,t):l,[D,w]=n.useState(I()),T=n.useRef(D),A=n.useRef({focus:()=>null}),L=n.useRef(i||(()=>{Je(A.current.focus)&&A.current.focus(),"production"!==process.env.NODE_ENV&&(Je(A.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"))})),R=n.useCallback(e=>!rt(Object.assign({isBlurEvent:e,isReValidateOnBlur:v,isReValidateOnChange:f,isSubmitted:E,isTouched:!!De(y,t)},p)),[v,f,E,y,t,p]),P=n.useCallback(e=>{let[t]=e;const n=(e=>$e(e)||!_e(e.target)||_e(e.target)&&!e.type?e:Ie(e.target.value)?e.target.checked:e.target.value)(t);return w(n),T.current=n,n},[]),x=n.useCallback(e=>{if("production"!==process.env.NODE_ENV&&!t)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");b.current[t]?b.current[t]=Object.assign({ref:b.current[t].ref},o):(u(Object.defineProperties({name:t,focus:L.current},{value:{set(e){w(e),T.current=e},get:()=>T.current}}),o),e=Ie(De(s.current,t))),e&&C&&w(I())},[o,t,u]);n.useEffect(()=>()=>d(t),[t]),n.useEffect(()=>{"production"!==process.env.NODE_ENV&&(Ie(D)&&console.warn(`📋 ${t} 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)`),!C&&Ie(l)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),x()},[x]),n.useEffect(()=>{!b.current[t]&&x(!0)});const M=n.useCallback(()=>{S.current.touched&&!De(y,t)&&(Ne(y,t,!0),_({touched:y})),R(!0)&&m(t)},[t,_,R,m,S]);return{field:{onChange:n.useCallback(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return c(t,P(n),{shouldValidate:R(),shouldDirty:!0})},[c,t,R]),onBlur:M,name:t,value:D,ref:A},meta:Object.defineProperties({invalid:!!De(h,t)},{isDirty:{get:()=>!!De(g.dirtyFields,t)},isTouched:{get:()=>!!De(g.touched,t)}})}}(e),a=Object.assign(Object.assign({},l),r);return t?n.isValidElement(t)?n.cloneElement(t,a):n.createElement(t,a):o?o(r,i):null},gt=e=>{let{control:n,t:l}=e;const r=window.Digit.Utils.browser.isMobile();return o.createElement(Fragment,null,o.createElement(t.SearchField,{className:"pt-form-field"},o.createElement("label",null,l("AUDIT_FROM_DATE_LABEL")),o.createElement(ft,{render:e=>o.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:n})),o.createElement(t.SearchField,{className:"pt-form-field"},o.createElement("label",null,l("AUDIT_TO_DATE_LABEL")),o.createElement(ft,{render:e=>o.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:n})),o.createElement(t.SearchField,{className:"pt-search-action-submit"},o.createElement(t.Button,{style:{marginTop:r?"510px":"25px",marginLeft:r?"0":"-30px",maxWidth:r?"100%":"240px"},label:l("ES_COMMON_APPLY"),submit:!0})))},Et=e=>{var l;let{Controller:r,register:i,control:a,t:s,reset:c,previousPage:u,handleSubmit:d,tenantId:m,data:p,onSubmit:v,isLoading:f}=e;const[g,y]=n.useState([]),h=e=>o.createElement("div",{onClick:e.onClick},o.createElement(t.DownloadBtnCommon,null));n.useEffect(()=>{(null==p?void 0:p.length)>0&&y([null==p?void 0:p.map(e=>{let t={};return t[s("AUDIT_DATE_LABEL")]=_(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=S(null==e?void 0:e.timestamp),t[s("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[s("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[s("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[p]);const _=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,o=t.getDate();return n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${o}/${n}/${t.getFullYear()}`},S=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),o=t.getMinutes(),l=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${n}:${o} ${l}`},[b,O]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),N=()=>{O({type:"remove"})},C=()=>o.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:N},o.createElement(t.CloseSvg,null)),I={Controller:r,register:i,control:a,t:s,reset:c,previousPage:u},D=n.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:r,...i}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:r,...i}=e;const{closeMobilePopupModal:a}=i;switch(n){case"SearchFormComponent":return o.createElement(t.SearchForm,i,o.createElement(C,null),o.createElement("div",{className:"MobilePopupHeadingWrapper"},o.createElement("h2",null,s("PRIVACY_AUDIT_REPORT"),":")),o.createElement(gt,E({},l,{closeMobilePopupModal:a,tenantId:r,t:s})));default:return o.createElement("span",null)}})({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:r,...i})},[b]);null==p||null===(l=p.roles)||void 0===l||l.forEach(e=>{});const w=n.useMemo(()=>null!=p&&p.display||""===p?[]:null==p?void 0:p.map(e=>{var t;return{[s("AUDIT_DATE_LABEL")]:_(e.timestamp),[s("AUDIT_TIME_LABEL")]:S(e.timestamp),[s("AUDIT_DATAVIEWED_LABEL")]:e.dataView[0]+","+e.dataView[1],[s("AUDIT_DATAVIEWED_BY_LABEL")]:e.dataViewedBy,[s("AUDIT_ROLE_LABEL")]:null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name).join(",")}}),[p]);return o.createElement(o.Fragment,null,o.createElement(t.BackButton,null),o.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},o.createElement(h,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(g)})),o.createElement(t.Header,null,s("PRIVACY_AUDIT_REPORT"),":"),o.createElement("div",{className:"digit-search-box"},o.createElement(t.SearchAction,{text:s("ES_COMMON_SEARCH"),handleActionClick:()=>O({type:"set",payload:"SearchFormComponent"}),tenantId:m,t:s})),b?o.createElement(t.PopUp,null,o.createElement(D,{onSubmit:e=>{O({type:"remove"}),v(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:I,currentlyActiveMobileModal:b,closeMobilePopupModal:N,tenantId:m})):null,f&&o.createElement(t.Loader,null),o.createElement(t.DetailsCard,{data:w}))},yt=e=>{let{tenantId:l,t:r,onSubmit:i,data:a,count:c}=e;const u=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"},{register:d,control:m,handleSubmit:p,setValue:v,getValues:f,reset:g}=function(e){let{mode:t=Ee.onSubmit,reValidateMode:o=Ee.onChange,resolver:l,context:r,defaultValues:i={},shouldFocusError:a=!0,shouldUnregister:s=!0,criteriaMode:c}=void 0===e?{}:e;const u=n.useRef({}),d=n.useRef({}),m=n.useRef({}),p=n.useRef(new Set),v=n.useRef({}),f=n.useRef({}),g=n.useRef({}),E=n.useRef({}),y=n.useRef(i),h=n.useRef(!1),_=n.useRef(!1),S=n.useRef(),b=n.useRef({}),O=n.useRef({}),N=n.useRef(r),C=n.useRef(l),I=n.useRef(new Set),D=n.useRef(ut(t)),{isOnSubmit:w,isOnTouch:T}=D.current,A=c===Ee.all,[L,R]=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!w,errors:{}}),P=n.useRef({isDirty:!pt,dirtyFields:!pt,touched:!pt||T,isValidating:!pt,isSubmitting:!pt,isValid:!pt}),x=n.useRef(L),M=n.useRef(),{isOnBlur:k,isOnChange:U}=n.useRef(ut(o)).current;N.current=r,C.current=l,x.current=L,b.current=s?{}:je(b.current)?ct(i):b.current;const B=n.useCallback(function(e){void 0===e&&(e={}),h.current||(x.current=Object.assign(Object.assign({},x.current),e),R(x.current))},[]),F=()=>P.current.isValidating&&B({isValidating:!0}),j=n.useCallback(function(e,t,n,o,l){void 0===n&&(n=!1),void 0===o&&(o={});let r=n||(e=>{let{errors:t,name:n,error:o,validFields:l,fieldsWithValidation:r}=e;const i=Ie(o),a=De(t,n);return i&&!!a||!i&&!We(a,o,!0)||i&&De(r,n)&&!De(l,n)})({errors:x.current.errors,error:t,name:e,validFields:E.current,fieldsWithValidation:g.current});const i=De(x.current.errors,e);t?(Ge(E.current,e),r=r||!i||!We(i,t,!0),Ne(x.current.errors,e,t)):((De(g.current,e)||C.current)&&(Ne(E.current,e,!0),r=r||i),Ge(x.current.errors,e)),(r&&!ye(n)||!je(o)||P.current.isValidating)&&B(Object.assign(Object.assign(Object.assign({},o),C.current?{isValid:!!l}:{}),{isValidating:!1}))},[]),H=n.useCallback((e,t)=>{const{ref:n,options:o}=u.current[e],l=st&&ge(n)&&ye(t)?"":t;Le(n)?(o||[]).forEach(e=>{let{ref:t}=e;return t.checked=t.value===l}):Re(n)&&!qe(l)?n.files=l:xe(n)?[...n.options].forEach(e=>e.selected=l.includes(e.value)):Pe(n)&&o?o.length>1?o.forEach(e=>{let{ref:t}=e;return t.checked=Array.isArray(l)?!!l.find(e=>e===t.value):l===t.value}):o[0].ref.checked=!!l:n.value=l},[]),G=n.useCallback((e,t)=>{if(P.current.isDirty){const n=J();return e&&t&&Ne(n,e,t),!We(n,y.current)}return!1},[]),V=n.useCallback(function(e,t){if(void 0===t&&(t=!0),P.current.isDirty||P.current.dirtyFields){const n=!We(De(y.current,e),Be(u,e,b)),o=De(x.current.dirtyFields,e),l=x.current.isDirty;n?Ne(x.current.dirtyFields,e,!0):Ge(x.current.dirtyFields,e);const r={isDirty:G(),dirtyFields:x.current.dirtyFields},i=P.current.isDirty&&l!==r.isDirty||P.current.dirtyFields&&o!==De(x.current.dirtyFields,e);return i&&t&&B(r),i?r:{}}return{}},[]),$=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||u.current[e]?Promise.resolve(nt(u,A,u.current[e],b)).then(function(n){const o=n[e];return j(e,o,t),Ie(o)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[j,A]),z=n.useCallback(function(e){try{return Promise.resolve(C.current(J(),N.current,A)).then(function(t){let{errors:n}=t;const o=x.current.isValid;if(Array.isArray(e)){const t=e.map(e=>{const t=De(n,e);return t?Ne(x.current.errors,e,t):Ge(x.current.errors,e),!t}).every(Boolean);return B({isValid:je(n),isValidating:!1}),t}{const t=De(n,e);return j(e,t,o!==je(n),{},je(n)),!t}})}catch(e){return Promise.reject(e)}},[j,A]),W=n.useCallback(function(e){try{let n=!1;function t(e){return n?e:Promise.resolve($(o))}const o=e||Object.keys(u.current);if(F(),C.current)return Promise.resolve(z(o));const l=function(){if(Array.isArray(o))return!e&&(x.current.errors={}),Promise.resolve(Promise.all(o.map(function(e){try{return Promise.resolve($(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){B({isValidating:!1});const t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(l&&l.then?l.then(t):t(l))}catch(e){return Promise.reject(e)}},[z,$]),X=n.useCallback((e,t,n)=>{let{shouldDirty:o,shouldValidate:l}=n;const r={};Ne(r,e,t);for(const n of ot(e,t))u.current[n]&&(H(n,De(r,n)),o&&V(n),l&&W(n))},[W,H,V]),q=n.useCallback((e,t,n)=>{if(!s&&!$e(t)&&Ne(b.current,e,Array.isArray(t)?[...t]:Object.assign({},t)),u.current[e])H(e,t),n.shouldDirty&&V(e),n.shouldValidate&&W(e);else if(!$e(t)&&(X(e,t,n),I.current.has(e))){const o=it(e)||e;Ne(d.current,e,t),O.current[o]({[o]:De(d.current,o)}),(P.current.isDirty||P.current.dirtyFields)&&n.shouldDirty&&(Ne(x.current.dirtyFields,e,((e,t,n)=>ze(Xe(e,t,n.slice(0,e.length)),Xe(t,e,n.slice(0,e.length))))(t,De(y.current,e,[]),De(x.current.dirtyFields,e,[]))),B({isDirty:!We(Object.assign(Object.assign({},J()),{[e]:t}),y.current)}))}!s&&Ne(b.current,e,t)},[V,H,X]),Q=e=>_.current||p.current.has(e)||p.current.has((e.match(/\w+/)||[])[0]),Z=e=>{let t=!0;if(!je(v.current))for(const n in v.current)e&&v.current[n].size&&!v.current[n].has(e)&&!v.current[n].has(it(e))||(f.current[n](),t=!1);return t};function Y(e){if(!s){let t=ct(e);for(const e of I.current)Se(e)&&!t[e]&&(t=Object.assign(Object.assign({},t),{[e]:[]}));return t}return e}function J(e){if(qe(e))return Be(u,e,b);if(Array.isArray(e)){const t={};for(const n of e)Ne(t,n,Be(u,n,b));return t}return Y(Qe(u,ct(b.current),s))}S.current=S.current?S.current:function(e){let{type:t,target:n}=e;try{let e=n.name;const o=u.current[e];let l,r;return Promise.resolve(function(){if(o){function i(){!a&&Z(e),j(e,l,m,d,r)}const a="blur"===t,c=rt(Object.assign({isBlurEvent:a,isReValidateOnChange:U,isReValidateOnBlur:k,isTouched:!!De(x.current.touched,e),isSubmitted:x.current.isSubmitted},D.current));let d=V(e,!1),m=!je(d)||!a&&Q(e);if(a&&!De(x.current.touched,e)&&P.current.touched&&(Ne(x.current.touched,e,!0),d=Object.assign(Object.assign({},d),{touched:x.current.touched})),!s&&Pe(n)&&Ne(b.current,e,Be(u,e)),c)return!a&&Z(e),(!je(d)||m&&je(d))&&B(d);F();const p=C.current?Promise.resolve(C.current(J(),N.current,A)).then(function(t){let{errors:o}=t;const i=x.current.isValid;if(l=De(o,e),Pe(n)&&!l&&C.current){const t=it(e),n=De(o,t,{});n.type&&n.message&&(l=n),t&&(n||De(x.current.errors,t))&&(e=t)}r=je(o),i!==r&&(m=!0)}):Promise.resolve(nt(u,A,o,b)).then(function(t){l=t[e]});return p&&p.then?p.then(i):i()}}())}catch(e){return Promise.reject(e)}};const K=n.useCallback(function(e){void 0===e&&(e={});try{const t=je(u.current)?y.current:{};return Promise.resolve(C.current(Object.assign(Object.assign(Object.assign({},t),J()),e),N.current,A)).then(function(e){let{errors:t}=e;const n=je(t);x.current.isValid!==n&&B({isValid:n})})}catch(e){return Promise.reject(e)}},[A]),te=n.useCallback((e,t)=>{!function(e,t,n,o,l,r){const{ref:i,ref:{name:a}}=n,s=e.current[a];if(!l){const t=Be(e,a,o);!Ie(t)&&Ne(o.current,a,t)}i.type&&s?Le(i)||Pe(i)?Array.isArray(s.options)&&s.options.length?(be(s.options).forEach(function(e,n){void 0===e&&(e={}),(Fe(e.ref)&&Ve(e,e.ref)||r)&&(we(e.ref,t),Ge(s.options,`[${n}]`))}),s.options&&!be(s.options).length&&delete e.current[a]):delete e.current[a]:(Fe(i)&&Ve(s,i)||r)&&(we(i,t),delete e.current[a]):delete e.current[a]}(u,S.current,e,b,s,t),s&&(Ge(E.current,e.ref.name),Ge(g.current,e.ref.name))},[s]),ne=n.useCallback(e=>{if(_.current)B();else{for(const t of p.current)if(t.startsWith(e)){B();break}Z(e)}},[]),oe=n.useCallback((e,t)=>{e&&(te(e,t),s&&!be(e.options||[]).length&&(Ge(x.current.errors,e.ref.name),Ne(x.current.dirtyFields,e.ref.name,!0),B({isDirty:G()}),P.current.isValid&&C.current&&K(),ne(e.ref.name)))},[K,te]),le=n.useCallback((e,t,n)=>{const o=n?v.current[n]:p.current;let l=Qe(u,ct(b.current),s,!1,e);if(qe(e)){const n=it(e)||e;return I.current.has(n)&&(l=Object.assign(Object.assign({},m.current),l)),lt(l,e,o,Ie(De(y.current,e))?t:De(y.current,e),!0)}const r=Ie(t)?y.current:t;return Array.isArray(e)?e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:lt(l,t,o,r)}),{}):(_.current=Ie(n),Ce(!je(l)&&l||r))},[]);function re(e,t){if(void 0===t&&(t={}),"production"!==process.env.NODE_ENV){if(!e.name)return console.warn("📋 Field is missing `name` attribute",e,"https://react-hook-form.com/api#useForm");if(I.current.has(e.name.split(/\[\d+\]$/)[0])&&!RegExp(`^${e.name.split(/\[\d+\]$/)[0]}[\\d+].\\w+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e.name))return console.warn('📋 `name` prop should be in object shape: name="test[index].name"',e,"https://react-hook-form.com/api#useFieldArray")}const{name:n,type:o,value:l}=e,r=Object.assign({ref:e},t),i=u.current,a=dt(e),c=at(I.current,n),d=t=>st&&(!ge(e)||t===e);let m,p=i[n],v=!0;if(p&&(a?Array.isArray(p.options)&&be(p.options).find(e=>l===e.ref.value&&d(e.ref)):d(p.ref)))return void(i[n]=Object.assign(Object.assign({},p),t));p=o?a?Object.assign({options:[...be(p&&p.options||[]),{ref:e}],ref:{type:o,name:n}},t):Object.assign({},r):r,i[n]=p;const f=Ie(De(b.current,n));je(y.current)&&f||(m=De(f?y.current:b.current,n),v=Ie(m),v||c||H(n,m)),je(t)||(Ne(g.current,n,!0),!w&&P.current.isValid&&nt(u,A,p,b).then(e=>{const t=x.current.isValid;je(e)?Ne(E.current,n,!0):Ge(E.current,n),t!==je(e)&&B()})),!s||c&&v||!c&&Ge(x.current.dirtyFields,n),o&&function(e,t,n){let{ref:o}=e;ge(o)&&n&&(o.addEventListener(t?"change":"input",n),o.addEventListener("blur",n))}(a&&p.options?p.options[p.options.length-1]:p,a||"select-one"===e.type,S.current)}const ie=n.useCallback((e,t)=>function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());let o={},l=Y(Qe(u,ct(b.current),s,!0));return P.current.isSubmitting&&B({isSubmitting:!0}),Promise.resolve(function(r,i){try{var s=function(){function r(){const r=function(){if(je(o)&&Object.keys(x.current.errors).every(e=>e in u.current))return B({errors:{},isSubmitting:!0}),Promise.resolve(e(l,n)).then(function(){});{function r(e){a&&((e,t)=>{for(const n in e)if(De(t,n)){const t=e[n];if(t){if(t.ref.focus&&Ie(t.ref.focus()))break;if(t.options){t.options[0].ref.focus();break}}}})(u.current,x.current.errors)}return x.current.errors=Object.assign(Object.assign({},x.current.errors),o),t?Promise.resolve(t(x.current.errors,n)).then(r):r()}}();if(r&&r.then)return r.then(function(){})}const i=C.current?Promise.resolve(C.current(l,N.current,A)).then(function(e){let{errors:t,values:n}=e;x.current.errors=o=t,l=n}):ee(Object.values(u.current),function(e){const t=function(){if(e){const{name:t}=e.ref;return Promise.resolve(nt(u,A,e,b)).then(function(e){e[t]?(Ne(o,t,e[t]),Ge(E.current,t)):De(g.current,t)&&(Ge(x.current.errors,t),Ne(E.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return i&&i.then?i.then(r):r()}()}catch(e){return i(!0,e)}return s&&s.then?s.then(i.bind(null,!1),i.bind(null,!0)):i(!1,s)}(0,function(e,t){if(x.current.isSubmitting=!1,B({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:je(x.current.errors),submitCount:x.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}},[a,A]);n.useEffect(()=>{l&&P.current.isValid&&K(),M.current=M.current||!st?M.current:function(e,t){const n=new MutationObserver(()=>{for(const n of Object.values(e.current))if(n&&n.options)for(const e of n.options)e&&e.ref&&Fe(e.ref)&&t(n);else n&&Fe(n.ref)&&t(n)});return n.observe(window.document,{childList:!0,subtree:!0}),n}(u,oe)},[oe,y.current]),n.useEffect(()=>()=>{M.current&&M.current.disconnect(),h.current=!0,"production"===process.env.NODE_ENV&&Object.values(u.current).forEach(e=>oe(e,!0))},[]),!l&&P.current.isValid&&(L.isValid=We(E.current,g.current)&&je(x.current.errors));const ae={trigger:W,setValue:n.useCallback(function(e,t,n){q(e,t,n||{}),Q(e)&&B(),Z(e)},[q,W]),getValues:n.useCallback(J,[]),register:n.useCallback(function(e,t){if(!mt)if(qe(e))re({name:e},t);else{if(!_e(e)||!("name"in e))return t=>t&&re(t,e);re(e,t)}},[y.current]),unregister:n.useCallback(function(e){for(const t of Array.isArray(e)?e:[e])oe(u.current[t],!0)},[]),formState:pt?new Proxy(L,{get:(e,t)=>{if("production"!==process.env.NODE_ENV&&"isValid"===t&&w&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return P.current[t]=!0,e[t]}}):L},se=n.useMemo(()=>Object.assign({isFormDirty:G,updateWatchedValue:ne,shouldUnregister:s,updateFormState:B,removeFieldEventListener:te,watchInternal:le,mode:D.current,reValidateMode:{isReValidateOnBlur:k,isReValidateOnChange:U},validateResolver:l?K:void 0,fieldsRef:u,resetFieldArrayFunctionRef:O,useWatchFieldsRef:v,useWatchRenderFunctionsRef:f,fieldArrayDefaultValuesRef:d,validFieldsRef:E,fieldsWithValidationRef:g,fieldArrayNamesRef:I,readFormStateRef:P,formStateRef:x,defaultValuesRef:y,shallowFieldsStateRef:b,fieldArrayValuesRef:m},ae),[y.current,ne,s,te,le]);return Object.assign({watch:function(e,t){return le(e,t)},control:se,handleSubmit:ie,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),st)for(const e of Object.values(u.current))if(e){const{ref:t,options:n}=e,o=dt(t)&&Array.isArray(n)?n[0].ref:t;if(ge(o))try{o.closest("form").reset();break}catch(e){}}u.current={},y.current=Object.assign({},e||y.current),e&&Z(""),Object.values(O.current).forEach(e=>Je(e)&&e()),b.current=s?{}:ct(e||y.current),(e=>{let{errors:t,isDirty:n,isSubmitted:o,touched:l,isValid:r,submitCount:i,dirtyFields:a}=e;r||(E.current={},g.current={}),d.current={},p.current=new Set,_.current=!1,B({submitCount:i?x.current.submitCount:0,isDirty:!!n&&x.current.isDirty,isSubmitted:!!o&&x.current.isSubmitted,isValid:!!r&&x.current.isValid,dirtyFields:a?x.current.dirtyFields:{},touched:l?x.current.touched:{},errors:t?x.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(t)},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>u.current[e]&&Se(e)?delete x.current.errors[e]:Ge(x.current.errors,e)),B({errors:e?x.current.errors:{}})},[]),setError:n.useCallback(function(e,t){const n=(u.current[e]||{}).ref;Ne(x.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),B({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:L.errors},ae)}({defaultValues:u}),E=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,o=t.getDate();return n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${o}/${n}/${t.getFullYear()}`},y=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),o=t.getMinutes(),l=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,o=(o>9?"":"0")+o,`${n}:${o} ${l}`},[h,_]=n.useState([]),S=e=>o.createElement("div",{onClick:e.onClick},o.createElement(s.DownloadBtnCommon,null));n.useEffect(()=>{d("offset",0),d("limit",5),d("sortOrder","DESC")},[d]),n.useEffect(()=>{(null==a?void 0:a.length)>0&&_([null==a?void 0:a.map(e=>{let t={};return t[r("AUDIT_DATE_LABEL")]=E(null==e?void 0:e.timestamp),t[r("AUDIT_TIME_LABEL")]=y(null==e?void 0:e.timestamp),t[r("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[r("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[r("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[a]);const b=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function O(){v("offset",f("offset")-f("limit")),p(i)()}const N=window.Digit.Utils.browser.isMobile();if(N)return o.createElement(Et,{Controller:ft,register:d,control:m,t:r,reset:g,previousPage:O,handleSubmit:p,tenantId:l,data:a,onSubmit:i});const C=e=>o.createElement("span",{className:"cell-text"},e),I=n.useMemo(()=>[{Header:r("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):E(e.timestamp);return C(""+t)}},{Header:r("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):y(e.timestamp);return C(""+t)}},{Header:r(N?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>C(""+(null==e?void 0:e.dataView))},{Header:r(N?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>C(""+(null==e?void 0:e.dataViewedBy))},{Header:r("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return C(""+(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name)))}}],[]);return o.createElement(o.Fragment,null,o.createElement("div",{style:{marginRight:"-70px"}}," ",o.createElement(t.BackButton,null)," "),o.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",o.createElement(t.Header,null,r("PRIVACY_AUDIT_REPORT"))," "),o.createElement(t.SearchForm,{className:"audit-card",onSubmit:i,handleSubmit:p},o.createElement(gt,{register:d,control:m,reset:g,tenantId:l,t:r,previousPage:O})),o.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=a&&a.display?o.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},r(a.display).split("\\n").map((e,t)=>o.createElement("p",{key:t,style:{textAlign:"center"}},e))):""!==a?o.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},o.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},o.createElement(S,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(h)})),o.createElement(s.Table,{t:r,data:a,totalRecords:c,columns:I,getCellProps:e=>({style:{minWidth:e.column.Header===r("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){v("limit",Number(e.target.value)),p(i)()},currentPage:f("offset")/f("limit"),onNextPage:function(){v("offset",f("offset")+f("limit")),p(i)()},onPrevPage:O,manualPagination:!1,pageSizeLimit:f("limit"),onSort:b,disableSort:!1,sortParams:[{id:f("sortBy"),desc:"DESC"===f("sortOrder")}]})):o.createElement(t.Loader,null)))},ht=e=>{var t,r;const{t:i}=l.useTranslation(),a=Digit.ULBService.getCitizenCurrentTenant(),[s,c]=n.useState({}),u=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),o=new Date(Date.UTC(n[1],n[2]-1,n[3]));return o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),"dayend"===t&&(o.setHours(o.getHours()+24),o.setSeconds(o.getSeconds()-1)),o.getTime()}catch(t){return e}};n.useEffect(()=>{const e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){const t={...e};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);const d={enabled:!!(s&&Object.keys(s).length>0)},m={...s},{isLoading:p,data:v}=Digit.Hooks.useAudit({tenantId:a,filters:{...m},config:d});return o.createElement(yt,{t:i,tenantId:a,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});const t={...e,fromDate:u(null==e?void 0:e.fromDate),toDate:u(null==e?void 0:e.toDate)};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:t[n]}),{}))},data:p?"":(null==v||null===(t=v.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==v?void 0:v.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==v||null===(r=v.ElasticSearchData)||void 0===r?void 0:r.length})},_t=e=>{var n,r,i,a,s,c,u,d,m,p,v,f,g,E,y,h;let{moduleCode:_}=e;const{t:S}=l.useTranslation(),b=Digit.ULBService.getCitizenCurrentTenant(),{isLoading:O,data:N}=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),{isLoading:C,error:I,data:D}=Digit.Hooks.useDynamicData({moduleCode:_,tenantId:b,filters:{},t:S}),w=e=>{let{module:n,styles:l}=e;switch(n){case"TL":return o.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:l});case"PT":return o.createElement(t.PTIcon,{className:"fill-path-primary-main",styles:l});case"MCOLLECT":return o.createElement(t.MCollectIcon,{className:"fill-path-primary-main",styles:l});case"PGR":return o.createElement(t.ComplaintIcon,{className:"fill-path-primary-main",styles:l});default:return o.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:l})}},T=null==N||null===(n=N.MdmsRes["common-masters"])||void 0===n||null===(r=n.StaticData[0])||void 0===r?void 0:r[""+_],A=e=>{let{module:n}=e;switch(n){case"PT":case"WS":return o.createElement("span",{className:"timerIcon"},o.createElement(t.TimerIcon,null));default:return null}},L=e=>{let{module:n}=e;switch(n){case"PT":return o.createElement("span",{className:"rupeeSymbol"},o.createElement(t.RupeeSymbol,null));case"WS":return o.createElement("span",{className:"timerIcon"},o.createElement(t.TimerIcon,null));default:return null}},R=e=>{switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:S("COMMON_VALIDITY"),validity:(null==T?void 0:T.validity)+S("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};case"PGR":return{staticCommonContent:S("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:S("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==T?void 0:T.validity)+" "+S("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},P=e=>{switch(e){case"PT":return{staticDataOne:(null==T?void 0:T.staticDataOne)+" "+S("COMMON_DAYS"),staticDataOneHeader:S("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==T?void 0:T.staticDataTwo,staticDataTwoHeader:S("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:S("PAY_WATER_CHARGES_BY")+" "+(null==T?void 0:T.staticDataOne)+" "+S("COMMON_DAYS")+" "+S("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==T?void 0:T.staticDataTwo)+" "+S("COMMON_DAYS"),staticDataTwoHeader:S("APPLICATION_PROCESSING_TIME")};default:return{}}};return O||C?o.createElement(t.Loader,null):T?o.createElement(o.Fragment,null,T&&null!=T&&T.payViaWhatsApp?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"pay-whatsapp-card",onClick:()=>{window.open(null==T?void 0:T.payViaWhatsApp)}},o.createElement("div",{className:"pay-whatsapp-text"},S("PAY_VIA_WHATSAPP")),o.createElement("div",{className:"whatsAppIconG"},o.createElement(t.WhatsappIconGreen,null)))):null,T&&null!=T&&T.helpline?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"static-home-Card"},o.createElement("div",{className:"static-home-Card-header"},S("CALL_CENTER_HELPLINE")),o.createElement("div",{className:"helplineIcon"},o.createElement(t.HelpLineIcon,null))),o.createElement("div",{className:"call-center-card-text"},null!=T&&null!==(i=T.helpline)&&void 0!==i&&i.contactOne?o.createElement("div",{className:"call-center-card-content"},o.createElement("a",{href:"tel:"+(null==T||null===(a=T.helpline)||void 0===a?void 0:a.contactOne)},null==T||null===(s=T.helpline)||void 0===s?void 0:s.contactOne)):null,null!=T&&null!==(c=T.helpline)&&void 0!==c&&c.contactTwo?o.createElement("div",{className:"call-center-card-content"},o.createElement("a",{href:"tel:"+(null==T||null===(u=T.helpline)||void 0===u?void 0:u.contactTwo)},null==T||null===(d=T.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,T&&null!=T&&T.serviceCenter?o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},o.createElement("div",{className:"static-home-Card"},o.createElement("div",{className:"static-home-Card-header"},S("CITIZEN_SERVICE_CENTER")),o.createElement("div",{className:"serviceCentrIcon"},o.createElement(t.ServiceCenterIcon,null))),o.createElement("div",{className:"service-center-details-card"},o.createElement("div",{className:"service-center-details-text"},null==T?void 0:T.serviceCenter)),null!=T&&T.viewMapLocation?o.createElement("div",{className:"link"},o.createElement("a",{href:null==T?void 0:T.viewMapLocation},S("VIEW_ON_MAP"))):null):o.createElement("div",null),o.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},I||null==D||null===(null==D?void 0:D.dynamicDataOne)?o.createElement("div",null):o.createElement("div",{className:"dynamicDataCard"},o.createElement("div",{className:"dynamicData"},o.createElement(w,{module:_,styles:{width:"24px",height:"24px"}}),o.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataOne))),I||null==D||null===(null==D?void 0:D.dynamicDataTwo)?o.createElement("div",null):o.createElement("div",{className:"dynamicDataCard"},o.createElement("div",{className:"dynamicData"},o.createElement(w,{module:_,styles:{width:"24px",height:"24px"}}),o.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataTwo))),T&&null!=T&&T.staticDataOne?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement(A,{module:_}),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=P(_))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(p=P(_))||void 0===p?void 0:p.staticDataOneHeader),o.createElement("span",{className:"static-data-content-second"},""+(null===(v=P(_))||void 0===v?void 0:v.staticDataOne))))):o.createElement("div",null),T&&null!=T&&T.staticDataTwo?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement(L,{module:_}),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(f=P(_))||void 0===f?void 0:f.staticDataTwoHeader),o.createElement("span",{className:"static-data-content-second"},null===(g=P(_))||void 0===g?void 0:g.staticDataTwo)))):o.createElement("div",null),T&&null!=T&&T.validity?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement("span",{className:"validityIcon"},o.createElement(t.ValidityTimeIcon,null)),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(E=R(_))||void 0===E?void 0:E.staticCommonContent),o.createElement("span",{className:"static-data-content-second"},null===(y=R(_))||void 0===y?void 0:y.validity)))):o.createElement("div",null),I||null==D||null==D||!D.staticData||null===(null==D?void 0:D.staticData)?o.createElement("div",null):o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},"PGR"===_?o.createElement(w,{module:_,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):o.createElement("span",{className:"validityIcon"},o.createElement(t.ValidityTimeIcon,null)),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(h=R(_))||void 0===h?void 0:h.staticCommonContent),o.createElement("span",{className:"static-data-content-second"},null==D?void 0:D.staticData)))))):o.createElement(o.Fragment,null)};var St,bt,Ot,Nt,Ct;const It=[(null===(St=window)||void 0===St?void 0:St.contextPath)+"/citizen/register/name",`/${null===(bt=window)||void 0===bt?void 0:bt.contextPath}/citizen/select-language`,`/${null===(Ot=window)||void 0===Ot?void 0:Ot.contextPath}/citizen/select-location`,`/${null===(Nt=window)||void 0===Nt?void 0:Nt.contextPath}/citizen/login`,`/${null===(Ct=window)||void 0===Ct?void 0:Ct.contextPath}/citizen/register/otp`],Dt=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code)),wt=e=>{var n,r,i;let{stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:f,stateCode:E,modules:y,appTenants:h,pathname:_,initData:S}=e;const{isLoading:b,data:O,isFetched:N}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:`[?(@.url == '${Digit.Utils.getMultiRootTenant()?window.globalPath:window.contextPath}-card')]`}],{select:e=>{var t,n;return null==e||null===(t=e["ACCESSCONTROL-ACTIONS-TEST"])||void 0===t||null===(n=t["actions-test"])||void 0===n?void 0:n.filter(e=>!0===e.enabled).reduce((e,t)=>{var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t,...e[t.parentModule]]:[t],e},{})}}),I=Digit.Hooks.useRouteSubscription(_),{t:D}=l.useTranslation(),{path:T}=a.useRouteMatch(),A=a.useHistory(),L=It.some(e=>window.location.href.includes(e)),R=y.map((e,t)=>{let{code:n,tenants:l}=e;const r=Digit.ComponentRegistryService.getComponent(n+"Module");return r?o.createElement(a.Route,{key:t,path:`${T}/${n.toLowerCase()}`},o.createElement(r,{stateCode:E,moduleCode:n,userType:"citizen",tenants:Dt(l,h)})):null}),P=y.map((e,n)=>{let{code:l,bannerImage:r}=e,i=(Digit.ComponentRegistryService.getComponent(l+"Links"),N?C(O,l,D):void 0);return"ACTION_TEST_WS"===(null==i?void 0:i.header)&&(null==i||i.links.sort((e,t)=>t.orderNumber-e.orderNumber)),o.createElement(o.Fragment,null,o.createElement(a.Route,{key:n,path:`${T}/${l.toLowerCase()}-home`},o.createElement("div",{className:"moduleLinkHomePage"},o.createElement("img",{src:r||(null==s?void 0:s.bannerUrl),alt:"noimagefound"}),o.createElement(t.BackLink,{className:"moduleLinkHomePageBackButton",onClick:()=>window.history.back()}),o.createElement("h1",null,D("MODULE_"+l.toUpperCase())),o.createElement("div",{className:"moduleLinkHomePageModuleLinks"},i&&o.createElement(t.CitizenHomeCard,{header:D(null==i?void 0:i.header),links:null==i?void 0:i.links,Icon:()=>o.createElement("span",null),Info:"OBPS"===l?()=>o.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:D("CS_FILE_APPLICATION_INFO_LABEL"),text:D("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===l})),o.createElement(_t,{moduleCode:null==l?void 0:l.toUpperCase()}))),o.createElement(a.Route,{key:"faq"+n,path:`${T}/${l.toLowerCase()}-faq`},o.createElement(W,{module:null==l?void 0:l.toUpperCase()})),o.createElement(a.Route,{key:"hiw"+n,path:`${T}/${l.toLowerCase()}-how-it-works`},o.createElement(le,{module:null==l?void 0:l.toUpperCase()})))});return o.createElement("div",{className:I},o.createElement($,{t:D,stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:f,showSidebar:!!u,linkData:O,islinkDataLoading:b}),o.createElement("div",{className:"main center-container citizen-home-container mb-25"},L?null:o.createElement("div",{className:"SideBarStatic"},o.createElement(U,{linkData:O,islinkDataLoading:b})),o.createElement(a.Switch,null,o.createElement(a.Route,{exact:!0,path:T},o.createElement(X,null)),o.createElement(a.Route,{exact:!0,path:T+"/select-language"},o.createElement(q,null)),o.createElement(a.Route,{exact:!0,path:T+"/select-location"},o.createElement(Q,null)),o.createElement(a.Route,{path:T+"/error"},o.createElement(v,{initData:S,goToHome:()=>{var e,t,n,o;A.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(o=n.getType)||void 0===o?void 0:o.call(n)}`)}})),o.createElement(a.Route,{path:T+"/all-services"},o.createElement(w,{userType:"citizen",modules:y,getCitizenMenu:O,fetchedCitizen:N,isLoading:b})),o.createElement(a.Route,{path:T+"/login"},o.createElement(fe,{stateCode:E})),o.createElement(a.Route,{path:T+"/register"},o.createElement(fe,{stateCode:E,isUserRegistered:!1})),o.createElement(a.Route,{path:T+"/user/profile"},o.createElement(oe,{stateCode:E,userType:"citizen",cityDetails:d})),o.createElement(a.Route,{path:T+"/Audit"},o.createElement(ht,null)),o.createElement(g,{initData:S},R,P))),o.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},o.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(r=n.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};var Tt="function"==typeof Symbol&&Symbol.for,At=Tt?Symbol.for("react.element"):60103,Lt=Tt?Symbol.for("react.portal"):60106,Rt=Tt?Symbol.for("react.fragment"):60107,Pt=Tt?Symbol.for("react.strict_mode"):60108,xt=Tt?Symbol.for("react.profiler"):60114,Mt=Tt?Symbol.for("react.provider"):60109,kt=Tt?Symbol.for("react.context"):60110,Ut=Tt?Symbol.for("react.async_mode"):60111,Bt=Tt?Symbol.for("react.concurrent_mode"):60111,Ft=Tt?Symbol.for("react.forward_ref"):60112,jt=Tt?Symbol.for("react.suspense"):60113,Ht=Tt?Symbol.for("react.suspense_list"):60120,Gt=Tt?Symbol.for("react.memo"):60115,Vt=Tt?Symbol.for("react.lazy"):60116,$t=Tt?Symbol.for("react.block"):60121,zt=Tt?Symbol.for("react.fundamental"):60117,Wt=Tt?Symbol.for("react.responder"):60118,Xt=Tt?Symbol.for("react.scope"):60119;function qt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case At:switch(e=e.type){case Ut:case Bt:case Rt:case xt:case Pt:case jt:return e;default:switch(e=e&&e.$$typeof){case kt:case Ft:case Vt:case Gt:case Mt:return e;default:return t}}case Lt:return t}}}function Qt(e){return qt(e)===Bt}var Zt={AsyncMode:Ut,ConcurrentMode:Bt,ContextConsumer:kt,ContextProvider:Mt,Element:At,ForwardRef:Ft,Fragment:Rt,Lazy:Vt,Memo:Gt,Portal:Lt,Profiler:xt,StrictMode:Pt,Suspense:jt,isAsyncMode:function(e){return Qt(e)||qt(e)===Ut},isConcurrentMode:Qt,isContextConsumer:function(e){return qt(e)===kt},isContextProvider:function(e){return qt(e)===Mt},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===At},isForwardRef:function(e){return qt(e)===Ft},isFragment:function(e){return qt(e)===Rt},isLazy:function(e){return qt(e)===Vt},isMemo:function(e){return qt(e)===Gt},isPortal:function(e){return qt(e)===Lt},isProfiler:function(e){return qt(e)===xt},isStrictMode:function(e){return qt(e)===Pt},isSuspense:function(e){return qt(e)===jt},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Rt||e===Bt||e===xt||e===Pt||e===jt||e===Ht||"object"==typeof e&&null!==e&&(e.$$typeof===Vt||e.$$typeof===Gt||e.$$typeof===Mt||e.$$typeof===kt||e.$$typeof===Ft||e.$$typeof===zt||e.$$typeof===Wt||e.$$typeof===Xt||e.$$typeof===$t)},typeOf:qt},Yt=F(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case c:case u:case l:case i:case r:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case a:return g;default:return t}}case o:return t}}}var S=u,b=s,O=a,N=n,C=d,I=l,D=f,w=v,T=o,A=i,L=r,R=m,P=!1;function x(e){return _(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=b,t.ContextProvider=O,t.Element=N,t.ForwardRef=C,t.Fragment=I,t.Lazy=D,t.Memo=w,t.Portal=T,t.Profiler=A,t.StrictMode=L,t.Suspense=R,t.isAsyncMode=function(e){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),x(e)||_(e)===c},t.isConcurrentMode=x,t.isContextConsumer=function(e){return _(e)===s},t.isContextProvider=function(e){return _(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return _(e)===d},t.isFragment=function(e){return _(e)===l},t.isLazy=function(e){return _(e)===f},t.isMemo=function(e){return _(e)===v},t.isPortal=function(e){return _(e)===o},t.isProfiler=function(e){return _(e)===i},t.isStrictMode=function(e){return _(e)===r},t.isSuspense=function(e){return _(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===i||e===r||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=_}()}),Jt=F(function(e){e.exports="production"===process.env.NODE_ENV?Zt:Yt}),Kt=Object.getOwnPropertySymbols,en=Object.prototype.hasOwnProperty,tn=Object.prototype.propertyIsEnumerable;function nn(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var on=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,o,l=nn(e),r=1;r<arguments.length;r++){for(var i in n=Object(arguments[r]))en.call(n,i)&&(l[i]=n[i]);if(Kt){o=Kt(n);for(var a=0;a<o.length;a++)tn.call(n,o[a])&&(l[o[a]]=n[o[a]])}}return l},ln="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",rn=Function.call.bind(Object.prototype.hasOwnProperty),an=function(){};if("production"!==process.env.NODE_ENV){var sn=ln,cn={},un=rn;an=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function dn(e,t,n,o,l){if("production"!==process.env.NODE_ENV)for(var r in e)if(un(e,r)){var i;try{if("function"!=typeof e[r]){var a=Error((o||"React class")+": "+n+" type `"+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[r]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}i=e[r](t,r,o,n,null,sn)}catch(e){i=e}if(!i||i instanceof Error||an((o||"React class")+": type specification of "+n+" `"+r+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in cn)){cn[i.message]=!0;var s=l?l():"";an("Failed "+n+" type: "+i.message+(null!=s?s:""))}}}dn.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(cn={})};var mn=dn,pn=function(){};function vn(){return null}function fn(){}function gn(){}"production"!==process.env.NODE_ENV&&(pn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),gn.resetWarningCache=fn;var En=F(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,o={array:a("array"),bigint:a("bigint"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:i(vn),arrayOf:function(e){return i(function(t,n,o,l,i){if("function"!=typeof e)return new r("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new r("Invalid "+l+" `"+i+"` of type `"+u(a)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<a.length;s++){var c=e(a,s,o,l,i+"["+s+"]",ln);if(c instanceof Error)return c}return null})},element:i(function(t,n,o,l,i){var a=t[n];return e(a)?null:new r("Invalid "+l+" `"+i+"` of type `"+u(a)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:i(function(e,t,n,o,l){var i=e[t];return Jt.isValidElementType(i)?null:new r("Invalid "+o+" `"+l+"` of type `"+u(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return i(function(t,n,o,l,i){var a;return t[n]instanceof e?null:new r("Invalid "+l+" `"+i+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+o+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:i(function(e,t,n,o,l){return c(e[t])?null:new r("Invalid "+o+" `"+l+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return i(function(t,n,o,l,i){if("function"!=typeof e)return new r("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var a=t[n],s=u(a);if("object"!==s)return new r("Invalid "+l+" `"+i+"` of type `"+s+"` supplied to `"+o+"`, expected an object.");for(var c in a)if(rn(a,c)){var d=e(a,c,o,l,i+"."+c,ln);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&pn(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),vn;function t(t,n,o,i,a){for(var s=t[n],c=0;c<e.length;c++)if(l(s,e[c]))return null;var u=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new r("Invalid "+i+" `"+a+"` of value `"+String(s)+"` supplied to `"+o+"`, expected one of "+u+".")}return i(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&pn("Invalid argument supplied to oneOfType, expected an instance of array."),vn;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return pn("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),vn}return i(function(t,n,o,l,i){for(var a=[],s=0;s<e.length;s++){var c=(0,e[s])(t,n,o,l,i,ln);if(null==c)return null;c.data&&rn(c.data,"expectedType")&&a.push(c.data.expectedType)}return new r("Invalid "+l+" `"+i+"` supplied to `"+o+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return i(function(t,n,o,l,i){var a=t[n],c=u(a);if("object"!==c)return new r("Invalid "+l+" `"+i+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var m in e){var p=e[m];if("function"!=typeof p)return s(o,l,i,m,d(p));var v=p(a,m,o,l,i+"."+m,ln);if(v)return v}return null})},exact:function(e){return i(function(t,n,o,l,i){var a=t[n],c=u(a);if("object"!==c)return new r("Invalid "+l+" `"+i+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");var m=on({},t[n],e);for(var p in m){var v=e[p];if(rn(e,p)&&"function"!=typeof v)return s(o,l,i,p,d(v));if(!v)return new r("Invalid "+l+" `"+i+"` key `"+p+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=v(a,p,o,l,i+"."+p,ln);if(f)return f}return null})}};function l(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function r(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function i(e){function t(t,n,o,l,i,a,s){if(l=l||"<<anonymous>>",a=a||o,s!==ln){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}return null==n[o]?t?new r(null===n[o]?"The "+i+" `"+a+"` is marked as required in `"+l+"`, but its value is `null`.":"The "+i+" `"+a+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:e(n,o,l,i,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return i(function(t,n,o,l,i,a){var s=t[n];return u(s)!==e?new r("Invalid "+l+" `"+i+"` of type `"+d(s)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,o,l){return new r((e||"React class")+": "+t+" type `"+n+"."+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+l+"`.")}function c(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(c);if(null===t||e(t))return!0;var o=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!o)return!1;var l,r=o.call(t);if(o!==t.entries){for(;!(l=r.next()).done;)if(!c(l.value))return!1}else for(;!(l=r.next()).done;){var i=l.value;if(i&&!c(i[1]))return!1}return!0;default:return!1}}function u(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function d(e){if(null==e)return""+e;var t=u(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function m(e){var t=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return r.prototype=Error.prototype,o.checkPropTypes=mn,o.resetWarningCache=mn.resetWarningCache,o.PropTypes=o,o}(Jt.isElement):function(){function e(e,t,n,o,l,r){if(r!==ln){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:gn,resetWarningCache:fn};return n.PropTypes=n,n}()});const yn=e=>{let{children:t}=e;return o.createElement("div",{className:"banner banner-container"},t)},hn=e=>{var n;let{showTenant:r=!0}=e;const{data:i,isLoading:a}=Digit.Hooks.useStore.getInitData(),{stateInfo:s}=i||{},{t:c}=l.useTranslation();return a?o.createElement(t.Loader,null):o.createElement("div",{className:"bannerHeader"},o.createElement("img",{className:"bannerLogo",src:null==s?void 0:s.logoUrl,style:r?{}:{borderRight:"unset"}}),r&&(null==s?void 0:s.code)&&o.createElement("p",null,c("TENANT_TENANTS_"+(null==s||null===(n=s.code)||void 0===n?void 0:n.toUpperCase()))))},_n=e=>{var l,r,i;let{config:c,t:u}=e;const[d,m]=n.useState(null),{mobile_number:p,tenantId:v}=Digit.Hooks.useQueryParams(),f=a.useHistory(),[g,E]=n.useState(""),[y,h]=n.useState(!0),[_,S]=n.useState(null),b=()=>Digit.UserService.getType();n.useEffect(()=>{var e,t;if(!d)return void Digit.UserService.setType("employee");Digit.UserService.setUser(d);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;f.replace(n)},[d]);const O=()=>{S(null)},[N,C,I]=c.inputs,D=[{body:[{label:u(N.label),type:N.type,populators:{name:N.name},isMandatory:!0},{label:u(C.label),type:C.type,populators:{name:C.name},isMandatory:!0},{label:u(I.label),type:I.type,populators:{name:I.name},isMandatory:!0}]}];return o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{variant:"primary",style:{borderBottom:"none"}})),o.createElement(s.FormComposer,{onSubmit:function(e){try{return Promise.resolve(te(function(){if(e.newPassword!==e.confirmPassword)return S(u("ERR_PASSWORD_DO_NOT_MATCH"));const t={...e,otpReference:g,tenantId:v,type:b().toUpperCase()};return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){(()=>{var e;f.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/login`)})()})},function(e){var t,n,o,l,r;S((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.error)||void 0===o||null===(l=o.fields)||void 0===l||null===(r=l[0])||void 0===r?void 0:r.message)||u("ES_SOMETHING_WRONG")),setTimeout(O,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:D,label:c.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},o.createElement(hn,null),o.createElement(s.CardSubHeader,{style:{textAlign:"center"}}," ",c.texts.header," "),o.createElement(s.CardText,null,u("CS_LOGIN_OTP_TEXT")+" ",o.createElement("b",null," ",""+u("+ 91 - ")," ",p)),o.createElement(ce,{t:u,userType:"employee",otp:g,onOtpChange:E,error:y,onResend:function(){try{function e(){setTimeout(O,5e3)}const t={otp:{mobileNumber:p,userType:b().toUpperCase(),type:"passwordreset",tenantId:v}},n=te(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){S(u("ES_OTP_RESEND"))})},function(e){var t,n;S((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||u("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),_&&o.createElement(t.Toast,{type:"error",label:u(_),onClose:O}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(r=l.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};_n.propTypes={loginParams:En.any},_n.defaultProps={loginParams:null};const Sn=[{texts:{header:"CORE_COMMON_RESET_PASSWORD_LABEL",submitButtonLabel:"CORE_COMMON_CHANGE_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",name:"userName",error:"ERR_HRMS_INVALID_USERNAME"},{label:"CORE_LOGIN_NEW_PASSWORD",type:"password",name:"newPassword",error:"CORE_COMMON_REQUIRED_ERRMSG"},{label:"CORE_LOGIN_CONFIRM_NEW_PASSWORD",type:"password",name:"confirmPassword",error:"CORE_COMMON_REQUIRED_ERRMSG"}]}],bn=()=>{const{t:e}=l.useTranslation(),{path:t}=a.useRouteMatch(),r=n.useMemo(()=>Sn.map(t=>{const n={};for(const o in t.texts)n[o]=e(t.texts[o]);return{...t,texts:n}},[Sn]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+t,exact:!0},o.createElement(_n,{config:r[0],t:e})))},On=[{texts:{header:"CORE_COMMON_FORGOT_PASSWORD_LABEL",description:"ES_FORGOT_PASSWORD_DESC",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"mobileNumber",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOBILE_NUMBER"},{label:"CORE_COMMON_CITY",type:"dropdown",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],Nn=e=>{var l,r,i;let{config:s,t:c}=e;const{data:u,isLoading:d}=Digit.Hooks.useTenants(),[m,p]=n.useState(null),v=a.useHistory(),[f,g]=n.useState(null);n.useEffect(()=>{var e,t;if(!m)return void Digit.UserService.setType("employee");Digit.UserService.setUser(m);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;v.replace(n)},[m]);const E=()=>{g(null)},[y,h]=s.inputs,_=[{body:[{label:c(y.label),type:y.type,populators:{name:y.name},isMandatory:!0},{label:c(h.label),type:h.type,populators:{name:h.name,optionsKey:"name",required:!0,options:u},isMandatory:!0}]}];return d?o.createElement(t.Loader,null):o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();const t={otp:{mobileNumber:e.mobileNumber,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=te(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;v.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/change-password?mobile_number=${e.mobileNumber}&tenantId=${e.city.code}`)})},function(e){var t,n,o,l,r;g((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(o=n.error)||void 0===o||null===(l=o.fields)||void 0===l||null===(r=l[0])||void 0===r?void 0:r.message)||"Invalid login credentials!"),setTimeout(E,5e3)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:_,label:s.texts.submitButtonLabel,secondaryActionLabel:s.texts.secondaryButtonLabel,onSecondayActionClick:()=>{var e;v.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/login`)},heading:s.texts.header,description:s.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},o.createElement(hn,null)),f&&o.createElement(t.Toast,{type:"error",label:c(f),onClose:E}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(r=l.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Nn.propTypes={loginParams:En.any},Nn.defaultProps={loginParams:null};const Cn=()=>{const{t:e}=l.useTranslation(),{path:t}=a.useRouteMatch(),r=n.useMemo(()=>On.map(t=>{const n={};for(const o in t.texts)n[o]=e(t.texts[o]);return{...t,texts:n}},[On]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+t,exact:!0},o.createElement(Nn,{config:r[0],t:e})))},In=(e,t)=>t.filter(t=>{var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,e=>e.code).includes(t.code)}),Dn=e=>{var t;let{stateCode:n,userType:l,modules:r,appTenants:i,additionalComponent:s}=e;Digit;const{path:c}=a.useRouteMatch(),u=a.useLocation(),d=Digit.UserService.getUser();var m;if(!d||null==d||!d.access_token||null==d||!d.info)return o.createElement(a.Redirect,{to:{pathname:`/${null===(m=window)||void 0===m?void 0:m.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}});const p=null==r?void 0:r.map((e,t)=>{var r;let{code:s,tenants:u}=e;const d=Digit.ComponentRegistryService.getComponent(s+"Module");return o.createElement(a.Route,{key:t,path:`${c}/${s.toLowerCase()}`},d?o.createElement(d,{stateCode:n,moduleCode:s,userType:l,tenants:In(u,i)}):o.createElement(a.Redirect,{to:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee/user/error?type=notfound&module=${s}`}))});return o.createElement("div",{className:"ground-container digit-home-ground"},o.createElement(a.Switch,null,p,o.createElement(a.Route,{path:c+"/login"},o.createElement(a.Redirect,{to:{pathname:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}})),o.createElement(a.Route,{path:c+"/forgot-password"},o.createElement(Cn,null)),o.createElement(a.Route,{path:c+"/change-password"},o.createElement(bn,null)),o.createElement(a.Route,null,o.createElement(w,{userType:l,modules:r,additionalComponent:s}))))},wn={label:"English",value:Digit.Utils.getDefaultLanguage()},Tn=()=>{var e,r,i,c,u;const{data:d,isLoading:m}=Digit.Hooks.useStore.getInitData(),{t:p}=l.useTranslation(),v=a.useHistory(),{languages:f,stateInfo:g}=d||{};let E=f;E&&0!=(null===(e=E)||void 0===e?void 0:e.length)||(E=[wn]);const y=Digit.StoreData.getCurrentLanguage(),[h,_]=n.useState(y);return m?o.createElement(t.Loader,null):o.createElement(yn,null,o.createElement(t.Card,{className:"bannerCard removeBottomMargin languageSelection"},o.createElement("div",{className:"bannerHeader"},o.createElement("img",{className:"bannerLogo",src:null==g?void 0:g.logoUrl,alt:"Digit"}),o.createElement("p",null,p("TENANT_TENANTS_"+(null==g||null===(r=g.code)||void 0===r?void 0:r.toUpperCase())))),o.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},E.map((e,t)=>o.createElement("div",{className:"language-button-container",key:t},o.createElement(s.CustomButton,{selected:e.value===h,text:p(e.label),onClick:()=>(e=>{_(e.value),Digit.LocalizationService.changeLanguage(e.value,g.code)})(e)})))),o.createElement(t.SubmitBar,{style:{width:"100%"},label:p("CORE_COMMON_CONTINUE"),onSubmit:e=>{var t;v.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`)}})),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(c=i.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))},An=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",key:"username",isMandatory:!0,populators:{name:"username",validation:{required:!0},error:"ERR_USERNAME_REQUIRED"}},{label:"CORE_LOGIN_PASSWORD",type:"password",key:"password",isMandatory:!0,populators:{name:"password",validation:{required:!0},error:"ERR_PASSWORD_REQUIRED"}},{isMandatory:!0,type:"dropdown",key:"city",label:"CORE_COMMON_CITY",disable:!1,populators:{name:"city",optionsKey:"name",error:"ERR_HRMS_INVALID_CITY",mdmsConfig:{masterName:"tenants",moduleName:"tenant",localePrefix:"TENANT_TENANTS",select:"(data)=>{ return Array.isArray(data['tenant'].tenants) && Digit.Utils.getUnique(data['tenant'].tenants).map(ele=>({code:ele.code,name:Digit.Utils.locale.getTransformedLocale('TENANT_TENANTS_'+ele.code)}))}"}}}]}],Ln=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"Sandbox"},populators:{name:"check"}}]}],Rn=e=>{var l,r,i,s,c,u,d,m,p,v,f,g,E;let{config:y,t:h,isDisabled:_,loginOTPBased:S}=e;const{isLoading:b}=Digit.Hooks.useTenants(),{data:O,isLoading:N}=Digit.Hooks.useStore.getInitData(),{stateInfo:C}=O||{},[I,D]=n.useState(null),[w,T]=n.useState(null),[A,L]=n.useState(!1),R=a.useHistory();n.useEffect(()=>{var e,t,n,o,l,r,i,a,s,c,u,d,m,p,v,f,g,E;if(!I)return;Digit.SessionStorage.set("citizen.userRequestObject",I);const y=null==I||null===(e=I.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==I||null===(n=I.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.length)>0&&(I.info.roles=y),Digit.UserService.setUser(I),((e,t)=>{var n;if(Digit.Utils.getMultiRootTenant())return;let o=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",o),localStorage.setItem("Employee.locale",o),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==I?void 0:I.info,null==I?void 0:I.access_token);let h=`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee`;var _,S,b,O,N,C,D;null!==(r=window)&&void 0!==r&&null!==(i=r.location)&&void 0!==i&&null!==(a=i.href)&&void 0!==a&&a.includes("from=")&&(h=decodeURIComponent(null===(_=window)||void 0===_||null===(S=_.location)||void 0===S||null===(b=S.href)||void 0===b||null===(O=b.split("from="))||void 0===O?void 0:O[1])||`/${null===(N=window)||void 0===N?void 0:N.contextPath}/employee`),null!=I&&null!==(s=I.info)&&void 0!==s&&s.roles&&(null==I||null===(c=I.info)||void 0===c||null===(u=c.roles)||void 0===u?void 0:u.length)>0&&null!=I&&null!==(d=I.info)&&void 0!==d&&null!==(m=d.roles)&&void 0!==m&&m.every(e=>"NATADMIN"===e.code)&&(h=`/${null===(C=window)||void 0===C?void 0:C.contextPath}/employee/dss/landing/NURT_DASHBOARD`),null!=I&&null!==(p=I.info)&&void 0!==p&&p.roles&&(null==I||null===(v=I.info)||void 0===v||null===(f=v.roles)||void 0===f?void 0:f.length)>0&&null!=I&&null!==(g=I.info)&&void 0!==g&&null!==(E=g.roles)&&void 0!==E&&E.every(e=>"STADMIN"===e.code)&&(h=`/${null===(D=window)||void 0===D?void 0:D.contextPath}/employee/dss/landing/home`),R.replace(h)},[I]);const P={url:"/user-otp/v1/_send",params:{tenantId:Digit.ULBService.getStateId()},body:{},config:{enable:!1}},x=Digit.Hooks.useCustomAPIMutationHook(P),M=()=>{T(null)},k={code:Digit.ULBService.getStateId(),name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+Digit.ULBService.getStateId())};let U=[{body:null==y?void 0:y.inputs}];const{mode:B}=Digit.Hooks.useQueryParams();return"admin"===B&&0==(null==U||null===(l=U[0])||void 0===l||null===(r=l.body)||void 0===r||null===(i=r[2])||void 0===i?void 0:i.disable)&&null==(null==U||null===(s=U[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(U[0].body[2].disable=!0,U[0].body[2].isMandatory=!1,U[0].body[2].populators.defaultValue=k),b||N?o.createElement(t.Loader,null):o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:S?function(e){try{const t=e.email;return Promise.resolve(x.mutate({body:{otp:{userName:e.email,type:"login",tenantId:Digit.ULBService.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,r,i,a,s;T(null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&l[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i||null===(a=i.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"),setTimeout(M,5e3)},onSuccess:function(e){try{var n;return R.push({pathname:`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee/user/login/otp`,state:{email:t,tenant:Digit.ULBService.getStateId()}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}:function(e){try{var t;function n(){L(!1)}L(!0);const o={...e,userType:"EMPLOYEE"};o.tenantId=(null==e||null===(t=e.city)||void 0===t?void 0:t.code)||Digit.ULBService.getStateId(),delete o.city;const l=te(function(){return Promise.resolve(Digit.UserService.authenticate(o)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),D({info:t,...n})})},function(e){var t,n;T((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&h("ES_ERROR_USER_NOT_PERMITTED")||h("INVALID_LOGIN_CREDENTIALS")),setTimeout(M,5e3)});return Promise.resolve(l&&l.then?l.then(n):n())}catch(e){return Promise.reject(e)}},isDisabled:_||A,noBoxShadow:!0,inline:!0,submitInForm:!0,config:U,label:null==y||null===(m=y.texts)||void 0===m?void 0:m.submitButtonLabel,secondaryActionLabel:null==y||null===(p=y.texts)||void 0===p?void 0:p.secondaryButtonLabel,onSecondayActionClick:()=>{var e;R.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/forgot-password`)},onFormValueChange:(e,t,n)=>{const o=U[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});L(o)},heading:null==y||null===(v=y.texts)||void 0===v?void 0:v.header,className:"loginFormStyleEmployee "+(S?"sandbox-onboarding-wrapper":""),cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:"loginCardClassName",buttonClassName:"buttonClassName"},o.createElement(hn,null!=C&&C.code?null:{showTenant:!1})),w&&o.createElement(t.Toast,{type:"error",label:h(w),onClose:M}),o.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},o.createElement("img",{alt:"Powered by DIGIT",src:null===(f=window)||void 0===f||null===(g=f.globalConfigs)||void 0===g||null===(E=g.getConfig)||void 0===E?void 0:E.call(g,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Rn.propTypes={loginParams:En.any},Rn.defaultProps={loginParams:null};const Pn=e=>{var t,r;let{stateCode:i}=e;const{t:s}=l.useTranslation(),{path:c}=a.useRouteMatch(),[u,d]=n.useState(An),[m,p]=n.useState(Ln),v=Digit.StoreData.getCurrentLanguage(),f=(null===(t=window)||void 0===t||null===(r=t.globalConfigs)||void 0===r?void 0:r.getConfig("OTP_BASED_LOGIN"))||!1,{data:g,isLoading:E}=(Digit.Services.useStore({stateCode:i,moduleCode:["privacy-policy"],language:v,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(i,"commonUiConfig",["LoginConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.LoginConfig}},retry:!1}));n.useEffect(()=>{d(0==E&&null!=g&&g.config?null==g?void 0:g.config:An)},[g,E]);const y=n.useMemo(()=>u.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}},[u])),h=n.useMemo(()=>m.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}},[m]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+c,exact:!0},o.createElement(Rn,f?{config:h[0],t:s,loginOTPBased:f}:{config:y[0],t:s})))},xn=e=>{let{embedId:t}=e;return o.createElement("iframe",{className:"player-iframe",width:"480",height:"270",src:"https://www.youtube.com/embed/"+t,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Embedded youtube"})},Mn=e=>{const[t,l]=n.useState(""),[r,i]=n.useState(!1);return n.useEffect(()=>{let t=e.link;t.startsWith("https://www.youtube.com/watch?v=")&&(t=t.split("https://www.youtube.com/watch?v=")[1]),l(t)},[e.link]),o.createElement("div",null,r&&o.createElement("div",{className:"overlay",onClick:()=>i(!1)},o.createElement("div",{onClick:e=>e.stopPropagation()},o.createElement(xn,{embedId:t}))),e.overlay?o.createElement("div",{className:"player-wrapper"},o.createElement("div",{className:"player-click-area",onClick:()=>{e.overlay&&i(!0)}}),o.createElement(xn,{embedId:t})):o.createElement(xn,{embedId:t}))},kn=e=>{var r;let{config:i}=e;const{t:s}=l.useTranslation(),{heading:c,subsections:u,url:d}=i;let m=`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee/user/landing/select-role`;const p=a.useHistory();return o.createElement("div",{className:"custom-landing-container"},o.createElement(t.Card,{className:"custom-landing-card"},o.createElement(t.Header,{className:"custom-landing-header"},s(c)),o.createElement("div",{className:"custom-video-section"},o.createElement(Mn,{link:d,overlay:!0})),u.map((e,l)=>o.createElement("div",{key:l,className:"custom-section-container"},o.createElement(t.CardHeader,{className:"custom-section-header"},s(e.title)),"paragraph"===e.type&&e.content&&o.createElement(n.Fragment,null,e.content.map((e,n)=>o.createElement(t.CardText,{className:"custom-section-paragraph",key:n},o.createElement("p",null,s(e.text))))),"steps"===e.type&&e.content&&o.createElement("ul",{className:"custom-steps-list"}," ",e.content.map((e,t)=>o.createElement("li",{key:t,className:"custom-step-item"}," ",s(e.text)))),"both"===e.type&&e.content&&o.createElement(n.Fragment,null,e.content.map((e,n)=>"paragraph"===e.type?o.createElement(t.CardText,{className:"custom-section-paragraph",key:n},o.createElement("p",null,s(e.text))):"step"===e.type?o.createElement("li",{key:n,className:"custom-step-item"}," ",s(e.text)):null)))),o.createElement("div",{className:"custom-continue-button-container"},o.createElement(t.Button,{className:"custom-continue-button",label:s("CONTINUE_LANDING"),variation:"primary",icon:"ArrowForward",isSuffix:!0,onClick:e=>{e.preventDefault(),p.push(m)}}))))},Un={heading:"SANDBOX_HEADING",url:"https://www.youtube.com/watch?v=0wcuD67MVt8",subsections:[{title:"SANDBOX_INTRODUCTION_TITLE",type:"paragraph",content:[{text:"SANDBOX_INTRODUCTION_TEXT"}]},{title:"SANDBOX_PRODUCTS_TITLE",type:"both",content:[{type:"paragraph",text:"SANDBOX_PRODUCTS_DESCRIPTION"},{type:"step",id:1,text:"SANDBOX_PRODUCTS_STEP_1"},{type:"step",id:2,text:"SANDBOX_PRODUCTS_STEP_2"},{type:"step",id:3,text:"SANDBOX_PRODUCTS_STEP_3"},{type:"step",id:4,text:"SANDBOX_PRODUCTS_STEP_4"}]},{title:"SANDBOX_USER_CAPABILITIES_TITLE",type:"both",content:[{type:"step",id:1,text:"SANDBOX_USER_CAPABILITIES_STEP_1"},{type:"step",id:2,text:"SANDBOX_USER_CAPABILITIES_STEP_2"},{type:"step",id:3,text:"SANDBOX_USER_CAPABILITIES_STEP_3"},{type:"step",id:4,text:"SANDBOX_USER_CAPABILITIES_STEP_4"},{type:"step",id:5,text:"SANDBOX_USER_CAPABILITIES_STEP_5"},{type:"step",id:6,text:"SANDBOX_USER_CAPABILITIES_STEP_6"},{type:"paragraph",text:"SANDBOX_CLICK_CONTINUE"}]}]},Bn=()=>o.createElement(kn,{config:Un}),Fn=[{texts:{header:"CORE_COMMON_SIGN_UP",submitButtonLabel:"CORE_COMMON_SIGN_UP_BUTTON"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,pattern:/^[A-Za-z]+( [A-Za-z]+)*$/},error:"ERR_ACCOUNT_NAME_REQUIRED"},infoMessage:"SANDBOX_SIGNUP_ACCOUNT_NAME_TOOLTIP"},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check"}}]}],jn=e=>{var l,r,i,s,c,u,d,m,p,v,f,g,E;let{config:y,t:h,isDisabled:_}=e;const{isLoading:S}=Digit.Hooks.useTenants(),{isLoading:b}=Digit.Hooks.useStore.getInitData(),[O,N]=n.useState(null),[C,I]=n.useState(!1),D=a.useHistory(),w=Digit.Hooks.useCustomAPIMutationHook({url:"/tenant-management/tenant/_create",params:{},body:{},config:{enable:!1}});let T=[{body:null==y?void 0:y.inputs}];const{mode:A}=Digit.Hooks.useQueryParams();return"admin"===A&&0==(null==T||null===(l=T[0])||void 0===l||null===(r=l.body)||void 0===r||null===(i=r[2])||void 0===i?void 0:i.disable)&&null==(null==T||null===(s=T[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(T[0].body[2].disable=!0,T[0].body[2].isMandatory=!1,T[0].body[2].populators.defaultValue=defaultValue),S||b?o.createElement(t.Loader,null):o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:function(e){try{return Promise.resolve(w.mutate({body:{tenant:{name:e.accountName,email:e.email}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,r,i,a,s,c;N({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&null!==(r=l[0])&&void 0!==r&&r.code?"SANDBOX_SIGNUP_"+(null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(s=a.Errors)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.code):"SANDBOX_SIGNUP_ERROR"})},onSuccess:function(e){try{var t,n,o;return D.push({pathname:`/${null===(t=window)||void 0===t?void 0:t.globalPath}/user/otp`,state:{email:null==e||null===(n=e.Tenants[0])||void 0===n?void 0:n.email,tenant:null==e||null===(o=e.Tenants[0])||void 0===o?void 0:o.code}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},isDisabled:_||C,noBoxShadow:!0,inline:!0,submitInForm:!0,config:T,label:null==y||null===(m=y.texts)||void 0===m?void 0:m.submitButtonLabel,secondaryActionLabel:null==y||null===(p=y.texts)||void 0===p?void 0:p.secondaryButtonLabel,onFormValueChange:(e,t,n)=>{const o=T[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});I(o)},heading:null==y||null===(v=y.texts)||void 0===v?void 0:v.header,className:"sandbox-signup-form",cardSubHeaderClassName:"signupCardSubHeaderClassName",cardClassName:"signupCardClassName sandbox-onboarding-wrapper",buttonClassName:"buttonClassName"},o.createElement(hn,{showTenant:!1})),O&&o.createElement(t.Toast,{type:"error",label:h(null==O?void 0:O.label),onClose:()=>{N(null)}}),o.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},o.createElement("img",{alt:"Powered by DIGIT",src:null===(f=window)||void 0===f||null===(g=f.globalConfigs)||void 0===g||null===(E=g.getConfig)||void 0===E?void 0:E.call(g,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};jn.propTypes={loginParams:En.any},jn.defaultProps={loginParams:null};const Hn=e=>{let{stateCode:t}=e;const{t:r}=l.useTranslation(),{path:i}=a.useRouteMatch(),[s,c]=n.useState(Fn),u=Digit.StoreData.getCurrentLanguage(),{data:d,isLoading:m}=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:u,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(t,"commonUiConfig",["SignUpConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.SignUpConfig}},retry:!1}));n.useEffect(()=>{c(0==m&&null!=d&&d.config?null==d?void 0:d.config:Fn)},[d,m]);const p=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=r(e.texts[n]);return{...e,texts:t}},[s]));return o.createElement(a.Switch,null,o.createElement(a.Route,{path:""+i,exact:!0},o.createElement(jn,{config:p[0],t:r})))},Gn=e=>{var r,i,c,u;let{isLogin:d=!1}=e;const{t:m}=l.useTranslation(),p=(a.useRouteMatch(),a.useHistory()),v=a.useLocation(),[f,g]=n.useState(null),[E,y]=n.useState(!1),[h,_]=n.useState(null),[S,b]=n.useState((null==v||null===(r=v.state)||void 0===r?void 0:r.data)||{}),[O,N]=n.useState(!1),{email:C,tenant:I}=v.state||{},{data:D}=Digit.Hooks.useCustomMDMS(I,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}}),w=null==D?void 0:D[0].url,T=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:C,tenant:I},populators:{required:!0}}]}],A=[{texts:{header:m("SANDBOX_OTP_VERIFICATION"),submitButtonLabel:"CORE_COMMON_SUBMIT"}}],L=()=>{g(null)};return n.useEffect(()=>{var e,t,n,o,l;if(!h)return;Digit.SessionStorage.set("citizen.userRequestObject",h);const r=null==h||null===(e=h.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==h||null===(n=h.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.length)>0&&(h.info.roles=r),Digit.UserService.setUser(h),((e,t)=>{var n;if(Digit.Utils.getMultiRootTenant())return;let o=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",o),localStorage.setItem("Employee.locale",o),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==h?void 0:h.info,null==h?void 0:h.access_token);let i=`/${null===(l=window)||void 0===l?void 0:l.globalPath}/user/setup`;const a=((e,t,n,o)=>{var l,r,i,a,s,c;const u="SUPERUSER"===(null==t||null===(l=t.info)||void 0===l||null===(r=l.roles)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.code),d=null===(a=window)||void 0===a?void 0:a.contextPath;switch(!0){case"/sandbox-ui/user/otp"===e&&u:return`/${d}/employee/user/landing`;case u&&(null==n||null===(s=n[0])||void 0===s||null===(c=s.rolesForLandingPage)||void 0===c?void 0:c.includes("SUPERUSER")):return`/${d}${o}`;default:return`/${d}/employee`}})(v.pathname,h,D,w);return d?void p.push(a):void p.push({pathname:i,state:{tenant:I}})},[h]),o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(s.FormComposerV2,{onSubmit:function(e){try{var t;const n={username:C,password:null==e||null===(t=e.OtpComponent)||void 0===t?void 0:t.otp,tenantId:I,userType:"EMPLOYEE"},o=te(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),_({info:t,...n})})},function(e){var t,n;g((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&m("ES_ERROR_USER_NOT_PERMITTED")||m("INVALID_LOGIN_CREDENTIALS")),setTimeout(L,5e3)});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,onFormValueChange:(e,t)=>{var n;const o=t.OtpComponent;6===(null==o||null===(n=o.otp)||void 0===n?void 0:n.length)?y(!0):y(!1)},isDisabled:!E,config:T,label:A[0].texts.submitButtonLabel,heading:A[0].texts.header,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper"},o.createElement(hn,{showTenant:!1})),f&&o.createElement(t.Toast,{type:"error",label:m(f),onClose:L}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(c=i.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))},Vn=()=>{var e,r,i,s,c,u;const{t:d}=l.useTranslation(),m=a.useLocation(),{tenant:p}=m.state||{},v=(a.useHistory(),n.useRef(null)),f=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(r=e.info)||void 0===r?void 0:r.roles,[g,E]=n.useState(!0),{data:y}=Digit.Hooks.useCustomMDMS(p,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,cacheTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}});n.useEffect(()=>{null!=y&&y[0].url&&E(!1)},[y]);const h=null==y?void 0:y[0].url;return o.createElement(yn,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.Card,{className:"card-sandbox"},o.createElement(hn,{showTenant:!1}),o.createElement("div",{className:"sandbox-success-signup"},o.createElement(t.SVG.TickMark,{fill:"#fff",height:30,width:70})),o.createElement(t.CardHeader,{className:"cardHeader-sandbox",styles:{color:"#00703c"}},d("SANDBOX_HEADER")),o.createElement(t.CardText,{className:"cardText-sandbox"},d("SAMDBOX_URL_SUB")),o.createElement(t.CardLabel,null," ",d("SANDBOX_URL")," "),o.createElement("div",{className:"sandbox-url-wrapper"},o.createElement(t.TextInput,{inputRef:v,className:"urlInputText",onChange:()=>{},nonEditable:!0,value:`${window.location.host}/${null===(i=window)||void 0===i?void 0:i.globalPath}/${p}/employee`}),o.createElement(t.Button,{className:"copyButton",variation:"secondary",onClick:()=>{navigator.clipboard.writeText(v.current.value)},label:d("COPY_URL")})),o.createElement("div",{className:"sandbox-url-footer"},d("SANDBOX_URL_FOOT")),o.createElement(t.Button,{isDisabled:g,onClick:()=>{var e,t;((e,t)=>{var n;return"SUPERUSER"===(null==e||null===(n=e[0])||void 0===n?void 0:n.code)&&t.some(e=>e.rolesForLandingPage.includes("SUPERUSER"))})(f,y)?window.location.href=`/${null===(e=window)||void 0===e?void 0:e.globalPath}/${p}${h}`:window.location.href=`/${null===(t=window)||void 0===t?void 0:t.globalPath}/${p}/employee`},label:d("SIGN_IN")})),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(s=window)||void 0===s||null===(c=s.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))},$n=[{type:"link",url:"https://www.youtube.com/watch?v=IBJDxxP3rDc"},{type:"text",heading:"ROLE_LANDING_ROLE_SECTION_ONE",paragraphs:["ROLE_LANDING_SELECT_ROLE_PARAGRAPH_1","ROLE_LANDING_SELECT_ROLE_PARAGRAPH_2"],steps:[{description:"ROLE_LANDING_STEP_1"},{description:"ROLE_LANDING_STEP_2"}]},{type:"text",heading:"ROLE_LANDING_ROLE_SECTION_TWO",paragraphs:["ROLE_LANDING_ANOTHER_ROLE_PARAGRAPH_1"],steps:[{description:"ROLE_LANDING_ANOTHER_ROLE_STEP_1"},{description:"ROLE_LANDING_ANOTHER_ROLE_STEP_2"},{description:"ROLE_LANDING_ANOTHER_ROLE_STEP_3"},{description:"ROLE_LANDING_ANOTHER_ROLE_STEP_4"}]},{type:"text",heading:"ROLE_LANDING_ROLE_SECTION_THREE",paragraphs:["ROLE_LANDING_THREE_PARAGRAPH_1"],steps:[{description:"ROLE_LANDING_THREE_ROLE_STEP_1"},{description:"ROLE_LANDING_THREE_ROLE_STEP_2"},{description:"ROLE_LANDING_THREE_ROLE_STEP_3"},{description:"ROLE_LANDING_THREE_ROLE_STEP_4"}]},{type:"card",icon:c.People,heading:"ROLE_LANDING_CITIZEN",description:"ROLE_LANDING_CITIZEN_DESCRIPTION",buttonName:"ROLE_LANDING_CITIZEN_BUTTON",action:"/citizen/login"},{type:"card",icon:c.People,heading:"ROLE_LANDING_GOV_ADMIN",description:"ROLE_LANDING_GOV_ADMIN_DESCRIPTION",buttonName:"ROLE_LANDING_GOV_ADMIN_BUTTON",action:"/employee"}],zn=()=>{const{t:e}=l.useTranslation();return a.useHistory(),o.createElement("div",{className:"role-landing-container"},o.createElement(t.Card,{className:"role-landing-card"},$n.filter(e=>"link"===e.type).map((n,l)=>o.createElement("div",{key:l,className:"header-video-section"},o.createElement(t.Header,{className:"role-header"},e("ROLE_BASED_LANDING_HEADER")),o.createElement(Mn,{link:n.url,overlay:!0,className:"role-video"}))),$n.filter(e=>"text"===e.type).map((n,l)=>o.createElement("div",{key:l,className:"config-section"},o.createElement(t.CardHeader,{className:"role-section-header"},e(n.heading)),n.paragraphs.map((n,l)=>o.createElement(t.CardText,{className:"role-paragraph",key:l},e(n))),o.createElement("ul",{className:"role-list"},n.steps.map((t,n)=>o.createElement("li",{key:n,className:"role-list-item"},e(t.description)," "))))),o.createElement("div",{className:"role-action-container"},$n.filter(e=>"card"===e.type).map((n,l)=>{const r=n.icon;return o.createElement("div",{key:l,className:"role-card"},o.createElement("div",{className:"icon-container"},r&&o.createElement(r,null)," "),o.createElement(t.CardHeader,{className:"role-section-header"},e(n.heading)),o.createElement(t.Button,{className:"role-button",label:e(n.buttonName),variation:"primary",onClick:()=>(e=>{const t="/"+window.contextPath+e;window.open(t,"_blank")})(n.action)}),o.createElement(t.CardText,{className:"role-paragraph"},e(n.description)))}))))},Wn=()=>o.createElement(zn,null),Xn=["user/landing","user/profile","user/error"],qn=e=>{var r,i,s,c,u,d;let{stateInfo:m,userDetails:p,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:_,logoUrlWhite:S,DSO:b,stateCode:O,modules:N,appTenants:C,initData:I}=e;const D=a.useHistory(),{t:w}=l.useTranslation(),{path:T}=a.useRouteMatch(),A=a.useLocation(),L=null==A||null===(r=A.pathname)||void 0===r?void 0:r.includes("language-selection"),R=Xn.some(e=>{var t;return null==A||null===(t=A.pathname)||void 0===t?void 0:t.includes(e)});n.useEffect(()=>{Digit.UserService.setType("employee")},[]);const P=null==I||null===(i=I.modules)||void 0===i||null===(s=i.filter(e=>null==e?void 0:e.additionalComponent))||void 0===s?void 0:s.map(e=>null==e?void 0:e.additionalComponent);return o.createElement("div",{className:"employee"},o.createElement(a.Switch,null,o.createElement(a.Route,{path:T+"/user"},R&&o.createElement($,{t:w,stateInfo:m,userDetails:p,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:_,logoUrlWhite:S,showSidebar:!!R,showLanguageChange:!L}),o.createElement("div",{className:R?"grounded-container":"loginContainer",style:R?{padding:0,paddingTop:"0",marginLeft:"0"}:{"--banner-url":`url(${null==m?void 0:m.bannerUrl})`,padding:"0px"}},o.createElement(a.Switch,null,o.createElement(a.Route,{exact:!0,path:T+"/user/login"},o.createElement(Pn,{stateCode:O})),o.createElement(a.Route,{exact:!0,path:T+"/user/login/otp"},o.createElement(Gn,{isLogin:!0})),o.createElement(a.Route,{path:T+"/user/forgot-password"},o.createElement(Cn,null)),o.createElement(a.Route,{path:T+"/user/change-password"},o.createElement(bn,null)),o.createElement(t.PrivateRoute,{path:T+"/user/profile"},o.createElement(oe,{stateCode:O,userType:"employee",cityDetails:E})),o.createElement(t.PrivateRoute,{path:T+"/user/landing/select-role"},o.createElement("div",{className:"employee-app-wrapper sandbox-landing-wrapper"},o.createElement(Wn,null))),o.createElement(t.PrivateRoute,{path:T+"/user/landing"},o.createElement("div",{className:"employee-app-wrapper sandbox-landing-wrapper"},o.createElement(Bn,null))),o.createElement(a.Route,{path:T+"/user/error"},o.createElement(v,{initData:I,goToHome:()=>{var e,t,n,o;D.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(o=n.getType)||void 0===o?void 0:o.call(n)}`)}})),o.createElement(a.Route,{path:T+"/user/language-selection"},o.createElement(Tn,null)),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:T+"/user/language-selection"}))))),o.createElement(a.Route,null,o.createElement($,{t:w,stateInfo:m,userDetails:p,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:_,logoUrlWhite:S,modules:N}),o.createElement("div",{className:`main ${b?"m-auto":""} digit-home-main`},o.createElement("div",{className:"employee-app-wrapper digit-home-app-wrapper"},o.createElement(g,{initData:I},o.createElement(Dn,{stateCode:O,userType:"employee",modules:N,appTenants:C,additionalComponent:P}))),o.createElement("div",{className:"employee-home-footer"},o.createElement("img",{alt:"Powered by DIGIT",src:null===(c=window)||void 0===c||null===(u=c.globalConfigs)||void 0===u||null===(d=u.getConfig)||void 0===d?void 0:d.call(u,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:T+"/user/language-selection"}))))},Qn=e=>{const{state:n={}}=a.useLocation(),{t:r}=l.useTranslation(),i=a.useHistory(),s={imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoHeader:"WRONG_TENANT_SIGN_UP",infoMessage:"WRONG_TENANT_SIGN_UP_MESSAGE",buttonInfo:"WRONG_TENANT_SIGN_UP_BUTTON",action:()=>{i.push(`/${window.globalPath}/`)}};return o.createElement(yn,null,o.createElement(t.Card,{className:"digit-employee-card customError"},o.createElement(hn,{showTenant:!1}),o.createElement(t.CardHeader,{className:"center"},r(s.infoHeader)),o.createElement(t.CardText,{className:"center"},r(s.infoMessage)),o.createElement(t.Button,{className:"customErrorButton",label:r(null==s?void 0:s.buttonInfo),variation:"primary",isSuffix:!0,onClick:e=>{e.preventDefault(),null==s||s.action()}})))},Zn=()=>{const[e,t]=n.useState(0),r=a.useHistory(),i=a.useLocation(),{t:s}=l.useTranslation(),{tenant:u}=i.state||{},d=["SANDBOX_GUIDE_SETUP_ACCOUNT","SANDBOX_GUIDE_DEFAULT_MASTER_DATA","SANDBOX_GUIDE_CONFIGURING_COMPLAINTS","SANDBOX_GUIDE_CONFIGURING_EMPLOYEE_MANAGEMENT","SANDBOX_GUIDE_SETTING_UP_CITIZEN_PORTAL","SANDBOX_GUIDE_SETTING_UP_EMPLOYEE_PORTAL","SANDBOX_GUIDE_LOADING_CONFIGURATION_INTERFACE","SANDBOX_GUIDE_CREATING_DASHBOARD","SANDBOX_GUIDE_ALL_SETUP_DONE"];return n.useEffect(()=>{const n=setInterval(()=>{e<d.length&&t(e=>e+1)},2e3);if(e===d.length){clearInterval(n);const e=setTimeout(()=>{var e;r.push({pathname:`/${null===(e=window)||void 0===e?void 0:e.globalPath}/user/url`,state:{tenant:u}})},1e3);return()=>clearTimeout(e)}return()=>{clearInterval(n)}},[e]),o.createElement("div",{className:"sandbox-loader-screen"},o.createElement("div",{className:"sandbox-loader"}),o.createElement("ul",{className:"sandbox-installation-steps"},d.map((t,n)=>o.createElement("li",{key:n,className:"sandbox-step "+(n<e?"sandbox-visible":"")},o.createElement("span",{className:"sandbox-step-text"},s(t)),n<e&&o.createElement(c.CheckCircle,{fill:"#00703C"})))))},Yn=e=>{var t,l,r,i;let{stateCode:s,modules:c,appTenants:u,logoUrl:d,logoUrlWhite:m,initData:p,defaultLanding:v="citizen"}=e;const f=a.useHistory(),{pathname:g}=a.useLocation(),E=window.innerWidth,y=Digit.ULBService.getCurrentUlb(),h=Digit.UserService.getUser(),{data:_}=Digit.Hooks.useStore.getInitData(),{stateInfo:S}=_||{},b=Digit.UserService.hasAccess(["FSM_DSO"]);let O="CITIZEN"===(null==h||null===(t=h.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(O=!1),n.useEffect(()=>{var e,t,n;null!=g&&g.includes("application-details")||(null!=g&&g.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=g&&g.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=g&&g.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==g?void 0:g.toString())===`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee`&&(Digit.SessionStorage.del("SEARCH_APPLICATION_DETAIL"),Digit.SessionStorage.del("WS_EDIT_APPLICATION_DETAILS")),(null==g?void 0:g.toString())!==`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`&&(null==g?void 0:g.toString())!==`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee`||Digit.SessionStorage.del("WS_DISCONNECTION")},[g]),f.listen(()=>{var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});const N={stateInfo:S,userDetails:h,CITIZEN:O,cityDetails:y,mobileView:E<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:d,logoUrlWhite:m,DSO:b,stateCode:s,modules:c,appTenants:u,sourceUrl:window.location.origin+"/citizen",pathname:g,initData:p};return o.createElement(a.Switch,null,o.createElement(a.Route,{path:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee`},o.createElement(qn,N)),o.createElement(a.Route,{path:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen`},o.createElement(wt,N)),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/${v}`})))},Jn=e=>{var t,n,l,r,i,s,c,u,d,m;let{stateCode:p,modules:v,appTenants:f,logoUrl:g,logoUrlWhite:E,initData:y,defaultLanding:h="citizen"}=e;const{data:_}=Digit.Hooks.useStore.getInitData(),{stateInfo:S}=_||{},b=["user/profile","user/error"].some(e=>{var t,n;return null===(t=location)||void 0===t||null===(n=t.pathname)||void 0===n?void 0:n.includes(e)}),O=Digit.UserService.getUser();let N="CITIZEN"===(null==O||null===(t=O.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");const C=window.innerWidth<=640;return o.createElement("div",{className:b?"grounded-container":"loginContainer",style:b?{padding:0,paddingTop:N?"0":C&&!N?"3rem":"80px",marginLeft:N||C?"0":"40px"}:{"--banner-url":`url(${null==S?void 0:S.bannerUrl})`,padding:"0px"}},o.createElement(a.Switch,null,o.createElement(a.Route,{exact:!0,path:`/${null===(n=window)||void 0===n?void 0:n.globalPath}/user/invalid-url`},o.createElement(Qn,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(l=window)||void 0===l?void 0:l.globalPath}/user/sign-up`},o.createElement(Hn,{stateCode:p})),o.createElement(a.Route,{exact:!0,path:`/${null===(r=window)||void 0===r?void 0:r.globalPath}/user/otp`},o.createElement(Gn,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(i=window)||void 0===i?void 0:i.globalPath}/user/setup`},o.createElement(Zn,null)),o.createElement(a.Route,{exact:!0,path:`/${null===(s=window)||void 0===s?void 0:s.globalPath}/user/url`},o.createElement(Vn,null)),(null===(c=window)||void 0===c?void 0:c.globalPath)!==(null===(u=window)||void 0===u?void 0:u.contextPath)&&o.createElement(a.Route,{path:"/"+(null===(d=window)||void 0===d?void 0:d.contextPath)},o.createElement(Yn,{stateCode:p,modules:v,appTenants:f,logoUrl:g,logoUrlWhite:E,initData:y,defaultLanding:h})),o.createElement(a.Route,null,o.createElement(a.Redirect,{to:`/${null===(m=window)||void 0===m?void 0:m.globalPath}/user/sign-up`}))))},Kn=[d],eo=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):u.compose)(u.applyMiddleware(...Kn)),to=e=>{let{onSelect:r,...i}=e;const{t:a}=l.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,u]=n.useState(!1),[d,m]=n.useState(!1),{data:p}=Digit.Hooks.useCustomMDMS(s,"commonUiConfig",[{name:"PrivacyPolicy"}],{select:e=>{var t;return null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.PrivacyPolicy.find(e=>{var t;return e.module===(null==i||null===(t=i.props)||void 0===t?void 0:t.module)})}});return n.useEffect(()=>{r("check",c)},[c]),o.createElement(o.Fragment,null,o.createElement("div",{className:"digit-privacy-checkbox"},o.createElement(t.CheckBox,{label:a("ES_BY_CLICKING"),checked:c,onChange:e=>{u(e.target.checked)}}),o.createElement(t.Button,{label:a("ES_PRIVACY_POLICY"),variation:"link",size:"medium",onClick:()=>{m(!0)},style:{marginBottom:"1.18rem",paddingLeft:"0.2rem"}})),d&&o.createElement(t.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:a(null==p?void 0:p.header),onOverlayClick:()=>{m(!1)},footerChildren:[o.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:a("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{u(!1),m(!1)}}),o.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:a("DIGIT_I_ACCEPT"),className:"accept-class",onClick:()=>{u(!0),m(!1)}})],sortFooterChildren:!0,onClose:()=>{m(!1)}},o.createElement("div",null,o.createElement("div",{className:"privacy-table"},a("DIGIT_TABLE_OF_CONTENTS")),o.createElement("ul",null,null==p?void 0:p.contents.map((e,n)=>o.createElement("li",{key:n,style:{display:"flex",alignItems:"center"}},o.createElement("span",{style:{marginRight:"0.5rem"}},n+1,". "),o.createElement(t.Button,{label:a(e.header),variation:"link",size:"medium",onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})})(null==e?void 0:e.header)}}))))),null==p?void 0:p.contents.map((e,t)=>o.createElement("div",{key:t,id:null==e?void 0:e.header},o.createElement("div",{style:{fontWeight:"bold",paddingLeft:null!=e&&e.isSpaceRequired?"1rem":"0"}},a(e.header)),e.descriptions.map((e,t)=>o.createElement("div",{key:t,style:{paddingLeft:e.isSpaceRequired?"1rem":"0",marginBottom:"0.5rem"}},o.createElement("div",{style:{fontWeight:null!=e&&e.isBold?700:400,display:"flex",alignItems:"center"}},"points"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc"}},"•"),"step"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal"}},t+1,". "),a(e.text)),(null==e?void 0:e.subDescriptions)&&(null==e?void 0:e.subDescriptions.length)>0&&o.createElement("div",{className:"policy-subdescription"},e.subDescriptions.map((e,t)=>o.createElement("div",{key:t,className:"policy-subdescription-points"},"points"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc",paddingLeft:"1rem"}},"•"),"step"===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal",paddingLeft:"1rem"}},t+1,". "),null===e.type&&o.createElement("span",{style:{marginRight:"0.5rem",paddingLeft:"1rem"}}," "),a(e.text))))))))))},no=e=>{var n,r,s;let{stateCode:c,enabledModules:d,moduleReducers:m,defaultLanding:p}=e;const{isLoading:v,data:f={}}=Digit.Hooks.useInitStore(c,d);if(v)return o.createElement(t.Loader,{page:!0});const g=function(e,t){return void 0===t&&(t={}),u.createStore(((e,t)=>{return u.combineReducers({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return{...e,selectedLanguage:t.payload};default:return e}}),...t});var n})(e,t),eo)}(f,m(f))||{};return l.getI18n(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",to),o.createElement(i.Provider,{store:g},o.createElement(a.BrowserRouter,null,o.createElement(t.BodyContainer,null,Digit.Utils.getMultiRootTenant()?o.createElement(Jn,{initData:f,stateCode:c,modules:null==f?void 0:f.modules,appTenants:f.tenants,logoUrl:null==f||null===(n=f.stateInfo)||void 0===n?void 0:n.logoUrl,logoUrlWhite:null==f||null===(r=f.stateInfo)||void 0===r?void 0:r.logoUrlWhite,defaultLanding:p}):o.createElement(Yn,{initData:f,stateCode:c,modules:null==f?void 0:f.modules,appTenants:f.tenants,logoUrl:null==f||null===(s=f.stateInfo)||void 0===s?void 0:s.logoUrl,defaultLanding:p}))))},oo={SelectOtp:ce,ChangeCity:A,ChangeLanguage:L,PrivacyComponent:to,OtpComponent:e=>{var r,i;let{onSelect:c,...u}=e;const{t:d}=l.useTranslation(),[m,p]=(a.useLocation(),n.useState(null)),[v,f]=n.useState({}),[g,E]=n.useState(!0),[y,h]=n.useState(30),_=()=>{p(null)};se(()=>{h(y-1)},y>0?1e3:null),n.useEffect(()=>{c("OtpComponent",v)},[v]);const S={url:"/user-otp/v1/_send",params:{tenantId:null==u||null===(r=u.props)||void 0===r?void 0:r.code},body:{},config:{enable:!1}},b=Digit.Hooks.useCustomAPIMutationHook(S);return o.createElement(n.Fragment,null,o.createElement(t.CardLabel,{className:"sandbox-custom-otp-header"},d("CS_OTP_EMAIL")),o.createElement(t.CardLabel,{className:"sandbox-custom-otp-email"},null==u||null===(i=u.props)||void 0===i?void 0:i.email),o.createElement(t.CardLabel,{className:"sandbox-custom-otp-subheader"},d("SANDBOX_ENTER_OTP")),o.createElement(s.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{f({...v,otp:e})},value:null==v?void 0:v.otp}),y>0?o.createElement(t.CardText,{className:"sandbox-resend-otp"},`${d("CS_RESEND_ANOTHER_OTP")} ${y} ${d("CS_RESEND_SECONDS")}`):o.createElement("p",{className:"card-text-button sandbox-otp-input",onClick:function(){try{var e,t;return h(30),Promise.resolve(b.mutate({body:{otp:{userName:null==u||null===(e=u.props)||void 0===e?void 0:e.email,type:"login",tenantId:null==u||null===(t=u.props)||void 0===t?void 0:t.tenant,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,r,i,a,s;p({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(o=n.data)&&void 0!==o&&null!==(l=o.Errors)&&void 0!==l&&l[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i||null===(a=i.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(_,5e3)},onSuccess:function(e){try{return p({key:"info",label:d("OTP_RESNED_SUCCESFULL")}),setTimeout(_,5e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}},d("CS_RESEND_OTP")),!g&&o.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")),m&&o.createElement(t.Toast,{type:null==m?void 0:m.key,label:d(null==m?void 0:m.label),onClose:_}))}};exports.DigitUI=e=>{let{stateCode:t,registry:l,enabledModules:i,moduleReducers:a,defaultLanding:s}=e;const[c,u]=n.useState(Digit.Utils.getPrivacyObject()||{}),d=(Digit.UserService.getType(),new r.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retry:!1,retryDelay:e=>Infinity}}})),m=Digit.Contexts.ComponentProvider,p=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),o.createElement("div",null,o.createElement(g,null,o.createElement(r.QueryClientProvider,{client:d},o.createElement(m.Provider,{value:l},o.createElement(p.Provider,{value:{privacy:null==c?void 0:c[window.location.pathname],resetPrivacy:e=>{Digit.Utils.setPrivacyObject({}),u({})},getPrivacy:()=>{const e=Digit.Utils.getPrivacyObject();return u(e),e},updatePrivacyDescoped:e=>{const t=Digit.Utils.getAllPrivacyObject(),n={...t,[window.location.pathname]:e};Digit.Utils.setPrivacyObject({...n}),u((null==t?void 0:t[window.location.pathname])||{})},updatePrivacy:(e,t)=>{u(Digit.Utils.updatePrivacy(e,t)||{})}}},o.createElement(no,{stateCode:t,enabledModules:i,moduleReducers:a,defaultLanding:s}))))))},exports.initCoreComponents=()=>{Object.entries(oo).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|