@egovernments/digit-ui-module-core 1.9.1-beta.8 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,16 +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"),l=e(n),o=require("react-i18next"),r=require("react-query"),a=require("react-redux"),i=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"));function m(){return(m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function p(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}const v={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"}},f={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"}},g=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:a}=o.useTranslation(),i=r?f[r]:v[n];return l.createElement("div",{className:"error-boundary"},l.createElement("div",{className:"error-container"},l.createElement("img",{src:i.imgUrl,alt:"error"}),l.createElement("h1",null,a(i.infoMessage)),l.createElement("button",{onClick:()=>{var t;r?null==e||null===(t=e.errorData)||void 0===t||t.action():e.goToHome()}},a(i.buttonInfo))))},E=()=>{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),l.createElement("span",null)};class y extends l.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?l.createElement("div",{className:"error-boundary"},l.createElement(E,null),l.createElement(g,{initData:this.props.initData,errorData:this.state})):this.props.children}}const h=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web","sandbox-ui"],_=e=>{var r;const{isLoading:a,data:s}=Digit.Hooks.useAccessControl(),c=Digit.Utils.getMultiRootTenant(),{t:u}=o.useTranslation(),d=i.useHistory(),p=Digit.ULBService.getStateId();let v=null;const[f,g]=n.useState([{}]),{data:E}=Digit.Hooks.useCustomMDMS(p,"HomeScreenOrder",[{name:"CardsAndLinksOrder"}],{select:e=>{var t;return null==e||null===(t=e.HomeScreenOrder)||void 0===t?void 0:t.CardsAndLinksOrder}}),{data:y}=Digit.Hooks.useCustomMDMS(p,"SandBoxLanding",[{name:"AdditionalModuleLinks"}],{select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.AdditionalModuleLinks}});n.useEffect(()=>{g(E)},[E]);const _=(e,t)=>{if(!e||!t)return null;const n=null==y?void 0:y.find(t=>t.moduleName===e.module),l=null==n?void 0:n[t],o=null==e?void 0:e.links;return(null==o?void 0:o.find(e=>(null==e?void 0:e.displayName)===l))||null},S=e=>{var t;const n=null==y?void 0:y.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 l=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/"+p+"/employee"):null!=h&&h.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),o=l.indexOf("?");return e[n].links.push({link:l,icon:t.leftIcon,queryParams:-1===o?null:l.substring(o),label:u(Digit.Utils.locale.getTransformedLocale(n+"_LINK_"+t.displayName)),displayName:t.displayName}),e},{});if(a)return l.createElement(t.Loader,null);if(!b)return"";v=c?(e=>Object.keys(e).sort((e,t)=>{var n,l;return((null==f||null===(n=f.find(t=>"card"===t.moduleType&&t.name===e))||void 0===n?void 0:n.order)||null)-((null==f||null===(l=f.find(e=>"card"===e.moduleType&&e.name===t))||void 0===l?void 0:l.order)||null)}).reduce((t,n)=>{var l,o;const r=null==e||null===(l=e[n])||void 0===l||null===(o=l.links)||void 0===o?void 0:o.sort((e,t)=>{var l,o;const r=null==e?void 0:e.displayName,a=null==t?void 0:t.displayName;return((null==f||null===(l=f.find(e=>"link"===e.moduleType&&e.name===n+"."+r.replace(/\s+/g,"_")))||void 0===l?void 0:l.order)||null)-((null==f||null===(o=f.find(e=>"link"===e.moduleType&&e.name===n+"."+a.replace(/\s+/g,"_")))||void 0===o?void 0:o.order)||null)});return t[n]=m({},e[n],{links:r}),t},{}))(b):b;const O=null===(r=Object.keys(v))||void 0===r?void 0:r.map((e,n)=>{var o,r;const a=null===(o=v)||void 0===o?void 0:o[e],i=null==a||null===(r=a.links)||void 0===r?void 0:r.find(e=>"Configure_master"===(null==e?void 0:e.displayName)),s=_(a,"howItWorksLink"),c=_(a,"userManualLink"),p={icon:"SupervisorAccount",moduleName:u(null==a?void 0:a.label),metrics:[],links:Digit.Utils.getMultiRootTenant()?S(a):null==a?void 0:a.links,centreChildren:[l.createElement("div",null,u(Digit.Utils.locale.getTransformedLocale("MODULE_CARD_DESC_"+e))),s&&l.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()?[i&&l.createElement(t.Button,{variation:"teritiary",label:null==i?void 0:i.label,icon:null==i?void 0:i.icon,type:"button",size:"medium",onClick:()=>null==d?void 0:d.push(null==i?void 0:i.link),style:{padding:"0px"}}),c&&l.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 l.createElement(t.LandingPageCard,m({buttonSize:"medium"},p))});return l.createElement(n.Fragment,null,l.createElement(t.LandingPageWrapper,null,l.Children.map(O,e=>l.cloneElement(e))))},S=e=>{const{question:r,isLabelLink:a,type:i,actions:u,content:d,lastIndex:m}=e,[p,v]=n.useState(!1),{t:f}=o.useTranslation(),g=Digit.ULBService.getStateId(),E="number"===i?"ol":"ul";return l.createElement("div",{className:"faqs border-none",onClick:()=>v(!p)},l.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},l.createElement("span",null,f(r)),l.createElement("span",{className:p?"faqicon rotate":"faqicon",style:{float:"right"}},l.createElement(c.ArrowForward,null))),l.createElement("div",{className:"faq-answer",style:p?{display:"block"}:{display:"none"}},l.createElement(s.CardSectionSubText,{style:{marginTop:"1rem"}},f(d)),l.createElement("div",{style:{marginTop:"1rem"}},u&&l.createElement(E,null,u.map((e,n)=>l.createElement("li",{key:n,style:{listStyleType:"ul"===E?"disc":"auto",margin:"8px 0"}},a?null!=e&&e.label?l.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?l.createElement("strong",null,f(null==e?void 0:e.label),":"):null,f(null==e?void 0:e.description)))))),m?null:l.createElement("div",{className:"cs-box-border"}))},b=e=>{let{type:t,title:n,content:r,actions:a}=e;const{t:i}=o.useTranslation(),c="number"===t?"ol":"ul";return l.createElement("div",null,l.createElement(s.CardSectionHeader,null,i(n)),l.createElement(s.CardSectionSubText,{style:{marginTop:"1rem"}},i(r)),l.createElement("div",{style:{marginTop:"1rem"}},a&&l.createElement(c,null,a.map((e,t)=>l.createElement("li",{key:t,style:{listStyleType:"ul"===c?"disc":"auto",margin:"8px 0"}},null!=e&&e.label?l.createElement("strong",null,i(null==e?void 0:e.label),":"):null," ",i(null==e?void 0:e.description))))))},O=e=>{let{faqs:t,type:n}=e;return o.useTranslation(),l.createElement("div",{style:{width:"100%"}},l.createElement("div",{style:{width:"100%"}},t.map((e,o)=>l.createElement(S,{key:"faq_"+o,question:e.question,answer:e.answer,isLabelLink:e.isLabelLink,type:n,actions:e.answer,content:e.content,lastIndex:o===(null==t?void 0:t.length)-1}))))},N=e=>{let{cardConfig:n}=e;const{t:r}=o.useTranslation();return l.createElement(t.Card,{className:"sandbox-guide",style:{width:"25rem",height:"47rem",overflowY:"scroll"}},l.createElement(t.CardHeader,null,r("GUIDE_TO_SETUP")),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},n.map((e,t)=>"faqs"===(null==e?void 0:e.type)?l.createElement(O,{key:e.id,title:e.title,type:null==e?void 0:e.type,content:e.content,faqs:e.actions}):l.createElement(l.Fragment,null,l.createElement(b,{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&&l.createElement(s.BreakLine,{style:{width:"100%",border:"1px solid #d6d5d4"}})))))},C=["onSelect","formData","control","formState"],I=e=>{p(e,C);const{t:t}=o.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 l=n.parentModule;e[l]||(e[l]={module:l,label:Digit.Utils.locale.getTransformedLocale(l+"_CARD_HEADER"),links:[]});const o=Digit.Utils.transformURL(n.navigationURL,r),a=o.indexOf("?");return e[l].links.push({link:-1===a?o:o.substring(0,a),label:t(Digit.Utils.locale.getTransformedLocale(l+"_LINK_"+n.displayName)),queryParams:-1===a?null:o.substring(a),description:t(Digit.Utils.locale.getTransformedLocale(l+"_LINK_"+n.displayName+"_DESCRIPTION"))}),e},{}))?l.createElement(N,{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"}]}]}):""},D=(e,t,n)=>{const l=null==e?void 0:e[""+t];l&&l.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 o={links:null==l?void 0:l.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,l,r;let{role:a,from:i,loginLink:s,dashoardLink:c}=e;Digit.UserService.hasAccess(a)?null==o||null===(t=o.links)||void 0===t||t.push({link:i,i18nKey:n(c)}):null==o||null===(l=o.links)||void 0===l||l.push({link:"/"+(null===(r=window)||void 0===r?void 0:r.contextPath)+"/citizen/login",state:{role:"FSM_DSO",from:i},i18nKey:n(s)})}),o},w=e=>{let{modules:n,getCitizenMenu:r,fetchedCitizen:a,isLoading:i}=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}=o.useTranslation();return i?l.createElement(s.Loader,null):l.createElement(l.Fragment,null,l.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:l.createElement(t.BackLink,{onClick:()=>window.history.back()}),l.createElement("div",{className:"citizenAllServiceGrid"},c.filter(e=>e).map((e,n)=>{var o,i;let c,{code:d}=e;var m,p,v,f;return a&&(c=a?D(r,d,u):void 0),(null===(o=c)||void 0===o||null===(i=o.links)||void 0===i?void 0:i.length)>0?l.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 l.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"});case"WS":return l.createElement(t.CustomSVG.WSICon,{className:"fill-path-primary-main"});case"FSM":return l.createElement(t.CustomSVG.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return l.createElement(t.CustomSVG.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return l.createElement(t.CustomSVG.PGRIcon,{className:"fill-path-primary-main"});case"TL":return l.createElement(t.CustomSVG.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return l.createElement(t.CustomSVG.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return l.createElement(t.CustomSVG.BillsIcon,{className:"fill-path-primary-main"});default:return l.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"})}})(d),Info:"OBPS"===d?()=>l.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}):l.createElement(l.Fragment,null)}))))},T=e=>{let{modules:o,additionalComponent:r}=e;return l.createElement(n.Fragment,null,l.createElement("div",{className:"employee-app-container digit-home-employee-app"},l.createElement(t.LandingPageWrapper,null,null==o?void 0:o.map((e,t)=>{let{code:n}=e;const o=Digit.ComponentRegistryService.getComponent(n+"Card")||(()=>l.createElement(l.Fragment,null));return l.createElement(o,{key:t})}))),r&&(null==r?void 0:r.length)>0&&r.map(e=>{const t="string"==typeof e?Digit.ComponentRegistryService.getComponent(e):null;return t?l.createElement("div",{className:"additional-component-wrapper"},l.createElement(t,null)):null}))},A=e=>{let{userType:t,modules:n,getCitizenMenu:o,fetchedCitizen:r,isLoading:a,additionalComponent:i}=e;if("citizen"===t)return l.createElement(w,{modules:n,getCitizenMenu:o,fetchedCitizen:r,isLoading:a});const s=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return Digit.Utils.getRoleBasedHomeCard()?l.createElement("div",{className:s?"homeWrapper":""},l.createElement(_,{modules:n,additionalComponent:i}),s&&!window.Digit.Utils.browser.isMobile()?l.createElement(I,null):null):l.createElement(T,{modules:n,additionalComponent:i})},L=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(l=e)&&void 0!==l&&l.includes(t);){var l,o;e=null===(o=e)||void 0===o?void 0:o.replace(t,n)}return e},R=e=>{var o;const[r,a]=n.useState(null),[s,c]=n.useState([]),[u,d]=n.useState([]),m=i.useHistory();let p=[];return n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let l=[],o=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>l.push(e.tenantId));let r=l.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;o.push({label:"TENANT_TENANTS_"+(null===(t=L(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),p=null==o?void 0:o.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),c(o)},[r]),l.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},l.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,l,o;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===(l=n.roles)||void 0===l?void 0:l.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),a(e),window.location.href.includes("/"+(null===(o=window)||void 0===o?void 0:o.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:l.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(o=L(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===o?void 0:o.toUpperCase())))}))},P=e=>{const r=e.dropdown||!1,{data:a,isLoading:i}=Digit.Hooks.useStore.getInitData(),{languages:s,stateInfo:c}=a||{},{t:u}=o.useTranslation(),d=Digit.StoreData.getCurrentLanguage(),[m,p]=n.useState(d),v=e=>{p(e.value),Digit.LocalizationService.changeLanguage(e.value,c.code)};return i?null:r?l.createElement("div",null,l.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:l.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))})):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"5px"}},"Language"),l.createElement("div",{className:"language-selector"},s.map((e,n)=>l.createElement("div",{className:"language-button-container",key:n},l.createElement(t.Button,{label:e.label,onClick:()=>v(e),variation:e.value===m?"primary":""})))));var f},x=e=>{var o,r,a,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]=l.useState(null);l.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,l=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],l=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");T(null==l?void 0:l.at(0))}})}();return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==w,null==h||null===(o=h.info)||void 0===o?void 0:o.uuid]);const A=Digit.ULBService.getCitizenCurrentTenant(!0);let L=i.useHistory();const{pathname:x}=i.useLocation(),{data:{unreadCount:M}={},isSuccess:k}=Digit.Hooks.useNotificationCount({tenantId:A,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===(V=j.getUser())||void 0===V||null===(H=V.info)||void 0===H?void 0:H.type)&&!!A}});var U,B,F,j,V,H;if(_)return l.createElement("div",null,l.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(A),onNotificationIconClick:function(){var e;L.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/engagement/notifications")},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:(e=>{var t,n,l,o;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&["/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/citizen/select-language","/"+(null===(o=window)||void 0===o?void 0:o.contextPath)+"/citizen/select-location"].includes(e)})(x),changeLanguage:b?null:l.createElement(P,{dropdown:!0})}));const G=!(null==h||!h.access_token),W=null===(r=Digit.ComponentRegistryService)||void 0===r?void 0:r.getComponent("CustomEmployeeTopBar");return W?l.createElement(W,{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:G}):l.createElement(t.TopBar,{actionFields:[l.createElement(R,{dropdown:!0,t:v}),D&&l.createElement(P,{dropdown:!0}),(null==h?void 0:h.access_token)&&l.createElement(t.Dropdown,{option:O,optionKey:"name",profilePic:w||(null==h||null===(a=h.info)||void 0===a?void 0:a.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:G?null==S?void 0:S.logoId:null==f?void 0:f.statelogo,onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:"light",ulb:G?null!=S&&null!==(d=S.city)&&void 0!==d&&d.ulbGrade?l.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()):l.createElement("img",{className:"state",src:I,alt:"State Logo"}):l.createElement(n.Fragment,null,v("MYCITY_"+(null==f||null===(p=f.code)||void 0===p?void 0:p.toUpperCase())+"_LABEL")," ",v("MYCITY_STATECODE_LABEL"))})},M=(e,t,n,o)=>[{type:"component",element:"LANGUAGE",action:l.createElement(P,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:l.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:n}}],k=e=>{let{onSelect:n,onCancel:r,onDismiss:a,PopupStyles:i,isDisabled:s,hideSubmit:c}=e;const{t:u}=o.useTranslation(),d=[l.createElement("div",null,l.createElement(t.CardText,null,u("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",l.createElement("strong",null,u("CORE_LOGOUT_MESSAGE"))))],m=[l.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r}),l.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:u("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:n,isDisabled:s})],p=[l.createElement(t.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r})];return l.createElement(t.PopUp,{type:"default",children:d,heading:u("CORE_LOGOUT_WEB_HEADER"),footerChildren:c?p:m,sortFooterButtons:!0,onClose:a,className:"digit-logout-popup-wrapper",onOverlayClick:a,equalWidthButtons:!0,style:i})},U=e=>{let{info:t,t:n}=e;return l.createElement("div",{className:"profile-section"},l.createElement("div",{className:"imageloader imageloader-loaded"},l.createElement("img",{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,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"})),l.createElement("div",{id:"profile-name",className:"label-container name-Profile"},l.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),l.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},l.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&l.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},l.createElement("div",{className:"label-text"}," ",t.emailId," ")),l.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")&&l.createElement(R,{t:n,mobileView:!0}))},B={CommonPTIcon:l.createElement(s.PTIcon,{className:"icon"}),OBPSIcon:l.createElement(s.OBPSIcon,{className:"icon"}),propertyIcon:l.createElement(s.PropertyHouse,{className:"icon"}),TLIcon:l.createElement(s.CaseIcon,{className:"icon"}),PGRIcon:l.createElement(s.PGRIcon,{className:"icon"}),FSMIcon:l.createElement(s.FSMIcon,{className:"icon"}),WSIcon:l.createElement(s.WSICon,{className:"icon"}),MCollectIcon:l.createElement(s.MCollectIcon,{className:"icon"}),BillsIcon:l.createElement(s.CollectionIcon,{className:"icon"}),BirthIcon:l.createElement(s.BirthIcon,{className:"icon"}),DeathIcon:l.createElement(s.DeathIcon,{className:"icon"}),FirenocIcon:l.createElement(s.FirenocIcon,{className:"icon"}),HomeIcon:l.createElement(s.HomeIcon,{className:"icon"}),EditPencilIcon:l.createElement(s.EditPencilIcon,{className:"icon"}),LogoutIcon:l.createElement(s.LogoutIcon,{className:"icon"}),Phone:l.createElement(s.Phone,{className:"icon"})},F=e=>{var t,r,a,c;let{linkData:u,islinkDataLoading:d}=e;const{t:p}=o.useTranslation(),v=i.useHistory(),f=i.useLocation(),{pathname:g}=f,{data:E,isFetched:y}=Digit.Hooks.useStore.getInitData(),{stateInfo:h}=E||{},_=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 l.createElement(s.Loader,null);let T=[...M(p,0,()=>{var e;v.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:o}=e;const r=(null==o?void 0:o.icon)||(null===(t=o.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),a=r?B[r]:B.BillsIcon;let s;s="component"===o.type?o.action:o.text;const c=()=>l.createElement("span",m({className:"menu-item"},o.populators),a,l.createElement("div",{className:"menu-label"},s));return"external-link"===o.type?l.createElement("a",{href:o.link},l.createElement(c,null)):"link"===o.type?l.createElement(i.Link,{to:null==o?void 0:o.link},l.createElement(c,null)):l.createElement(c,null)};let L;var R,P,x,F,j;return y&&_&&_.access_token&&"CITIZEN"===(null==_||null===(t=_.info)||void 0===t?void 0:t.type)&&(L=l.createElement(U,{info:null==_?void 0:_.info,stateName:null==h?void 0:h.name,t:p}),T=T.filter(e=>"login-btn"!==(null==e?void 0:e.id)),T=[...T,{type:"link",icon:"HomeIcon",element:"HOME",text:p("COMMON_BOTTOM_NAVIGATION_HOME"),link:b?"/"+(null===(R=window)||void 0===R?void 0:R.contextPath)+"/employee":"/"+(null===(P=window)||void 0===P?void 0:P.contextPath)+"/citizen",populators:{onClick:()=>{var e;v.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/all-services")}}},{text:p("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:()=>{var e;v.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/user/profile")}}},{text:p("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{C(!1),D(!0)}}},{text:l.createElement(l.Fragment,null,p("CS_COMMON_HELPLINE"),l.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==E||null===(x=E.tenants)||void 0===x?void 0:x.map(e=>{}),l.createElement("div",{className:"link"},l.createElement("a",{href:"tel:"+(null==E||null===(F=E.tenants)||void 0===F?void 0:F[0].contactNumber)},null==E||null===(j=E.tenants)||void 0===j?void 0:j[0].contactNumber)))),element:"Helpline",icon:"Phone"}]),null===(r=Object.keys(u))||void 0===r||null===(a=r.sort((e,t)=>t.localeCompare(e)))||void 0===a||a.map(e=>{var t,n,l,o,r,a;(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!==(l=n.sidebarURL)&&void 0!==l&&l.includes(null===(o=window)||void 0===o?void 0:o.contextPath)?"link":"external-link",text:p("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===(a=u[e][0])||void 0===a?void 0:a.sidebarURL})}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),l.createElement("div",{style:{display:"flex",flexDirection:"column",height:S?"calc(100vh - 56px)":"auto",zIndex:"99"}},L,l.createElement("div",{className:"drawer-desktop"},null===(c=T)||void 0===c?void 0:c.map((e,t)=>l.createElement("div",{className:"sidebar-list "+(g===(null==e?void 0:e.link)||g===(null==e?void 0:e.sidebarURL)?"active":""),key:t},l.createElement(A,{item:e}))))),l.createElement("div",null,I&&l.createElement(k,{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}))))},j=e=>{var r,a,c,u;let{isMobile:d=!1,toggleSidebar:p,onLogout:v,isEmployee:f=!1,linkData:g,islinkDataLoading:E,userProfile:y}=e;Digit.Utils.getMultiRootTenant();const{data:h,isFetched:_}=Digit.Hooks.useStore.getInitData(),S=Digit.StoreData.getCurrentLanguage(),[b,O]=n.useState(null),{languages:N,stateInfo:C}=h||{},I=Digit.UserService.getUser(),[D,w]=n.useState(""),[T,A]=n.useState(null),[L,R]=n.useState([]),[P,x]=n.useState([]),[M,k]=n.useState(S);let U=[];const{isLoading:B,data:j}=Digit.Hooks.useAccessControl(),V=Digit.ULBService.getCurrentTenantId(),{t:H}=o.useTranslation(),G=i.useHistory(),W=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(l=e)&&void 0!==l&&l.includes(t);){var l,o;e=null===(o=e)||void 0===o?void 0:o.replace(t,n)}return e};n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let l=[],o=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>l.push(e.tenantId));let r=l.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;o.push({label:H("TENANT_TENANTS_"+(null===(t=W(e,".","_"))||void 0===t?void 0:t.toUpperCase())),value:e})}),U=null==o?void 0:o.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),R(o)},[T]);const z=()=>{Digit.clikOusideFired=!0,p(!1)};n.useEffect(()=>{b||function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==I||null===(e=I.info)||void 0===e?void 0:e.uuid,l=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],l=null==t||null===(n=t.photo)||void 0===n?void 0:n.split(",");O(null==l?void 0:l.at(0))}})}();Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[b]);const X=e=>{let t=null;var n,l;Digit.Utils.getMultiRootTenant()?(t=f?e.replace("/sandbox-ui/employee","/sandbox-ui/"+V+"/employee"):e.replace("/sandbox-ui/citizen","/sandbox-ui/"+V+"/citizen"),G.push(t),p()):(G.push("/"===e[0]?"/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/"+(f?"employee":"citizen")+e:"/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/"+(f?"employee":"citizen")+"/"+e),p())};if(E||B)return l.createElement(t.Loader,null);let q=[{id:"login-btn",element:"LOGIN",text:H("CORE_COMMON_LOGIN"),icon:l.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:()=>{var e,t;G.push(f?"/"+(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"),z()}}}];_&&I&&I.access_token&&(q=q.filter(e=>"login-btn"!==(null==e?void 0:e.id)));let Q={};if(f){var Z;null==j||j.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==D&&""!==e.path){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),Q[t]?Q[t].push(e):Q[t]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(D.toLowerCase())){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),Q[t]?Q[t].push(e):Q[t]=[e]}});const e=Object.keys(Q);for(let t=0;t<(null==e?void 0:e.length);t++){var Y,$,J,K,ee;const n=null===(Y=Q[e[t]][0])||void 0===Y||null===($=Y.displayName)||void 0===$||null===(J=$.toUpperCase())||void 0===J?void 0:J.replace(/[ -]/g,"_"),l=null===(K=e[t])||void 0===K||null===(ee=K.toUpperCase())||void 0===ee?void 0:ee.replace(/[ -]/g,"_");var te,ne,le,oe;-1===Q[e[t]][0].path.indexOf(".")?q.splice(1,0,{type:"link",text:H("ACTION_TEST_"+n),link:null===(te=Q[e[t]][0])||void 0===te?void 0:te.navigationURL,icon:null===(ne=Q[e[t]][0])||void 0===ne?void 0:ne.leftIcon,populators:{onClick:()=>{var n;G.push(null===(n=Q[e[t]][0])||void 0===n?void 0:n.navigationURL),z()}}}):q.splice(1,0,{type:"dynamic",moduleName:H("ACTION_TEST_"+l),links:null===(le=Q[e[t]])||void 0===le?void 0:le.map(e=>{var t,n;return m({},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=Q[e[t]][1])||void 0===oe?void 0:oe.leftIcon})}const t=q.findIndex(e=>"HOME"===e.element),n=q.splice(t,1),l=q.findIndex(e=>"LANGUAGE"===e.element),o=q.splice(l,(null===(Z=q)||void 0===Z?void 0:Z.length)-l);q.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])&&q.splice(0,0,n[0]),q=(null==o?void 0:o.length)>0?q.concat(o):q}else{var re,ae;null===(re=Object.keys(g))||void 0===re||null===(ae=re.sort((e,t)=>t.localeCompare(e)))||void 0===ae||ae.map(e=>{var t,n,l,o,r,a;"digit-ui-links"===(null===(t=g[e][0])||void 0===t?void 0:t.sidebar)&&q.splice(1,0,{type:null!==(n=g[e][0])&&void 0!==n&&null!==(l=n.sidebarURL)&&void 0!==l&&l.includes(null===(o=window)||void 0===o?void 0:o.contextPath)?"link":"external-link",text:H("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:g[e],icon:null===(r=g[e][0])||void 0===r?void 0:r.leftIcon,link:null===(a=g[e][0])||void 0===a?void 0:a.sidebarURL})})}G.location.pathname.includes("/openlink")&&(q=q.filter(e=>"LANGUAGE"===e.element)),q=null===(r=q)||void 0===r?void 0:r.map(e=>m({},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 se;ie=Digit.Utils.getMultiRootTenant()?H("TENANT_TENANTS_"+V):H("TENANT_TENANTS_"+(null===(se=W(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===se?void 0:se.toUpperCase()));const ce=null===(a=q)||void 0===a?void 0:a.map(e=>{var t;return"dynamic"===(null==e?void 0:e.type)?m({},e,{children:null==e||null===(t=e.links)||void 0===t?void 0:t.map(e=>m({},e,{label:null==e?void 0:e.displayName,icon:null==e?void 0:e.leftIcon}))}):e}),ue=null==L?void 0:L.map(e=>m({},e,{type:"custom",key:"city"})),de=null==N?void 0:N.map(e=>m({},e,{type:"custom",key:"language",icon:"Language"})),me=[{label:"HOME",value:"HOME",icon:"Home",type:"custom",key:"home"},{label:ie,value:ie,children:(null==ue?void 0:ue.length)>0?ue:void 0,type:"custom",icon:"LocationCity",key:"city"},{label:H("Language"),children:(null==de?void 0:de.length)>0?de:void 0,type:"custom",icon:"Language",key:"language"},{label:H("EDIT_PROFILE"),type:"custom",icon:"Edit",key:"editProfile"},{label:H("Modules"),icon:"DriveFileMove",children:ce}];return d?l.createElement(t.MobileSidebar,{items:me,profileName:null==I||null===(c=I.info)||void 0===c?void 0:c.name,profileNumber:null==I||null===(u=I.info)||void 0===u?void 0:u.mobileNumber,theme:"dark",transitionDuration:.3,styles:{marginTop:"64px",height:"93%"},onLogout:v,hideUserManuals:!0,profile:b||void 0,isSearchable:!0,onSelect:e=>{let{item:t,index:n,parentIndex:l}=e;return(e=>{let{item:t}=e;if(null!=t&&t.navigationURL)X(null==t?void 0:t.navigationURL);else if(null!=t&&t.link)X(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(f?"/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/employee":"/"+(null===(o=window)||void 0===o?void 0:o.contextPath)+"/citizen"),p();break;case"editProfile":y(),p();break;case"language":k((n=t).value),Digit.LocalizationService.changeLanguage(n.value,C.code),p();break;case"city":(e=>{var t,n,l,o;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===(l=n.roles)||void 0===l?void 0:l.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),A(e),window.location.href.includes("/"+(null===(o=window)||void 0===o?void 0:o.contextPath)+"/employee/")){var i,s;const e=(null===(i=location.state)||void 0===i?void 0:i.from)||"/"+(null===(s=window)||void 0===s?void 0:s.contextPath)+"/employee";G.replace(e)}window.location.reload()})(t),p()}}var n,l,o})({item:t,index:n,parentIndex:l})}}):l.createElement(F,{logout:v})};function V(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 H=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(V(function(e,t){var n;n=e=>(()=>{var t={"./node_modules/css-mediaquery/index.js":(e,t)=>{t.match=function(e,t){return i(e).some(function(e){var n=e.inverse,l="all"===e.type||t.type===e.type;if(l&&n||!l&&!n)return!1;var o=e.expressions.every(function(e){var n=e.feature,l=e.modifier,o=e.value,r=t[n];if(!r)return!1;switch(n){case"orientation":case"scan":return r.toLowerCase()===o.toLowerCase();case"width":case"height":case"device-width":case"device-height":o=u(o),r=u(r);break;case"resolution":o=c(o),r=c(r);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":o=s(o),r=s(r);break;case"grid":case"color":case"color-index":case"monochrome":o=parseInt(o,10)||1,r=parseInt(r,10)||0}switch(l){case"min":return r>=o;case"max":return r<=o;default:return r===o}});return o&&!n||!o&&n})},t.parse=i;var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,l=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,o=/^(?:(min|max)-)?(.+)/,r=/(em|rem|px|cm|mm|in|pt|pc)?$/,a=/(dpi|dpcm|dppx)?$/;function i(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(n),r=t[1],a=t[2],i=t[3]||"",s={};return s.inverse=!!r&&"not"===r.toLowerCase(),s.type=a?a.toLowerCase():"all",i=i.match(/\([^\)]+\)/g)||[],s.expressions=i.map(function(e){var t=e.match(l),n=t[1].toLowerCase().match(o);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(a)[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:()=>i});var l=/[A-Z]/g,o=/^ms-/,r={};function a(e){return"-"+e.toLowerCase()}const i=function(e){if(r.hasOwnProperty(e))return r[e];var t=e.replace(l,a);return r[e]=o.test(t)?"-"+t:t}},"./node_modules/matchmediaquery/index.js":(e,t,n)=>{var l=n("./node_modules/css-mediaquery/index.js").match,o="undefined"!=typeof window?window.matchMedia:null;function r(e,t,n){var r=this;if(o&&!n){var a=o.call(window,e);this.matches=a.matches,this.media=a.media,a.addListener(i)}else this.matches=l(e,t),this.media=e;function i(e){r.matches=e.matches,r.media=e.media}this.addListener=function(e){a&&a.addListener(e)},this.removeListener=function(e){a&&a.removeListener(e)},this.dispose=function(){a&&a.removeListener(i)}}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,l=Object.prototype.propertyIsEnumerable;function o(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 l={};return"abcdefghijklmnopqrst".split("").forEach(function(e){l[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},l)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var a,i,s=o(e),c=1;c<arguments.length;c++){for(var u in a=Object(arguments[c]))n.call(a,u)&&(s[u]=a[u]);if(t){i=t(a);for(var d=0;d<i.length;d++)l.call(a,i[d])&&(s[i[d]]=a[i[d]])}}return s}},"./node_modules/prop-types/checkPropTypes.js":(e,t,n)=>{var l,o=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),r={},a=n("./node_modules/prop-types/lib/has.js");function i(e,t,n,i,s){for(var c in e)if(a(e,c)){var u;try{if("function"!=typeof e[c]){var d=Error((i||"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,i,n,null,o)}catch(e){u=e}if(!u||u instanceof Error||l((i||"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():"";l("Failed "+n+" type: "+u.message+(null!=m?m:""))}}}l=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},i.resetWarningCache=function(){r={}},e.exports=i},"./node_modules/prop-types/factoryWithTypeCheckers.js":(e,t,n)=>{var l,o=n("./node_modules/react-is/index.js"),r=n("./node_modules/object-assign/index.js"),a=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),i=n("./node_modules/prop-types/lib/has.js"),s=n("./node_modules/prop-types/checkPropTypes.js");function c(){return null}l=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,l,o,r){if("function"!=typeof e)return new m("Property `"+r+"` of component `"+l+"` has invalid PropType notation inside arrayOf.");var i=t[n];if(!Array.isArray(i))return new m("Invalid "+o+" `"+r+"` of type `"+E(i)+"` supplied to `"+l+"`, expected an array.");for(var s=0;s<i.length;s++){var c=e(i,s,l,o,r+"["+s+"]",a);if(c instanceof Error)return c}return null})},element:p(function(t,n,l,o,r){var a=t[n];return e(a)?null:new m("Invalid "+o+" `"+r+"` of type `"+E(a)+"` supplied to `"+l+"`, expected a single ReactElement.")}),elementType:p(function(e,t,n,l,r){var a=e[t];return o.isValidElementType(a)?null:new m("Invalid "+l+" `"+r+"` of type `"+E(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return p(function(t,n,l,o,r){var a;return t[n]instanceof e?null:new m("Invalid "+o+" `"+r+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+l+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:p(function(e,t,n,l,o){return g(e[t])?null:new m("Invalid "+l+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return p(function(t,n,l,o,r){if("function"!=typeof e)return new m("Property `"+r+"` of component `"+l+"` has invalid PropType notation inside objectOf.");var s=t[n],c=E(s);if("object"!==c)return new m("Invalid "+o+" `"+r+"` of type `"+c+"` supplied to `"+l+"`, expected an object.");for(var u in s)if(i(s,u)){var d=e(s,u,l,o,r+"."+u,a);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return l(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,l,o,r){for(var a=t[n],i=0;i<e.length;i++)if(d(a,e[i]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===y(t)?String(t):t});return new m("Invalid "+o+" `"+r+"` of value `"+String(a)+"` supplied to `"+l+"`, expected one of "+s+".")}return p(t)},oneOfType:function(e){if(!Array.isArray(e))return l("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 l("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+h(n)+" at index "+t+"."),c}return p(function(t,n,l,o,r){for(var s=[],c=0;c<e.length;c++){var u=(0,e[c])(t,n,l,o,r,a);if(null==u)return null;u.data&&i(u.data,"expectedType")&&s.push(u.data.expectedType)}return new m("Invalid "+o+" `"+r+"` supplied to `"+l+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")})},shape:function(e){return p(function(t,n,l,o,r){var i=t[n],s=E(i);if("object"!==s)return new m("Invalid "+o+" `"+r+"` of type `"+s+"` supplied to `"+l+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return f(l,o,r,c,y(u));var d=u(i,c,l,o,r+"."+c,a);if(d)return d}return null})},exact:function(e){return p(function(t,n,l,o,s){var c=t[n],u=E(c);if("object"!==u)return new m("Invalid "+o+" `"+s+"` of type `"+u+"` supplied to `"+l+"`, expected `object`.");var d=r({},t[n],e);for(var p in d){var v=e[p];if(i(e,p)&&"function"!=typeof v)return f(l,o,s,p,y(v));if(!v)return new m("Invalid "+o+" `"+s+"` key `"+p+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=v(c,p,l,o,s+"."+p,a);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={},o=0;function r(r,i,s,c,u,d,p){if(c=c||"<<anonymous>>",d=d||s,p!==a){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]&&o<3&&(l("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,o++)}}return null==i[s]?r?new m(null===i[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(i,s,c,u,d)}var i=r.bind(null,!1);return i.isRequired=r.bind(null,!0),i}function v(e){return p(function(t,n,l,o,r,a){var i=t[n];return E(i)!==e?new m("Invalid "+o+" `"+r+"` of type `"+y(i)+"` supplied to `"+l+"`, expected `"+e+"`.",{expectedType:e}):null})}function f(e,t,n,l,o){return new m((e||"React class")+": "+t+" type `"+n+"."+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}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 l=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!l)return!1;var o,r=l.call(t);if(l!==t.entries){for(;!(o=r.next()).done;)if(!g(o.value))return!1}else for(;!(o=r.next()).done;){var a=o.value;if(a&&!g(a[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 l=n("./node_modules/react-is/index.js");e.exports=n("./node_modules/prop-types/factoryWithTypeCheckers.js")(l.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,l=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=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 o:case a:case r:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case i:return g;default:return t}}case l:return t}}}var S=u,b=s,O=i,N=n,C=d,I=o,D=f,w=v,T=l,A=a,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)===i},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)===o},t.isLazy=function(e){return _(e)===f},t.isMemo=function(e){return _(e)===v},t.isPortal=function(e){return _(e)===l},t.isProfiler=function(e){return _(e)===a},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===o||e===u||e===a||e===r||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===i||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 l(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),l=Object.keys(t),o=n.length;if(l.length!==o)return!1;for(var r=0;r<o;r++){var a=n[r];if(e[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0}function o(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var l=0;l<n;l++)if(e[l]!==t[l])return!1;return!0}n.r(t),n.d(t,{shallowEqualArrays:()=>o,shallowEqualObjects:()=>l})},"./src/Component.ts":function(e,t,n){var l=this&&this.__rest||function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)t.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=o(n("./src/useMediaQuery.ts"));t.default=function(e){var t=e.children,n=e.device,o=e.onChange,a=l(e,["children","device","onChange"]),i=(0,r.default)(a,n,o);return"function"==typeof t?t(i):i?t:null}},"./src/Context.ts":(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var l=(0,n("react").createContext)(void 0);t.default=l},"./src/index.ts":function(e,t,n){var l=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 o=l(n("./src/useMediaQuery.ts"));t.useMediaQuery=o.default;var r=l(n("./src/Component.ts"));t.default=r.default;var a=l(n("./src/toQuery.ts"));t.toQuery=a.default;var i=l(n("./src/Context.ts"));t.Context=i.default},"./src/mediaQuery.ts":function(e,t,n){var l=this&&this.__assign||function(){return(l=Object.assign||function(e){for(var t,n=1,l=arguments.length;n<l;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)t.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n("./node_modules/prop-types/index.js")),i=a.default.oneOfType([a.default.string,a.default.number]),s={all:a.default.bool,grid:a.default.bool,aural:a.default.bool,braille:a.default.bool,handheld:a.default.bool,print:a.default.bool,projection:a.default.bool,screen:a.default.bool,tty:a.default.bool,tv:a.default.bool,embossed:a.default.bool},c={orientation:a.default.oneOf(["portrait","landscape"]),scan:a.default.oneOf(["progressive","interlace"]),aspectRatio:a.default.string,deviceAspectRatio:a.default.string,height:i,deviceHeight:i,width:i,deviceWidth:i,color:a.default.bool,colorIndex:a.default.bool,monochrome:a.default.bool,resolution:i,type:Object.keys(s)},u=o(c,["type"]),d=l({minAspectRatio:a.default.string,maxAspectRatio:a.default.string,minDeviceAspectRatio:a.default.string,maxDeviceAspectRatio:a.default.string,minHeight:i,maxHeight:i,minDeviceHeight:i,maxDeviceHeight:i,minWidth:i,maxWidth:i,minDeviceWidth:i,maxDeviceWidth:i,minColor:a.default.number,maxColor:a.default.number,minColorIndex:a.default.number,maxColorIndex:a.default.number,minMonochrome:a.default.number,maxMonochrome:a.default.number,minResolution:i,maxResolution:i},u),m=l(l({},s),d);t.default={all:m,types:s,matchers:c,features:d}},"./src/toQuery.ts":function(e,t,n){var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=l(n("./node_modules/hyphenate-style-name/index.js")),r=l(n("./src/mediaQuery.ts"));t.default=function(e){var t=[];return Object.keys(r.default.all).forEach(function(n){var l=e[n];null!=l&&t.push(function(e,t){var n=(0,o.default)(e);return"number"==typeof t&&(t="".concat(t,"px")),!0===t?n:!1===t?"not ".concat(n):"(".concat(n,": ").concat(t,")")}(n,l))}),t.join(" and ")}},"./src/useMediaQuery.ts":function(e,t,n){var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n("react"),r=l(n("./node_modules/matchmediaquery/index.js")),a=l(n("./node_modules/hyphenate-style-name/index.js")),i=n("./node_modules/shallow-equal/dist/index.esm.js"),s=l(n("./src/toQuery.ts")),c=l(n("./src/Context.ts")),u=function(e){if(e)return Object.keys(e).reduce(function(t,n){return t[(0,a.default)(n)]=e[n],t},{})},d=function(){var e=(0,o.useRef)(!1);return(0,o.useEffect)(function(){e.current=!0},[]),e.current};t.default=function(e,t,n){var l=function(e){var t=(0,o.useContext)(c.default),n=function(){return u(e)||u(t)},l=(0,o.useState)(n),r=l[0],a=l[1];return(0,o.useEffect)(function(){var e=n();(0,i.shallowEqualObjects)(r,e)||a(e)},[e,t]),r}(t),a=function(e){var t=function(){return function(e){return e.query||(0,s.default)(e)}(e)},n=(0,o.useState)(t),l=n[0],r=n[1];return(0,o.useEffect)(function(){var e=t();l!==e&&r(e)},[e]),l}(e);if(!a)throw new Error("Invalid or missing MediaQuery!");var m=function(e,t){var n=function(){return(0,r.default)(e,t||{},!!t)},l=(0,o.useState)(n),a=l[0],i=l[1],s=d();return(0,o.useEffect)(function(){if(s){var e=n();return i(e),function(){e&&e.dispose()}}},[e,t]),a}(a,l),p=function(e){var t=(0,o.useState)(e.matches),n=t[0],l=t[1];return(0,o.useEffect)(function(){var t=function(e){l(e.matches)};return e.addListener(t),l(e.matches),function(){e.removeListener(t)}},[e]),n}(m),v=d();return(0,o.useEffect)(function(){v&&n&&n(p)},[p]),(0,o.useEffect)(function(){return function(){m&&m.dispose()}},[]),p}},react:t=>{t.exports=e}},n={};function l(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={exports:{}};return t[e].call(r.exports,r,r.exports,l),r.exports}return l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l("./src/index.ts")})(),e.exports=n(l)}));const G=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web","sandbox-ui","kibana-v8"],W=()=>{const{isLoading:e,data:n}=Digit.Hooks.useAccessControl(),r=Digit.Utils.getMultiRootTenant(),{t:a}=o.useTranslation(),s=i.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 l={};t.reduce((n,l,o)=>{if(o!==t.length-1)return n[l]={},n[l];n[l]={item:e}},l),function e(t,n){for(const l in n)n.hasOwnProperty(l)&&("object"!=typeof n[l]||Array.isArray(n[l])?t[l]||(t[l]=n[l]):(t[l]||(t[l]={}),e(t[l],n[l])))}(u,l)}});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:a(n.item.displayName),icon:{icon:n.item.leftIcon,width:"1.5rem",height:"1.5rem"},navigationUrl:n.item.navigationURL,orderNumber:n.item.orderNumber};const l=Object.keys(n).map(e=>t(e,n[e])),o=function e(t){void 0===t&&(t={});for(const n in t){const l=t[n];if("item"===n&&""!==(null==l?void 0:l.leftIcon))return null==l?void 0:l.leftIcon;if("object"==typeof t[n]&&!Array.isArray(t[n])){const l=e(t[n]);if(l)return l}}return null}(n);return{label:a(e),icon:{icon:o,width:"1.5rem",height:"1.5rem"},children:l}};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?l.createElement(t.Loader,null):u?l.createElement(H,{minWidth:768},l.createElement(t.Sidebar,{items:p,hideAccessbilityTools:!0,onSelect:e=>{let{item:t,index:n,parentIndex:l}=e;return(e=>{let{item:t}=e;null!=t&&t.navigationUrl&&function(e,t){var n,l;if(void 0===e&&(e={}),void 0===t&&(t=""),"/"!=t)if(-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+(null===(l=window)||void 0===l?void 0:l.contextPath)))){const n=window.location.origin;let l=null;r?(l=t=t.replace("/sandbox-ui/employee","/sandbox-ui/"+c+"/employee"),e.push(l)):(l=null!=G&&G.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=l)}else e.push(t)}(s,null==t?void 0:t.navigationUrl)})({item:t,index:n,parentIndex:l})},theme:"dark",variant:"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}})):""},z=e=>{let{CITIZEN:t,isSidebarOpen:n,toggleSidebar:o,handleLogout:r,mobileView:a,userDetails:i,modules:s,linkData:c,islinkDataLoading:u,userProfile:d}=e;return t?l.createElement(j,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:r,linkData:c,islinkDataLoading:u,userProfile:d,isEmployee:!1}):!n&&null!=i&&i.access_token?l.createElement("div",{className:"digit-employeeSidebar"},l.createElement(W,{mobileView:a,userDetails:i,modules:s})):l.createElement("div",{className:"digit-citizenSidebar"},l.createElement(j,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:r,isEmployee:!0,userProfile:d}))},X=e=>{let{t:t,stateInfo:o,userDetails:r,CITIZEN:a,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=i.useHistory(),[_,S]=n.useState(!1),b=()=>{y(!1),S(!0)},O=()=>{S(!1)},N=()=>{y(!E)},C=()=>{var e,t;h.push(a?"/"+(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 l.createElement(l.Fragment,null,l.createElement(x,{t:t,stateInfo:o,toggleSidebar:N,isSidebarOpen:E,handleLogout:b,userDetails:r,CITIZEN:a,cityDetails:s,mobileView:c,userOptions:I,handleUserDropdownSelection:u,logoUrl:d,logoUrlWhite:m,showLanguageChange:v}),_&&l.createElement(k,{onSelect:()=>{Digit.UserService.logout(),S(!1)},onCancel:O,onDismiss:O}),a?a?p&&E&&l.createElement(z,{t:t,CITIZEN:a,isSidebarOpen:E,toggleSidebar:N,handleLogout:b,mobileView:c,userDetails:r,linkData:f,userProfile:C,islinkDataLoading:g}):null:p&&l.createElement(z,{t:t,CITIZEN:a,isSidebarOpen:E,toggleSidebar:N,handleLogout:b,mobileView:c,userDetails:r,linkData:f,userProfile:C,islinkDataLoading:g}))},q=e=>{const{question:t,answer:r,lastIndex:a}=e,[i,s]=n.useState(!1),{t:u}=o.useTranslation();return l.createElement("div",{className:"faqs border-none",onClick:()=>s(!i)},l.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},l.createElement("span",null,u(t)),l.createElement("span",{className:i?"faqicon rotate":"faqicon",style:{float:"right"}},l.createElement(c.ArrowForward,null))),l.createElement("div",{className:"faq-answer",style:i?{display:"block"}:{display:"none"}},l.createElement("span",null,u(r))),a?null:l.createElement("div",{className:"cs-box-border"}))},Q=e=>{var r,a,i;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(),o.useTranslation()),{isLoading:d,data:m}=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),p=null==m||null===(a=m.MdmsRes["common-masters"])||void 0===a||null===(i=a.faqs[0])||void 0===i?void 0:i[""+s].faqs;return d?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,l.createElement("div",{className:"faq-page"},l.createElement(t.BackButton,{style:{marginLeft:"unset"}}),l.createElement("div",{style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},u("FAQ_S"))),l.createElement("div",{className:"faq-list"},p.map((e,t)=>l.createElement(q,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==p?void 0:p.length)-1})))))},Z=()=>{var e,t,n,r,a,c,u,d,p,v,f,g,E,y,h,_,S,b,O,N,C,I,D,w,T,A,L;const{t:R}=o.useTranslation(),P=i.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,l,o;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===(l=Digit.UserService)||void 0===l||null===(o=l.getUser())||void 0===o||!o.access_token)},{data:F,isLoading:j}=Digit.Hooks.useEvents({tenantId:x,variant:"whats-new",config:{enabled:B()}});var V;x||P.push("/"+(null===(V=window)||void 0===V?void 0:V.contextPath)+"/citizen/select-language");const H=null==M?void 0:M.appBannerDesktop,G=null==M?void 0:M.appBannerMobile,W=null==M?void 0:M.citizenServicesCard,z=null==M?void 0:M.informationAndUpdatesCard,X=null==M?void 0:M.whatsAppBannerDesktop,q=null==M?void 0:M.whatsAppBannerMobile,Q=null==M?void 0:M.whatsNewSection,Z=null==M?void 0:M.redirectURL;var Y,$;Z&&P.push("/"+(null===(Y=window)||void 0===Y?void 0:Y.contextPath)+"/citizen/"+Z),(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!==(a=window)&&void 0!==a&&null!==(c=a.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===($=window)||void 0===$?void 0:$.contextPath)+"/citizen/all-services");const J=e=>{window.open(null==e?void 0:e.navigationUrl)},K={header:R(null==W?void 0:W.headerLabel),sideOption:{name:R(null==W||null===(p=W.sideOption)||void 0===p?void 0:p.name),onClick:()=>{var e;return P.push(null==W||null===(e=W.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:R(null==W||null===(v=W.props)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.label),Icon:l.createElement(s.ComplaintIcon,null),onClick:()=>{var e,t;return P.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==W||null===(g=W.props)||void 0===g||null===(E=g[1])||void 0===E?void 0:E.label),Icon:l.createElement(s.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return P.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==W||null===(y=W.props)||void 0===y||null===(h=y[2])||void 0===h?void 0:h.label),Icon:l.createElement(s.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return P.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==W||null===(_=W.props)||void 0===_||null===(S=_[3])||void 0===S?void 0:S.label),Icon:l.createElement(s.OBPSIcon,null),onClick:()=>{var e,t;return P.push(null==W||null===(e=W.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:l.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:l.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:l.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:l.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?l.createElement(s.Loader,null):l.createElement("div",{className:"HomePageContainer"},l.createElement("div",{className:"HomePageWrapper"},l.createElement("div",{className:"BannerWithSearch"},l.createElement("img",U?{src:null==G?void 0:G.bannerUrl}:{src:null==H?void 0:H.bannerUrl}),l.createElement("div",{className:"ServicesSection"},l.createElement(s.CardBasedOptions,m({style:{marginTop:"-30px"}},K)),l.createElement(s.CardBasedOptions,m({style:U?{}:{marginTop:"-30px"}},ee)))),(q||X)&&l.createElement("div",{className:"WhatsAppBanner"},l.createElement("img",U?{src:null==q?void 0:q.bannerUrl,onClick:()=>J(q)}:{src:null==X?void 0:X.bannerUrl,onClick:()=>J(X)})),B()?j?l.createElement(s.Loader,null):l.createElement("div",{className:"WhatsNewSection"},l.createElement("div",{className:"headSection"},l.createElement("h2",null,R(null==Q?void 0:Q.headerLabel)),l.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))),l.createElement(s.WhatsNewCard,null==F?void 0:F[0])):null))},Y=()=>{const{t:e}=o.useTranslation(),r=i.useHistory(),{data:{languages:a,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:a,optionsKey:"label",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:e=>Digit.LocalizationService.changeLanguage(e.value,s.code),selectedOption:null==a?void 0:a.filter(e=>e.value===u)[0]}),[u,a]);return c?l.createElement(t.Loader,null):l.createElement("div",{className:"selection-card-wrapper"},l.createElement(t.PageBasedInput,{texts:d,onSubmit:function(){var e;r.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/select-location")}},l.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),l.createElement(t.RadioButtons,m)))},$=()=>{const{t:e}=o.useTranslation(),r=i.useHistory(),a=i.useLocation(),{data:{uiHomePage:c}={}}=Digit.Hooks.useStore.getInitData(),u=null==c?void 0:c.redirectURL,{data:d,isLoading:p}=Digit.Hooks.useTenants(),[v,f]=n.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[g,E]=n.useState(!1),y=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function h(e){f(e),E(!1)}const _=n.useMemo(()=>({options:d,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:h,selectedOption:v}),[d,e,v]);return p?l.createElement("loader",null):l.createElement("div",{className:"selection-card-wrapper"},l.createElement(t.BackLink,{onClick:()=>window.history.back()}),l.createElement(s.PageBasedInput,{texts:y,onSubmit:function(){if(v){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",v);const l=null===(e=a.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):l?r.replace(l):r.push("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/citizen")}else E(!0)},className:"location-selection-container"},l.createElement(s.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),l.createElement(s.SearchOnRadioButtons,m({},_,{placeholder:e("COMMON_TABLE_SEARCH")})),g?l.createElement(s.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))};function J(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function K(e){let{setProfilePic:t,closeDrawer:r,userType:a,removeProfilePic:i,showToast:c}=e;const[u,d]=n.useState(null),[m,p]=n.useState(""),[v,f]=n.useState(null),{t:g}=o.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=J(function(){return Promise.resolve(Digit.UploadServices.Filestorage(a+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var n,l;if((null==e||null===(n=e.data)||void 0===n||null===(l=n.files)||void 0===l?void 0:l.length)>0){var o,r;const n=null==e||null===(o=e.data)||void 0===o||null===(r=o.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]),l.createElement(l.Fragment,null,l.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()}),l.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===a?"2.5rem":"0",zIndex:"1000"}},l.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},l.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",l.createElement(s.GalleryIcon,null)),l.createElement("label",{style:{cursor:"pointer"}}," Gallery"),l.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>p(e.target.files[0]),style:{display:"none"}})),l.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},l.createElement("button",{onClick:()=>{i(),r()}},l.createElement(s.RemoveIcon,null)),l.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const ee={tenantId:""+Digit.ULBService.getStateId(),UserProfileValidationConfig:[{name:"/^[a-zA-Z ]+$/i",mobileNumber:"/^[6-9]{1}[0-9]{9}$/",password:"/^([a-zA-Z0-9@#$%]{8,15})$/i"}]},te=e=>{var r,a,c,u,d,p,v,f,g,E,y,h,_,S,b,O,N,C,I,D,w,T,A,L,R,P,x,M,k,U,B,F,j,V,H;let{stateCode:G,userType:W,cityDetails:z}=e;i.useHistory();const{t:X}=o.useTranslation(),q=window.location.href,Q=Digit.ULBService.getStateId(),Z=Digit.ULBService.getCurrentTenantId(),Y=(null===(r=Digit.UserService.getUser())||void 0===r?void 0:r.info)||{},[$,te]=n.useState(null),[ne,le]=n.useState(null!=Y&&Y.name?Y.name:""),[oe,re]=n.useState(null!=Y&&Y.emailId?Y.emailId:""),[ae,ie]=n.useState(null==$?void 0:$.gender),[se,ce]=n.useState(null!=Y&&Y.permanentCity?Y.permanentCity:z.name),[ue,de]=n.useState(null!=Y&&Y.mobileNumber?Y.mobileNumber:""),[me,pe]=n.useState(null),[ve,fe]=n.useState(""),[ge,Ee]=n.useState(!1),[ye,he]=n.useState(!1),[_e,Se]=n.useState(""),[be,Oe]=n.useState(""),[Ne,Ce]=n.useState(""),[Ie,De]=n.useState(null),[we,Te]=n.useState(!1),[Ae,Le]=l.useState(window.innerWidth),[Re,Pe]=l.useState({}),xe=window.Digit.Utils.browser.isMobile(),Me=e=>{var t;return(null==e||null===(t=e.UserProfileValidationConfig)||void 0===t?void 0:t[0])&&Object.entries(null==e?void 0:e.UserProfileValidationConfig[0]).reduce((e,t)=>{let[n,l]=t;return e[n]=new RegExp(l),e},{})},[ke,Ue]=n.useState(Me(ee)||{}),{data:Be,isValidationConfigLoading:Fe}=Digit.Hooks.useCustomMDMS(G,"commonUiConfig",[{name:"UserProfileValidationConfig"}],{select:e=>null==e?void 0:e.commonUiConfig});n.useEffect(()=>{var e;if(Be&&null!=Be&&null!==(e=Be.UserProfileValidationConfig)&&void 0!==e&&e[0]){const e=Me(Be);Ue(e)}},[Be]),l.useEffect(()=>(window.addEventListener("resize",()=>Le(window.innerWidth)),()=>{window.removeEventListener("resize",()=>Le(window.innerWidth))})),n.useEffect(()=>{var e;Te(!0),function(){try{const e=null==Y?void 0:Y.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(Z,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&te(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),ie({i18nKey:void 0,code:null==$?void 0:$.gender,value:null==$?void 0:$.gender});const t=null==$||null===(e=$.photo)||void 0===e?void 0:e.split(",");fe(null==t?void 0:t.at(0)),Te(!1)},[null!==$]);let je={};const Ve=e=>ie(e),He=()=>Ee(!1),Ge=e=>{var t;le(e),null==ke||null===(t=ke.name)||void 0===t||!t.test(e)||0===e.length||e.length>50?Pe(m({},Re,{userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}})):Pe(m({},Re,{userName:null}))},We=e=>{(null==Y?void 0:Y.userName)!==e?(re(e),!e.length||e.includes("@")&&e.includes(".")?Pe(m({},Re,{emailAddress:null})):Pe(m({},Re,{emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}}))):Pe(m({},Re,{emailAddress:null}))},ze=function(e,t,n){void 0===n&&(n=5e3),De({key:e,action:t}),setTimeout(()=>{De(null)},n)},Xe=function(){try{let t=!1;function e(e){if(t)return e;Te(!1)}Te(!0);const n=J(function(){const e=m({},Y,{name:ne,gender:null==ae?void 0:ae.value,emailId:oe,photo:me});if(null==ke||!ke.name.test(ne)||""===ne||ne.length>50||ne.length<1)throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===W&&(null==ke||!ke.mobileNumber.test(ue)))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(oe.length&&(!oe.includes("@")||!oe.includes(".")))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_EMAIL_INVALID")});if(ye&&(_e.length||be.length||Ne.length)){if(be!==Ne)throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(_e.length&&be.length&&Ne.length))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!(null!=ke&&ke.password.test(be)||null!=ke&&ke.password.test(Ne)))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}return Promise.resolve(Digit.UserService.updateUser(e,G)).then(function(e){let{responseInfo:t}=e;if(t&&"200"===t.status){const e=Digit.UserService.getUser();e&&Digit.UserService.setUser(m({},e,{info:m({},e.info,{name:ne,mobileNumber:ue,emailId:oe,permanentCity:se})}))}return function(){if(_e.length&&be.length&&Ne.length){const e={existingPassword:_e,newPassword:be,tenantId:Z,type:"EMPLOYEE",username:null==Y?void 0:Y.userName,confirmPassword:Ne};return function(){if(be===Ne)return J(function(){return Promise.resolve(Digit.UserService.changePassword(e,Z)).then(function(e){const{responseInfo:t}=e;if(null==t||!t.status||"200"!==t.status)throw"";ze("success",X("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&&ze("success",X("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){const t=JSON.parse(e);ze(t.type,X(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}};let qe=[];const{data:Qe}=Digit.Hooks.useGenderMDMS(Q,"common-masters","GenderType");return Qe&&Qe.map(e=>{qe.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),we||Fe?l.createElement(t.Loader,null):l.createElement("div",{className:"user-profile"},l.createElement("section",{style:{margin:"citizen"===W||xe?"8px":"24px"}},"citizen"===W||xe?l.createElement(t.BackLink,{onClick:()=>window.history.back()}):l.createElement(t.BreadCrumb,{crumbs:[{path:"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/employee",content:X("ES_COMMON_HOME"),show:!0},{path:"/"+(null===(c=window)||void 0===c?void 0:c.contextPath)+"/employee/user/profile",content:X("ES_COMMON_PAGE_1"),show:q.includes("/user/profile")}]})),l.createElement("div",{style:{display:"flex",flex:1,flexDirection:Ae<768||"citizen"===W?"column":"row",margin:"citizen"===W?"8px":"16px",gap:"citizen"===W?"":"0 24px",boxShadow:"citizen"===W?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===W?"white":"",borderRadius:"citizen"===W?"4px":"",maxWidth:"citizen"===W?"960px":""}},l.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===W?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===W?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===W?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===W?"8px":"16px"}},l.createElement("div",{style:{position:"relative",height:"citizen"===W?"114px":"150px",width:"citizen"===W?"114px":"150px",margin:"16px"}},l.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:ve&&""!==ve?ve:"data:image/png;base64,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"}),l.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>Ee(!ge)},l.createElement(s.CameraIcon,null)))),l.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===W?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===W?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===W?"8px":"24px",paddingBottom:"20px"}},"citizen"===W?l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"user-profile",style:{}},""+X("CORE_COMMON_PROFILE_NAME"),"*"),l.createElement("div",{style:{width:"40rem",maxWidth:"960px"}},l.createElement(t.TextInput,m({t:X,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:ne,onChange:e=>Ge(e.target.value)},je={isRequired:!0,pattern:(null==Be||null===(u=Be.UserProfileValidationConfig)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.name)||(null==ee||null===(p=ee.UserProfileValidationConfig)||void 0===p||null===(v=p[0])||void 0===v?void 0:v.name),type:"tel",title:X("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==Re?void 0:Re.userName)&&l.createElement(t.ErrorMessage,{message:X(null==Re||null===(f=Re.userName)||void 0===f?void 0:f.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"user-profile",style:{}},""+X("CORE_COMMON_PROFILE_GENDER")),l.createElement(t.Dropdown,{style:{width:"40rem",fontSize:"1rem"},className:"form-field profileDropdown",selected:1===(null==ae?void 0:ae.length)?ae[0]:ae,disable:1===(null==ae?void 0:ae.length)||!1,option:qe,select:Ve,value:ae,optionKey:"code",t:X,name:"gender"})),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"user-profile",style:{}},""+X("CORE_COMMON_PROFILE_EMAIL")),l.createElement("div",{style:{width:"40rem"}},l.createElement(t.TextInput,{t:X,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:oe,onChange:e=>We(e.target.value),disabled:!1}),(null==Re?void 0:Re.emailAddress)&&l.createElement(t.ErrorMessage,{message:X(null==Re||null===(g=Re.emailAddress)||void 0===g?void 0:g.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement("button",{onClick:Xe,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:xe?"100%":"240px",borderBottom:"1px solid black"}},X("CORE_COMMON_SAVE"))):l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+X("CORE_COMMON_PROFILE_NAME"),"*"),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,m({t:X,type:"text",isMandatory:!1,name:"name",value:ne,onChange:e=>Ge(e.target.value),placeholder:"Enter Your Name"},je={isRequired:!0,pattern:(null==Be||null===(E=Be.UserProfileValidationConfig)||void 0===E||null===(y=E[0])||void 0===y?void 0:y.name)||(null==ee||null===(h=ee.UserProfileValidationConfig)||void 0===h||null===(_=h[0])||void 0===_?void 0:_.name),type:"text",title:X("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disabled:!1})),(null==Re?void 0:Re.userName)&&l.createElement(t.ErrorMessage,{message:X(null==Re||null===(S=Re.userName)||void 0===S?void 0:S.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+X("CORE_COMMON_PROFILE_GENDER")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.Dropdown,{className:"profileDropdown",selected:1===(null==ae?void 0:ae.length)?ae[0]:ae,disable:1===(null==ae?void 0:ae.length)||!1,option:qe,select:Ve,value:ae,optionKey:"code",t:X,name:"gender"}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+X("CORE_COMMON_PROFILE_CITY")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,m({t:X,type:"text",isMandatory:!1,name:"city",value:X(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+Z)),onChange:e=>ce(e.target.value),placeholder:"Enter Your City Name"},je={isRequired:!0,type:"text",title:X("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disabled:!0})),l.createElement(t.ErrorMessage,null))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},X("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),l.createElement("div",{style:{width:"100%"}},l.createElement(t.MobileNumber,{value:ue,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{var t;de(e),"employee"!==W||null!=ke&&null!==(t=ke.mobileNumber)&&void 0!==t&&t.test(e)?Pe(m({},Re,{mobileNumber:null})):Pe(m({},Re,{mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}}))})(e),disable:!Digit.Utils.getMultiRootTenant(),required:!0,pattern:(null==Be||null===(b=Be.UserProfileValidationConfig)||void 0===b||null===(O=b[0])||void 0===O?void 0:O.mobileNumber)||(null==ee||null===(N=ee.UserProfileValidationConfig)||void 0===N||null===(C=N[0])||void 0===C?void 0:C.mobileNumber),type:"tel",title:X("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==Re?void 0:Re.mobileNumber)&&l.createElement(t.ErrorMessage,{message:X(null==Re||null===(I=Re.mobileNumber)||void 0===I?void 0:I.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+X("CORE_COMMON_PROFILE_EMAIL")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:X,type:"email",isMandatory:!1,placeholder:X("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:oe,onChange:e=>We(e.target.value),disabled:!!Digit.Utils.getMultiRootTenant()}),(null==Re?void 0:Re.emailAddress)&&l.createElement(t.ErrorMessage,{message:X(null==Re||null===(D=Re.emailAddress)||void 0===D?void 0:D.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,null,l.createElement("div",{style:{width:"100%"}},0!=ye||Digit.Utils.getOTPBasedLogin()?null:l.createElement(t.Button,{label:X("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>he(!ye),style:{paddingLeft:"0rem"}}),ye?l.createElement("div",{style:{marginTop:"10px"}},l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+X("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:X,type:"password",isMandatory:!1,name:"name",pattern:(null==Be||null===(w=Be.UserProfileValidationConfig)||void 0===w||null===(T=w[0])||void 0===T?void 0:T.password)||(null==ee||null===(A=ee.UserProfileValidationConfig)||void 0===A||null===(L=A[0])||void 0===L?void 0:L.password),onChange:e=>{return Se(t=e.target.value),void(null!=ke&&ke.password.test(t)?Pe(m({},Re,{currentPassword:null})):Pe(m({},Re,{currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disabled:!1}),(null==Re?void 0:Re.currentPassword)&&l.createElement(t.ErrorMessage,{message:X(null==Re||null===(R=Re.currentPassword)||void 0===R?void 0:R.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+X("CORE_COMMON_PROFILE_NEW_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:X,type:"password",isMandatory:!1,name:"name",pattern:(null==Be||null===(P=Be.UserProfileValidationConfig)||void 0===P||null===(x=P[0])||void 0===x?void 0:x.password)||(null==ee||null===(M=ee.UserProfileValidationConfig)||void 0===M||null===(k=M[0])||void 0===k?void 0:k.password),onChange:e=>{return Oe(t=e.target.value),void(null!=ke&&ke.password.test(t)?Pe(m({},Re,{newPassword:null})):Pe(m({},Re,{newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disabled:!1}),(null==Re?void 0:Re.newPassword)&&l.createElement(t.ErrorMessage,{message:X(null==Re||null===(U=Re.newPassword)||void 0===U?void 0:U.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+X("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:X,type:"password",isMandatory:!1,name:"name",pattern:(null==Be||null===(B=Be.UserProfileValidationConfig)||void 0===B||null===(F=B[0])||void 0===F?void 0:F.password)||(null==ee||null===(j=ee.UserProfileValidationConfig)||void 0===j||null===(V=j[0])||void 0===V?void 0:V.password),onChange:e=>{return Ce(t=e.target.value),void(null!=ke&&ke.password.test(t)?Pe(m({},Re,{confirmPassword:null})):Pe(m({},Re,{confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disabled:!1}),(null==Re?void 0:Re.confirmPassword)&&l.createElement(t.ErrorMessage,{message:X(null==Re||null===(H=Re.confirmPassword)||void 0===H?void 0:H.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})))):"")),"employee"===W&&xe?l.createElement("button",{onClick:Xe,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:xe?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"}},X("CORE_COMMON_SAVE")):null))),"employee"!==W||xe?null:l.createElement(t.ActionBar,{actionFields:[l.createElement(t.SubmitBar,{t:X,label:X("CORE_COMMON_SAVE"),onSubmit:Xe})],className:"",setactionFieldsToRight:!0}),Ie&&l.createElement(t.Toast,{type:Ie.key,label:X("success"===Ie.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":Ie.action),onClose:()=>De(null),style:{maxWidth:"670px"}}),1==ge?l.createElement(K,{setProfilePic:function(e){try{function t(e){fe(null==e?void 0:e.thumbs[0]),He()}return pe(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],Q)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:He,userType:W,removeProfilePic:()=>{pe(null),fe(null)},showToast:ze}):"")},ne=e=>{var r,a,i;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(),o.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(""),_=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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===(a=b.MdmsRes["common-masters"])||void 0===a||null===(i=a.howItWorks[0])||void 0===i?void 0:i[""+c];return S?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,l.createElement("div",{className:"how-it-works-page"},l.createElement(t.BackButton,null),l.createElement("div",{className:"how-it-works-page-header"},l.createElement(t.Header,null,d(O.screenHeader?O.screenHeader:"HOW_IT_WORKS"))),l.createElement("div",{className:"language-selector",style:{margin:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map((e,t)=>l.createElement("div",{className:"language-button-container",key:t},l.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)=>l.createElement("div",null,l.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},l.createElement("div",{className:"video-icon",onClick:()=>{return t=e,h("hi_IN"===v?t.hi_IN:t.en_IN),void E(!0);var t}},l.createElement("div",{className:"vid-svg"},l.createElement(_,null))),l.createElement("div",{className:"how-it-works-header-description"},l.createElement("h2",null,d(e.headerLabel)),l.createElement("p",null,d(e.description)))))),O.pdfHeader&&O.pdfDesc&&l.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},l.createElement("div",{className:"how-it-works-pdf-section"},l.createElement("div",{className:"pdf-icon-header-desc"},l.createElement("div",{className:"pdf-icon"},l.createElement(t.PDFSvg,null)),l.createElement("div",{className:"pdf-header-desc"},l.createElement("h2",null,d(O.pdfHeader)),l.createElement("p",null,d(O.pdfDesc)))),l.createElement("div",{className:"download-icon"},l.createElement(t.DownloadImgIcon,null)))),g&&l.createElement("div",{className:"how-it-works-video-play"},l.createElement("div",{className:"close-button"},l.createElement(t.CloseSvg,{onClick:()=>{E(!1)}})),l.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},l.createElement("source",{src:y,type:"video/mp4"})))))},le=[{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]+)*$"}}]}],oe=e=>{let{t:n,onSelect:o,mobileNumber:r,onMobileChange:a,config:i,canSubmit:s}=e;return l.createElement(t.FormStep,{isDisabled:!(10===r.length&&s),onSelect:o,config:i,t:n,componentInFront:"+91",onChange:a,value:r})},re=e=>{let{config:n,onSelect:o,t:r,isDisabled:a}=e;return l.createElement(t.FormStep,{config:n,onSelect:o,t:r,isDisabled:a})};function ae(e,t){const l=n.useRef();n.useEffect(()=>{l.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){l.current()},t);return()=>clearInterval(e)}},[t])}const ie=e=>{let{config:o,otp:r,onOtpChange:a,onResend:i,onSelect:c,t:u,error:d,userType:m="citizen",canSubmit:p}=e;const[v,f]=n.useState(30);ae(()=>{f(v-1)},v>0?1e3:null);const g=()=>{i(),f(2)};return"employee"===m?l.createElement(n.Fragment,null,l.createElement(s.OTPInput,{length:6,onChange:a,value:r}),v>0?l.createElement(t.CardText,null,u("CS_RESEND_ANOTHER_OTP")+" "+v+" "+u("CS_RESEND_SECONDS")):l.createElement("p",{className:"card-text-button resend-otp",onClick:g},u("CS_RESEND_OTP")),!d&&l.createElement(t.CardLabelError,null,u("CS_INVALID_OTP"))):l.createElement(t.FormStep,{onSelect:c,config:o,t:u,isDisabled:!(6===(null==r?void 0:r.length)&&p)},l.createElement(s.OTPInput,{length:6,onChange:a,value:r}),v>0?l.createElement(t.CardText,null,u("CS_RESEND_ANOTHER_OTP")+" "+v+" "+u("CS_RESEND_SECONDS")):l.createElement("p",{className:"card-text-button",onClick:g},u("CS_RESEND_OTP")),!d&&l.createElement(t.CardLabelError,null,u("CS_INVALID_OTP")))},se=["ResponseInfo","UserRequest"],ce=["ResponseInfo","UserRequest"];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,a;let{stateCode:s,isUserRegistered:c=!0}=e;const{t:u}=o.useTranslation(),d=i.useLocation(),{path:v}=i.useRouteMatch(),f=i.useHistory(),[g,E]=n.useState(null),[y,h]=n.useState(null),[_,S]=n.useState(!0),[b,O]=n.useState(null),[N,C]=n.useState(c?{}:null==d||null===(r=d.state)||void 0===r?void 0:r.data),[I,D]=n.useState(null),w=Digit.Hooks.useQueryParams(),[T,A]=n.useState(!1),[L,R]=n.useState(!0),[P,x]=n.useState(!0);n.useEffect(()=>{let e;return y&&(I&&(clearTimeout(I),D(null)),e=setTimeout(()=>{h("")},5e3),D(e)),()=>{e&&clearTimeout(e)}},[y]),n.useEffect(()=>{var e;if(!g)return;Digit.SessionStorage.set("citizen.userRequestObject",g),Digit.UserService.setUser(g),((e,t,n)=>{var l,o;if(Digit.Utils.getMultiRootTenant())return;let r=null===(l=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===l||null===(o=l.value)||void 0===o?void 0:o.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==g?void 0:g.info,null==g?void 0:g.access_token,s);const t=(null===(e=d.state)||void 0===e?void 0:e.from)||pe;var n;Digit.ULBService.getCitizenCurrentTenant(!0)?f.replace(t):f.replace("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/citizen/select-location",{redirectBackTo:t})},[g]);const M=n.useMemo(()=>le.map(e=>{const t={};for(const n in e.texts)t[n]=u(e.texts[n]);return m({},e,{texts:t})},[le])),k=()=>Digit.UserService.getType(),U=function(e){return Promise.resolve(J(function(){return Promise.resolve(Digit.UserService.sendOtp(e,s)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return l.createElement("div",{className:"citizen-form-wrapper"},l.createElement(i.Switch,null,l.createElement(t.AppContainer,null,d.pathname.includes("login")?null:l.createElement(t.BackLink,{onClick:()=>window.history.back()}),l.createElement(i.Route,{path:""+v,exact:!0},l.createElement(oe,{onSelect:function(e){try{x(!1),C(m({},N,e));const t=m({},e,{tenantId:s,userType:k()});return Promise.resolve(c?Promise.resolve(U({otp:m({},t,me)})).then(function(e){var n;let[l,o]=e;var r,a,i;if(!o)return x(!0),void f.replace(v+"/otp",{from:ve(d.state,w),role:null===(r=d.state)||void 0===r?void 0:r.role});x(!0),d.state&&"FSM_DSO"===d.state.role||f.push("/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/citizen/register/name",{from:ve(d.state,w),data:t}),null!==(n=d.state)&&void 0!==n&&n.role&&(x(!0),h("FSM_DSO"===(null===(i=d.state)||void 0===i?void 0:i.role)?u("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(U({otp:m({},t,de)})).then(function(e){let[t,n]=e;if(!n)return x(!0),void f.replace(v+"/otp",{from:ve(d.state,w)});x(!0)}))}catch(e){return Promise.reject(e)}},config:M[0],mobileNumber:N.mobileNumber||"",onMobileChange:e=>{const{value:t}=e.target;C(m({},N,{mobileNumber:t}))},canSubmit:P,showRegisterLink:c&&!(null!==(a=d.state)&&void 0!==a&&a.role),t:u})),l.createElement(i.Route,{path:v+"/otp"},l.createElement(ie,{config:m({},M[1],{texts:m({},M[1].texts,{cardText:M[1].texts.cardText+" "+(N.mobileNumber||"")})}),onOtpChange:e=>{C(m({},N,{otp:e}))},onResend:function(){try{const{mobileNumber:e}=N,t={mobileNumber:e,tenantId:s,userType:k()},n=function(){if(!c)return Promise.resolve(U({otp:m({},t,de)})).then(function(){});{const e=function(){if(c)return Promise.resolve(U({otp:m({},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(J(function(){S(!0),R(!1);const{mobileNumber:e,otp:t,name:n}=N;return function(){if(c){const n={username:e,password:t,tenantId:s,userType:k()};return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t,n,l;let{UserRequest:o}=e,r=p(e,se);if(null!==(t=d.state)&&void 0!==t&&t.role){const e=o.roles.find(e=>e.code===d.state.role);if(!e||!e.code)return h(u("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>f.replace(pe),5e3)}null!==(n=window)&&void 0!==n&&null!==(l=n.globalConfigs)&&void 0!==l&&l.getConfig("ENABLE_SINGLEINSTANCE")&&(o.tenantId=Digit.ULBService.getStateId()),E(m({info:o},r))})}{const l=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:l}=e,o=p(e,ce);null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(l.tenantId=Digit.ULBService.getStateId()),E(m({info:l},o))})}();if(l&&l.then)return l.then(function(){})}}()},function(){R(!0),S(!1)}))}catch(e){return Promise.reject(e)}},otp:N.otp,error:_,canSubmit:L,t:u})),l.createElement(i.Route,{path:v+"/name"},l.createElement(re,{config:M[2],onSelect:function(e){try{const t=m({},N,{tenantId:s,userType:k()},e);return C(m({},N,e)),A(!0),Promise.resolve(U({otp:m({},t,de)})).then(function(e){let[t,n]=e;t?(A(!1),f.replace(v+"/otp",{from:ve(d.state,w)})):A(!1)})}catch(e){return Promise.reject(e)}},t:u,isDisabled:T})),y&&l.createElement(t.Toast,{type:"error",label:y,onClose:()=>h(null)}))))};var ge=e=>e instanceof HTMLElement,Ee=e=>null==e;const ye=e=>"object"==typeof e;var he=e=>!Ee(e)&&!Array.isArray(e)&&ye(e)&&!(e instanceof Date),_e=e=>/^\w*$/.test(e),Se=e=>e.filter(Boolean),be=e=>Se(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function Oe(e,t,n){let l=-1;const o=_e(t)?[t]:be(t),r=o.length,a=r-1;for(;++l<r;){const t=o[l];let r=n;if(l!==a){const n=e[t];r=he(n)||Array.isArray(n)?n:isNaN(+o[l+1])?{}:[]}e[t]=r,e=e[t]}return e}var Ne=(e,t={})=>{for(const n in e)_e(n)?t[n]=e[n]:Oe(t,n,e[n]);return t},Ce=e=>void 0===e,Ie=(e={},t,n)=>{const l=Se(t.split(/[,[\].]+?/)).reduce((e,t)=>Ee(e)?e:e[t],e);return Ce(l)||l===e?Ce(e[t])?n:e[t]:l},De=(e,t)=>{ge(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))};const we={isValid:!1,value:null};var Te=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e,we):we,Ae=e=>"radio"===e.type,Le=e=>"file"===e.type,Re=e=>"checkbox"===e.type,Pe=e=>"select-multiple"===e.type;const xe={value:!1,isValid:!1},Me={value:!0,isValid:!0};var ke=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.ref.checked).map(({ref:{value:e}})=>e);return{value:t,isValid:!!t.length}}const{checked:t,value:n,attributes:l}=e[0].ref;return t?l&&!Ce(l.value)?Ce(n)||""===n?Me:{value:n,isValid:!0}:Me:xe}return xe};function Ue(e,t,n,l,o){const r=e.current[t];if(r){const{ref:{value:e,disabled:t},ref:n,valueAsNumber:i,valueAsDate:s,setValueAs:c}=r;if(t&&l)return;return Le(n)?n.files:Ae(n)?Te(r.options).value:Pe(n)?(a=n.options,[...a].filter(({selected:e})=>e).map(({value:e})=>e)):Re(n)?ke(r.options).value:o?e:i?""===e?NaN:+e:s?n.valueAsDate:c?c(e):e}var a;if(n)return Ie(n.current,t)}function Be(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&Be(e.parentNode)}var Fe=e=>he(e)&&!Object.keys(e).length,je=e=>"boolean"==typeof e;function Ve(e,t){const n=_e(t)?[t]:be(t),l=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let l=0;for(;l<n;)e=Ce(e)?l++:e[t[l++]];return e}(e,n);let o;l&&delete l[n[n.length-1]];for(let t=0;t<n.slice(0,-1).length;t++){let l,r=-1;const a=n.slice(0,-(t+1)),i=a.length-1;for(t>0&&(o=e);++r<a.length;){const t=a[r];l=l?l[t]:e[t],i===r&&(he(l)&&Fe(l)||Array.isArray(l)&&!l.filter(e=>he(e)&&!Fe(e)||je(e)).length)&&(o?delete o[t]:delete e[t]),o=l}}return e}const He=(e,t)=>e&&e.ref===t;var Ge=e=>Ee(e)||!ye(e);function We(e,t){if(Ge(e)||Ge(t))return t;for(const n in t){const l=e[n],o=t[n];try{e[n]=he(l)&&he(o)||Array.isArray(l)&&Array.isArray(o)?We(l,o):o}catch(e){}}return e}function ze(e,t,l){if(Ge(e)||Ge(t)||e instanceof Date||t instanceof Date)return e===t;if(!n.isValidElement(e)){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const o of n){const n=e[o];if(!l||"ref"!==o){const e=t[o];if((he(n)||Array.isArray(n))&&(he(e)||Array.isArray(e))?!ze(n,e,l):n!==e)return!1}}}return!0}function Xe(e,t,n,l,o){let r=-1;for(;++r<e.length;){for(const l in e[r])Array.isArray(e[r][l])?(!n[r]&&(n[r]={}),n[r][l]=[],Xe(e[r][l],Ie(t[r]||{},l,[]),n[r][l],n[r],l)):ze(Ie(t[r]||{},l),e[r][l])?Oe(n[r]||{},l):n[r]=Object.assign(Object.assign({},n[r]),{[l]:!0});l&&!n.length&&delete l[o]}return n}var qe=e=>"string"==typeof e,Qe=(e,t,n,l,o)=>{const r={};for(const t in e.current)(Ce(o)||(qe(o)?t.startsWith(o):Array.isArray(o)&&o.find(e=>t.startsWith(e))))&&(r[t]=Ue(e,t,void 0,l));return n?Ne(r):We(t,Ne(r))},Ze=e=>e instanceof RegExp,Ye=e=>he(e)&&!Ze(e)?e:{value:e,message:""},$e=e=>"function"==typeof e,Je=e=>qe(e)||n.isValidElement(e);function Ke(e,t,n="validate"){if(Je(e)||je(e)&&!e)return{type:n,message:Je(e)?e:"",ref:t}}var et=(e,t,n,l,o)=>t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),{[l]:o||!0})}):{},tt=async(e,t,{ref:n,ref:{value:l},options:o,required:r,maxLength:a,minLength:i,min:s,max:c,pattern:u,validate:d},m)=>{const p=n.name,v={},f=Ae(n),g=Re(n),E=f||g,y=""===l,h=et.bind(null,p,t,v),_=(e,t,l,o="maxLength",r="minLength")=>{const a=e?t:l;v[p]=Object.assign({type:e?o:r,message:a,ref:n},h(e?o:r,a))};if(r&&(!f&&!g&&(y||Ee(l))||je(l)&&!l||g&&!ke(o).isValid||f&&!Te(o).isValid)){const{value:l,message:o}=Je(r)?{value:!!r,message:r}:Ye(r);if(l&&(v[p]=Object.assign({type:"required",message:o,ref:E?((e.current[p].options||[])[0]||{}).ref:n},h("required",o)),!t))return v}if(!(Ee(s)&&Ee(c)||""===l)){let e,o;const r=Ye(c),a=Ye(s);if(isNaN(l)){const t=n.valueAsDate||new Date(l);qe(r.value)&&(e=t>new Date(r.value)),qe(a.value)&&(o=t<new Date(a.value))}else{const t=n.valueAsNumber||parseFloat(l);Ee(r.value)||(e=t>r.value),Ee(a.value)||(o=t<a.value)}if((e||o)&&(_(!!e,r.message,a.message,"max","min"),!t))return v}if(qe(l)&&!y&&(a||i)){const e=Ye(a),n=Ye(i),o=!Ee(e.value)&&l.length>e.value,r=!Ee(n.value)&&l.length<n.value;if((o||r)&&(_(o,e.message,n.message),!t))return v}if(qe(l)&&u&&!y){const{value:e,message:o}=Ye(u);if(Ze(e)&&!e.test(l)&&(v[p]=Object.assign({type:"pattern",message:o,ref:n},h("pattern",o)),!t))return v}if(d){const l=Ue(e,p,m,!1,!0),r=E&&o?o[0].ref:n;if($e(d)){const e=Ke(await d(l),r);if(e&&(v[p]=Object.assign(Object.assign({},e),h("validate",e.message)),!t))return v}else if(he(d)){let e={};for(const[n,o]of Object.entries(d)){if(!Fe(e)&&!t)break;const a=Ke(await o(l),r,n);a&&(e=Object.assign(Object.assign({},a),h(n,a.message)),t&&(v[p]=e))}if(!Fe(e)&&(v[p]=Object.assign({ref:r},e),!t))return v}}return v};const nt=(e,t,n=[])=>{for(const l in t){const o=e+(he(t)?"."+l:`[${l}]`);Ge(t[l])?n.push(o):nt(o,t[l],n)}return n};var lt=(e,t,n,l,o)=>{let r=void 0;return n.add(t),Fe(e)||(r=Ie(e,t),(he(r)||Array.isArray(r))&&nt(t,r).forEach(e=>n.add(e))),Ce(r)?o?l:Ie(l,t):r},ot=({isOnBlur:e,isOnChange:t,isOnTouch:n,isTouched:l,isReValidateOnBlur:o,isReValidateOnChange:r,isBlurEvent:a,isSubmitted:i,isOnAll:s})=>!s&&(!i&&n?!(l||a):(i?o:e)?!a:!(i?r:t)||a),rt=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)),it="undefined"!=typeof window&&"undefined"!=typeof document;function st(e){var t;let n;if(Ge(e)||it&&(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,st(e.get(t)));return n}n=Array.isArray(e)?[]:{};for(const t in e)n[t]=st(e[t]);return n}var ct=e=>({isOnSubmit:!e||"onSubmit"===e,isOnBlur:"onBlur"===e,isOnChange:"onChange"===e,isOnAll:"all"===e,isOnTouch:"onTouched"===e}),ut=e=>Ae(e)||Re(e);const dt="undefined"==typeof window,mt=it?"Proxy"in window:"undefined"!=typeof Proxy,pt=n.createContext(null);pt.displayName="RHFContext";const vt=e=>{const{as:t,render:l}=e,o=
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */
16
- function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)t.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:r,meta:a}=function({name:e,rules:t,defaultValue:l,control:o,onFocus:r}){const a=n.useContext(pt);if("production"!==process.env.NODE_ENV&&!o&&!a)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:i,setValue:s,register:c,unregister:u,trigger:d,mode:m,reValidateMode:{isReValidateOnBlur:p,isReValidateOnChange:v},formState:f,formStateRef:{current:{isSubmitted:g,touched:E,errors:y}},updateFormState:h,readFormStateRef:_,fieldsRef:S,fieldArrayNamesRef:b,shallowFieldsStateRef:O}=o||a.control,N=!at(b.current,e),C=()=>!Ce(Ie(O.current,e))&&N?Ie(O.current,e):Ce(l)?Ie(i.current,e):l,[I,D]=n.useState(C()),w=n.useRef(I),T=n.useRef({focus:()=>null}),A=n.useRef(r||(()=>{$e(T.current.focus)&&T.current.focus(),"production"!==process.env.NODE_ENV&&($e(T.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(t=>!ot(Object.assign({isBlurEvent:t,isReValidateOnBlur:p,isReValidateOnChange:v,isSubmitted:g,isTouched:!!Ie(E,e)},m)),[p,v,g,E,e,m]),R=n.useCallback(([e])=>{const t=(e=>Ge(e)||!he(e.target)||he(e.target)&&!e.type?e:Ce(e.target.value)?e.target.checked:e.target.value)(e);return D(t),w.current=t,t},[]),P=n.useCallback(n=>{if("production"!==process.env.NODE_ENV&&!e)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");S.current[e]?S.current[e]=Object.assign({ref:S.current[e].ref},t):(c(Object.defineProperties({name:e,focus:A.current},{value:{set(e){D(e),w.current=e},get:()=>w.current}}),t),n=Ce(Ie(i.current,e))),n&&N&&D(C())},[t,e,c]);n.useEffect(()=>()=>u(e),[e]),n.useEffect(()=>{"production"!==process.env.NODE_ENV&&(Ce(I)&&console.warn(`📋 ${e} 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)`),!N&&Ce(l)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),P()},[P]),n.useEffect(()=>{!S.current[e]&&P(!0)});const x=n.useCallback(()=>{_.current.touched&&!Ie(E,e)&&(Oe(E,e,!0),h({touched:E})),L(!0)&&d(e)},[e,h,L,d,_]);return{field:{onChange:n.useCallback((...t)=>s(e,R(t),{shouldValidate:L(),shouldDirty:!0}),[s,e,L]),onBlur:x,name:e,value:I,ref:T},meta:Object.defineProperties({invalid:!!Ie(y,e)},{isDirty:{get:()=>!!Ie(f.dirtyFields,e)},isTouched:{get:()=>!!Ie(f.touched,e)}})}}(e),i=Object.assign(Object.assign({},o),r);return t?n.isValidElement(t)?n.cloneElement(t,i):n.createElement(t,i):l?l(r,a):null},ft=e=>{let{control:n,t:o}=e;const r=window.Digit.Utils.browser.isMobile();return l.createElement(Fragment,null,l.createElement(t.SearchField,{className:"pt-form-field"},l.createElement("label",null,o("AUDIT_FROM_DATE_LABEL")),l.createElement(vt,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:n})),l.createElement(t.SearchField,{className:"pt-form-field"},l.createElement("label",null,o("AUDIT_TO_DATE_LABEL")),l.createElement(vt,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:n})),l.createElement(t.SearchField,{className:"pt-search-action-submit"},l.createElement(t.Button,{style:{marginTop:r?"510px":"25px",marginLeft:r?"0":"-30px",maxWidth:r?"100%":"240px"},label:o("ES_COMMON_APPLY"),submit:!0})))},gt=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Et=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],yt=e=>{var o;let{Controller:r,register:a,control:i,t:s,reset:c,previousPage:u,handleSubmit:d,tenantId:v,data:f,onSubmit:g,isLoading:E}=e;const[y,h]=n.useState([]),_=e=>l.createElement("div",{onClick:e.onClick},l.createElement(t.DownloadBtnCommon,null));n.useEffect(()=>{(null==f?void 0:f.length)>0&&h([null==f?void 0:f.map(e=>{let t={};return t[s("AUDIT_DATE_LABEL")]=S(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=b(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(","),m({},t)})])},[f]);const S=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},b=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),l=t.getMinutes(),o=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,n+":"+l+" "+o},[O,N]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),C=()=>{N({type:"remove"})},I=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:C},l.createElement(t.CloseSvg,null)),D={Controller:r,register:a,control:i,t:s,reset:c,previousPage:u},w=n.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r}=e,a=p(e,gt);const{closeMobilePopupModal:i}=a;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,a,l.createElement(I,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,s("PRIVACY_AUDIT_REPORT"),":")),l.createElement(ft,m({},o,{closeMobilePopupModal:i,tenantId:r,t:s})));default:return l.createElement("span",null)}})(m({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r},p(e,Et)))},[O]);null==f||null===(o=f.roles)||void 0===o||o.forEach(e=>{});const T=n.useMemo(()=>null!=f&&f.display||""===f?[]:null==f?void 0:f.map(e=>{var t;return{[s("AUDIT_DATE_LABEL")]:S(e.timestamp),[s("AUDIT_TIME_LABEL")]:b(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(",")}}),[f]);return l.createElement(l.Fragment,null,l.createElement(t.BackButton,null),l.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},l.createElement(_,{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")})(y)})),l.createElement(t.Header,null,s("PRIVACY_AUDIT_REPORT"),":"),l.createElement("div",{className:"digit-search-box"},l.createElement(t.SearchAction,{text:s("ES_COMMON_SEARCH"),handleActionClick:()=>N({type:"set",payload:"SearchFormComponent"}),tenantId:v,t:s})),O?l.createElement(t.PopUp,null,l.createElement(w,{onSubmit:e=>{N({type:"remove"}),g(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:D,currentlyActiveMobileModal:O,closeMobilePopupModal:C,tenantId:v})):null,E&&l.createElement(t.Loader,null),l.createElement(t.DetailsCard,{data:T}))},ht=e=>{let{tenantId:o,t:r,onSubmit:a,data:i,count:c}=e;const u=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"},{register:d,control:p,handleSubmit:v,setValue:f,getValues:g,reset:E}=function({mode:e="onSubmit",reValidateMode:t="onChange",resolver:l,context:o,defaultValues:r={},shouldFocusError:a=!0,shouldUnregister:i=!0,criteriaMode:s}={}){const c=n.useRef({}),u=n.useRef({}),d=n.useRef({}),m=n.useRef(new Set),p=n.useRef({}),v=n.useRef({}),f=n.useRef({}),g=n.useRef({}),E=n.useRef(r),y=n.useRef(!1),h=n.useRef(!1),_=n.useRef(),S=n.useRef({}),b=n.useRef({}),O=n.useRef(o),N=n.useRef(l),C=n.useRef(new Set),I=n.useRef(ct(e)),{isOnSubmit:D,isOnTouch:w}=I.current,T="all"===s,[A,L]=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!D,errors:{}}),R=n.useRef({isDirty:!mt,dirtyFields:!mt,touched:!mt||w,isValidating:!mt,isSubmitting:!mt,isValid:!mt}),P=n.useRef(A),x=n.useRef(),{isOnBlur:M,isOnChange:k}=n.useRef(ct(t)).current;O.current=o,N.current=l,P.current=A,S.current=i?{}:Fe(S.current)?st(r):S.current;const U=n.useCallback((e={})=>{y.current||(P.current=Object.assign(Object.assign({},P.current),e),L(P.current))},[]),B=()=>R.current.isValidating&&U({isValidating:!0}),F=n.useCallback((e,t,n=!1,l={},o)=>{let r=n||(({errors:e,name:t,error:n,validFields:l,fieldsWithValidation:o})=>{const r=Ce(n),a=Ie(e,t);return r&&!!a||!r&&!ze(a,n,!0)||r&&Ie(o,t)&&!Ie(l,t)})({errors:P.current.errors,error:t,name:e,validFields:g.current,fieldsWithValidation:f.current});const a=Ie(P.current.errors,e);t?(Ve(g.current,e),r=r||!a||!ze(a,t,!0),Oe(P.current.errors,e,t)):((Ie(f.current,e)||N.current)&&(Oe(g.current,e,!0),r=r||a),Ve(P.current.errors,e)),(r&&!Ee(n)||!Fe(l)||R.current.isValidating)&&U(Object.assign(Object.assign(Object.assign({},l),N.current?{isValid:!!o}:{}),{isValidating:!1}))},[]),j=n.useCallback((e,t)=>{const{ref:n,options:l}=c.current[e],o=it&&ge(n)&&Ee(t)?"":t;Ae(n)?(l||[]).forEach(({ref:e})=>e.checked=e.value===o):Le(n)&&!qe(o)?n.files=o:Pe(n)?[...n.options].forEach(e=>e.selected=o.includes(e.value)):Re(n)&&l?l.length>1?l.forEach(({ref:e})=>e.checked=Array.isArray(o)?!!o.find(t=>t===e.value):o===e.value):l[0].ref.checked=!!o:n.value=o},[]),V=n.useCallback((e,t)=>{if(R.current.isDirty){const n=$();return e&&t&&Oe(n,e,t),!ze(n,E.current)}return!1},[]),H=n.useCallback((e,t=!0)=>{if(R.current.isDirty||R.current.dirtyFields){const n=!ze(Ie(E.current,e),Ue(c,e,S)),l=Ie(P.current.dirtyFields,e),o=P.current.isDirty;n?Oe(P.current.dirtyFields,e,!0):Ve(P.current.dirtyFields,e);const r={isDirty:V(),dirtyFields:P.current.dirtyFields},a=R.current.isDirty&&o!==r.isDirty||R.current.dirtyFields&&l!==Ie(P.current.dirtyFields,e);return a&&t&&U(r),a?r:{}}return{}},[]),G=n.useCallback(async(e,t)=>{if("production"!==process.env.NODE_ENV&&!c.current[e])return console.warn("📋 Field is missing with `name` attribute: ",e),!1;const n=(await tt(c,T,c.current[e],S))[e];return F(e,n,t),Ce(n)},[F,T]),W=n.useCallback(async e=>{const{errors:t}=await N.current($(),O.current,T),n=P.current.isValid;if(Array.isArray(e)){const n=e.map(e=>{const n=Ie(t,e);return n?Oe(P.current.errors,e,n):Ve(P.current.errors,e),!n}).every(Boolean);return U({isValid:Fe(t),isValidating:!1}),n}{const l=Ie(t,e);return F(e,l,n!==Fe(t),{},Fe(t)),!l}},[F,T]),z=n.useCallback(async e=>{const t=e||Object.keys(c.current);if(B(),N.current)return W(t);if(Array.isArray(t)){!e&&(P.current.errors={});const n=await Promise.all(t.map(async e=>await G(e,null)));return U({isValidating:!1}),n.every(Boolean)}return await G(t)},[W,G]),X=n.useCallback((e,t,{shouldDirty:n,shouldValidate:l})=>{const o={};Oe(o,e,t);for(const r of nt(e,t))c.current[r]&&(j(r,Ie(o,r)),n&&H(r),l&&z(r))},[z,j,H]),q=n.useCallback((e,t,n)=>{if(!i&&!Ge(t)&&Oe(S.current,e,Array.isArray(t)?[...t]:Object.assign({},t)),c.current[e])j(e,t),n.shouldDirty&&H(e),n.shouldValidate&&z(e);else if(!Ge(t)&&(X(e,t,n),C.current.has(e))){const l=rt(e)||e;Oe(u.current,e,t),b.current[l]({[l]:Ie(u.current,l)}),(R.current.isDirty||R.current.dirtyFields)&&n.shouldDirty&&(Oe(P.current.dirtyFields,e,((e,t,n)=>We(Xe(e,t,n.slice(0,e.length)),Xe(t,e,n.slice(0,e.length))))(t,Ie(E.current,e,[]),Ie(P.current.dirtyFields,e,[]))),U({isDirty:!ze(Object.assign(Object.assign({},$()),{[e]:t}),E.current)}))}!i&&Oe(S.current,e,t)},[H,j,X]),Q=e=>h.current||m.current.has(e)||m.current.has((e.match(/\w+/)||[])[0]),Z=e=>{let t=!0;if(!Fe(p.current))for(const n in p.current)e&&p.current[n].size&&!p.current[n].has(e)&&!p.current[n].has(rt(e))||(v.current[n](),t=!1);return t};function Y(e){if(!i){let t=st(e);for(const e of C.current)_e(e)&&!t[e]&&(t=Object.assign(Object.assign({},t),{[e]:[]}));return t}return e}function $(e){if(qe(e))return Ue(c,e,S);if(Array.isArray(e)){const t={};for(const n of e)Oe(t,n,Ue(c,n,S));return t}return Y(Qe(c,st(S.current),i))}_.current=_.current?_.current:async({type:e,target:t})=>{let n=t.name;const l=c.current[n];let o,r;if(l){const a="blur"===e,s=ot(Object.assign({isBlurEvent:a,isReValidateOnChange:k,isReValidateOnBlur:M,isTouched:!!Ie(P.current.touched,n),isSubmitted:P.current.isSubmitted},I.current));let u=H(n,!1),d=!Fe(u)||!a&&Q(n);if(a&&!Ie(P.current.touched,n)&&R.current.touched&&(Oe(P.current.touched,n,!0),u=Object.assign(Object.assign({},u),{touched:P.current.touched})),!i&&Re(t)&&Oe(S.current,n,Ue(c,n)),s)return!a&&Z(n),(!Fe(u)||d&&Fe(u))&&U(u);if(B(),N.current){const{errors:e}=await N.current($(),O.current,T),l=P.current.isValid;if(o=Ie(e,n),Re(t)&&!o&&N.current){const t=rt(n),l=Ie(e,t,{});l.type&&l.message&&(o=l),t&&(l||Ie(P.current.errors,t))&&(n=t)}r=Fe(e),l!==r&&(d=!0)}else o=(await tt(c,T,l,S))[n];!a&&Z(n),F(n,o,d,u,r)}};const J=n.useCallback(async(e={})=>{const t=Fe(c.current)?E.current:{},{errors:n}=await N.current(Object.assign(Object.assign(Object.assign({},t),$()),e),O.current,T)||{},l=Fe(n);P.current.isValid!==l&&U({isValid:l})},[T]),K=n.useCallback((e,t)=>{!function(e,t,n,l,o,r){const{ref:a,ref:{name:i}}=n,s=e.current[i];if(!o){const t=Ue(e,i,l);!Ce(t)&&Oe(l.current,i,t)}a.type&&s?Ae(a)||Re(a)?Array.isArray(s.options)&&s.options.length?(Se(s.options).forEach((e={},n)=>{(Be(e.ref)&&He(e,e.ref)||r)&&(De(e.ref,t),Ve(s.options,`[${n}]`))}),s.options&&!Se(s.options).length&&delete e.current[i]):delete e.current[i]:(Be(a)&&He(s,a)||r)&&(De(a,t),delete e.current[i]):delete e.current[i]}(c,_.current,e,S,i,t),i&&(Ve(g.current,e.ref.name),Ve(f.current,e.ref.name))},[i]),ee=n.useCallback(e=>{if(h.current)U();else{for(const t of m.current)if(t.startsWith(e)){U();break}Z(e)}},[]),te=n.useCallback((e,t)=>{e&&(K(e,t),i&&!Se(e.options||[]).length&&(Ve(P.current.errors,e.ref.name),Oe(P.current.dirtyFields,e.ref.name,!0),U({isDirty:V()}),R.current.isValid&&N.current&&J(),ee(e.ref.name)))},[J,K]),ne=n.useCallback((e,t,n)=>{const l=n?p.current[n]:m.current;let o=Qe(c,st(S.current),i,!1,e);if(qe(e)){const n=rt(e)||e;return C.current.has(n)&&(o=Object.assign(Object.assign({},d.current),o)),lt(o,e,l,Ce(Ie(E.current,e))?t:Ie(E.current,e),!0)}const r=Ce(t)?E.current:t;return Array.isArray(e)?e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:lt(o,t,l,r)}),{}):(h.current=Ce(n),Ne(!Fe(o)&&o||r))},[]);function le(e,t={}){if("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(C.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:l,value:o}=e,r=Object.assign({ref:e},t),a=c.current,s=ut(e),u=at(C.current,n),d=t=>it&&(!ge(e)||t===e);let m,p=a[n],v=!0;if(p&&(s?Array.isArray(p.options)&&Se(p.options).find(e=>o===e.ref.value&&d(e.ref)):d(p.ref)))return void(a[n]=Object.assign(Object.assign({},p),t));p=l?s?Object.assign({options:[...Se(p&&p.options||[]),{ref:e}],ref:{type:l,name:n}},t):Object.assign({},r):r,a[n]=p;const y=Ce(Ie(S.current,n));Fe(E.current)&&y||(m=Ie(y?E.current:S.current,n),v=Ce(m),v||u||j(n,m)),Fe(t)||(Oe(f.current,n,!0),!D&&R.current.isValid&&tt(c,T,p,S).then(e=>{const t=P.current.isValid;Fe(e)?Oe(g.current,n,!0):Ve(g.current,n),t!==Fe(e)&&U()})),!i||u&&v||!u&&Ve(P.current.dirtyFields,n),l&&function({ref:e},t,n){ge(e)&&n&&(e.addEventListener(t?"change":"input",n),e.addEventListener("blur",n))}(s&&p.options?p.options[p.options.length-1]:p,s||"select-one"===e.type,_.current)}const oe=n.useCallback((e,t)=>async n=>{n&&n.preventDefault&&(n.preventDefault(),n.persist());let l={},o=Y(Qe(c,st(S.current),i,!0));R.current.isSubmitting&&U({isSubmitting:!0});try{if(N.current){const{errors:e,values:t}=await N.current(o,O.current,T);P.current.errors=l=e,o=t}else for(const e of Object.values(c.current))if(e){const{name:t}=e.ref,n=await tt(c,T,e,S);n[t]?(Oe(l,t,n[t]),Ve(g.current,t)):Ie(f.current,t)&&(Ve(P.current.errors,t),Oe(g.current,t,!0))}Fe(l)&&Object.keys(P.current.errors).every(e=>e in c.current)?(U({errors:{},isSubmitting:!0}),await e(o,n)):(P.current.errors=Object.assign(Object.assign({},P.current.errors),l),t&&await t(P.current.errors,n),a&&((e,t)=>{for(const n in e)if(Ie(t,n)){const t=e[n];if(t){if(t.ref.focus&&Ce(t.ref.focus()))break;if(t.options){t.options[0].ref.focus();break}}}})(c.current,P.current.errors))}finally{P.current.isSubmitting=!1,U({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Fe(P.current.errors),submitCount:P.current.submitCount+1})}},[a,T]);n.useEffect(()=>{l&&R.current.isValid&&J(),x.current=x.current||!it?x.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&&Be(e.ref)&&t(n);else n&&Be(n.ref)&&t(n)});return n.observe(window.document,{childList:!0,subtree:!0}),n}(c,te)},[te,E.current]),n.useEffect(()=>()=>{x.current&&x.current.disconnect(),y.current=!0,"production"===process.env.NODE_ENV&&Object.values(c.current).forEach(e=>te(e,!0))},[]),!l&&R.current.isValid&&(A.isValid=ze(g.current,f.current)&&Fe(P.current.errors));const re={trigger:z,setValue:n.useCallback(function(e,t,n){q(e,t,n||{}),Q(e)&&U(),Z(e)},[q,z]),getValues:n.useCallback($,[]),register:n.useCallback(function(e,t){if(!dt)if(qe(e))le({name:e},t);else{if(!he(e)||!("name"in e))return t=>t&&le(t,e);le(e,t)}},[E.current]),unregister:n.useCallback(function(e){for(const t of Array.isArray(e)?e:[e])te(c.current[t],!0)},[]),formState:mt?new Proxy(A,{get:(e,t)=>{if("production"!==process.env.NODE_ENV&&"isValid"===t&&D&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return R.current[t]=!0,e[t]}}):A},ae=n.useMemo(()=>Object.assign({isFormDirty:V,updateWatchedValue:ee,shouldUnregister:i,updateFormState:U,removeFieldEventListener:K,watchInternal:ne,mode:I.current,reValidateMode:{isReValidateOnBlur:M,isReValidateOnChange:k},validateResolver:l?J:void 0,fieldsRef:c,resetFieldArrayFunctionRef:b,useWatchFieldsRef:p,useWatchRenderFunctionsRef:v,fieldArrayDefaultValuesRef:u,validFieldsRef:g,fieldsWithValidationRef:f,fieldArrayNamesRef:C,readFormStateRef:R,formStateRef:P,defaultValuesRef:E,shallowFieldsStateRef:S,fieldArrayValuesRef:d},re),[E.current,ee,i,K,ne]);return Object.assign({watch:function(e,t){return ne(e,t)},control:ae,handleSubmit:oe,reset:n.useCallback((e,t={})=>{if(it)for(const e of Object.values(c.current))if(e){const{ref:t,options:n}=e,l=ut(t)&&Array.isArray(n)?n[0].ref:t;if(ge(l))try{l.closest("form").reset();break}catch(e){}}c.current={},E.current=Object.assign({},e||E.current),e&&Z(""),Object.values(b.current).forEach(e=>$e(e)&&e()),S.current=i?{}:st(e||E.current),(({errors:e,isDirty:t,isSubmitted:n,touched:l,isValid:o,submitCount:r,dirtyFields:a})=>{o||(g.current={},f.current={}),u.current={},m.current=new Set,h.current=!1,U({submitCount:r?P.current.submitCount:0,isDirty:!!t&&P.current.isDirty,isSubmitted:!!n&&P.current.isSubmitted,isValid:!!o&&P.current.isValid,dirtyFields:a?P.current.dirtyFields:{},touched:l?P.current.touched:{},errors:e?P.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(t)},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>c.current[e]&&_e(e)?delete P.current.errors[e]:Ve(P.current.errors,e)),U({errors:e?P.current.errors:{}})},[]),setError:n.useCallback(function(e,t){const n=(c.current[e]||{}).ref;Oe(P.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),U({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:A.errors},re)}({defaultValues:u}),y=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},h=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),l=t.getMinutes(),o=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,n+":"+l+" "+o},[_,S]=n.useState([]),b=e=>l.createElement("div",{onClick:e.onClick},l.createElement(s.DownloadBtnCommon,null));n.useEffect(()=>{d("offset",0),d("limit",5),d("sortOrder","DESC")},[d]),n.useEffect(()=>{(null==i?void 0:i.length)>0&&S([null==i?void 0:i.map(e=>{let t={};return t[r("AUDIT_DATE_LABEL")]=y(null==e?void 0:e.timestamp),t[r("AUDIT_TIME_LABEL")]=h(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(","),m({},t)})])},[i]);const O=n.useCallback(e=>{0!==e.length&&(f("sortBy",e.id),f("sortOrder",e.desc?"DESC":"ASC"))},[]);function N(){f("offset",g("offset")-g("limit")),v(a)()}const C=window.Digit.Utils.browser.isMobile();if(C)return l.createElement(yt,{Controller:vt,register:d,control:p,t:r,reset:E,previousPage:N,handleSubmit:v,tenantId:o,data:i,onSubmit:a});const I=e=>l.createElement("span",{className:"cell-text"},e),D=n.useMemo(()=>[{Header:r("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):y(e.timestamp);return I(""+t)}},{Header:r("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):h(e.timestamp);return I(""+t)}},{Header:r(C?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataView))},{Header:r(C?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataViewedBy))},{Header:r("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return I(""+(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name)))}}],[]);return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginRight:"-70px"}}," ",l.createElement(t.BackButton,null)," "),l.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",l.createElement(t.Header,null,r("PRIVACY_AUDIT_REPORT"))," "),l.createElement(t.SearchForm,{className:"audit-card",onSubmit:a,handleSubmit:v},l.createElement(ft,{register:d,control:p,reset:E,tenantId:o,t:r,previousPage:N})),l.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=i&&i.display?l.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},r(i.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):""!==i?l.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},l.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},l.createElement(b,{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")})(_)})),l.createElement(s.Table,{t:r,data:i,totalRecords:c,columns:D,getCellProps:e=>({style:{minWidth:e.column.Header===r("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){f("limit",Number(e.target.value)),v(a)()},currentPage:g("offset")/g("limit"),onNextPage:function(){f("offset",g("offset")+g("limit")),v(a)()},onPrevPage:N,manualPagination:!1,pageSizeLimit:g("limit"),onSort:O,disableSort:!1,sortParams:[{id:g("sortBy"),desc:"DESC"===g("sortOrder")}]})):l.createElement(t.Loader,null)))},_t=e=>{var t,r;const{t:a}=o.useTranslation(),i=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})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}};n.useEffect(()=>{const e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){const t=m({},e);c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>m({},e,{[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);const d={enabled:!!(s&&Object.keys(s).length>0)},p=m({},s),{isLoading:v,data:f}=Digit.Hooks.useAudit({tenantId:i,filters:m({},p),config:d});return l.createElement(ht,{t:a,tenantId:i,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});const t=m({},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)=>m({},e,{[n]:t[n]}),{}))},data:v?"":(null==f||null===(t=f.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==f?void 0:f.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==f||null===(r=f.ElasticSearchData)||void 0===r?void 0:r.length})},St=e=>{var n,r,a,i,s,c,u,d,m,p,v,f,g,E,y,h;let{moduleCode:_}=e;const{t:S}=o.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:o}=e;switch(n){case"TL":return l.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:o});case"PT":return l.createElement(t.PTIcon,{className:"fill-path-primary-main",styles:o});case"MCOLLECT":return l.createElement(t.MCollectIcon,{className:"fill-path-primary-main",styles:o});case"PGR":return l.createElement(t.ComplaintIcon,{className:"fill-path-primary-main",styles:o});default:return l.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:o})}},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 l.createElement("span",{className:"timerIcon"},l.createElement(t.TimerIcon,null));default:return null}},L=e=>{let{module:n}=e;switch(n){case"PT":return l.createElement("span",{className:"rupeeSymbol"},l.createElement(t.RupeeSymbol,null));case"WS":return l.createElement("span",{className:"timerIcon"},l.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?l.createElement(t.Loader,null):T?l.createElement(l.Fragment,null,T&&null!=T&&T.payViaWhatsApp?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"pay-whatsapp-card",onClick:()=>{window.open(null==T?void 0:T.payViaWhatsApp)}},l.createElement("div",{className:"pay-whatsapp-text"},S("PAY_VIA_WHATSAPP")),l.createElement("div",{className:"whatsAppIconG"},l.createElement(t.WhatsappIconGreen,null)))):null,T&&null!=T&&T.helpline?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"static-home-Card"},l.createElement("div",{className:"static-home-Card-header"},S("CALL_CENTER_HELPLINE")),l.createElement("div",{className:"helplineIcon"},l.createElement(t.HelpLineIcon,null))),l.createElement("div",{className:"call-center-card-text"},null!=T&&null!==(a=T.helpline)&&void 0!==a&&a.contactOne?l.createElement("div",{className:"call-center-card-content"},l.createElement("a",{href:"tel:"+(null==T||null===(i=T.helpline)||void 0===i?void 0:i.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?l.createElement("div",{className:"call-center-card-content"},l.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?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"static-home-Card"},l.createElement("div",{className:"static-home-Card-header"},S("CITIZEN_SERVICE_CENTER")),l.createElement("div",{className:"serviceCentrIcon"},l.createElement(t.ServiceCenterIcon,null))),l.createElement("div",{className:"service-center-details-card"},l.createElement("div",{className:"service-center-details-text"},null==T?void 0:T.serviceCenter)),null!=T&&T.viewMapLocation?l.createElement("div",{className:"link"},l.createElement("a",{href:null==T?void 0:T.viewMapLocation},S("VIEW_ON_MAP"))):null):l.createElement("div",null),l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},I||null==D||null===(null==D?void 0:D.dynamicDataOne)?l.createElement("div",null):l.createElement("div",{className:"dynamicDataCard"},l.createElement("div",{className:"dynamicData"},l.createElement(w,{module:_,styles:{width:"24px",height:"24px"}}),l.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataOne))),I||null==D||null===(null==D?void 0:D.dynamicDataTwo)?l.createElement("div",null):l.createElement("div",{className:"dynamicDataCard"},l.createElement("div",{className:"dynamicData"},l.createElement(w,{module:_,styles:{width:"24px",height:"24px"}}),l.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataTwo))),T&&null!=T&&T.staticDataOne?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement(A,{module:_}),l.createElement("span",{className:"static-data-content"},l.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),l.createElement("span",{className:"static-data-content-second"},""+(null===(v=P(_))||void 0===v?void 0:v.staticDataOne))))):l.createElement("div",null),T&&null!=T&&T.staticDataTwo?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement(L,{module:_}),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(f=P(_))||void 0===f?void 0:f.staticDataTwoHeader),l.createElement("span",{className:"static-data-content-second"},null===(g=P(_))||void 0===g?void 0:g.staticDataTwo)))):l.createElement("div",null),T&&null!=T&&T.validity?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement("span",{className:"validityIcon"},l.createElement(t.ValidityTimeIcon,null)),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(E=R(_))||void 0===E?void 0:E.staticCommonContent),l.createElement("span",{className:"static-data-content-second"},null===(y=R(_))||void 0===y?void 0:y.validity)))):l.createElement("div",null),I||null==D||null==D||!D.staticData||null===(null==D?void 0:D.staticData)?l.createElement("div",null):l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},"PGR"===_?l.createElement(w,{module:_,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):l.createElement("span",{className:"validityIcon"},l.createElement(t.ValidityTimeIcon,null)),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(h=R(_))||void 0===h?void 0:h.staticCommonContent),l.createElement("span",{className:"static-data-content-second"},null==D?void 0:D.staticData)))))):l.createElement(l.Fragment,null)};var bt,Ot,Nt,Ct,It;const Dt=[(null===(bt=window)||void 0===bt?void 0:bt.contextPath)+"/citizen/register/name","/"+(null===(Ot=window)||void 0===Ot?void 0:Ot.contextPath)+"/citizen/select-language","/"+(null===(Nt=window)||void 0===Nt?void 0:Nt.contextPath)+"/citizen/select-location","/"+(null===(Ct=window)||void 0===Ct?void 0:Ct.contextPath)+"/citizen/login","/"+(null===(It=window)||void 0===It?void 0:It.contextPath)+"/citizen/register/otp"],wt=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code)),Tt=e=>{var n,r,a;let{stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:v,stateCode:f,modules:E,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},{})}}),C=Digit.Hooks.useRouteSubscription(_),{t:I}=o.useTranslation(),{path:w}=i.useRouteMatch(),T=i.useHistory(),L=Dt.some(e=>window.location.href.includes(e)),R=E.map((e,t)=>{let{code:n,tenants:o}=e;const r=Digit.ComponentRegistryService.getComponent(n+"Module");return r?l.createElement(i.Route,{key:t,path:w+"/"+n.toLowerCase()},l.createElement(r,{stateCode:f,moduleCode:n,userType:"citizen",tenants:wt(o,h)})):null}),P=E.map((e,n)=>{let{code:o,bannerImage:r}=e,a=(Digit.ComponentRegistryService.getComponent(o+"Links"),N?D(O,o,I):void 0);return"ACTION_TEST_WS"===(null==a?void 0:a.header)&&(null==a||a.links.sort((e,t)=>t.orderNumber-e.orderNumber)),l.createElement(l.Fragment,null,l.createElement(i.Route,{key:n,path:w+"/"+o.toLowerCase()+"-home"},l.createElement("div",{className:"moduleLinkHomePage"},l.createElement("img",{src:r||(null==s?void 0:s.bannerUrl),alt:"noimagefound"}),l.createElement(t.BackLink,{className:"moduleLinkHomePageBackButton",onClick:()=>window.history.back()}),l.createElement("h1",null,I("MODULE_"+o.toUpperCase())),l.createElement("div",{className:"moduleLinkHomePageModuleLinks"},a&&l.createElement(t.CitizenHomeCard,{header:I(null==a?void 0:a.header),links:null==a?void 0:a.links,Icon:()=>l.createElement("span",null),Info:"OBPS"===o?()=>l.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:I("CS_FILE_APPLICATION_INFO_LABEL"),text:I("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===o})),l.createElement(St,{moduleCode:null==o?void 0:o.toUpperCase()}))),l.createElement(i.Route,{key:"faq"+n,path:w+"/"+o.toLowerCase()+"-faq"},l.createElement(Q,{module:null==o?void 0:o.toUpperCase()})),l.createElement(i.Route,{key:"hiw"+n,path:w+"/"+o.toLowerCase()+"-how-it-works"},l.createElement(ne,{module:null==o?void 0:o.toUpperCase()})))});return l.createElement("div",{className:C},l.createElement(X,{t:I,stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:v,showSidebar:!!u,linkData:O,islinkDataLoading:b}),l.createElement("div",{className:"main center-container citizen-home-container mb-25"},L?null:l.createElement("div",{className:"SideBarStatic"},l.createElement(F,{linkData:O,islinkDataLoading:b})),l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:w},l.createElement(Z,null)),l.createElement(i.Route,{exact:!0,path:w+"/select-language"},l.createElement(Y,null)),l.createElement(i.Route,{exact:!0,path:w+"/select-location"},l.createElement($,null)),l.createElement(i.Route,{path:w+"/error"},l.createElement(g,{initData:S,goToHome:()=>{var e,t,n,l;T.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===(l=n.getType)||void 0===l?void 0:l.call(n)))}})),l.createElement(i.Route,{path:w+"/all-services"},l.createElement(A,{userType:"citizen",modules:E,getCitizenMenu:O,fetchedCitizen:N,isLoading:b})),l.createElement(i.Route,{path:w+"/login"},l.createElement(fe,{stateCode:f})),l.createElement(i.Route,{path:w+"/register"},l.createElement(fe,{stateCode:f,isUserRegistered:!1})),l.createElement(i.Route,{path:w+"/user/profile"},l.createElement(te,{stateCode:f,userType:"citizen",cityDetails:d})),l.createElement(i.Route,{path:w+"/Audit"},l.createElement(_t,null)),l.createElement(y,{initData:S},R,P))),l.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},l.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(r=n.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.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 At="function"==typeof Symbol&&Symbol.for,Lt=At?Symbol.for("react.element"):60103,Rt=At?Symbol.for("react.portal"):60106,Pt=At?Symbol.for("react.fragment"):60107,xt=At?Symbol.for("react.strict_mode"):60108,Mt=At?Symbol.for("react.profiler"):60114,kt=At?Symbol.for("react.provider"):60109,Ut=At?Symbol.for("react.context"):60110,Bt=At?Symbol.for("react.async_mode"):60111,Ft=At?Symbol.for("react.concurrent_mode"):60111,jt=At?Symbol.for("react.forward_ref"):60112,Vt=At?Symbol.for("react.suspense"):60113,Ht=At?Symbol.for("react.suspense_list"):60120,Gt=At?Symbol.for("react.memo"):60115,Wt=At?Symbol.for("react.lazy"):60116,zt=At?Symbol.for("react.block"):60121,Xt=At?Symbol.for("react.fundamental"):60117,qt=At?Symbol.for("react.responder"):60118,Qt=At?Symbol.for("react.scope"):60119;function Zt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Lt:switch(e=e.type){case Bt:case Ft:case Pt:case Mt:case xt:case Vt:return e;default:switch(e=e&&e.$$typeof){case Ut:case jt:case Wt:case Gt:case kt:return e;default:return t}}case Rt:return t}}}function Yt(e){return Zt(e)===Ft}var $t={AsyncMode:Bt,ConcurrentMode:Ft,ContextConsumer:Ut,ContextProvider:kt,Element:Lt,ForwardRef:jt,Fragment:Pt,Lazy:Wt,Memo:Gt,Portal:Rt,Profiler:Mt,StrictMode:xt,Suspense:Vt,isAsyncMode:function(e){return Yt(e)||Zt(e)===Bt},isConcurrentMode:Yt,isContextConsumer:function(e){return Zt(e)===Ut},isContextProvider:function(e){return Zt(e)===kt},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Lt},isForwardRef:function(e){return Zt(e)===jt},isFragment:function(e){return Zt(e)===Pt},isLazy:function(e){return Zt(e)===Wt},isMemo:function(e){return Zt(e)===Gt},isPortal:function(e){return Zt(e)===Rt},isProfiler:function(e){return Zt(e)===Mt},isStrictMode:function(e){return Zt(e)===xt},isSuspense:function(e){return Zt(e)===Vt},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Pt||e===Ft||e===Mt||e===xt||e===Vt||e===Ht||"object"==typeof e&&null!==e&&(e.$$typeof===Wt||e.$$typeof===Gt||e.$$typeof===kt||e.$$typeof===Ut||e.$$typeof===jt||e.$$typeof===Xt||e.$$typeof===qt||e.$$typeof===Qt||e.$$typeof===zt)},typeOf:Zt},Jt=V(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,l=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=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 o:case a:case r:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case i:return g;default:return t}}case l:return t}}}var S=u,b=s,O=i,N=n,C=d,I=o,D=f,w=v,T=l,A=a,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)===i},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)===o},t.isLazy=function(e){return _(e)===f},t.isMemo=function(e){return _(e)===v},t.isPortal=function(e){return _(e)===l},t.isProfiler=function(e){return _(e)===a},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===o||e===u||e===a||e===r||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===i||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=_}()}),Kt=V(function(e){e.exports="production"===process.env.NODE_ENV?$t:Jt}),en=Object.getOwnPropertySymbols,tn=Object.prototype.hasOwnProperty,nn=Object.prototype.propertyIsEnumerable;function ln(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 l={};return"abcdefghijklmnopqrst".split("").forEach(function(e){l[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},l)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,o=ln(e),r=1;r<arguments.length;r++){for(var a in n=Object(arguments[r]))tn.call(n,a)&&(o[a]=n[a]);if(en){l=en(n);for(var i=0;i<l.length;i++)nn.call(n,l[i])&&(o[l[i]]=n[l[i]])}}return o},rn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",an=Function.call.bind(Object.prototype.hasOwnProperty),sn=function(){};if("production"!==process.env.NODE_ENV){var cn=rn,un={},dn=an;sn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function mn(e,t,n,l,o){if("production"!==process.env.NODE_ENV)for(var r in e)if(dn(e,r)){var a;try{if("function"!=typeof e[r]){var i=Error((l||"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 i.name="Invariant Violation",i}a=e[r](t,r,l,n,null,cn)}catch(e){a=e}if(!a||a instanceof Error||sn((l||"React class")+": type specification of "+n+" `"+r+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in un)){un[a.message]=!0;var s=o?o():"";sn("Failed "+n+" type: "+a.message+(null!=s?s:""))}}}mn.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(un={})};var pn=mn,vn=function(){};function fn(){return null}function gn(){}function En(){}"production"!==process.env.NODE_ENV&&(vn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),En.resetWarningCache=gn;var yn=V(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l={array:i("array"),bigint:i("bigint"),bool:i("boolean"),func:i("function"),number:i("number"),object:i("object"),string:i("string"),symbol:i("symbol"),any:a(fn),arrayOf:function(e){return a(function(t,n,l,o,a){if("function"!=typeof e)return new r("Property `"+a+"` of component `"+l+"` has invalid PropType notation inside arrayOf.");var i=t[n];if(!Array.isArray(i))return new r("Invalid "+o+" `"+a+"` of type `"+u(i)+"` supplied to `"+l+"`, expected an array.");for(var s=0;s<i.length;s++){var c=e(i,s,l,o,a+"["+s+"]",rn);if(c instanceof Error)return c}return null})},element:a(function(t,n,l,o,a){var i=t[n];return e(i)?null:new r("Invalid "+o+" `"+a+"` of type `"+u(i)+"` supplied to `"+l+"`, expected a single ReactElement.")}),elementType:a(function(e,t,n,l,o){var a=e[t];return Kt.isValidElementType(a)?null:new r("Invalid "+l+" `"+o+"` of type `"+u(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,l,o,a){var i;return t[n]instanceof e?null:new r("Invalid "+o+" `"+a+"` of type `"+((i=t[n]).constructor&&i.constructor.name?i.constructor.name:"<<anonymous>>")+"` supplied to `"+l+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,t,n,l,o){return c(e[t])?null:new r("Invalid "+l+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,n,l,o,a){if("function"!=typeof e)return new r("Property `"+a+"` of component `"+l+"` has invalid PropType notation inside objectOf.");var i=t[n],s=u(i);if("object"!==s)return new r("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+l+"`, expected an object.");for(var c in i)if(an(i,c)){var d=e(i,c,l,o,a+"."+c,rn);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&vn(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."),fn;function t(t,n,l,a,i){for(var s=t[n],c=0;c<e.length;c++)if(o(s,e[c]))return null;var u=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new r("Invalid "+a+" `"+i+"` of value `"+String(s)+"` supplied to `"+l+"`, expected one of "+u+".")}return a(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&vn("Invalid argument supplied to oneOfType, expected an instance of array."),fn;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return vn("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),fn}return a(function(t,n,l,o,a){for(var i=[],s=0;s<e.length;s++){var c=(0,e[s])(t,n,l,o,a,rn);if(null==c)return null;c.data&&an(c.data,"expectedType")&&i.push(c.data.expectedType)}return new r("Invalid "+o+" `"+a+"` supplied to `"+l+"`"+(i.length>0?", expected one of type ["+i.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,n,l,o,a){var i=t[n],c=u(i);if("object"!==c)return new r("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");for(var m in e){var p=e[m];if("function"!=typeof p)return s(l,o,a,m,d(p));var v=p(i,m,l,o,a+"."+m,rn);if(v)return v}return null})},exact:function(e){return a(function(t,n,l,o,a){var i=t[n],c=u(i);if("object"!==c)return new r("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var m=on({},t[n],e);for(var p in m){var v=e[p];if(an(e,p)&&"function"!=typeof v)return s(l,o,a,p,d(v));if(!v)return new r("Invalid "+o+" `"+a+"` key `"+p+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=v(i,p,l,o,a+"."+p,rn);if(f)return f}return null})}};function o(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 a(e){function t(t,n,l,o,a,i,s){if(o=o||"<<anonymous>>",i=i||l,s!==rn){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[l]?t?new r(null===n[l]?"The "+a+" `"+i+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+a+" `"+i+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,l,o,a,i)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function i(e){return a(function(t,n,l,o,a,i){var s=t[n];return u(s)!==e?new r("Invalid "+o+" `"+a+"` of type `"+d(s)+"` supplied to `"+l+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,l,o){return new r((e||"React class")+": "+t+" type `"+n+"."+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}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 l=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!l)return!1;var o,r=l.call(t);if(l!==t.entries){for(;!(o=r.next()).done;)if(!c(o.value))return!1}else for(;!(o=r.next()).done;){var a=o.value;if(a&&!c(a[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,l.checkPropTypes=pn,l.resetWarningCache=pn.resetWarningCache,l.PropTypes=l,l}(Kt.isElement):function(){function e(e,t,n,l,o,r){if(r!==rn){var a=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 a.name="Invariant Violation",a}}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:En,resetWarningCache:gn};return n.PropTypes=n,n}()});const hn=e=>{let{children:t}=e;return l.createElement("div",{className:"banner banner-container"},t)},_n=e=>{var n;let{showTenant:r=!0}=e;const{data:a,isLoading:i}=Digit.Hooks.useStore.getInitData(),{stateInfo:s}=a||{},{t:c}=o.useTranslation();return i?l.createElement(t.Loader,null):l.createElement("div",{className:"bannerHeader"},l.createElement("img",{className:"bannerLogo",src:null==s?void 0:s.logoUrl,style:r?{}:{borderRight:"unset"}}),r&&(null==s?void 0:s.code)&&l.createElement("p",null,c("TENANT_TENANTS_"+(null==s||null===(n=s.code)||void 0===n?void 0:n.toUpperCase()))))},Sn=e=>{var o,r,a;let{config:c,t:u}=e;const[d,p]=n.useState(null),{mobile_number:v,tenantId:f}=Digit.Hooks.useQueryParams(),g=i.useHistory(),[E,y]=n.useState(""),[h,_]=n.useState(!0),[S,b]=n.useState(null),O=()=>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";g.replace(n)},[d]);const N=()=>{b(null)},[C,I,D]=c.inputs,w=[{body:[{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},{label:u(D.label),type:D.type,populators:{name:D.name},isMandatory:!0}]}];return l.createElement(hn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,{variant:"primary",style:{borderBottom:"none"}})),l.createElement(s.FormComposer,{onSubmit:function(e){try{return Promise.resolve(J(function(){if(e.newPassword!==e.confirmPassword)return b(u("ERR_PASSWORD_DO_NOT_MATCH"));const t=m({},e,{otpReference:E,tenantId:f,type:O().toUpperCase()});return Promise.resolve(Digit.UserService.changePassword(t,f)).then(function(e){(()=>{var e;g.replace("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/login")})()})},function(e){var t,n,l,o,r;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.error)||void 0===l||null===(o=l.fields)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.message)||u("ES_SOMETHING_WRONG")),setTimeout(N,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:w,label:c.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},l.createElement(_n,null),l.createElement(s.CardSubHeader,{style:{textAlign:"center"}}," ",c.texts.header," "),l.createElement(s.CardText,null,u("CS_LOGIN_OTP_TEXT")+" ",l.createElement("b",null," ",""+u("+ 91 - ")," ",v)),l.createElement(ie,{t:u,userType:"employee",otp:E,onOtpChange:y,error:h,onResend:function(){try{function e(){setTimeout(N,5e3)}const t={otp:{mobileNumber:v,userType:O().toUpperCase(),type:"passwordreset",tenantId:f}},n=J(function(){return Promise.resolve(Digit.UserService.sendOtp(t,f)).then(function(){b(u("ES_OTP_RESEND"))})},function(e){var t,n;b((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)}}})),S&&l.createElement(t.Toast,{type:"error",label:u(S),onClose:N}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(r=o.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.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()}})," "))};Sn.propTypes={loginParams:yn.any},Sn.defaultProps={loginParams:null};const bn=[{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"}]}],On=()=>{const{t:e}=o.useTranslation(),{path:t}=i.useRouteMatch(),r=n.useMemo(()=>bn.map(t=>{const n={};for(const l in t.texts)n[l]=e(t.texts[l]);return m({},t,{texts:n})},[bn]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+t,exact:!0},l.createElement(Sn,{config:r[0],t:e})))},Nn=[{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"}]}],Cn=e=>{var o,r,a;let{config:s,t:c}=e;const{data:u,isLoading:d}=Digit.Hooks.useTenants(),[m,p]=n.useState(null),v=i.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?l.createElement(t.Loader,null):l.createElement(hn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,{onClick:()=>window.history.back()})),l.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=J(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,l,o,r;g((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.error)||void 0===l||null===(o=l.fields)||void 0===o||null===(r=o[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"},l.createElement(_n,null)),f&&l.createElement(t.Toast,{type:"error",label:c(f),onClose:E}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(r=o.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.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()}})," "))};Cn.propTypes={loginParams:yn.any},Cn.defaultProps={loginParams:null};const In=()=>{const{t:e}=o.useTranslation(),{path:t}=i.useRouteMatch(),r=n.useMemo(()=>Nn.map(t=>{const n={};for(const l in t.texts)n[l]=e(t.texts[l]);return m({},t,{texts:n})},[Nn]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+t,exact:!0},l.createElement(Cn,{config:r[0],t:e})))},Dn=(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)}),wn=e=>{var t;let{stateCode:n,userType:o,modules:r,appTenants:a,additionalComponent:s}=e;Digit;const{path:c}=i.useRouteMatch(),u=i.useLocation(),d=Digit.UserService.getUser();var m;if(!d||null==d||!d.access_token||null==d||!d.info)return l.createElement(i.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 l.createElement(i.Route,{key:t,path:c+"/"+s.toLowerCase()},d?l.createElement(d,{stateCode:n,moduleCode:s,userType:o,tenants:Dn(u,a)}):l.createElement(i.Redirect,{to:"/"+(null===(r=window)||void 0===r?void 0:r.contextPath)+"/employee/user/error?type=notfound&module="+s}))});return l.createElement("div",{className:"ground-container digit-home-ground"},l.createElement(i.Switch,null,p,l.createElement(i.Route,{path:c+"/login"},l.createElement(i.Redirect,{to:{pathname:"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee/user/login",state:{from:u.pathname+u.search}}})),l.createElement(i.Route,{path:c+"/forgot-password"},l.createElement(In,null)),l.createElement(i.Route,{path:c+"/change-password"},l.createElement(On,null)),l.createElement(i.Route,null,l.createElement(A,{userType:o,modules:r,additionalComponent:s}))))},Tn={label:"English",value:Digit.Utils.getDefaultLanguage()},An=()=>{var e,r,a,c,u;const{data:d,isLoading:m}=Digit.Hooks.useStore.getInitData(),{t:p}=o.useTranslation(),v=i.useHistory(),{languages:f,stateInfo:g}=d||{};let E=f;E&&0!=(null===(e=E)||void 0===e?void 0:e.length)||(E=[Tn]);const y=Digit.StoreData.getCurrentLanguage(),[h,_]=n.useState(y);return m?l.createElement(t.Loader,null):l.createElement(hn,null,l.createElement(t.Card,{className:"bannerCard removeBottomMargin languageSelection"},l.createElement("div",{className:"bannerHeader"},l.createElement("img",{className:"bannerLogo",src:null==g?void 0:g.logoUrl,alt:"Digit"}),l.createElement("p",null,p("TENANT_TENANTS_"+(null==g||null===(r=g.code)||void 0===r?void 0:r.toUpperCase())))),l.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},E.map((e,t)=>l.createElement("div",{className:"language-button-container",key:t},l.createElement(s.CustomButton,{selected:e.value===h,text:p(e.label),onClick:()=>(e=>{_(e.value),Digit.LocalizationService.changeLanguage(e.value,g.code)})(e)})))),l.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")}})),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(a=window)||void 0===a||null===(c=a.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()}})," "))},Ln=[{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"}}]}],Pn=["UserRequest"],xn=e=>{var o,r,a,s,c,u,d,v,f,g,E,y,h;let{config:_,t:S,isDisabled:b,loginOTPBased:O}=e;const{isLoading:N}=Digit.Hooks.useTenants(),{data:C,isLoading:I}=Digit.Hooks.useStore.getInitData(),{stateInfo:D}=C||{},[w,T]=n.useState(null),[A,L]=n.useState(null),[R,P]=n.useState(!1),x=i.useHistory();n.useEffect(()=>{var e,t,n,l,o,r,a,i,s,c,u,d,m,p,v,f,g,E;if(!w)return;Digit.SessionStorage.set("citizen.userRequestObject",w);const y=null==w||null===(e=w.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==w||null===(n=w.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.length)>0&&(w.info.roles=y),Digit.UserService.setUser(w),((e,t)=>{var n;if(Digit.Utils.getMultiRootTenant())return;let l=(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",l),localStorage.setItem("Employee.locale",l),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==w?void 0:w.info,null==w?void 0:w.access_token);let h="/"+(null===(o=window)||void 0===o?void 0:o.contextPath)+"/employee";var _,S,b,O,N,C,I;null!==(r=window)&&void 0!==r&&null!==(a=r.location)&&void 0!==a&&null!==(i=a.href)&&void 0!==i&&i.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!=w&&null!==(s=w.info)&&void 0!==s&&s.roles&&(null==w||null===(c=w.info)||void 0===c||null===(u=c.roles)||void 0===u?void 0:u.length)>0&&null!=w&&null!==(d=w.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!=w&&null!==(p=w.info)&&void 0!==p&&p.roles&&(null==w||null===(v=w.info)||void 0===v||null===(f=v.roles)||void 0===f?void 0:f.length)>0&&null!=w&&null!==(g=w.info)&&void 0!==g&&null!==(E=g.roles)&&void 0!==E&&E.every(e=>"STADMIN"===e.code)&&(h="/"+(null===(I=window)||void 0===I?void 0:I.contextPath)+"/employee/dss/landing/home"),x.replace(h)},[w]);const M={url:"/user-otp/v1/_send",params:{tenantId:Digit.ULBService.getStateId()},body:{},config:{enable:!1}},k=Digit.Hooks.useCustomAPIMutationHook(M),U=()=>{L(null)},B={code:Digit.ULBService.getStateId(),name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+Digit.ULBService.getStateId())};let F=[{body:null==_?void 0:_.inputs}];const{mode:j}=Digit.Hooks.useQueryParams();return"admin"===j&&0==(null==F||null===(o=F[0])||void 0===o||null===(r=o.body)||void 0===r||null===(a=r[2])||void 0===a?void 0:a.disable)&&null==(null==F||null===(s=F[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)&&(F[0].body[2].disable=!0,F[0].body[2].isMandatory=!1,F[0].body[2].populators.defaultValue=B),N||I?l.createElement(t.Loader,null):l.createElement(hn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,{onClick:()=>window.history.back()})),l.createElement(t.FormComposerV2,{onSubmit:O?function(e){try{const t=e.email;return Promise.resolve(k.mutate({body:{otp:{userName:e.email,type:"login",tenantId:Digit.ULBService.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,l,o,r,a,i,s;L(null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(i=a.Errors)||void 0===i||null===(s=i[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"),setTimeout(U,5e3)},onSuccess:function(e){try{var n;return x.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(){P(!1)}P(!0);const l=m({},e,{userType:"EMPLOYEE"});l.tenantId=(null==e||null===(t=e.city)||void 0===t?void 0:t.code)||Digit.ULBService.getStateId(),delete l.city;const o=J(function(){return Promise.resolve(Digit.UserService.authenticate(l)).then(function(e){let{UserRequest:t}=e,n=p(e,Pn);Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),T(m({info:t},n))})},function(e){var t,n;L((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)&&S("ES_ERROR_USER_NOT_PERMITTED")||S("INVALID_LOGIN_CREDENTIALS")),setTimeout(U,5e3)});return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}},isDisabled:b||R,noBoxShadow:!0,inline:!0,submitInForm:!0,config:F,label:null==_||null===(v=_.texts)||void 0===v?void 0:v.submitButtonLabel,secondaryActionLabel:null==_||null===(f=_.texts)||void 0===f?void 0:f.secondaryButtonLabel,onSecondayActionClick:()=>{var e;x.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/forgot-password")},onFormValueChange:(e,t,n)=>{const l=F[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});P(l)},heading:null==_||null===(g=_.texts)||void 0===g?void 0:g.header,className:"loginFormStyleEmployee "+(O?"sandbox-onboarding-wrapper":""),cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:"loginCardClassName",buttonClassName:"buttonClassName"},l.createElement(_n,null!=D&&D.code?null:{showTenant:!1})),A&&l.createElement(t.Toast,{type:"error",label:S(A),onClose:U}),l.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},l.createElement("img",{alt:"Powered by DIGIT",src:null===(E=window)||void 0===E||null===(y=E.globalConfigs)||void 0===y||null===(h=y.getConfig)||void 0===h?void 0:h.call(y,"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()}})," "))};xn.propTypes={loginParams:yn.any},xn.defaultProps={loginParams:null};const Mn=e=>{var t,r;let{stateCode:a}=e;const{t:s}=o.useTranslation(),{path:c}=i.useRouteMatch(),[u,d]=n.useState(Ln),[p,v]=n.useState(Rn),f=Digit.StoreData.getCurrentLanguage(),g=(null===(t=window)||void 0===t||null===(r=t.globalConfigs)||void 0===r?void 0:r.getConfig("OTP_BASED_LOGIN"))||!1,{data:E,isLoading:y}=(Digit.Services.useStore({stateCode:a,moduleCode:["privacy-policy"],language:f,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(a,"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==y&&null!=E&&E.config?null==E?void 0:E.config:Ln)},[E,y]);const h=n.useMemo(()=>u.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return m({},e,{texts:t})},[u])),_=n.useMemo(()=>p.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return m({},e,{texts:t})},[p]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+c,exact:!0},l.createElement(xn,g?{config:_[0],t:s,loginOTPBased:g}:{config:h[0],t:s})))},kn=e=>{let{embedId:t}=e;return l.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"})},Un=e=>{const[t,o]=n.useState(""),[r,a]=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]),o(t)},[e.link]),l.createElement("div",null,r&&l.createElement("div",{className:"overlay",onClick:()=>a(!1)},l.createElement("div",{onClick:e=>e.stopPropagation()},l.createElement(kn,{embedId:t}))),e.overlay?l.createElement("div",{className:"player-wrapper"},l.createElement("div",{className:"player-click-area",onClick:()=>{e.overlay&&a(!0)}}),l.createElement(kn,{embedId:t})):l.createElement(kn,{embedId:t}))},Bn=e=>{var r;let{config:a}=e;const{t:s}=o.useTranslation(),{heading:c,subsections:u,url:d}=a;let m="/"+(null===(r=window)||void 0===r?void 0:r.contextPath)+"/employee/user/landing/select-role";const p=i.useHistory();return l.createElement("div",{className:"custom-landing-container"},l.createElement(t.Card,{className:"custom-landing-card"},l.createElement(t.Header,{className:"custom-landing-header"},s(c)),l.createElement("div",{className:"custom-video-section"},l.createElement(Un,{link:d,overlay:!0})),u.map((e,o)=>l.createElement("div",{key:o,className:"custom-section-container"},l.createElement(t.CardHeader,{className:"custom-section-header"},s(e.title)),"paragraph"===e.type&&e.content&&l.createElement(n.Fragment,null,e.content.map((e,n)=>l.createElement(t.CardText,{className:"custom-section-paragraph",key:n},l.createElement("p",null,s(e.text))))),"steps"===e.type&&e.content&&l.createElement("ul",{className:"custom-steps-list"}," ",e.content.map((e,t)=>l.createElement("li",{key:t,className:"custom-step-item"}," ",s(e.text)))),"both"===e.type&&e.content&&l.createElement(n.Fragment,null,e.content.map((e,n)=>"paragraph"===e.type?l.createElement(t.CardText,{className:"custom-section-paragraph",key:n},l.createElement("p",null,s(e.text))):"step"===e.type?l.createElement("li",{key:n,className:"custom-step-item"}," ",s(e.text)):null)))),l.createElement("div",{className:"custom-continue-button-container"},l.createElement(t.Button,{className:"custom-continue-button",label:s("CONTINUE_LANDING"),variation:"primary",icon:"ArrowForward",isSuffix:!0,onClick:e=>{e.preventDefault(),p.push(m)}}))))},Fn={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"}]}]},jn=()=>l.createElement(Bn,{config:Fn}),Vn=[{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]+)*$/,maxLength:60},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"}}]}],Hn=e=>{var o,r,a,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=i.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===(o=T[0])||void 0===o||null===(r=o.body)||void 0===r||null===(a=r[2])||void 0===a?void 0:a.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?l.createElement(t.Loader,null):l.createElement(hn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,{onClick:()=>window.history.back()})),l.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,l,o,r,a,i,s,c;N({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&null!==(r=o[0])&&void 0!==r&&r.code?"SANDBOX_SIGNUP_"+(null==e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i||null===(s=i.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,l;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===(l=e.Tenants[0])||void 0===l?void 0:l.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 l=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(l)},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"},l.createElement(_n,{showTenant:!1})),O&&l.createElement(t.Toast,{type:"error",label:h(null==O?void 0:O.label),onClose:()=>{N(null)}}),l.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},l.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()}})))};Hn.propTypes={loginParams:yn.any},Hn.defaultProps={loginParams:null};const Gn=e=>{let{stateCode:t}=e;const{t:r}=o.useTranslation(),{path:a}=i.useRouteMatch(),[s,c]=n.useState(Vn),u=Digit.StoreData.getCurrentLanguage(),{data:d,isLoading:p}=(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==p&&null!=d&&d.config?null==d?void 0:d.config:Vn)},[d,p]);const v=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=r(e.texts[n]);return m({},e,{texts:t})},[s]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+a,exact:!0},l.createElement(Hn,{config:v[0],t:r})))},Wn=["UserRequest"],zn=e=>{var r,a,c,u;let{isLogin:d=!1}=e;const{t:v}=o.useTranslation(),f=(i.useRouteMatch(),i.useHistory()),g=i.useLocation(),[E,y]=n.useState(null),[h,_]=n.useState(!1),[S,b]=n.useState(null),[O,N]=n.useState((null==g||null===(r=g.state)||void 0===r?void 0:r.data)||{}),[C,I]=n.useState(!1),{email:D,tenant:w}=g.state||{},{data:T}=Digit.Hooks.useCustomMDMS(w,"SandBoxLanding",[{name:"LandingPageRoles"}],{enabled:!0,staleTime:0,gcTime:0,select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.LandingPageRoles}}),A=null==T?void 0:T[0].url,L=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:D,tenant:w},populators:{required:!0}}]}],R=[{texts:{header:v("SANDBOX_OTP_VERIFICATION"),submitButtonLabel:"CORE_COMMON_SUBMIT"}}],P=()=>{y(null)};return n.useEffect(()=>{var e,t,n,l,o;if(!S)return;Digit.SessionStorage.set("citizen.userRequestObject",S);const r=null==S||null===(e=S.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==S||null===(n=S.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.length)>0&&(S.info.roles=r),Digit.UserService.setUser(S),((e,t)=>{var n;if(Digit.Utils.getMultiRootTenant())return;let l=(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",l),localStorage.setItem("Employee.locale",l),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==S?void 0:S.info,null==S?void 0:S.access_token);let a="/"+(null===(o=window)||void 0===o?void 0:o.globalPath)+"/user/setup";const i=((e,t,n,l)=>{var o,r,a,i,s,c;const u="SUPERUSER"===(null==t||null===(o=t.info)||void 0===o||null===(r=o.roles)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.code),d=null===(i=window)||void 0===i?void 0:i.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+l;default:return"/"+d+"/employee"}})(g.pathname,S,T,A);return d?void f.push(i):void f.push({pathname:a,state:{tenant:w}})},[S]),l.createElement(hn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,{onClick:()=>window.history.back()})),l.createElement(s.FormComposerV2,{onSubmit:function(e){try{var t;const n={username:D,password:null==e||null===(t=e.OtpComponent)||void 0===t?void 0:t.otp,tenantId:w,userType:"EMPLOYEE"},l=J(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){let{UserRequest:t}=e,n=p(e,Wn);Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),b(m({info:t},n))})},function(e){var t,n;y((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)&&v("ES_ERROR_USER_NOT_PERMITTED")||v("INVALID_LOGIN_CREDENTIALS")),setTimeout(P,5e3)});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,onFormValueChange:(e,t)=>{var n;const l=t.OtpComponent;6===(null==l||null===(n=l.otp)||void 0===n?void 0:n.length)?_(!0):_(!1)},isDisabled:!h,config:L,label:R[0].texts.submitButtonLabel,heading:R[0].texts.header,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper"},l.createElement(_n,{showTenant:!1})),E&&l.createElement(t.Toast,{type:"error",label:v(E),onClose:P}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(a=window)||void 0===a||null===(c=a.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()}})," "))},Xn=()=>{var e,r,a,s,c,u;const{t:d}=o.useTranslation(),m=i.useLocation(),{tenant:p}=m.state||{},v=(i.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,gcTime: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 l.createElement(hn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,{onClick:()=>window.history.back()})),l.createElement(t.Card,{className:"card-sandbox"},l.createElement(_n,{showTenant:!1}),l.createElement("div",{className:"sandbox-success-signup"},l.createElement(t.SVG.TickMark,{fill:"#fff",height:30,width:70})),l.createElement(t.CardHeader,{className:"cardHeader-sandbox",styles:{color:"#00703c"}},d("SANDBOX_HEADER")),l.createElement(t.CardText,{className:"cardText-sandbox"},d("SAMDBOX_URL_SUB")),l.createElement(t.CardLabel,null," ",d("SANDBOX_URL")," "),l.createElement("div",{className:"sandbox-url-wrapper"},l.createElement(t.TextInput,{inputRef:v,className:"urlInputText",onChange:()=>{},nonEditable:!0,value:window.location.host+"/"+(null===(a=window)||void 0===a?void 0:a.globalPath)+"/"+p+"/employee"}),l.createElement(t.Button,{className:"copyButton",variation:"secondary",onClick:()=>{navigator.clipboard.writeText(v.current.value)},label:d("COPY_URL")})),l.createElement("div",{className:"sandbox-url-footer"},d("SANDBOX_URL_FOOT")),l.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")})),l.createElement("div",{className:"EmployeeLoginFooter"},l.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()}})))},qn=[{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"}],Qn=()=>{const{t:e}=o.useTranslation();return i.useHistory(),l.createElement("div",{className:"role-landing-container"},l.createElement(t.Card,{className:"role-landing-card"},qn.filter(e=>"link"===e.type).map((n,o)=>l.createElement("div",{key:o,className:"header-video-section"},l.createElement(t.Header,{className:"role-header"},e("ROLE_BASED_LANDING_HEADER")),l.createElement(Un,{link:n.url,overlay:!0,className:"role-video"}))),qn.filter(e=>"text"===e.type).map((n,o)=>l.createElement("div",{key:o,className:"config-section"},l.createElement(t.CardHeader,{className:"role-section-header"},e(n.heading)),n.paragraphs.map((n,o)=>l.createElement(t.CardText,{className:"role-paragraph",key:o},e(n))),l.createElement("ul",{className:"role-list"},n.steps.map((t,n)=>l.createElement("li",{key:n,className:"role-list-item"},e(t.description)," "))))),l.createElement("div",{className:"role-action-container"},qn.filter(e=>"card"===e.type).map((n,o)=>{const r=n.icon;return l.createElement("div",{key:o,className:"role-card"},l.createElement("div",{className:"icon-container"},r&&l.createElement(r,null)," "),l.createElement(t.CardHeader,{className:"role-section-header"},e(n.heading)),l.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)}),l.createElement(t.CardText,{className:"role-paragraph"},e(n.description)))}))))},Zn=()=>l.createElement(Qn,null),Yn=["user/landing","user/profile","user/error"],$n=e=>{var r,a,s,c,u,d;let{stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:f,mobileView:E,handleUserDropdownSelection:h,logoUrl:_,logoUrlWhite:S,DSO:b,stateCode:O,modules:N,appTenants:C,initData:I}=e;const D=i.useHistory(),{t:w}=o.useTranslation(),{path:T}=i.useRouteMatch(),A=i.useLocation(),L=null==A||null===(r=A.pathname)||void 0===r?void 0:r.includes("language-selection"),R=Yn.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===(a=I.modules)||void 0===a||null===(s=a.filter(e=>null==e?void 0:e.additionalComponent))||void 0===s?void 0:s.map(e=>null==e?void 0:e.additionalComponent);return l.createElement("div",{className:"employee"},l.createElement(i.Switch,null,l.createElement(i.Route,{path:T+"/user"},R&&l.createElement(X,{t:w,stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:f,mobileView:E,handleUserDropdownSelection:h,logoUrl:_,logoUrlWhite:S,showSidebar:!!R,showLanguageChange:!L}),l.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"}},l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:T+"/user/login"},l.createElement(Mn,{stateCode:O})),l.createElement(i.Route,{exact:!0,path:T+"/user/login/otp"},l.createElement(zn,{isLogin:!0})),l.createElement(i.Route,{path:T+"/user/forgot-password"},l.createElement(In,null)),l.createElement(i.Route,{path:T+"/user/change-password"},l.createElement(On,null)),l.createElement(t.PrivateRoute,{path:T+"/user/profile"},l.createElement(te,{stateCode:O,userType:"employee",cityDetails:f})),l.createElement(t.PrivateRoute,{path:T+"/user/landing/select-role"},l.createElement("div",{className:"employee-app-wrapper sandbox-landing-wrapper"},l.createElement(Zn,null))),l.createElement(t.PrivateRoute,{path:T+"/user/landing"},l.createElement("div",{className:"employee-app-wrapper sandbox-landing-wrapper"},l.createElement(jn,null))),l.createElement(i.Route,{path:T+"/user/error"},l.createElement(g,{initData:I,goToHome:()=>{var e,t,n,l;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===(l=n.getType)||void 0===l?void 0:l.call(n)))}})),l.createElement(i.Route,{path:T+"/user/language-selection"},l.createElement(An,null)),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:T+"/user/language-selection"}))))),l.createElement(i.Route,null,l.createElement(X,{t:w,stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:f,mobileView:E,handleUserDropdownSelection:h,logoUrl:_,logoUrlWhite:S,modules:N}),l.createElement("div",{className:"main "+(b?"m-auto":"")+" digit-home-main"},l.createElement("div",{className:"employee-app-wrapper digit-home-app-wrapper"},l.createElement(y,{initData:I},l.createElement(wn,{stateCode:O,userType:"employee",modules:N,appTenants:C,additionalComponent:P}))),l.createElement("div",{className:"employee-home-footer"},l.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()}})))),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:T+"/user/language-selection"}))))},Jn=e=>{const{state:n={}}=i.useLocation(),{t:r}=o.useTranslation(),a=i.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:()=>{a.push("/"+window.globalPath+"/")}};return l.createElement(hn,null,l.createElement(t.Card,{className:"digit-employee-card customError"},l.createElement(_n,{showTenant:!1}),l.createElement(t.CardHeader,{className:"center"},r(s.infoHeader)),l.createElement(t.CardText,{className:"center"},r(s.infoMessage)),l.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()}})))},Kn=()=>{const[e,t]=n.useState(0),r=i.useHistory(),a=i.useLocation(),{t:s}=o.useTranslation(),{tenant:u}=a.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]),l.createElement("div",{className:"sandbox-loader-screen"},l.createElement("div",{className:"sandbox-loader"}),l.createElement("ul",{className:"sandbox-installation-steps"},d.map((t,n)=>l.createElement("li",{key:n,className:"sandbox-step "+(n<e?"sandbox-visible":"")},l.createElement("span",{className:"sandbox-step-text"},s(t)),n<e&&l.createElement(c.CheckCircle,{fill:"#00703C"})))))},el=e=>{var t,o,r,a;let{stateCode:s,modules:c,appTenants:u,logoUrl:d,logoUrlWhite:m,initData:p,defaultLanding:v="citizen"}=e;const f=i.useHistory(),{pathname:g}=i.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 l.createElement(i.Switch,null,l.createElement(i.Route,{path:"/"+(null===(o=window)||void 0===o?void 0:o.contextPath)+"/employee"},l.createElement($n,N)),l.createElement(i.Route,{path:"/"+(null===(r=window)||void 0===r?void 0:r.contextPath)+"/citizen"},l.createElement(Tt,N)),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/"+v})))},tl=e=>{var t,n,o,r,a,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 l.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"}},l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:"/"+(null===(n=window)||void 0===n?void 0:n.globalPath)+"/user/invalid-url"},l.createElement(Jn,null)),l.createElement(i.Route,{exact:!0,path:"/"+(null===(o=window)||void 0===o?void 0:o.globalPath)+"/user/sign-up"},l.createElement(Gn,{stateCode:p})),l.createElement(i.Route,{exact:!0,path:"/"+(null===(r=window)||void 0===r?void 0:r.globalPath)+"/user/otp"},l.createElement(zn,null)),l.createElement(i.Route,{exact:!0,path:"/"+(null===(a=window)||void 0===a?void 0:a.globalPath)+"/user/setup"},l.createElement(Kn,null)),l.createElement(i.Route,{exact:!0,path:"/"+(null===(s=window)||void 0===s?void 0:s.globalPath)+"/user/url"},l.createElement(Xn,null)),(null===(c=window)||void 0===c?void 0:c.globalPath)!==(null===(u=window)||void 0===u?void 0:u.contextPath)&&l.createElement(i.Route,{path:"/"+(null===(d=window)||void 0===d?void 0:d.contextPath)},l.createElement(el,{stateCode:p,modules:v,appTenants:f,logoUrl:g,logoUrlWhite:E,initData:y,defaultLanding:h})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:"/"+(null===(m=window)||void 0===m?void 0:m.globalPath)+"/user/sign-up"}))))},nl=[d],ll=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):u.compose)(u.applyMiddleware(...nl)),ol=["onSelect","formData","control","formState"],rl=e=>{let{onSelect:r}=e,a=p(e,ol);const{t:i}=o.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,u]=n.useState(!1),[d,m]=n.useState(!1),{data:v}=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==a||null===(t=a.props)||void 0===t?void 0:t.module)})}});return n.useEffect(()=>{r("check",c)},[c]),l.createElement(l.Fragment,null,l.createElement("div",{className:"digit-privacy-checkbox"},l.createElement(t.CheckBox,{label:i("ES_BY_CLICKING"),checked:c,onChange:e=>{u(e.target.checked)}}),l.createElement(t.Button,{label:i("ES_PRIVACY_POLICY"),variation:"link",size:"medium",onClick:()=>{m(!0)},style:{marginBottom:"1.18rem",paddingLeft:"0.2rem"}})),d&&l.createElement(t.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:i(null==v?void 0:v.header),onOverlayClick:()=>{m(!1)},footerChildren:[l.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:i("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{u(!1),m(!1)}}),l.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:i("DIGIT_I_ACCEPT"),className:"accept-class",onClick:()=>{u(!0),m(!1)}})],sortFooterChildren:!0,onClose:()=>{m(!1)}},l.createElement("div",null,l.createElement("div",{className:"privacy-table"},i("DIGIT_TABLE_OF_CONTENTS")),l.createElement("ul",null,null==v?void 0:v.contents.map((e,n)=>l.createElement("li",{key:n,style:{display:"flex",alignItems:"center"}},l.createElement("span",{style:{marginRight:"0.5rem"}},n+1,". "),l.createElement(t.Button,{label:i(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==v?void 0:v.contents.map((e,t)=>l.createElement("div",{key:t,id:null==e?void 0:e.header},l.createElement("div",{style:{fontWeight:"bold",paddingLeft:null!=e&&e.isSpaceRequired?"1rem":"0"}},i(e.header)),e.descriptions.map((e,t)=>l.createElement("div",{key:t,style:{paddingLeft:e.isSpaceRequired?"1rem":"0",marginBottom:"0.5rem"}},l.createElement("div",{style:{fontWeight:null!=e&&e.isBold?700:400,display:"flex",alignItems:"center"}},"points"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc"}},"•"),"step"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal"}},t+1,". "),i(e.text)),(null==e?void 0:e.subDescriptions)&&(null==e?void 0:e.subDescriptions.length)>0&&l.createElement("div",{className:"policy-subdescription"},e.subDescriptions.map((e,t)=>l.createElement("div",{key:t,className:"policy-subdescription-points"},"points"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc",paddingLeft:"1rem"}},"•"),"step"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal",paddingLeft:"1rem"}},t+1,". "),null===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",paddingLeft:"1rem"}}," "),i(e.text))))))))))},al=["onSelect","formData","control","formState"],il=e=>{var n,r,s;let{stateCode:c,enabledModules:d,moduleReducers:p,defaultLanding:v}=e;const{isLoading:f,data:g={}}=Digit.Hooks.useInitStore(c,d);if(f)return l.createElement(t.Loader,{page:!0});const E=function(e,t){return void 0===t&&(t={}),u.createStore(((e,t)=>{return u.combineReducers(m({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return m({},e,{selectedLanguage:t.payload});default:return e}})},t));var n})(e,t),ll)}(g,p(g))||{};return o.getI18n(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",rl),l.createElement(a.Provider,{store:E},l.createElement(i.BrowserRouter,null,l.createElement(t.BodyContainer,null,Digit.Utils.getMultiRootTenant()?l.createElement(tl,{initData:g,stateCode:c,modules:null==g?void 0:g.modules,appTenants:g.tenants,logoUrl:null==g||null===(n=g.stateInfo)||void 0===n?void 0:n.logoUrl,logoUrlWhite:null==g||null===(r=g.stateInfo)||void 0===r?void 0:r.logoUrlWhite,defaultLanding:v}):l.createElement(el,{initData:g,stateCode:c,modules:null==g?void 0:g.modules,appTenants:g.tenants,logoUrl:null==g||null===(s=g.stateInfo)||void 0===s?void 0:s.logoUrl,defaultLanding:v}))))},sl={SelectOtp:ie,ChangeCity:R,ChangeLanguage:P,PrivacyComponent:rl,OtpComponent:e=>{var r,a;let{onSelect:c}=e,u=p(e,al);const{t:d}=o.useTranslation(),[v,f]=(i.useLocation(),n.useState(null)),[g,E]=n.useState({}),[y,h]=n.useState(!0),[_,S]=n.useState(30),b=()=>{f(null)};ae(()=>{S(_-1)},_>0?1e3:null),n.useEffect(()=>{c("OtpComponent",g)},[g]);const O={url:"/user-otp/v1/_send",params:{tenantId:null==u||null===(r=u.props)||void 0===r?void 0:r.code},body:{},config:{enable:!1}},N=Digit.Hooks.useCustomAPIMutationHook(O);return l.createElement(n.Fragment,null,l.createElement(t.CardLabel,{className:"sandbox-custom-otp-header"},d("CS_OTP_EMAIL")),l.createElement(t.CardLabel,{className:"sandbox-custom-otp-email"},null==u||null===(a=u.props)||void 0===a?void 0:a.email),l.createElement(t.CardLabel,{className:"sandbox-custom-otp-subheader"},d("SANDBOX_ENTER_OTP")),l.createElement(s.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{E(m({},g,{otp:e}))},value:null==g?void 0:g.otp}),_>0?l.createElement(t.CardText,{className:"sandbox-resend-otp"},d("CS_RESEND_ANOTHER_OTP")+" "+_+" "+d("CS_RESEND_SECONDS")):l.createElement("p",{className:"card-text-button sandbox-otp-input",onClick:function(){try{var e,t;return S(30),Promise.resolve(N.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,l,o,r,a,i,s;f({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(i=a.Errors)||void 0===i||null===(s=i[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(b,5e3)},onSuccess:function(e){try{return f({key:"info",label:d("OTP_RESNED_SUCCESFULL")}),setTimeout(b,5e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}},d("CS_RESEND_OTP")),!y&&l.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")),v&&l.createElement(t.Toast,{type:null==v?void 0:v.key,label:d(null==v?void 0:v.label),onClose:b}))}};exports.DigitUI=e=>{let{stateCode:t,registry:o,enabledModules:a,moduleReducers:i,defaultLanding:s}=e;const[c,u]=n.useState(Digit.Utils.getPrivacyObject()||{}),d=(Digit.UserService.getType(),new r.QueryClient({defaultOptions:{queries:{staleTime:9e5,gcTime:3e6,retry:!1,retryDelay:e=>Infinity}}})),p=Digit.Contexts.ComponentProvider,v=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),l.createElement("div",null,l.createElement(y,null,l.createElement(r.QueryClientProvider,{client:d},l.createElement(p.Provider,{value:o},l.createElement(v.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=m({},t,{[window.location.pathname]:e});Digit.Utils.setPrivacyObject(m({},n)),u((null==t?void 0:t[window.location.pathname])||{})},updatePrivacy:(e,t)=>{u(Digit.Utils.updatePrivacy(e,t)||{})}}},l.createElement(il,{stateCode:t,enabledModules:a,moduleReducers:i,defaultLanding:s}))))))},exports.initCoreComponents=()=>{Object.entries(sl).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"),a=require("react-query"),r=require("react-redux"),i=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"));function m(){return(m=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)}function p(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}function v(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 f="function"==typeof Symbol&&Symbol.for,g=f?Symbol.for("react.element"):60103,E=f?Symbol.for("react.portal"):60106,y=f?Symbol.for("react.fragment"):60107,h=f?Symbol.for("react.strict_mode"):60108,b=f?Symbol.for("react.profiler"):60114,S=f?Symbol.for("react.provider"):60109,N=f?Symbol.for("react.context"):60110,C=f?Symbol.for("react.async_mode"):60111,O=f?Symbol.for("react.concurrent_mode"):60111,w=f?Symbol.for("react.forward_ref"):60112,I=f?Symbol.for("react.suspense"):60113,_=f?Symbol.for("react.suspense_list"):60120,D=f?Symbol.for("react.memo"):60115,T=f?Symbol.for("react.lazy"):60116,A=f?Symbol.for("react.block"):60121,L=f?Symbol.for("react.fundamental"):60117,R=f?Symbol.for("react.responder"):60118,P=f?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case g:switch(e=e.type){case C:case O:case y:case b:case h:case I:return e;default:switch(e=e&&e.$$typeof){case N:case w:case T:case D:case S:return e;default:return t}}case E:return t}}}function M(e){return x(e)===O}var k={AsyncMode:C,ConcurrentMode:O,ContextConsumer:N,ContextProvider:S,Element:g,ForwardRef:w,Fragment:y,Lazy:T,Memo:D,Portal:E,Profiler:b,StrictMode:h,Suspense:I,isAsyncMode:function(e){return M(e)||x(e)===C},isConcurrentMode:M,isContextConsumer:function(e){return x(e)===N},isContextProvider:function(e){return x(e)===S},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===g},isForwardRef:function(e){return x(e)===w},isFragment:function(e){return x(e)===y},isLazy:function(e){return x(e)===T},isMemo:function(e){return x(e)===D},isPortal:function(e){return x(e)===E},isProfiler:function(e){return x(e)===b},isStrictMode:function(e){return x(e)===h},isSuspense:function(e){return x(e)===I},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===y||e===O||e===b||e===h||e===I||e===_||"object"==typeof e&&null!==e&&(e.$$typeof===T||e.$$typeof===D||e.$$typeof===S||e.$$typeof===N||e.$$typeof===w||e.$$typeof===L||e.$$typeof===R||e.$$typeof===P||e.$$typeof===A)},typeOf:x},U=v(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,a=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=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 b(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 r:case a:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case i:return g;default:return t}}case o:return t}}}var S=u,N=s,C=i,O=n,w=d,I=l,_=f,D=v,T=o,A=r,L=a,R=m,P=!1;function x(e){return b(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=N,t.ContextProvider=C,t.Element=O,t.ForwardRef=w,t.Fragment=I,t.Lazy=_,t.Memo=D,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)||b(e)===c},t.isConcurrentMode=x,t.isContextConsumer=function(e){return b(e)===s},t.isContextProvider=function(e){return b(e)===i},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===l},t.isLazy=function(e){return b(e)===f},t.isMemo=function(e){return b(e)===v},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===r},t.isStrictMode=function(e){return b(e)===a},t.isSuspense=function(e){return b(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===r||e===a||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===i||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=b}()}),B=v(function(e){e.exports="production"===process.env.NODE_ENV?k:U}),j=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;function z(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var G=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=z(e),a=1;a<arguments.length;a++){for(var r in n=Object(arguments[a]))F.call(n,r)&&(l[r]=n[r]);if(j){o=j(n);for(var i=0;i<o.length;i++)H.call(n,o[i])&&(l[o[i]]=n[o[i]])}}return l},V="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",W=Function.call.bind(Object.prototype.hasOwnProperty),Q=function(){};if("production"!==process.env.NODE_ENV){var X=V,q={},Z=W;Q=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function Y(e,t,n,o,l){if("production"!==process.env.NODE_ENV)for(var a in e)if(Z(e,a)){var r;try{if("function"!=typeof e[a]){var i=Error((o||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw i.name="Invariant Violation",i}r=e[a](t,a,o,n,null,X)}catch(e){r=e}if(!r||r instanceof Error||Q((o||"React class")+": type specification of "+n+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof r+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),r instanceof Error&&!(r.message in q)){q[r.message]=!0;var s=l?l():"";Q("Failed "+n+" type: "+r.message+(null!=s?s:""))}}}Y.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(q={})};var J=Y,K=function(){};function $(){return null}function ee(){}function te(){}"production"!==process.env.NODE_ENV&&(K=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),te.resetWarningCache=ee;var ne=v(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,o={array:i("array"),bigint:i("bigint"),bool:i("boolean"),func:i("function"),number:i("number"),object:i("object"),string:i("string"),symbol:i("symbol"),any:r($),arrayOf:function(e){return r(function(t,n,o,l,r){if("function"!=typeof e)return new a("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var i=t[n];if(!Array.isArray(i))return new a("Invalid "+l+" `"+r+"` of type `"+u(i)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<i.length;s++){var c=e(i,s,o,l,r+"["+s+"]",V);if(c instanceof Error)return c}return null})},element:r(function(t,n,o,l,r){var i=t[n];return e(i)?null:new a("Invalid "+l+" `"+r+"` of type `"+u(i)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:r(function(e,t,n,o,l){var r=e[t];return B.isValidElementType(r)?null:new a("Invalid "+o+" `"+l+"` of type `"+u(r)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return r(function(t,n,o,l,r){var i;return t[n]instanceof e?null:new a("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:r(function(e,t,n,o,l){return c(e[t])?null:new a("Invalid "+o+" `"+l+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return r(function(t,n,o,l,r){if("function"!=typeof e)return new a("Property `"+r+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var i=t[n],s=u(i);if("object"!==s)return new a("Invalid "+l+" `"+r+"` of type `"+s+"` supplied to `"+o+"`, expected an object.");for(var c in i)if(W(i,c)){var d=e(i,c,o,l,r+"."+c,V);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&K(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."),$;function t(t,n,o,r,i){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 a("Invalid "+r+" `"+i+"` of value `"+String(s)+"` supplied to `"+o+"`, expected one of "+u+".")}return r(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&K("Invalid argument supplied to oneOfType, expected an instance of array."),$;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return K("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),$}return r(function(t,n,o,l,r){for(var i=[],s=0;s<e.length;s++){var c=(0,e[s])(t,n,o,l,r,V);if(null==c)return null;c.data&&W(c.data,"expectedType")&&i.push(c.data.expectedType)}return new a("Invalid "+l+" `"+r+"` supplied to `"+o+"`"+(i.length>0?", expected one of type ["+i.join(", ")+"]":"")+".")})},shape:function(e){return r(function(t,n,o,l,r){var i=t[n],c=u(i);if("object"!==c)return new a("Invalid "+l+" `"+r+"` 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,r,m,d(p));var v=p(i,m,o,l,r+"."+m,V);if(v)return v}return null})},exact:function(e){return r(function(t,n,o,l,r){var i=t[n],c=u(i);if("object"!==c)return new a("Invalid "+l+" `"+r+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");var m=G({},t[n],e);for(var p in m){var v=e[p];if(W(e,p)&&"function"!=typeof v)return s(o,l,r,p,d(v));if(!v)return new a("Invalid "+l+" `"+r+"` key `"+p+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=v(i,p,o,l,r+"."+p,V);if(f)return f}return null})}};function l(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function a(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function r(e){function t(t,n,o,l,r,i,s){if(l=l||"<<anonymous>>",i=i||o,s!==V){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 a(null===n[o]?"The "+r+" `"+i+"` is marked as required in `"+l+"`, but its value is `null`.":"The "+r+" `"+i+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:e(n,o,l,r,i)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function i(e){return r(function(t,n,o,l,r,i){var s=t[n];return u(s)!==e?new a("Invalid "+l+" `"+r+"` of type `"+d(s)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,o,l){return new a((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,a=o.call(t);if(o!==t.entries){for(;!(l=a.next()).done;)if(!c(l.value))return!1}else for(;!(l=a.next()).done;){var r=l.value;if(r&&!c(r[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 a.prototype=Error.prototype,o.checkPropTypes=J,o.resetWarningCache=J.resetWarningCache,o.PropTypes=o,o}(B.isElement):function(){function e(e,t,n,o,l,a){if(a!==V){var r=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 r.name="Invariant Violation",r}}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:te,resetWarningCache:ee};return n.PropTypes=n,n}()});const oe=["src","alt","decorative","ariaLabel","ariaLabelledby"],le=e=>{let{src:t,alt:n="Image not found",decorative:l=!1,ariaLabel:a="No Image description set",ariaLabelledby:r="no-image-description"}=e,i=p(e,oe);const s={};return l?s.alt="":n?s.alt=n:a?s["aria-label"]=a:r?s["aria-labelledby"]=r:console.warn("AccessibleImage: Missing alt, aria-label, or aria-labelledby for non-decorative image."),o.createElement("img",m({src:t},s,i))};le.propTypes={src:ne.string.isRequired,alt:ne.string,decorative:ne.bool,ariaLabel:ne.string,ariaLabelledby:ne.string};const ae={error:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/error-image.png",infoMessage:"CORE_SOMETHING_WENT_WRONG",buttonInfo:"ACTION_TEST_HOME"},maintenance:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/maintainence-image.png",infoMessage:"CORE_UNDER_MAINTENANCE",buttonInfo:"ACTION_TEST_HOME"},notfound:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/PageNotFound.png",infoMessage:"MODULE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},re={sandbox:{imgUrl:"https://digit-ui-assets.s3.ap-south-1.amazonaws.com/error-image.png",infoMessage:"WRONG_TENANT_SIGN_UP",buttonInfo:"CREATE_TENANT_ERROR_BUTTON"}},ie=e=>{var t;const{type:n="error"}=Digit.Hooks.useQueryParams(),a=null==e||null===(t=e.errorData)||void 0===t?void 0:t.module,{t:r}=l.useTranslation(),i=a?re[a]:ae[n];return o.createElement("div",{className:"error-boundary"},o.createElement("div",{className:"error-container"},o.createElement(le,{src:i.imgUrl,alt:"error"}),o.createElement("h1",null,r(i.infoMessage)),o.createElement("button",{onClick:()=>{var t;a?null==e||null===(t=e.errorData)||void 0===t||t.action():e.goToHome()}},r(i.buttonInfo))))},se=()=>{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 ce 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(se,null),o.createElement(ie,{initData:this.props.initData,errorData:this.state})):this.props.children}}const ue=require("@egovernments/digit-ui-svg-components"),de=e=>{var a;const{isLoading:r,data:s}=Digit.Hooks.useAccessControl(),c=Digit.Utils.getMultiRootTenant(),{t:u}=l.useTranslation(),d=i.useHistory(),p=Digit.ULBService.getStateId();let v=null;const[f,g]=n.useState([{}]),{data:E}=Digit.Hooks.useCustomMDMS(p,"HomeScreenOrder",[{name:"CardsAndLinksOrder"}],{select:e=>{var t;return null==e||null===(t=e.HomeScreenOrder)||void 0===t?void 0:t.CardsAndLinksOrder}}),{data:y}=Digit.Hooks.useCustomMDMS(p,"SandBoxLanding",[{name:"AdditionalModuleLinks"}],{select:e=>{var t;return null==e||null===(t=e.SandBoxLanding)||void 0===t?void 0:t.AdditionalModuleLinks}});n.useEffect(()=>{g(E)},[E]);const h=(e,t)=>{if(!e||!t)return null;const n=null==y?void 0:y.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},b=e=>{var t;const n=null==y?void 0:y.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)})},S=null==s?void 0:s.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,n)=>{const o=n.parentModule;e[o]||(e[o]={module:o,kpis:[],icon:n.leftIcon?Digit.Utils.iconRender({iconName:n.leftIcon,iconFill:"white",CustomSVG:t.CustomSVG,Components:ue}):"",label:Digit.Utils.locale.getTransformedLocale(o+"_CARD_HEADER"),links:[]});const l=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/"+p+"/employee"):e,t}return e}}(n.navigationURL),a=l.indexOf("?");return e[o].links.push({link:l,icon:n.leftIcon,queryParams:-1===a?null:l.substring(a),label:u(Digit.Utils.locale.getTransformedLocale(o+"_LINK_"+n.displayName)),displayName:n.displayName}),e},{});if(r)return o.createElement(t.Loader,{page:!1,variant:"PageLoader"});if(!S)return"";v=c?(e=>Object.keys(e).sort((e,t)=>{var n,o;return((null==f||null===(n=f.find(t=>"card"===t.moduleType&&t.name===e))||void 0===n?void 0:n.order)||null)-((null==f||null===(o=f.find(e=>"card"===e.moduleType&&e.name===t))||void 0===o?void 0:o.order)||null)}).reduce((t,n)=>{var o,l;const a=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 a=null==e?void 0:e.displayName,r=null==t?void 0:t.displayName;return((null==f||null===(o=f.find(e=>"link"===e.moduleType&&e.name===n+"."+a.replace(/\s+/g,"_")))||void 0===o?void 0:o.order)||null)-((null==f||null===(l=f.find(e=>"link"===e.moduleType&&e.name===n+"."+r.replace(/\s+/g,"_")))||void 0===l?void 0:l.order)||null)});return t[n]=m({},e[n],{links:a}),t},{}))(S):S;const N=null===(a=Object.keys(v))||void 0===a?void 0:a.map((e,n)=>{var l,a;const r=null===(l=v)||void 0===l?void 0:l[e],i=null==r||null===(a=r.links)||void 0===a?void 0:a.find(e=>"Configure_master"===(null==e?void 0:e.displayName)),s=h(r,"howItWorksLink"),c=h(r,"userManualLink"),p={icon:"SupervisorAccount",moduleName:u(null==r?void 0:r.label),metrics:[],links:Digit.Utils.getMultiRootTenant()?b(r):null==r?void 0:r.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()?[i&&o.createElement(t.Button,{variation:"teritiary",label:null==i?void 0:i.label,icon:null==i?void 0:i.icon,type:"button",size:"medium",onClick:()=>null==d?void 0:d.push(null==i?void 0:i.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,m({buttonSize:"medium"},p))});return o.createElement(n.Fragment,null,o.createElement(t.LandingPageWrapper,null,o.Children.map(N,e=>o.cloneElement(e))))},me=e=>{const{question:a,isLabelLink:r,type:i,actions:u,content:d,lastIndex:m}=e,[p,v]=n.useState(!1),{t:f}=l.useTranslation(),g=Digit.ULBService.getStateId(),E="number"===i?"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(a)),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"}},r?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"}))},pe=e=>{let{type:t,title:n,content:a,actions:r}=e;const{t:i}=l.useTranslation(),c="number"===t?"ol":"ul";return o.createElement("div",null,o.createElement(s.CardSectionHeader,null,i(n)),o.createElement(s.CardSectionSubText,{style:{marginTop:"1rem"}},i(a)),o.createElement("div",{style:{marginTop:"1rem"}},r&&o.createElement(c,null,r.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,i(null==e?void 0:e.label),":"):null," ",i(null==e?void 0:e.description))))))},ve=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(me,{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}))))},fe=e=>{let{cardConfig:n}=e;const{t:a}=l.useTranslation();return o.createElement(t.Card,{className:"sandbox-guide",style:{width:"25rem",height:"47rem",overflowY:"scroll"}},o.createElement(t.CardHeader,null,a("GUIDE_TO_SETUP")),o.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},n.map((e,t)=>"faqs"===(null==e?void 0:e.type)?o.createElement(ve,{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(pe,{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"}})))))},ge=["onSelect","formData","control","formState"],Ee=e=>{p(e,ge);const{t:t}=l.useTranslation(),{data:n}=Digit.Hooks.useAccessControl(),a=(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,a),r=l.indexOf("?");return e[o].links.push({link:-1===r?l:l.substring(0,r),label:t(Digit.Utils.locale.getTransformedLocale(o+"_LINK_"+n.displayName)),queryParams:-1===r?null:l.substring(r),description:t(Digit.Utils.locale.getTransformedLocale(o+"_LINK_"+n.displayName+"_DESCRIPTION"))}),e},{}))?o.createElement(fe,{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"}]}]}):""},ye=(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 a;return"FSM"===t&&[{role:"FSM_DSO",from:"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/citizen/fsm/dso-dashboard",dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,o,a;let{role:r,from:i,loginLink:s,dashoardLink:c}=e;Digit.UserService.hasAccess(r)?null==l||null===(t=l.links)||void 0===t||t.push({link:i,i18nKey:n(c)}):null==l||null===(o=l.links)||void 0===o||o.push({link:"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/citizen/login",state:{role:"FSM_DSO",from:i},i18nKey:n(s)})}),l},he=e=>{let{getCitizenMenu:n,isLoading:a}=e;const{t:r}=l.useTranslation();if(a)return o.createElement(s.Loader,null);const i=Object.keys(n||{});return 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")||location.pathname.includes("digit-studio")&&location.pathname.includes("all-services")?null:o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement("div",{className:"citizenAllServiceGrid"},i.map(e=>{var l;const a=ye(n,e,r);var i,c;return(null==a||null===(l=a.links)||void 0===l?void 0:l.length)>0?o.createElement(s.CitizenHomeCard,{key:e,header:r(null==a?void 0:a.header),links:null==a||null===(i=a.links)||void 0===i||null===(c=i.filter(e=>null==e?void 0:e.link))||void 0===c?void 0:c.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"})}})(e),Info:null,isInfo:!1}):null})))},be=e=>{let{modules:l,additionalComponent:a}=e;return o.createElement(n.Fragment,null,o.createElement("div",{className:"employee-app-container digit-home-employee-app"},o.createElement(t.LandingPageWrapper,null,null==l?void 0:l.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})}))),a&&(null==a?void 0:a.length)>0&&a.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}))},Se=e=>{let{userType:t,modules:n,getCitizenMenu:l,fetchedCitizen:a,isLoading:r,additionalComponent:i}=e;if("citizen"===t)return o.createElement(he,{modules:n,getCitizenMenu:l,fetchedCitizen:a,isLoading:r});const s=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return Digit.Utils.getRoleBasedHomeCard()?o.createElement("div",{className:s?"homeWrapper":""},o.createElement(de,{modules:n,additionalComponent:i}),s&&!window.Digit.Utils.browser.isMobile()?o.createElement(Ee,null):null):o.createElement(be,{modules:n,additionalComponent:i})},Ne=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},Ce=e=>{var l,a;const[r,s]=n.useState(null),[c,u]=n.useState([]),[d,m]=n.useState([]),p=i.useHistory();let v=[];const f=Digit.Utils.getMultiRootTenant();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 a=o.filter((e,t,n)=>n.indexOf(e)===t);null==a||a.forEach(e=>{var t;l.push({label:"TENANT_TENANTS_"+(null===(t=Ne(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),v=null==l?void 0:l.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),u(l)},[r]),o.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},f&&1==c.length?o.createElement(t.CardText,{style:{color:"#363636"}},null==c||null===(l=c[0])||void 0===l?void 0:l.value):o.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:c,selected:c.find(e=>e.value===(null==r?void 0:r.value)),optionKey:"label",select:e=>{var t,n,o,l;const a=Digit.SessionStorage.get("citizen.userRequestObject"),r=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==r?void 0:r.length)>0&&(a.info.roles=r,a.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(a),s(e),window.location.href.includes("/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/employee/")){var i,c;const e=(null===(i=location.state)||void 0===i?void 0:i.from)||"/"+(null===(c=window)||void 0===c?void 0:c.contextPath)+"/employee";p.replace(e)}window.location.reload()},freeze:!0,customSelector:o.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(a=Ne(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===a?void 0:a.toUpperCase())))}))},Oe=e=>{const a=e.dropdown||!1,{data:r,isLoading:i}=Digit.Hooks.useStore.getInitData(),{languages:s,stateInfo:c}=r||{},{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 i?null:a?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},we=e=>{var l,a,r,c,u,d,m,p;let{t:v,stateInfo:f,toggleSidebar:g,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:b,cityDetails:S,mobileView:N,userOptions:C,handleUserDropdownSelection:O,logoUrl:w,logoUrlWhite:I,showLanguageChange:_=!0}=e;const[D,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!==D,null==h||null===(l=h.info)||void 0===l?void 0:l.uuid]);const A=Digit.ULBService.getCitizenCurrentTenant(!0);let L=i.useHistory();const{pathname:R}=i.useLocation(),{data:{unreadCount:P}={},isSuccess:x}=Digit.Hooks.useNotificationCount({tenantId:A,config:{enabled:"EMPLOYEE"!==(null===(M=Digit.UserService)||void 0===M||null===(k=M.getUser())||void 0===k||null===(U=k.info)||void 0===U?void 0:U.type)&&"CITIZEN"===(null===(B=Digit.UserService)||void 0===B||null===(j=B.getUser())||void 0===j||null===(F=j.info)||void 0===F?void 0:F.type)&&!!A}});var M,k,U,B,j,F;if(b)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:P<99?P:99,notificationCountLoaded:x,cityOfCitizenShownBesideLogo:v(A),onNotificationIconClick:function(){var e;L.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)})(R),changeLanguage:N?null:o.createElement(Oe,{dropdown:!0})}));const H=!(null==h||!h.access_token),z=null===(a=Digit.ComponentRegistryService)||void 0===a?void 0:a.getComponent("CustomEmployeeTopBar");return z?o.createElement(z,{t:v,stateInfo:f,toggleSidebar:g,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:b,cityDetails:S,mobileView:N,userOptions:C,handleUserDropdownSelection:O,logoUrl:w,showLanguageChange:_,loggedin:H}):o.createElement(t.Header,{actionFields:[o.createElement(Ce,{dropdown:!0,t:v}),_&&o.createElement(Oe,{dropdown:!0}),(null==h?void 0:h.access_token)&&o.createElement(t.Dropdown,{option:C,optionKey:"name",profilePic:D||(null==h||null===(r=h.info)||void 0===r?void 0:r.name)||(null==h||null===(c=h.info)||void 0===c||null===(u=c.userInfo)||void 0===u?void 0:u.name)||"Employee",select:O,showArrow:!0,menuStyles:{marginTop:"1rem"},theme:"light"})],onHamburgerClick:()=>{g()},className:"digit-employee-header",img:w,logoWidth:"64px",logoHeight:"48px",logo:(H?null==S?void 0:S.logoId:null==f?void 0:f.statelogo)||"https://egov-dev-assets.s3.ap-south-1.amazonaws.com/egov-logo-2025.png",onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:"light",ulb:H?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(le,{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"))})},Ie=(e,t,n,l)=>[{type:"component",element:"LANGUAGE",action:o.createElement(Oe,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:o.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:n}}],_e=e=>{let{onSelect:n,onCancel:a,onDismiss:r,PopupStyles:i,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:a}),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:a})];return o.createElement(t.PopUp,{type:"default",children:d,heading:u("CORE_LOGOUT_WEB_HEADER"),footerChildren:c?p:m,sortFooterButtons:!0,onClose:r,className:"digit-logout-popup-wrapper",onOverlayClick:r,equalWidthButtons:!0,style:i})},De=e=>{let{info:t,t:n}=e;return o.createElement("div",{className:"profile-section"},o.createElement("div",{className:"imageloader imageloader-loaded"},o.createElement(le,{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,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",alt:"Profile Logo"})),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(Ce,{t:n,mobileView:!0}))},Te={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"})},Ae=e=>{var t,a,r,c;let{linkData:u,islinkDataLoading:d}=e;const{t:p}=l.useTranslation(),v=i.useHistory(),f=i.useLocation(),{pathname:g}=f,{data:E,isFetched:y}=Digit.Hooks.useStore.getInitData(),{stateInfo:h}=E||{},b=Digit.UserService.getUser();let S=window.Digit.Utils.browser.isMobile();const[N,C]=n.useState(!1),[O,w]=n.useState(!1),[I,_]=n.useState(!1),D=()=>{_(!1)};if(d)return o.createElement(s.Loader,null);let T=[...Ie(p,0,()=>{var e;v.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 a=(null==l?void 0:l.icon)||(null===(t=l.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),r=a?Te[a]:Te.BillsIcon;let s;s="component"===l.type?l.action:l.text;const c=()=>o.createElement("span",m({className:"menu-item"},l.populators),r,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(i.Link,{to:null==l?void 0:l.link},o.createElement(c,null)):o.createElement(c,null)};let L;var R,P,x,M,k;return y&&b&&b.access_token&&"CITIZEN"===(null==b||null===(t=b.info)||void 0===t?void 0:t.type)&&(L=o.createElement(De,{info:null==b?void 0:b.info,stateName:null==h?void 0:h.name,t:p}),T=T.filter(e=>"login-btn"!==(null==e?void 0:e.id)),T=[...T,{type:"link",icon:"HomeIcon",element:"HOME",text:p("COMMON_BOTTOM_NAVIGATION_HOME"),link:N?"/"+(null===(R=window)||void 0===R?void 0:R.contextPath)+"/employee":"/"+(null===(P=window)||void 0===P?void 0:P.contextPath)+"/citizen",populators:{onClick:()=>{var e;v.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/all-services")}}},{text:p("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:()=>{var e;v.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/user/profile")}}},{text:p("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{w(!1),_(!0)}}},{text:o.createElement(o.Fragment,null,p("CS_COMMON_HELPLINE"),o.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==E||null===(x=E.tenants)||void 0===x?void 0:x.map(e=>{}),o.createElement("div",{className:"link"},o.createElement("a",{href:"tel:"+(null==E||null===(M=E.tenants)||void 0===M?void 0:M[0].contactNumber)},null==E||null===(k=E.tenants)||void 0===k?void 0:k[0].contactNumber)))),element:"Helpline",icon:"Phone"}]),null===(a=Object.keys(u))||void 0===a||null===(r=a.sort((e,t)=>t.localeCompare(e)))||void 0===r||r.map(e=>{var t,n,o,l,a,r;(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:p("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:u[e],icon:null===(a=u[e][0])||void 0===a?void 0:a.leftIcon,link:null===(r=u[e][0])||void 0===r?void 0:r.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 "+(g===(null==e?void 0:e.link)||g===(null==e?void 0:e.sidebarURL)?"active":""),key:t},o.createElement(A,{item:e}))))),o.createElement("div",null,I&&o.createElement(_e,{onSelect:()=>{var e;Digit.Utils.getMultiRootTenant()?(Digit.UserService.logout(),_(!1),window.location.href="/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/login"):(Digit.UserService.logout(),_(!1))},onCancel:D,onDismiss:D}))))},Le=e=>{var a,r,c,u;let{isMobile:d=!1,toggleSidebar:p,onLogout:v,isEmployee:f=!1,linkData:g,islinkDataLoading:E,userProfile:y}=e;Digit.Utils.getMultiRootTenant();const{data:h,isFetched:b}=Digit.Hooks.useStore.getInitData(),S=Digit.StoreData.getCurrentLanguage(),[N,C]=n.useState(null),{languages:O,stateInfo:w}=h||{},I=Digit.UserService.getUser(),[_,D]=n.useState(""),[T,A]=n.useState(null),[L,R]=n.useState([]),[P,x]=n.useState([]),[M,k]=n.useState(S);let U=[];const{isLoading:B,data:j}=Digit.Hooks.useAccessControl(),F=Digit.ULBService.getCurrentTenantId(),{t:H}=l.useTranslation(),z=i.useHistory(),G=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 a=o.filter((e,t,n)=>n.indexOf(e)===t);null==a||a.forEach(e=>{var t;l.push({label:H("TENANT_TENANTS_"+(null===(t=G(e,".","_"))||void 0===t?void 0:t.toUpperCase())),value:e})}),U=null==l?void 0:l.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),R(l)},[T]);const V=()=>{Digit.clikOusideFired=!0,p(!1)};n.useEffect(()=>{N||function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==I||null===(e=I.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(",");C(null==o?void 0:o.at(0))}})}();Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[N]);const W=e=>{let t=null;var n,o;Digit.Utils.getMultiRootTenant()?(t=f?e.replace("/sandbox-ui/employee","/sandbox-ui/"+F+"/employee"):e.replace("/sandbox-ui/citizen","/sandbox-ui/"+F+"/citizen"),z.push(t),p()):(z.push("/"===e[0]?"/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/"+(f?"employee":"citizen")+e:"/"+(null===(o=window)||void 0===o?void 0:o.contextPath)+"/"+(f?"employee":"citizen")+"/"+e),p())};if(E||B)return o.createElement(t.Loader,null);let Q=[{id:"login-btn",element:"LOGIN",text:H("CORE_COMMON_LOGIN"),icon:o.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:()=>{var e,t;z.push(f?"/"+(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"),V()}}}];b&&I&&I.access_token&&(Q=Q.filter(e=>"login-btn"!==(null==e?void 0:e.id)));let X={};if(f){var q;null==j||j.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==_&&""!==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(_.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 Z,Y,J,K,$;const n=null===(Z=X[e[t]][0])||void 0===Z||null===(Y=Z.displayName)||void 0===Y||null===(J=Y.toUpperCase())||void 0===J?void 0:J.replace(/[ -]/g,"_"),o=null===(K=e[t])||void 0===K||null===($=K.toUpperCase())||void 0===$?void 0:$.replace(/[ -]/g,"_");var ee,te,ne,oe;-1===X[e[t]][0].path.indexOf(".")?Q.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;z.push(null===(n=X[e[t]][0])||void 0===n?void 0:n.navigationURL),V()}}}):Q.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 m({},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=Q.findIndex(e=>"HOME"===e.element),n=Q.splice(t,1),o=Q.findIndex(e=>"LANGUAGE"===e.element),l=Q.splice(o,(null===(q=Q)||void 0===q?void 0:q.length)-o);Q.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])&&Q.splice(0,0,n[0]),Q=(null==l?void 0:l.length)>0?Q.concat(l):Q}else{var le,ae;null===(le=Object.keys(g))||void 0===le||null===(ae=le.sort((e,t)=>t.localeCompare(e)))||void 0===ae||ae.map(e=>{var t,n,o,l,a,r;"digit-ui-links"===(null===(t=g[e][0])||void 0===t?void 0:t.sidebar)&&Q.splice(1,0,{type:null!==(n=g[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:g[e],icon:null===(a=g[e][0])||void 0===a?void 0:a.leftIcon,link:null===(r=g[e][0])||void 0===r?void 0:r.sidebarURL})})}z.location.pathname.includes("/openlink")&&(Q=Q.filter(e=>"LANGUAGE"===e.element)),Q=null===(a=Q)||void 0===a?void 0:a.map(e=>m({},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 re="";var ie;re=Digit.Utils.getMultiRootTenant()?H("TENANT_TENANTS_"+F):H("TENANT_TENANTS_"+(null===(ie=G(Digit.ULBService.getCurrentTenantId(),".","_"))||void 0===ie?void 0:ie.toUpperCase()));const se=null===(r=Q)||void 0===r?void 0:r.map(e=>{var t;return"dynamic"===(null==e?void 0:e.type)?m({},e,{children:null==e||null===(t=e.links)||void 0===t?void 0:t.map(e=>m({},e,{label:null==e?void 0:e.displayName,icon:null==e?void 0:e.leftIcon}))}):e}),ce=null==L?void 0:L.map(e=>m({},e,{type:"custom",key:"city"})),ue=null==O?void 0:O.map(e=>m({},e,{type:"custom",key:"language",icon:"Language"})),de=[{label:"HOME",value:"HOME",icon:"Home",type:"custom",key:"home"},{label:re,value:re,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.Hamburger,{items:de,profileName:null==I||null===(c=I.info)||void 0===c?void 0:c.name,profileNumber:null==I||null===(u=I.info)||void 0===u?void 0:u.mobileNumber,theme:"dark",transitionDuration:.3,styles:{marginTop:"64px",height:"93%"},onLogout:v,hideUserManuals:!0,profile:N||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)W(null==t?void 0:t.navigationURL);else if(null!=t&&t.link)W(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":z.push(f?"/"+(null===(o=window)||void 0===o?void 0:o.contextPath)+"/employee":"/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/citizen"),p();break;case"editProfile":y(),p();break;case"language":k((n=t).value),Digit.LocalizationService.changeLanguage(n.value,w.code),p();break;case"city":(e=>{var t,n,o,l;const a=Digit.SessionStorage.get("citizen.userRequestObject"),r=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==r?void 0:r.length)>0&&(a.info.roles=r,a.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(a),A(e),window.location.href.includes("/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/employee/")){var i,s;const e=(null===(i=location.state)||void 0===i?void 0:i.from)||"/"+(null===(s=window)||void 0===s?void 0:s.contextPath)+"/employee";z.replace(e)}window.location.reload()})(t),p()}}var n,o,l})({item:t,index:n,parentIndex:o})}}):o.createElement(Ae,{logout:v})};var Re=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(v(function(e,t){var n;n=e=>(()=>{var t={"./node_modules/css-mediaquery/index.js":(e,t)=>{t.match=function(e,t){return i(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,a=t[n];if(!a)return!1;switch(n){case"orientation":case"scan":return a.toLowerCase()===l.toLowerCase();case"width":case"height":case"device-width":case"device-height":l=u(l),a=u(a);break;case"resolution":l=c(l),a=c(a);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":l=s(l),a=s(a);break;case"grid":case"color":case"color-index":case"monochrome":l=parseInt(l,10)||1,a=parseInt(a,10)||0}switch(o){case"min":return a>=l;case"max":return a<=l;default:return a===l}});return l&&!n||!l&&n})},t.parse=i;var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,o=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,l=/^(?:(min|max)-)?(.+)/,a=/(em|rem|px|cm|mm|in|pt|pc)?$/,r=/(dpi|dpcm|dppx)?$/;function i(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(n),a=t[1],r=t[2],i=t[3]||"",s={};return s.inverse=!!a&&"not"===a.toLowerCase(),s.type=r?r.toLowerCase():"all",i=i.match(/\([^\)]+\)/g)||[],s.expressions=i.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(r)[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(a)[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:()=>i});var o=/[A-Z]/g,l=/^ms-/,a={};function r(e){return"-"+e.toLowerCase()}const i=function(e){if(a.hasOwnProperty(e))return a[e];var t=e.replace(o,r);return a[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 a(e,t,n){var a=this;if(l&&!n){var r=l.call(window,e);this.matches=r.matches,this.media=r.media,r.addListener(i)}else this.matches=o(e,t),this.media=e;function i(e){a.matches=e.matches,a.media=e.media}this.addListener=function(e){r&&r.addListener(e)},this.removeListener=function(e){r&&r.removeListener(e)},this.dispose=function(){r&&r.removeListener(i)}}e.exports=function(e,t,n){return new a(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,a){for(var r,i,s=l(e),c=1;c<arguments.length;c++){for(var u in r=Object(arguments[c]))n.call(r,u)&&(s[u]=r[u]);if(t){i=t(r);for(var d=0;d<i.length;d++)o.call(r,i[d])&&(s[i[d]]=r[i[d]])}}return s}},"./node_modules/prop-types/checkPropTypes.js":(e,t,n)=>{var o,l=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),a={},r=n("./node_modules/prop-types/lib/has.js");function i(e,t,n,i,s){for(var c in e)if(r(e,c)){var u;try{if("function"!=typeof e[c]){var d=Error((i||"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,i,n,null,l)}catch(e){u=e}if(!u||u instanceof Error||o((i||"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 a)){a[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){}},i.resetWarningCache=function(){a={}},e.exports=i},"./node_modules/prop-types/factoryWithTypeCheckers.js":(e,t,n)=>{var o,l=n("./node_modules/react-is/index.js"),a=n("./node_modules/object-assign/index.js"),r=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),i=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,a){if("function"!=typeof e)return new m("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var i=t[n];if(!Array.isArray(i))return new m("Invalid "+l+" `"+a+"` of type `"+E(i)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<i.length;s++){var c=e(i,s,o,l,a+"["+s+"]",r);if(c instanceof Error)return c}return null})},element:p(function(t,n,o,l,a){var r=t[n];return e(r)?null:new m("Invalid "+l+" `"+a+"` of type `"+E(r)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:p(function(e,t,n,o,a){var r=e[t];return l.isValidElementType(r)?null:new m("Invalid "+o+" `"+a+"` of type `"+E(r)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return p(function(t,n,o,l,a){var r;return t[n]instanceof e?null:new m("Invalid "+l+" `"+a+"` of type `"+((r=t[n]).constructor&&r.constructor.name?r.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,a){if("function"!=typeof e)return new m("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var s=t[n],c=E(s);if("object"!==c)return new m("Invalid "+l+" `"+a+"` of type `"+c+"` supplied to `"+o+"`, expected an object.");for(var u in s)if(i(s,u)){var d=e(s,u,o,l,a+"."+u,r);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,a){for(var r=t[n],i=0;i<e.length;i++)if(d(r,e[i]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===y(t)?String(t):t});return new m("Invalid "+l+" `"+a+"` of value `"+String(r)+"` 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,a){for(var s=[],c=0;c<e.length;c++){var u=(0,e[c])(t,n,o,l,a,r);if(null==u)return null;u.data&&i(u.data,"expectedType")&&s.push(u.data.expectedType)}return new m("Invalid "+l+" `"+a+"` supplied to `"+o+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")})},shape:function(e){return p(function(t,n,o,l,a){var i=t[n],s=E(i);if("object"!==s)return new m("Invalid "+l+" `"+a+"` 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,a,c,y(u));var d=u(i,c,o,l,a+"."+c,r);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=a({},t[n],e);for(var p in d){var v=e[p];if(i(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,r);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 a(a,i,s,c,u,d,p){if(c=c||"<<anonymous>>",d=d||s,p!==r){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==i[s]?a?new m(null===i[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(i,s,c,u,d)}var i=a.bind(null,!1);return i.isRequired=a.bind(null,!0),i}function v(e){return p(function(t,n,o,l,a,r){var i=t[n];return E(i)!==e?new m("Invalid "+l+" `"+a+"` of type `"+y(i)+"` 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,a=o.call(t);if(o!==t.entries){for(;!(l=a.next()).done;)if(!g(l.value))return!1}else for(;!(l=a.next()).done;){var r=l.value;if(r&&!g(r[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,a=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=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 b(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 r:case a:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case i:return g;default:return t}}case o:return t}}}var S=u,N=s,C=i,O=n,w=d,I=l,_=f,D=v,T=o,A=r,L=a,R=m,P=!1;function x(e){return b(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=N,t.ContextProvider=C,t.Element=O,t.ForwardRef=w,t.Fragment=I,t.Lazy=_,t.Memo=D,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)||b(e)===c},t.isConcurrentMode=x,t.isContextConsumer=function(e){return b(e)===s},t.isContextProvider=function(e){return b(e)===i},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===l},t.isLazy=function(e){return b(e)===f},t.isMemo=function(e){return b(e)===v},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===r},t.isStrictMode=function(e){return b(e)===a},t.isSuspense=function(e){return b(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===r||e===a||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===i||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=b}()},"./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 a=0;a<l;a++){var r=n[a];if(e[r]!==t[r]||!Object.prototype.hasOwnProperty.call(t,r))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 a=l(n("./src/useMediaQuery.ts"));t.default=function(e){var t=e.children,n=e.device,l=e.onChange,r=o(e,["children","device","onChange"]),i=(0,a.default)(r,n,l);return"function"==typeof t?t(i):i?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 a=o(n("./src/Component.ts"));t.default=a.default;var r=o(n("./src/toQuery.ts"));t.toQuery=r.default;var i=o(n("./src/Context.ts"));t.Context=i.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},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=a(n("./node_modules/prop-types/index.js")),i=r.default.oneOfType([r.default.string,r.default.number]),s={all:r.default.bool,grid:r.default.bool,aural:r.default.bool,braille:r.default.bool,handheld:r.default.bool,print:r.default.bool,projection:r.default.bool,screen:r.default.bool,tty:r.default.bool,tv:r.default.bool,embossed:r.default.bool},c={orientation:r.default.oneOf(["portrait","landscape"]),scan:r.default.oneOf(["progressive","interlace"]),aspectRatio:r.default.string,deviceAspectRatio:r.default.string,height:i,deviceHeight:i,width:i,deviceWidth:i,color:r.default.bool,colorIndex:r.default.bool,monochrome:r.default.bool,resolution:i,type:Object.keys(s)},u=l(c,["type"]),d=o({minAspectRatio:r.default.string,maxAspectRatio:r.default.string,minDeviceAspectRatio:r.default.string,maxDeviceAspectRatio:r.default.string,minHeight:i,maxHeight:i,minDeviceHeight:i,maxDeviceHeight:i,minWidth:i,maxWidth:i,minDeviceWidth:i,maxDeviceWidth:i,minColor:r.default.number,maxColor:r.default.number,minColorIndex:r.default.number,maxColorIndex:r.default.number,minMonochrome:r.default.number,maxMonochrome:r.default.number,minResolution:i,maxResolution:i},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")),a=o(n("./src/mediaQuery.ts"));t.default=function(e){var t=[];return Object.keys(a.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"),a=o(n("./node_modules/matchmediaquery/index.js")),r=o(n("./node_modules/hyphenate-style-name/index.js")),i=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,r.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),a=o[0],r=o[1];return(0,l.useEffect)(function(){var e=n();(0,i.shallowEqualObjects)(a,e)||r(e)},[e,t]),a}(t),r=function(e){var t=function(){return function(e){return e.query||(0,s.default)(e)}(e)},n=(0,l.useState)(t),o=n[0],a=n[1];return(0,l.useEffect)(function(){var e=t();o!==e&&a(e)},[e]),o}(e);if(!r)throw new Error("Invalid or missing MediaQuery!");var m=function(e,t){var n=function(){return(0,a.default)(e,t||{},!!t)},o=(0,l.useState)(n),r=o[0],i=o[1],s=d();return(0,l.useEffect)(function(){if(s){var e=n();return i(e),function(){e&&e.dispose()}}},[e,t]),r}(r,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 a=n[e]={exports:{}};return t[e].call(a.exports,a,a.exports,o),a.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 Pe=()=>{const{isLoading:e,data:n}=Digit.Hooks.useAccessControl(),a=Digit.Utils.getMultiRootTenant(),{t:r}=l.useTranslation(),s=i.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:r(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:r(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(Re,{minWidth:768},o.createElement(t.SideNav,{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;if(void 0===e&&(e={}),void 0===t&&(t=""),t&&"/"!==t)if(/^https?:\/\//i.test(t))window.open(t,"_blank","noopener,noreferrer");else if(t.includes("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)))e.push(t);else{const n=window.location.origin;let l;if(a){var o;const n=(null===(o=window)||void 0===o?void 0:o.contextPath)||"sandbox-ui";l=t=t.replace("/"+n+"/employee","/"+n+"/"+c+"/employee"),e.push(l)}else l=n+t,window.location.href=l}}(s,null==t?void 0:t.navigationUrl)})({item:t,index:n,parentIndex:o})},theme:"dark",variant:"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}})):""},xe=e=>{let{CITIZEN:t,isSidebarOpen:n,toggleSidebar:l,handleLogout:a,mobileView:r,userDetails:i,modules:s,linkData:c,islinkDataLoading:u,userProfile:d}=e;return t?o.createElement(Le,{isOpen:n,isMobile:!0,toggleSidebar:l,onLogout:a,linkData:c,islinkDataLoading:u,userProfile:d,isEmployee:!1}):!n&&null!=i&&i.access_token?o.createElement("div",{className:"digit-employeeSidebar"},o.createElement(Pe,{mobileView:r,userDetails:i,modules:s})):o.createElement("div",{className:"digit-citizenSidebar"},o.createElement(Le,{isOpen:n,isMobile:!0,toggleSidebar:l,onLogout:a,isEmployee:!0,userProfile:d}))},Me=e=>{let{t:t,stateInfo:l,userDetails:a,CITIZEN:r,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=i.useHistory(),[b,S]=n.useState(!1),N=()=>{y(!1),S(!0)},C=()=>{S(!1)},O=()=>{y(!E)},w=()=>{var e,t;h.push(r?"/"+(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:w},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:N}];return o.createElement(o.Fragment,null,o.createElement(we,{t:t,stateInfo:l,toggleSidebar:O,isSidebarOpen:E,handleLogout:N,userDetails:a,CITIZEN:r,cityDetails:s,mobileView:c,userOptions:I,handleUserDropdownSelection:u,logoUrl:d,logoUrlWhite:m,showLanguageChange:v}),b&&o.createElement(_e,{onSelect:()=>{Digit.UserService.logout(),S(!1)},onCancel:C,onDismiss:C}),r?r?p&&E&&o.createElement(xe,{t:t,CITIZEN:r,isSidebarOpen:E,toggleSidebar:O,handleLogout:N,mobileView:c,userDetails:a,linkData:f,userProfile:w,islinkDataLoading:g}):null:p&&o.createElement(xe,{t:t,CITIZEN:r,isSidebarOpen:E,toggleSidebar:O,handleLogout:N,mobileView:c,userDetails:a,linkData:f,userProfile:w,islinkDataLoading:g}))},ke=e=>{const{question:t,answer:a,lastIndex:r}=e,[i,s]=n.useState(!1),{t:u}=l.useTranslation();return o.createElement("div",{className:"faqs border-none",onClick:()=>s(!i)},o.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},o.createElement("span",null,u(t)),o.createElement("span",{className:i?"faqicon rotate":"faqicon",style:{float:"right"}},o.createElement(c.ArrowForward,null))),o.createElement("div",{className:"faq-answer",style:i?{display:"block"}:{display:"none"}},o.createElement("span",null,u(a))),r?null:o.createElement("div",{className:"cs-box-border"}))},Ue=e=>{var a,r,i;let{module:s}=e;const c=Digit.UserService.getUser(),{t:u}=((null==c||null===(a=c.info)||void 0===a?void 0:a.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation()),{isLoading:d,data:m}=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),p=null==m||null===(r=m.MdmsRes["common-masters"])||void 0===r||null===(i=r.faqs[0])||void 0===i?void 0:i[""+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.HeaderComponent,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},u("FAQ_S"))),o.createElement("div",{className:"faq-list"},p.map((e,t)=>o.createElement(ke,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==p?void 0:p.length)-1})))))},Be=()=>{var e,t,n,a,r,c,u,d,p,v,f,g,E,y,h,b,S,N,C,O,w,I,_,D,T,A,L;const{t:R}=l.useTranslation(),P=i.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:j,isLoading:F}=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 z=null==M?void 0:M.appBannerDesktop,G=null==M?void 0:M.appBannerMobile,V=null==M?void 0:M.citizenServicesCard,W=null==M?void 0:M.informationAndUpdatesCard,Q=null==M?void 0:M.whatsAppBannerDesktop,X=null==M?void 0:M.whatsAppBannerMobile,q=null==M?void 0:M.whatsNewSection,Z=null==M?void 0:M.redirectURL;var Y,J;Z&&P.push("/"+(null===(Y=window)||void 0===Y?void 0:Y.contextPath)+"/citizen/"+Z),(null!==(e=window)&&void 0!==e&&null!==(t=e.location)&&void 0!==t&&null!==(n=t.href)&&void 0!==n&&null!==(a=n.includes)&&void 0!==a&&a.call(n,"sanitation-ui")||null!==(r=window)&&void 0!==r&&null!==(c=r.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===(J=window)||void 0===J?void 0:J.contextPath)+"/citizen/all-services");const K=e=>{window.open(null==e?void 0:e.navigationUrl)},$={header:R(null==V?void 0:V.headerLabel),sideOption:{name:R(null==V||null===(p=V.sideOption)||void 0===p?void 0:p.name),onClick:()=>{var e;return P.push(null==V||null===(e=V.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:R(null==V||null===(v=V.props)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.label),Icon:o.createElement(s.ComplaintIcon,null),onClick:()=>{var e,t;return P.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==V||null===(g=V.props)||void 0===g||null===(E=g[1])||void 0===E?void 0:E.label),Icon:o.createElement(s.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return P.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==V||null===(y=V.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==V||null===(e=V.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==V||null===(b=V.props)||void 0===b||null===(S=b[3])||void 0===S?void 0:S.label),Icon:o.createElement(s.OBPSIcon,null),onClick:()=>{var e,t;return P.push(null==V||null===(e=V.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==W?void 0:W.headerLabel),sideOption:{name:R(null==W||null===(N=W.sideOption)||void 0===N?void 0:N.name),onClick:()=>{var e;return P.push(null==W||null===(e=W.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:R(null==W||null===(C=W.props)||void 0===C||null===(O=C[0])||void 0===O?void 0:O.label),Icon:o.createElement(s.HomeIcon,null),onClick:()=>{var e,t;return P.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==W||null===(w=W.props)||void 0===w||null===(I=w[1])||void 0===I?void 0:I.label),Icon:o.createElement(s.Calender,null),onClick:()=>{var e,t;return P.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==W||null===(_=W.props)||void 0===_||null===(D=_[2])||void 0===D?void 0:D.label),Icon:o.createElement(s.DocumentIcon,null),onClick:()=>{var e,t;return P.push(null==W||null===(e=W.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:R(null==W||null===(T=W.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==W||null===(e=W.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(le,U?{src:null==G?void 0:G.bannerUrl,alt:"Banner Image"}:{src:null==z?void 0:z.bannerUrl,alt:"Banner Image"}),o.createElement("div",{className:"ServicesSection"},o.createElement(s.CardBasedOptions,m({style:{marginTop:"-30px"}},$)),o.createElement(s.CardBasedOptions,m({style:U?{}:{marginTop:"-30px"}},ee)))),(X||Q)&&o.createElement("div",{className:"WhatsAppBanner"},o.createElement(le,U?{src:null==X?void 0:X.bannerUrl,onClick:()=>K(X),alt:"Whatsapp Banner"}:{src:null==Q?void 0:Q.bannerUrl,onClick:()=>K(Q),alt:"Whatsapp Banner"})),B()?F?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==j?void 0:j[0])):null))},je=()=>{const{t:e}=l.useTranslation(),t=i.useHistory(),{data:{languages:a,stateInfo:r}={},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:a,optionsKey:"label",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:e=>Digit.LocalizationService.changeLanguage(e.value,r.code),selectedOption:null==a?void 0:a.filter(e=>e.value===u)[0]}),[u,a]);return c?o.createElement(s.Loader,null):o.createElement("div",{className:"selection-card-wrapper"},o.createElement(s.PageBasedInput,{texts:d,onSubmit:function(){var e;t.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/citizen/login")}},o.createElement(s.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),o.createElement(s.RadioButtons,m)))},Fe=()=>{const{t:e}=l.useTranslation(),a=i.useHistory(),r=i.useLocation(),{data:{uiHomePage:c}={}}=Digit.Hooks.useStore.getInitData(),u=null==c?void 0:c.redirectURL,{data:d,isLoading:p}=Digit.Hooks.useTenants(),[v,f]=n.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[g,E]=n.useState(!1),y=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function h(e){f(e),E(!1)}const b=n.useMemo(()=>({options:d,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:h,selectedOption:v}),[d,e,v]);return p?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(v){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",v);const o=null===(e=r.state)||void 0===e?void 0:e.redirectBackTo;var t,n;u?a.push("/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/citizen/"+u):o?a.replace(o):a.push("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/citizen")}else E(!0)},className:"location-selection-container"},o.createElement(s.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),o.createElement(s.SearchOnRadioButtons,m({},b,{placeholder:e("COMMON_TABLE_SEARCH")})),g?o.createElement(s.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},He=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{ze(o,1,e(this.v))}catch(e){ze(o,2,e)}return o}return this}return this.o=function(e){try{const l=e.v;1&e.s?ze(o,1,t?t(l):l):n?ze(o,1,n(l)):ze(o,2,l)}catch(e){ze(o,2,e)}},o},e}();function ze(e,t,n){if(!e.s){if(n instanceof He){if(!n.s)return void(n.o=ze.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(ze.bind(null,e,t),ze.bind(null,e,2));e.s=t,e.v=n;const o=e.o;o&&o(e)}}function Ge(e){return e instanceof He&&1&e.s}const Ve="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function We(e,t,n){if("function"==typeof e[Ve]){var o,l,a,r=e[Ve]();if(function e(i){try{for(;!((o=r.next()).done||n&&n());)if((i=t(o.value))&&i.then){if(!Ge(i))return void i.then(e,a||(a=ze.bind(null,l=new He,2)));i=i.v}l?ze(l,1,i):l=i}catch(e){ze(l||(l=new He),2,e)}}(),r.return){var i=function(e){try{o.done||r.return()}catch(e){}return e};if(l&&l.then)return l.then(i,function(e){throw i(e)});i()}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,a=-1;return function r(i){try{for(;++a<e.length&&(!n||!n());)if((i=t(a))&&i.then){if(!Ge(i))return void i.then(r,l||(l=ze.bind(null,o=new He,2)));i=i.v}o?ze(o,1,i):o=i}catch(e){ze(o||(o=new He),2,e)}}(),o}(s,function(e){return t(s[e])},n)}function Qe(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function Xe(e){let{setProfilePic:t,closeDrawer:a,userType:r,removeProfilePic:i,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=Qe(function(){return Promise.resolve(Digit.UploadServices.Filestorage(r+"-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,a;const n=null==e||null===(l=e.data)||void 0===l||null===(a=l.files[0])||void 0===a?void 0:a.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:()=>a()}),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"===r?"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:()=>{i(),a()}},o.createElement(s.RemoveIcon,null)),o.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}var qe,Ze,Ye;"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Je={tenantId:""+(null===(qe=Digit)||void 0===qe||null===(Ze=qe.ULBService)||void 0===Ze||null===(Ye=Ze.getStateId)||void 0===Ye?void 0:Ye.call(Ze)),UserProfileValidationConfig:[{name:"/^[a-zA-Z ]+$/i",mobileNumber:"/^[6-9]{1}[0-9]{9}$/",password:"/^([a-zA-Z0-9@#$%]{8,15})$/i"}]},Ke=e=>{var a,r,c,u,d,p,v,f,g,E,y,h,b,S,N,C,O,w,I,_,D,T,A,L,R,P,x,M,k,U,B,j,F,H,z,G;let{stateCode:V,userType:W,cityDetails:Q}=e;i.useHistory();const{t:X}=l.useTranslation(),q=window.location.href,Z=Digit.ULBService.getStateId(),Y=Digit.ULBService.getCurrentTenantId(),J=(null===(a=Digit.UserService.getUser())||void 0===a?void 0:a.info)||{},[K,$]=n.useState(null),[ee,te]=n.useState(null!=J&&J.name?J.name:""),[ne,oe]=n.useState(null!=J&&J.emailId?J.emailId:""),[ae,re]=n.useState(null==K?void 0:K.gender),[ie,se]=n.useState(null!=J&&J.permanentCity?J.permanentCity:Q.name),[ce,ue]=n.useState(null!=J&&J.mobileNumber?J.mobileNumber:""),[de,me]=n.useState(null),[pe,ve]=n.useState(""),[fe,ge]=n.useState(!1),[Ee,ye]=n.useState(!1),[he,be]=n.useState(""),[Se,Ne]=n.useState(""),[Ce,Oe]=n.useState(""),[we,Ie]=n.useState(null),[_e,De]=n.useState(!1),[Te,Ae]=o.useState(window.innerWidth),[Le,Re]=o.useState({}),Pe=window.Digit.Utils.browser.isMobile(),xe=Digit.Utils.getMultiRootTenant(),Me=e=>{var t;return(null==e||null===(t=e.UserProfileValidationConfig)||void 0===t?void 0:t[0])&&Object.entries(null==e?void 0:e.UserProfileValidationConfig[0]).reduce((e,t)=>{let[n,o]=t;if("string"==typeof o)try{if(o.startsWith("/")&&o.lastIndexOf("/")>0){const t=o.lastIndexOf("/"),l=o.slice(1,t),a=o.slice(t+1);e[n]=new RegExp(l,a)}else e[n]=new RegExp(o)}catch(t){console.error('Error parsing regex for key "'+n+'":',t),e[n]=o}else e[n]=o;return e},{})},[ke,Ue]=n.useState(Me(Je)||{}),{data:Be,isValidationConfigLoading:je}=Digit.Hooks.useCustomMDMS(V,"commonUiConfig",[{name:"UserProfileValidationConfig"}],{select:e=>null==e?void 0:e.commonUiConfig});n.useEffect(()=>{var e;if(Be&&null!=Be&&null!==(e=Be.UserProfileValidationConfig)&&void 0!==e&&e[0]){const e=Me(Be);Ue(e)}},[Be]),o.useEffect(()=>(window.addEventListener("resize",()=>Ae(window.innerWidth)),()=>{window.removeEventListener("resize",()=>Ae(window.innerWidth))})),n.useEffect(()=>{var e;De(!0),function(){try{const e=null==J?void 0:J.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(Y,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&$(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),re({i18nKey:void 0,code:null==K?void 0:K.gender,value:null==K?void 0:K.gender});const t=null==K||null===(e=K.photo)||void 0===e?void 0:e.split(",");ve(null==t?void 0:t.at(0)),De(!1)},[null!==K]);let Fe={};const He=e=>re(e),ze=()=>ge(!1),Ge=e=>{var t;te(e),null==ke||null===(t=ke.name)||void 0===t||!t.test(e)||0===e.length||e.length>50?Re(m({},Le,{userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}})):Re(m({},Le,{userName:null}))},Ve=e=>{(null==J?void 0:J.userName)!==e?(oe(e),!e.length||e.includes("@")&&e.includes(".")?Re(m({},Le,{emailAddress:null})):Re(m({},Le,{emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}}))):Re(m({},Le,{emailAddress:null}))},We=function(e,t,n){void 0===n&&(n=5e3),Ie({key:e,action:t}),setTimeout(()=>{Ie(null)},n)},qe=function(){try{let t=!1;function e(e){if(t)return e;De(!1)}De(!0);const n=Qe(function(){const e=m({},J,{name:ee,gender:null==ae?void 0:ae.value,emailId:ne,photo:de});if(ee&&te(e=>e.trim()),null==ke||!ke.name.test(ee)||""===ee||ee.length>50||ee.length<1)throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===W&&(null==ke||!ke.mobileNumber.test(ce)))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(ne.length&&(!ne.includes("@")||!ne.includes(".")))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_EMAIL_INVALID")});const t=he.trim(),n=Se.trim(),o=Ce.trim();if(be(t),Ne(n),Oe(o),Ee&&t&&n&&o){if(n!==o)throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(t.length&&n.length&&o.length))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!(null!=ke&&ke.password.test(n)||null!=ke&&ke.password.test(o)))throw JSON.stringify({type:"error",message:X("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}return Promise.resolve(Digit.UserService.updateUser(e,V)).then(function(e){let{responseInfo:t}=e;if(t&&"200"===t.status){const e=Digit.UserService.getUser();e&&Digit.UserService.setUser(m({},e,{info:m({},e.info,{name:ee,mobileNumber:ce,emailId:ne,permanentCity:ie})}))}return function(){if(he.length&&Se.length&&Ce.length){const e={existingPassword:he,newPassword:Se,tenantId:Y,type:"EMPLOYEE",username:null==J?void 0:J.userName,confirmPassword:Ce};return function(){if(Se===Ce)return Qe(function(){return Promise.resolve(Digit.UserService.changePassword(e,Y)).then(function(e){const{responseInfo:t}=e;if(null==t||!t.status||"200"!==t.status)throw"";We("success",X("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&&We("success",X("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){const t=JSON.parse(e);We(t.type,X(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}};let Ze=[];const{data:Ye}=Digit.Hooks.useGenderMDMS(Z,"common-masters","GenderType");return Ye&&Ye.map(e=>{Ze.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),_e||je?o.createElement(t.Loader,null):o.createElement("div",{className:"user-profile "+("citizen"===W?"citizen":"employee")},o.createElement("section",{style:{margin:"citizen"===W||Pe?"8px":"0px"}},"citizen"===W||Pe?o.createElement(t.BackLink,{onClick:()=>window.history.back()}):o.createElement(t.BreadCrumb,{style:{marginTop:"0rem",marginBottom:"1.5rem"},crumbs:[{internalLink:xe?"/"+(null===(r=window)||void 0===r?void 0:r.contextPath)+"/employee/sandbox/landing":"/"+(null===(c=window)||void 0===c?void 0:c.contextPath)+"/employee",content:X("ES_COMMON_HOME"),show:!0},{internalLink:"/"+(null===(u=window)||void 0===u?void 0:u.contextPath)+"/employee/user/profile",content:X("ES_COMMON_PAGE_1"),show:q.includes("/user/profile")}]})),o.createElement("div",{style:{display:"flex",flex:1,flexDirection:Te<768||"citizen"===W?"column":"row",margin:"citizen"===W?"8px":"0px",gap:"citizen"===W?"":"0 24px",boxShadow:"citizen"===W?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===W?"white":"",borderRadius:"citizen"===W?"4px":"",maxWidth:"citizen"===W?"960px":""}},o.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===W?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===W?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===W?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===W?"8px":"16px"}},o.createElement("div",{style:{position:"relative",height:"citizen"===W?"114px":"150px",width:"citizen"===W?"114px":"150px",margin:"16px"}},o.createElement(le,{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:pe&&""!==pe?pe:"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",alt:"Profile Image"}),o.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>ge(!fe)},o.createElement(s.CameraIcon,null)))),o.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===W?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===W?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===W?"8px":"24px",paddingBottom:"20px"}},"citizen"===W?o.createElement(o.Fragment,null,o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+X("CORE_COMMON_PROFILE_NAME"),"*"),o.createElement("div",{style:{width:"100%",maxWidth:"960px"}},o.createElement(t.TextInput,m({t:X,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:ee,onChange:e=>Ge(e.target.value)},Fe={isRequired:!0,pattern:(null==Be||null===(d=Be.UserProfileValidationConfig)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.name)||(null==Je||null===(v=Je.UserProfileValidationConfig)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.name),type:"tel",title:X("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==Le?void 0:Le.userName)&&o.createElement(t.ErrorMessage,{message:X(null==Le||null===(g=Le.userName)||void 0===g?void 0:g.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+X("CORE_COMMON_PROFILE_GENDER")),o.createElement(t.Dropdown,{style:{width:"100%",fontSize:"1rem"},className:"form-field profileDropdown",selected:1===(null==ae?void 0:ae.length)?ae[0]:ae,disable:1===(null==ae?void 0:ae.length)||!1,option:Ze,select:He,value:ae,optionKey:"code",t:X,name:"gender"})),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"user-profile",style:{}},""+X("CORE_COMMON_PROFILE_EMAIL")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:X,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:ne,onChange:e=>Ve(e.target.value),disabled:!1}),(null==Le?void 0:Le.emailAddress)&&o.createElement(t.ErrorMessage,{message:X(null==Le||null===(E=Le.emailAddress)||void 0===E?void 0:E.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement("button",{onClick:qe,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Pe?"100%":"240px",borderBottom:"1px solid black"}},X("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"}},""+X("CORE_COMMON_PROFILE_NAME"),"*"),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,m({t:X,type:"text",isMandatory:!1,name:"name",value:ee,onChange:e=>Ge(e.target.value),placeholder:"Enter Your Name"},Fe={isRequired:!0,pattern:(null==Be||null===(y=Be.UserProfileValidationConfig)||void 0===y||null===(h=y[0])||void 0===h?void 0:h.name)||(null==Je||null===(b=Je.UserProfileValidationConfig)||void 0===b||null===(S=b[0])||void 0===S?void 0:S.name),type:"text",title:X("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disabled:!1})),(null==Le?void 0:Le.userName)&&o.createElement(t.ErrorMessage,{message:X(null==Le||null===(N=Le.userName)||void 0===N?void 0:N.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"}},""+X("CORE_COMMON_PROFILE_GENDER")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.Dropdown,{className:"profileDropdown",selected:1===(null==ae?void 0:ae.length)?ae[0]:ae,disable:1===(null==ae?void 0:ae.length)||!1,option:Ze,select:He,value:ae,optionKey:"code",t:X,name:"gender"}))),o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+X("CORE_COMMON_PROFILE_CITY")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,m({t:X,type:"text",isMandatory:!1,name:"city",value:X(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+Y)),onChange:e=>se(e.target.value),placeholder:"Enter Your City Name"},Fe={isRequired:!0,type:"text",title:X("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"}},X("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),o.createElement("div",{style:{width:"100%"}},o.createElement(t.MobileNumber,{value:ce,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{var t;ue(e),"employee"!==W||null!=ke&&null!==(t=ke.mobileNumber)&&void 0!==t&&t.test(e)?Re(m({},Le,{mobileNumber:null})):Re(m({},Le,{mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}}))})(e),disable:!Digit.Utils.getMultiRootTenant(),required:!0,pattern:(null==Be||null===(C=Be.UserProfileValidationConfig)||void 0===C||null===(O=C[0])||void 0===O?void 0:O.mobileNumber)||(null==Je||null===(w=Je.UserProfileValidationConfig)||void 0===w||null===(I=w[0])||void 0===I?void 0:I.mobileNumber),type:"tel",title:X("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==Le?void 0:Le.mobileNumber)&&o.createElement(t.ErrorMessage,{message:X(null==Le||null===(_=Le.mobileNumber)||void 0===_?void 0:_.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"}},""+X("CORE_COMMON_PROFILE_EMAIL")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:X,type:"email",isMandatory:!1,placeholder:X("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:ne,onChange:e=>Ve(e.target.value),disabled:!!Digit.Utils.getMultiRootTenant()}),(null==Le?void 0:Le.emailAddress)&&o.createElement(t.ErrorMessage,{message:X(null==Le||null===(D=Le.emailAddress)||void 0===D?void 0:D.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),o.createElement(t.LabelFieldPair,null,o.createElement("div",{style:{width:"100%"}},0!=Ee||Digit.Utils.getOTPBasedLogin()?null:o.createElement(t.Button,{label:X("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>ye(!Ee),style:{paddingLeft:"20rem"}}),Ee?o.createElement("div",{style:{marginTop:"10px"}},o.createElement(t.LabelFieldPair,{style:{display:"flex"}},o.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+X("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:X,type:"password",isMandatory:!1,name:"name",pattern:(null==Be||null===(T=Be.UserProfileValidationConfig)||void 0===T||null===(A=T[0])||void 0===A?void 0:A.password)||(null==Je||null===(L=Je.UserProfileValidationConfig)||void 0===L||null===(R=L[0])||void 0===R?void 0:R.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,void(null!=ke&&ke.password.test(n)?Re(m({},Le,{currentPassword:null})):Re(m({},Le,{currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:!1}),(null==Le?void 0:Le.currentPassword)&&o.createElement(t.ErrorMessage,{message:X(null==Le||null===(P=Le.currentPassword)||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"}},""+X("CORE_COMMON_PROFILE_NEW_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:X,type:"password",isMandatory:!1,name:"name",pattern:(null==Be||null===(x=Be.UserProfileValidationConfig)||void 0===x||null===(M=x[0])||void 0===M?void 0:M.password)||(null==Je||null===(k=Je.UserProfileValidationConfig)||void 0===k||null===(U=k[0])||void 0===U?void 0:U.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,Ne(n),void(null!=ke&&ke.password.test(n)?Re(m({},Le,{newPassword:null})):Re(m({},Le,{newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:!1}),(null==Le?void 0:Le.newPassword)&&o.createElement(t.ErrorMessage,{message:X(null==Le||null===(B=Le.newPassword)||void 0===B?void 0:B.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"}},""+X("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),o.createElement("div",{style:{width:"100%"}},o.createElement(t.TextInput,{t:X,type:"password",isMandatory:!1,name:"name",pattern:(null==Be||null===(j=Be.UserProfileValidationConfig)||void 0===j||null===(F=j[0])||void 0===F?void 0:F.password)||(null==Je||null===(H=Je.UserProfileValidationConfig)||void 0===H||null===(z=H[0])||void 0===z?void 0:z.password),onChange:e=>{var t,n;return n=null==e||null===(t=e.target)||void 0===t?void 0:t.value,Oe(n),void(null!=ke&&ke.password.test(n)?Re(m({},Le,{confirmPassword:null})):Re(m({},Le,{confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})))},disabled:!1}),(null==Le?void 0:Le.confirmPassword)&&o.createElement(t.ErrorMessage,{message:X(null==Le||null===(G=Le.confirmPassword)||void 0===G?void 0:G.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})))):"")),"employee"===W&&Pe?o.createElement("button",{onClick:qe,style:{marginTop:"24px",backgroundColor:"#c84c0e",width:"100%",height:"40px",color:"white",maxWidth:Pe?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"}},X("CORE_COMMON_SAVE")):null))),"employee"!==W||Pe?null:o.createElement(t.Footer,{actionFields:[o.createElement(t.SubmitBar,{t:X,label:X("CORE_COMMON_SAVE"),onSubmit:qe})],className:"",setactionFieldsToRight:!0}),we&&o.createElement(t.Toast,{type:we.key,label:X("success"===we.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":we.action),onClose:()=>Ie(null),style:{maxWidth:"670px"}}),1==fe?o.createElement(Xe,{setProfilePic:function(e){try{function t(e){ve(null==e?void 0:e.thumbs[0]),ze()}return me(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],Z)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:ze,userType:W,removeProfilePic:()=>{me(null),ve(null)},showToast:We}):"")},$e=e=>{var a,r,i;let{module:c}=e;const u=Digit.UserService.getUser(),{t:d}=((null==u||null===(a=u.info)||void 0===a?void 0:a.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(""),b=()=>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:N}=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),C=null==N||null===(r=N.MdmsRes["common-masters"])||void 0===r||null===(i=r.howItWorks[0])||void 0===i?void 0:i[""+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.HeaderComponent,null,d(C.screenHeader?C.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)})))),C.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(b,null))),o.createElement("div",{className:"how-it-works-header-description"},o.createElement("h2",null,d(e.headerLabel)),o.createElement("p",null,d(e.description)))))),C.pdfHeader&&C.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(C.pdfHeader)),o.createElement("p",null,d(C.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"})))))},et=[{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]+)*$"}}]}],tt=e=>{var l,a;let{t:r,onSelect:i,mobileNumber:s,emailId:c,onMobileChange:u,onEmailChange:d,config:p,canSubmit:v}=e;const[f,g]=n.useState(!!c),[E,y]=n.useState(""),h=(null===(l=window)||void 0===l||null===(a=l.globalConfigs)||void 0===a?void 0:a.getConfig("CORE_MOBILE_CONFIGS"))||{},b=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,S=new RegExp((null==h?void 0:h.mobileNumberPattern)||"^\\d+$"),N=n.useMemo(()=>b.test(c),[c]),C=n.useMemo(()=>S.test(s||""),[s,S]),O=n.useMemo(()=>f?!(N&&v):!(C&&v),[f,N,C,v]),w=n.useMemo(()=>window.innerWidth<=768?r(f?"LOGIN_WITH_MOBILE":"LOGIN_WITH_EMAIL"):r(f?"CS_USE_MOBILE_INSTEAD":"CS_LOGIN_REGISTER_WITH_EMAIL"),[f,r]);return o.createElement(t.InputCard,{t:r,texts:null==p?void 0:p.texts,submit:!0,onNext:()=>{if(f){if(!N)return void y(r("ERR_INVALID_EMAIL"));i({userName:c})}else{if(!C)return void y(r("ERR_INVALID_MOBILE_NUMBER"));i({mobileNumber:s})}},isDisable:O},o.createElement("div",null,o.createElement(t.FieldV1,{key:f?"email":"mobile",withoutLabel:!0,charCount:!0,error:E,onChange:e=>{const t=e.target.value;y(""),f?(d(e),t&&!b.test(t)&&y(r("ERR_INVALID_EMAIL"))):(u(e),t&&!S.test(t)&&y(r("ERR_INVALID_MOBILE_NUMBER")))},placeholder:r(f?"ENTER_EMAIL_PLACEHOLDER":"ENTER_MOBILE_PLACEHOLDER"),populators:{name:f?"userName":"mobileNumber",prefix:f?"":null==h?void 0:h.mobilePrefix,validation:{maxlength:f?256:(null==h?void 0:h.mobileNumberLength)||10,pattern:f?b:S}},props:{fieldStyle:{width:"100%"}},type:"text",value:f?c:s})),o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"1.5rem",marginTop:"-24px"}},o.createElement(t.LinkLabel,{style:m({display:"inline"},{marginLeft:"0px",userSelect:"none",color:"inherit",cursor:"pointer",textDecoration:"underline"}),onClick:()=>{g(!f),y(""),f?d({target:{value:""}}):u({target:{value:""}})}},w)))},nt=e=>{let{config:n,onSelect:l,t:a,isDisabled:r}=e;return o.createElement(t.FormStep,{config:n,onSelect:l,t:a,isDisabled:r})};function ot(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 lt=e=>{let{config:l,otp:a,onOtpChange:r,onResend:i,onSelect:c,t:u,error:d,userType:m="citizen",canSubmit:p}=e;const[v,f]=n.useState(30);ot(()=>{f(v-1)},v>0?1e3:null);const g=()=>{i(),f(2)};return"employee"===m?o.createElement(n.Fragment,null,o.createElement(s.OTPInput,{length:6,onChange:r,value:a}),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==a?void 0:a.length)&&p)},o.createElement(s.OTPInput,{length:6,onChange:r,value:a}),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")))},at=["ResponseInfo","UserRequest"],rt=["ResponseInfo","UserRequest"];var it,st,ct;const ut={type:"register"},dt={type:"login"};let mt="/"+((null===(it=window)||void 0===it?void 0:it.contextPath)||(null===(st=window)||void 0===st||null===(ct=st.globalConfigs)||void 0===ct?void 0:ct.getConfig("CONTEXT_PATH")))+"/citizen";const pt=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||mt,vt=e=>{var a,r,s,c;let{stateCode:u,isUserRegistered:d=!0}=e;const{t:v}=l.useTranslation(),f=i.useLocation(),{path:g}=i.useRouteMatch(),E=i.useHistory(),[y,h]=n.useState(null),[b,S]=n.useState(null),[N,C]=n.useState(!0),[O,w]=n.useState(null),[I,_]=n.useState(d?{}:null==f||null===(a=f.state)||void 0===a?void 0:a.data),[D,T]=n.useState(null),A=Digit.Hooks.useQueryParams(),[L,R]=n.useState(!1),[P,x]=n.useState(!0),[M,k]=n.useState(!0),U=null===(r=window)||void 0===r||null===(s=r.globalConfigs)||void 0===s?void 0:s.getConfig("INDIVIDUAL_SERVICE_CONTEXT_PATH");n.useEffect(()=>{let e;return b&&(D&&(clearTimeout(D),T(null)),e=setTimeout(()=>{S("")},5e3),T(e)),()=>{e&&clearTimeout(e)}},[b]),n.useEffect(()=>{var e;if(!y)return;Digit.SessionStorage.set("citizen.userRequestObject",y),Digit.UserService.setUser(y),((e,t,n)=>{var o,l;if(Digit.Utils.getMultiRootTenant())return;let a=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",a),localStorage.setItem("Citizen.locale",a),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==y?void 0:y.info,null==y?void 0:y.access_token,u);const t=(null===(e=f.state)||void 0===e?void 0:e.from)||mt;var n;Digit.ULBService.getCitizenCurrentTenant()?E.replace(t):E.replace("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/citizen/select-location",{redirectBackTo:t})},[y]);const B=n.useMemo(()=>et.map(e=>{const t={};for(const n in e.texts)t[n]=v(e.texts[n]);return m({},e,{texts:t})},[et])),j=function(e){return Promise.resolve(Qe(function(){return Promise.resolve(Digit.UserService.sendOtp(e,u)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return o.createElement("div",{className:"citizen-form-wrapper"},o.createElement(i.Switch,null,o.createElement(t.AppContainer,null,f.pathname.includes("login")?null:o.createElement(t.BackLink,{onClick:()=>window.history.back()}),o.createElement(i.Route,{path:""+g,exact:!0},o.createElement(tt,{onSelect:function(e){try{k(!1),_(m({},I,e));const t=m({},e,{tenantId:u,userType:"citizen"});return Promise.resolve(d?Promise.resolve(j({otp:m({},t,dt)})).then(function(e){var n;let[o,l]=e;var a,r,i;if(!l)return k(!0),void E.replace(g+"/otp",{from:pt(f.state,A),role:null===(a=f.state)||void 0===a?void 0:a.role});k(!0),f.state&&"FSM_DSO"===f.state.role||E.push("/"+(null===(r=window)||void 0===r?void 0:r.contextPath)+"/citizen/register/name",{from:pt(f.state,A),data:t}),null!==(n=f.state)&&void 0!==n&&n.role&&(k(!0),S("FSM_DSO"===(null===(i=f.state)||void 0===i?void 0:i.role)?v("ES_ERROR_DSO_LOGIN"):"User not registered."))}):function(){if(!U)return Promise.resolve(j({otp:m({},t,ut)})).then(function(e){let[t,n]=e;if(!n)return k(!0),void E.replace(g+"/otp",{from:pt(f.state,A)});k(!0)});k(!0),E.replace(g+"/name",{from:pt(f.state,A),data:t})}())}catch(e){return Promise.reject(e)}},config:B[0],mobileNumber:I.mobileNumber||"",emailId:I.userName||"",onMobileChange:e=>{const{value:t}=e.target;_(m({},I,{mobileNumber:t}))},onEmailChange:e=>{const{value:t}=e.target;_(m({},I,{userName:t}))},canSubmit:M,showRegisterLink:d&&!(null!==(c=f.state)&&void 0!==c&&c.role),t:v})),o.createElement(i.Route,{path:g+"/otp"},o.createElement(lt,{config:m({},B[1],{texts:m({},B[1].texts,{cardText:B[1].texts.cardText+" "+(I.mobileNumber||I.userName||"")})}),onOtpChange:e=>{_(m({},I,{otp:e}))},onResend:function(){try{const{mobileNumber:e,userName:t}=I,n={mobileNumber:e,userName:t,tenantId:u,userType:"citizen"},o=function(){if(!d&&U)S(v("PLEASE_COMPLETE_REGISTRATION")||"Please enter the OTP sent during registration.");else{const e=d?Promise.resolve(j({otp:m({},n,dt)})).then(function(e){let[t,n]=e;n&&S(v("OTP_RESEND_ERROR")||"Failed to resend OTP")}):Promise.resolve(j({otp:m({},n,ut)})).then(function(e){let[t,n]=e;n&&S(v("OTP_RESEND_ERROR")||"Failed to resend OTP")});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(Qe(function(){C(!0),x(!1);const{mobileNumber:e,otp:t,name:n,userName:o}=I;return d||U?Promise.resolve(Digit.UserService.authenticate({username:e||o,password:t,tenantId:u,userType:"citizen"})).then(function(e){var t,n,o;let{UserRequest:l}=e,a=p(e,at);if(null!==(t=f.state)&&void 0!==t&&t.role){const e=l.roles.find(e=>e.code===f.state.role);if(!e||!e.code)return S(v("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>E.replace(mt),5e3)}null!==(n=window)&&void 0!==n&&null!==(o=n.globalConfigs)&&void 0!==o&&o.getConfig("ENABLE_SINGLEINSTANCE")&&(l.tenantId=Digit.ULBService.getStateId()),h(m({info:l},a))}):Promise.resolve(Digit.UserService.registerUser({name:n,username:e||o,otpReference:t,tenantId:u},u)).then(function(e){var t,n;let{UserRequest:o}=e,l=p(e,rt);null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(o.tenantId=Digit.ULBService.getStateId()),h(m({info:o},l))})},function(){x(!0),C(!1),S(v("INVALID_OTP")||"Invalid OTP")}))}catch(e){return Promise.reject(e)}},otp:I.otp,error:N,canSubmit:P,t:v})),o.createElement(i.Route,{path:g+"/name"},o.createElement(nt,{config:B[2],onSelect:function(e){try{R(!0);const t=m({},I,e);return _(t),Promise.resolve(function(){if(!d&&U){const e=U+"/v1/_register",n={IndividualRegister:{tenantId:u,name:t.name,emailId:t.userName||"",mobileNumber:t.mobileNumber||"",requestType:"Register"}};return Qe(function(){return Promise.resolve(Digit.CustomService.getResponse({url:e,body:n,useCache:!1,method:"POST",userService:!1,auth:!1,params:{}})).then(function(e){if(!e)throw new Error("Registration API failed");R(!1),E.replace(g+"/otp",{from:pt(f.state,A)})})},function(e){console.error("Registration error:",e),R(!1),S(v("REGISTRATION_FAILED")||"Registration failed. Please try again.")})}{const t=m({},I,{tenantId:u,userType:"citizen"},e);return Promise.resolve(j({otp:m({},t,ut)})).then(function(e){let[t,n]=e;t?(R(!1),E.replace(g+"/otp",{from:pt(f.state,A)})):R(!1)})}}())}catch(e){return Promise.reject(e)}},t:v,isDisabled:L})),b&&o.createElement(t.Toast,{type:"error",label:b,onClose:()=>S(null)}))))};var ft=e=>e instanceof HTMLElement;const gt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};var Et=e=>null==e;const yt=e=>"object"==typeof e;var ht=e=>!Et(e)&&!Array.isArray(e)&&yt(e)&&!(e instanceof Date),bt=e=>/^\w*$/.test(e),St=e=>e.filter(Boolean),Nt=e=>St(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function Ct(e,t,n){let o=-1;const l=bt(t)?[t]:Nt(t),a=l.length,r=a-1;for(;++o<a;){const t=l[o];let a=n;if(o!==r){const n=e[t];a=ht(n)||Array.isArray(n)?n:isNaN(+l[o+1])?{}:[]}e[t]=a,e=e[t]}return e}var Ot=function(e,t){void 0===t&&(t={});for(const n in e)bt(n)?t[n]=e[n]:Ct(t,n,e[n]);return t},wt=e=>void 0===e,It=function(e,t,n){void 0===e&&(e={});const o=St(t.split(/[,[\].]+?/)).reduce((e,t)=>Et(e)?e:e[t],e);return wt(o)||o===e?wt(e[t])?n:e[t]:o},_t=(e,t)=>{ft(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))};const Dt={isValid:!1,value:null};var Tt=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e,Dt):Dt,At=e=>"radio"===e.type,Lt=e=>"file"===e.type,Rt=e=>"checkbox"===e.type,Pt=e=>"select-multiple"===e.type;const xt={value:!1,isValid:!1},Mt={value:!0,isValid:!0};var kt=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&&!wt(o.value)?wt(n)||""===n?Mt:{value:n,isValid:!0}:Mt:xt}return xt};function Ut(e,t,n,o,l){const a=e.current[t];if(a){const{ref:{value:e,disabled:t},ref:n,valueAsNumber:i,valueAsDate:s,setValueAs:c}=a;if(t&&o)return;return Lt(n)?n.files:At(n)?Tt(a.options).value:Pt(n)?(r=n.options,[...r].filter(e=>{let{selected:t}=e;return t}).map(e=>{let{value:t}=e;return t})):Rt(n)?kt(a.options).value:l?e:i?""===e?NaN:+e:s?n.valueAsDate:c?c(e):e}var r;if(n)return It(n.current,t)}function Bt(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&Bt(e.parentNode)}var jt=e=>ht(e)&&!Object.keys(e).length,Ft=e=>"boolean"==typeof e;function Ht(e,t){const n=bt(t)?[t]:Nt(t),o=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let o=0;for(;o<n;)e=wt(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,a=-1;const r=n.slice(0,-(t+1)),i=r.length-1;for(t>0&&(l=e);++a<r.length;){const t=r[a];o=o?o[t]:e[t],i===a&&(ht(o)&&jt(o)||Array.isArray(o)&&!o.filter(e=>ht(e)&&!jt(e)||Ft(e)).length)&&(l?delete l[t]:delete e[t]),l=o}}return e}const zt=(e,t)=>e&&e.ref===t;var Gt=e=>Et(e)||!yt(e);function Vt(e,t){if(Gt(e)||Gt(t))return t;for(const n in t){const o=e[n],l=t[n];try{e[n]=ht(o)&&ht(l)||Array.isArray(o)&&Array.isArray(l)?Vt(o,l):l}catch(e){}}return e}function Wt(e,t,o){if(Gt(e)||Gt(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((ht(n)||Array.isArray(n))&&(ht(e)||Array.isArray(e))?!Wt(n,e,o):n!==e)return!1}}}return!0}function Qt(e,t,n,o,l){let a=-1;for(;++a<e.length;){for(const o in e[a])Array.isArray(e[a][o])?(!n[a]&&(n[a]={}),n[a][o]=[],Qt(e[a][o],It(t[a]||{},o,[]),n[a][o],n[a],o)):Wt(It(t[a]||{},o),e[a][o])?Ct(n[a]||{},o):n[a]=Object.assign(Object.assign({},n[a]),{[o]:!0});o&&!n.length&&delete o[l]}return n}var Xt=e=>"string"==typeof e,qt=(e,t,n,o,l)=>{const a={};for(const t in e.current)(wt(l)||(Xt(l)?t.startsWith(l):Array.isArray(l)&&l.find(e=>t.startsWith(e))))&&(a[t]=Ut(e,t,void 0,o));return n?Ot(a):Vt(t,Ot(a))},Zt=e=>e instanceof RegExp,Yt=e=>ht(e)&&!Zt(e)?e:{value:e,message:""},Jt=e=>"function"==typeof e,Kt=e=>Xt(e)||n.isValidElement(e);function $t(e,t,n){if(void 0===n&&(n="validate"),Kt(e)||Ft(e)&&!e)return{type:n,message:Kt(e)?e:"",ref:t}}var en=(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})}):{},tn=function(e,t,n,o){let{ref:l,ref:{value:a},options:r,required:i,maxLength:s,minLength:c,min:u,max:d,pattern:m,validate:p}=n;try{let n=!1;const v=l.name,f={},g=At(l),E=Rt(l),y=g||E,h=""===a,b=en.bind(null,v,t,f),S=function(e,t,n,o,a){void 0===o&&(o="maxLength"),void 0===a&&(a="minLength");const r=e?t:n;f[v]=Object.assign({type:e?o:a,message:r,ref:l},b(e?o:a,r))};if(i&&(!g&&!E&&(h||Et(a))||Ft(a)&&!a||E&&!kt(r).isValid||g&&!Tt(r).isValid)){const{value:n,message:o}=Kt(i)?{value:!!i,message:i}:Yt(i);if(n&&(f[v]=Object.assign({type:"required",message:o,ref:y?((e.current[v].options||[])[0]||{}).ref:l},b("required",o)),!t))return Promise.resolve(f)}if(!(Et(u)&&Et(d)||""===a)){let e,n;const o=Yt(d),r=Yt(u);if(isNaN(a)){const t=l.valueAsDate||new Date(a);Xt(o.value)&&(e=t>new Date(o.value)),Xt(r.value)&&(n=t<new Date(r.value))}else{const t=l.valueAsNumber||parseFloat(a);Et(o.value)||(e=t>o.value),Et(r.value)||(n=t<r.value)}if((e||n)&&(S(!!e,o.message,r.message,"max","min"),!t))return Promise.resolve(f)}if(Xt(a)&&!h&&(s||c)){const e=Yt(s),n=Yt(c),o=!Et(e.value)&&a.length>e.value,l=!Et(n.value)&&a.length<n.value;if((o||l)&&(S(o,e.message,n.message),!t))return Promise.resolve(f)}if(Xt(a)&&m&&!h){const{value:e,message:n}=Yt(m);if(Zt(e)&&!e.test(a)&&(f[v]=Object.assign({type:"pattern",message:n,ref:l},b("pattern",n)),!t))return Promise.resolve(f)}const N=function(){if(p){const a=Ut(e,v,o,!1,!0),i=y&&r?r[0].ref:l;return Jt(p)?Promise.resolve(p(a)).then(function(e){const o=$t(e,i);if(o&&(f[v]=Object.assign(Object.assign({},o),b("validate",o.message)),!t))return n=!0,f}):function(){if(ht(p)){let o=!1;function e(){if(!jt(l)&&(f[v]=Object.assign({ref:i},l),!t))return n=!0,f}let l={};const r=We(Object.entries(p),function(e){let[n,r]=e;if(jt(l)||t)return Promise.resolve(r(a)).then(function(e){const o=$t(e,i,n);o&&(l=Object.assign(Object.assign({},o),b(n,o.message)),t&&(f[v]=l))});o=!0},function(){return o});return r&&r.then?r.then(e):e()}}()}}();return Promise.resolve(N&&N.then?N.then(function(e){return n?e:f}):n?N:f)}catch(e){return Promise.reject(e)}};const nn=function(e,t,n){void 0===n&&(n=[]);for(const o in t){const l=e+(ht(t)?"."+o:"["+o+"]");Gt(t[o])?n.push(l):nn(l,t[o],n)}return n};var on=(e,t,n,o,l)=>{let a=void 0;return n.add(t),jt(e)||(a=It(e,t),(ht(a)||Array.isArray(a))&&nn(t,a).forEach(e=>n.add(e))),wt(a)?l?o:It(o,t):a},ln=e=>{let{isOnBlur:t,isOnChange:n,isOnTouch:o,isTouched:l,isReValidateOnBlur:a,isReValidateOnChange:r,isBlurEvent:i,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&o?!(l||i):(s?a:t)?!i:!(s?r:n)||i)},an=e=>e.substring(0,e.indexOf("[")),rn=(e,t)=>[...e].some(e=>((e,t)=>RegExp(("^"+t+"([|.)\\d+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)),sn="undefined"!=typeof window&&"undefined"!=typeof document;function cn(e){var t;let n;if(Gt(e)||sn&&(e instanceof File||ft(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,cn(e.get(t)));return n}n=Array.isArray(e)?[]:{};for(const t in e)n[t]=cn(e[t]);return n}var un=e=>({isOnSubmit:!e||e===gt.onSubmit,isOnBlur:e===gt.onBlur,isOnChange:e===gt.onChange,isOnAll:e===gt.all,isOnTouch:e===gt.onTouched}),dn=e=>At(e)||Rt(e);const mn="undefined"==typeof window,pn=sn?"Proxy"in window:"undefined"!=typeof Proxy,vn=n.createContext(null);vn.displayName="RHFContext";const fn=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:a,meta:r}=function(e){let{name:t,rules:o,defaultValue:l,control:a,onFocus:r}=e;const i=n.useContext(vn);if("production"!==process.env.NODE_ENV&&!a&&!i)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:b,readFormStateRef:S,fieldsRef:N,fieldArrayNamesRef:C,shallowFieldsStateRef:O}=a||i.control,w=!rn(C.current,t),I=()=>!wt(It(O.current,t))&&w?It(O.current,t):wt(l)?It(s.current,t):l,[_,D]=n.useState(I()),T=n.useRef(_),A=n.useRef({focus:()=>null}),L=n.useRef(r||(()=>{Jt(A.current.focus)&&A.current.focus(),"production"!==process.env.NODE_ENV&&(Jt(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=>!ln(Object.assign({isBlurEvent:e,isReValidateOnBlur:v,isReValidateOnChange:f,isSubmitted:E,isTouched:!!It(y,t)},p)),[v,f,E,y,t,p]),P=n.useCallback(e=>{let[t]=e;const n=(e=>Gt(e)||!ht(e.target)||ht(e.target)&&!e.type?e:wt(e.target.value)?e.target.checked:e.target.value)(t);return D(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");N.current[t]?N.current[t]=Object.assign({ref:N.current[t].ref},o):(u(Object.defineProperties({name:t,focus:L.current},{value:{set(e){D(e),T.current=e},get:()=>T.current}}),o),e=wt(It(s.current,t))),e&&w&&D(I())},[o,t,u]);n.useEffect(()=>()=>d(t),[t]),n.useEffect(()=>{"production"!==process.env.NODE_ENV&&(wt(_)&&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)"),!w&&wt(l)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),x()},[x]),n.useEffect(()=>{!N.current[t]&&x(!0)});const M=n.useCallback(()=>{S.current.touched&&!It(y,t)&&(Ct(y,t,!0),b({touched:y})),R(!0)&&m(t)},[t,b,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:_,ref:A},meta:Object.defineProperties({invalid:!!It(h,t)},{isDirty:{get:()=>!!It(g.dirtyFields,t)},isTouched:{get:()=>!!It(g.touched,t)}})}}(e),i=Object.assign(Object.assign({},l),a);return t?n.isValidElement(t)?n.cloneElement(t,i):n.createElement(t,i):o?o(a,r):null},gn=e=>{let{control:n,t:l}=e;const a=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(fn,{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(fn,{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:a?"510px":"25px",marginLeft:a?"0":"-30px",maxWidth:a?"100%":"240px"},label:l("ES_COMMON_APPLY"),submit:!0})))},En=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],yn=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],hn=e=>{var l;let{Controller:a,register:r,control:i,t:s,reset:c,previousPage:u,handleSubmit:d,tenantId:v,data:f,onSubmit:g,isLoading:E}=e;const[y,h]=n.useState([]),b=e=>o.createElement("div",{onClick:e.onClick},o.createElement(t.DownloadBtnCommon,null));n.useEffect(()=>{(null==f?void 0:f.length)>0&&h([null==f?void 0:f.map(e=>{let t={};return t[s("AUDIT_DATE_LABEL")]=S(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=N(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(","),m({},t)})])},[f]);const S=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()},N=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},[C,O]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),w=()=>{O({type:"remove"})},I=()=>o.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:w},o.createElement(t.CloseSvg,null)),_={Controller:a,register:r,control:i,t:s,reset:c,previousPage:u},D=n.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:a}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:a}=e,r=p(e,En);const{closeMobilePopupModal:i}=r;switch(n){case"SearchFormComponent":return o.createElement(t.SearchForm,r,o.createElement(I,null),o.createElement("div",{className:"MobilePopupHeadingWrapper"},o.createElement("h2",null,s("PRIVACY_AUDIT_REPORT"),":")),o.createElement(gn,m({},l,{closeMobilePopupModal:i,tenantId:a,t:s})));default:return o.createElement("span",null)}})(m({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:l,tenantId:a},p(e,yn)))},[C]);null==f||null===(l=f.roles)||void 0===l||l.forEach(e=>{});const T=n.useMemo(()=>null!=f&&f.display||""===f?[]:null==f?void 0:f.map(e=>{var t;return{[s("AUDIT_DATE_LABEL")]:S(e.timestamp),[s("AUDIT_TIME_LABEL")]:N(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(",")}}),[f]);return o.createElement(o.Fragment,null,o.createElement(t.BackButton,null),o.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},o.createElement(b,{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")})(y)})),o.createElement(t.HeaderComponent,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:v,t:s})),C?o.createElement(t.PopUp,null,o.createElement(D,{onSubmit:e=>{O({type:"remove"}),g(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:_,currentlyActiveMobileModal:C,closeMobilePopupModal:w,tenantId:v})):null,E&&o.createElement(t.Loader,null),o.createElement(t.DetailsCard,{data:T}))},bn=e=>{let{tenantId:l,t:a,onSubmit:r,data:i,count:c}=e;const u=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"},{register:d,control:p,handleSubmit:v,setValue:f,getValues:g,reset:E}=function(e){let{mode:t=gt.onSubmit,reValidateMode:o=gt.onChange,resolver:l,context:a,defaultValues:r={},shouldFocusError:i=!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(r),h=n.useRef(!1),b=n.useRef(!1),S=n.useRef(),N=n.useRef({}),C=n.useRef({}),O=n.useRef(a),w=n.useRef(l),I=n.useRef(new Set),_=n.useRef(un(t)),{isOnSubmit:D,isOnTouch:T}=_.current,A=c===gt.all,[L,R]=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!D,errors:{}}),P=n.useRef({isDirty:!pn,dirtyFields:!pn,touched:!pn||T,isValidating:!pn,isSubmitting:!pn,isValid:!pn}),x=n.useRef(L),M=n.useRef(),{isOnBlur:k,isOnChange:U}=n.useRef(un(o)).current;O.current=a,w.current=l,x.current=L,N.current=s?{}:jt(N.current)?cn(r):N.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))},[]),j=()=>P.current.isValidating&&B({isValidating:!0}),F=n.useCallback(function(e,t,n,o,l){void 0===n&&(n=!1),void 0===o&&(o={});let a=n||(e=>{let{errors:t,name:n,error:o,validFields:l,fieldsWithValidation:a}=e;const r=wt(o),i=It(t,n);return r&&!!i||!r&&!Wt(i,o,!0)||r&&It(a,n)&&!It(l,n)})({errors:x.current.errors,error:t,name:e,validFields:E.current,fieldsWithValidation:g.current});const r=It(x.current.errors,e);t?(Ht(E.current,e),a=a||!r||!Wt(r,t,!0),Ct(x.current.errors,e,t)):((It(g.current,e)||w.current)&&(Ct(E.current,e,!0),a=a||r),Ht(x.current.errors,e)),(a&&!Et(n)||!jt(o)||P.current.isValidating)&&B(Object.assign(Object.assign(Object.assign({},o),w.current?{isValid:!!l}:{}),{isValidating:!1}))},[]),H=n.useCallback((e,t)=>{const{ref:n,options:o}=u.current[e],l=sn&&ft(n)&&Et(t)?"":t;At(n)?(o||[]).forEach(e=>{let{ref:t}=e;return t.checked=t.value===l}):Lt(n)&&!Xt(l)?n.files=l:Pt(n)?[...n.options].forEach(e=>e.selected=l.includes(e.value)):Rt(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},[]),z=n.useCallback((e,t)=>{if(P.current.isDirty){const n=K();return e&&t&&Ct(n,e,t),!Wt(n,y.current)}return!1},[]),G=n.useCallback(function(e,t){if(void 0===t&&(t=!0),P.current.isDirty||P.current.dirtyFields){const n=!Wt(It(y.current,e),Ut(u,e,N)),o=It(x.current.dirtyFields,e),l=x.current.isDirty;n?Ct(x.current.dirtyFields,e,!0):Ht(x.current.dirtyFields,e);const a={isDirty:z(),dirtyFields:x.current.dirtyFields},r=P.current.isDirty&&l!==a.isDirty||P.current.dirtyFields&&o!==It(x.current.dirtyFields,e);return r&&t&&B(a),r?a:{}}return{}},[]),V=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||u.current[e]?Promise.resolve(tn(u,A,u.current[e],N)).then(function(n){const o=n[e];return F(e,o,t),wt(o)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[F,A]),W=n.useCallback(function(e){try{return Promise.resolve(w.current(K(),O.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=It(n,e);return t?Ct(x.current.errors,e,t):Ht(x.current.errors,e),!t}).every(Boolean);return B({isValid:jt(n),isValidating:!1}),t}{const t=It(n,e);return F(e,t,o!==jt(n),{},jt(n)),!t}})}catch(e){return Promise.reject(e)}},[F,A]),Q=n.useCallback(function(e){try{let n=!1;function t(e){return n?e:Promise.resolve(V(o))}const o=e||Object.keys(u.current);if(j(),w.current)return Promise.resolve(W(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(V(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)}},[W,V]),X=n.useCallback((e,t,n)=>{let{shouldDirty:o,shouldValidate:l}=n;const a={};Ct(a,e,t);for(const n of nn(e,t))u.current[n]&&(H(n,It(a,n)),o&&G(n),l&&Q(n))},[Q,H,G]),q=n.useCallback((e,t,n)=>{if(!s&&!Gt(t)&&Ct(N.current,e,Array.isArray(t)?[...t]:Object.assign({},t)),u.current[e])H(e,t),n.shouldDirty&&G(e),n.shouldValidate&&Q(e);else if(!Gt(t)&&(X(e,t,n),I.current.has(e))){const o=an(e)||e;Ct(d.current,e,t),C.current[o]({[o]:It(d.current,o)}),(P.current.isDirty||P.current.dirtyFields)&&n.shouldDirty&&(Ct(x.current.dirtyFields,e,((e,t,n)=>Vt(Qt(e,t,n.slice(0,e.length)),Qt(t,e,n.slice(0,e.length))))(t,It(y.current,e,[]),It(x.current.dirtyFields,e,[]))),B({isDirty:!Wt(Object.assign(Object.assign({},K()),{[e]:t}),y.current)}))}!s&&Ct(N.current,e,t)},[G,H,X]),Z=e=>b.current||p.current.has(e)||p.current.has((e.match(/\w+/)||[])[0]),Y=e=>{let t=!0;if(!jt(v.current))for(const n in v.current)e&&v.current[n].size&&!v.current[n].has(e)&&!v.current[n].has(an(e))||(f.current[n](),t=!1);return t};function J(e){if(!s){let t=cn(e);for(const e of I.current)bt(e)&&!t[e]&&(t=Object.assign(Object.assign({},t),{[e]:[]}));return t}return e}function K(e){if(Xt(e))return Ut(u,e,N);if(Array.isArray(e)){const t={};for(const n of e)Ct(t,n,Ut(u,n,N));return t}return J(qt(u,cn(N.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,a;return Promise.resolve(function(){if(o){function r(){!i&&Y(e),F(e,l,m,d,a)}const i="blur"===t,c=ln(Object.assign({isBlurEvent:i,isReValidateOnChange:U,isReValidateOnBlur:k,isTouched:!!It(x.current.touched,e),isSubmitted:x.current.isSubmitted},_.current));let d=G(e,!1),m=!jt(d)||!i&&Z(e);if(i&&!It(x.current.touched,e)&&P.current.touched&&(Ct(x.current.touched,e,!0),d=Object.assign(Object.assign({},d),{touched:x.current.touched})),!s&&Rt(n)&&Ct(N.current,e,Ut(u,e)),c)return!i&&Y(e),(!jt(d)||m&&jt(d))&&B(d);j();const p=w.current?Promise.resolve(w.current(K(),O.current,A)).then(function(t){let{errors:o}=t;const r=x.current.isValid;if(l=It(o,e),Rt(n)&&!l&&w.current){const t=an(e),n=It(o,t,{});n.type&&n.message&&(l=n),t&&(n||It(x.current.errors,t))&&(e=t)}a=jt(o),r!==a&&(m=!0)}):Promise.resolve(tn(u,A,o,N)).then(function(t){l=t[e]});return p&&p.then?p.then(r):r()}}())}catch(e){return Promise.reject(e)}};const $=n.useCallback(function(e){void 0===e&&(e={});try{const t=jt(u.current)?y.current:{};return Promise.resolve(w.current(Object.assign(Object.assign(Object.assign({},t),K()),e),O.current,A)).then(function(e){let{errors:t}=e;const n=jt(t);x.current.isValid!==n&&B({isValid:n})})}catch(e){return Promise.reject(e)}},[A]),ee=n.useCallback((e,t)=>{!function(e,t,n,o,l,a){const{ref:r,ref:{name:i}}=n,s=e.current[i];if(!l){const t=Ut(e,i,o);!wt(t)&&Ct(o.current,i,t)}r.type&&s?At(r)||Rt(r)?Array.isArray(s.options)&&s.options.length?(St(s.options).forEach(function(e,n){void 0===e&&(e={}),(Bt(e.ref)&&zt(e,e.ref)||a)&&(_t(e.ref,t),Ht(s.options,"["+n+"]"))}),s.options&&!St(s.options).length&&delete e.current[i]):delete e.current[i]:(Bt(r)&&zt(s,r)||a)&&(_t(r,t),delete e.current[i]):delete e.current[i]}(u,S.current,e,N,s,t),s&&(Ht(E.current,e.ref.name),Ht(g.current,e.ref.name))},[s]),te=n.useCallback(e=>{if(b.current)B();else{for(const t of p.current)if(t.startsWith(e)){B();break}Y(e)}},[]),ne=n.useCallback((e,t)=>{e&&(ee(e,t),s&&!St(e.options||[]).length&&(Ht(x.current.errors,e.ref.name),Ct(x.current.dirtyFields,e.ref.name,!0),B({isDirty:z()}),P.current.isValid&&w.current&&$(),te(e.ref.name)))},[$,ee]),oe=n.useCallback((e,t,n)=>{const o=n?v.current[n]:p.current;let l=qt(u,cn(N.current),s,!1,e);if(Xt(e)){const n=an(e)||e;return I.current.has(n)&&(l=Object.assign(Object.assign({},m.current),l)),on(l,e,o,wt(It(y.current,e))?t:It(y.current,e),!0)}const a=wt(t)?y.current:t;return Array.isArray(e)?e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:on(l,t,o,a)}),{}):(b.current=wt(n),Ot(!jt(l)&&l||a))},[]);function le(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,a=Object.assign({ref:e},t),r=u.current,i=dn(e),c=rn(I.current,n),d=t=>sn&&(!ft(e)||t===e);let m,p=r[n],v=!0;if(p&&(i?Array.isArray(p.options)&&St(p.options).find(e=>l===e.ref.value&&d(e.ref)):d(p.ref)))return void(r[n]=Object.assign(Object.assign({},p),t));p=o?i?Object.assign({options:[...St(p&&p.options||[]),{ref:e}],ref:{type:o,name:n}},t):Object.assign({},a):a,r[n]=p;const f=wt(It(N.current,n));jt(y.current)&&f||(m=It(f?y.current:N.current,n),v=wt(m),v||c||H(n,m)),jt(t)||(Ct(g.current,n,!0),!D&&P.current.isValid&&tn(u,A,p,N).then(e=>{const t=x.current.isValid;jt(e)?Ct(E.current,n,!0):Ht(E.current,n),t!==jt(e)&&B()})),!s||c&&v||!c&&Ht(x.current.dirtyFields,n),o&&function(e,t,n){let{ref:o}=e;ft(o)&&n&&(o.addEventListener(t?"change":"input",n),o.addEventListener("blur",n))}(i&&p.options?p.options[p.options.length-1]:p,i||"select-one"===e.type,S.current)}const ae=n.useCallback((e,t)=>function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());let o={},l=J(qt(u,cn(N.current),s,!0));return P.current.isSubmitting&&B({isSubmitting:!0}),Promise.resolve(function(a,r){try{var s=function(){function a(){const a=function(){if(jt(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 a(e){i&&((e,t)=>{for(const n in e)if(It(t,n)){const t=e[n];if(t){if(t.ref.focus&&wt(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(a):a()}}();if(a&&a.then)return a.then(function(){})}const r=w.current?Promise.resolve(w.current(l,O.current,A)).then(function(e){let{errors:t,values:n}=e;x.current.errors=o=t,l=n}):We(Object.values(u.current),function(e){const t=function(){if(e){const{name:t}=e.ref;return Promise.resolve(tn(u,A,e,N)).then(function(e){e[t]?(Ct(o,t,e[t]),Ht(E.current,t)):It(g.current,t)&&(Ht(x.current.errors,t),Ct(E.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return r&&r.then?r.then(a):a()}()}catch(e){return r(!0,e)}return s&&s.then?s.then(r.bind(null,!1),r.bind(null,!0)):r(!1,s)}(0,function(e,t){if(x.current.isSubmitting=!1,B({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:jt(x.current.errors),submitCount:x.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}},[i,A]);n.useEffect(()=>{l&&P.current.isValid&&$(),M.current=M.current||!sn?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&&Bt(e.ref)&&t(n);else n&&Bt(n.ref)&&t(n)});return n.observe(window.document,{childList:!0,subtree:!0}),n}(u,ne)},[ne,y.current]),n.useEffect(()=>()=>{M.current&&M.current.disconnect(),h.current=!0,"production"===process.env.NODE_ENV&&Object.values(u.current).forEach(e=>ne(e,!0))},[]),!l&&P.current.isValid&&(L.isValid=Wt(E.current,g.current)&&jt(x.current.errors));const re={trigger:Q,setValue:n.useCallback(function(e,t,n){q(e,t,n||{}),Z(e)&&B(),Y(e)},[q,Q]),getValues:n.useCallback(K,[]),register:n.useCallback(function(e,t){if(!mn)if(Xt(e))le({name:e},t);else{if(!ht(e)||!("name"in e))return t=>t&&le(t,e);le(e,t)}},[y.current]),unregister:n.useCallback(function(e){for(const t of Array.isArray(e)?e:[e])ne(u.current[t],!0)},[]),formState:pn?new Proxy(L,{get:(e,t)=>{if("production"!==process.env.NODE_ENV&&"isValid"===t&&D&&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},ie=n.useMemo(()=>Object.assign({isFormDirty:z,updateWatchedValue:te,shouldUnregister:s,updateFormState:B,removeFieldEventListener:ee,watchInternal:oe,mode:_.current,reValidateMode:{isReValidateOnBlur:k,isReValidateOnChange:U},validateResolver:l?$:void 0,fieldsRef:u,resetFieldArrayFunctionRef:C,useWatchFieldsRef:v,useWatchRenderFunctionsRef:f,fieldArrayDefaultValuesRef:d,validFieldsRef:E,fieldsWithValidationRef:g,fieldArrayNamesRef:I,readFormStateRef:P,formStateRef:x,defaultValuesRef:y,shallowFieldsStateRef:N,fieldArrayValuesRef:m},re),[y.current,te,s,ee,oe]);return Object.assign({watch:function(e,t){return oe(e,t)},control:ie,handleSubmit:ae,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),sn)for(const e of Object.values(u.current))if(e){const{ref:t,options:n}=e,o=dn(t)&&Array.isArray(n)?n[0].ref:t;if(ft(o))try{o.closest("form").reset();break}catch(e){}}u.current={},y.current=Object.assign({},e||y.current),e&&Y(""),Object.values(C.current).forEach(e=>Jt(e)&&e()),N.current=s?{}:cn(e||y.current),(e=>{let{errors:t,isDirty:n,isSubmitted:o,touched:l,isValid:a,submitCount:r,dirtyFields:i}=e;a||(E.current={},g.current={}),d.current={},p.current=new Set,b.current=!1,B({submitCount:r?x.current.submitCount:0,isDirty:!!n&&x.current.isDirty,isSubmitted:!!o&&x.current.isSubmitted,isValid:!!a&&x.current.isValid,dirtyFields:i?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]&&bt(e)?delete x.current.errors[e]:Ht(x.current.errors,e)),B({errors:e?x.current.errors:{}})},[]),setError:n.useCallback(function(e,t){const n=(u.current[e]||{}).ref;Ct(x.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),B({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:L.errors},re)}({defaultValues:u}),y=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()},h=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,S]=n.useState([]),N=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==i?void 0:i.length)>0&&S([null==i?void 0:i.map(e=>{let t={};return t[a("AUDIT_DATE_LABEL")]=y(null==e?void 0:e.timestamp),t[a("AUDIT_TIME_LABEL")]=h(null==e?void 0:e.timestamp),t[a("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[a("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[a("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),m({},t)})])},[i]);const C=n.useCallback(e=>{0!==e.length&&(f("sortBy",e.id),f("sortOrder",e.desc?"DESC":"ASC"))},[]);function O(){f("offset",g("offset")-g("limit")),v(r)()}const w=window.Digit.Utils.browser.isMobile();if(w)return o.createElement(hn,{Controller:fn,register:d,control:p,t:a,reset:E,previousPage:O,handleSubmit:v,tenantId:l,data:i,onSubmit:r});const I=e=>o.createElement("span",{className:"cell-text"},e),_=n.useMemo(()=>[{Header:a("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?a("WS_NA"):y(e.timestamp);return I(""+t)}},{Header:a("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?a("WS_NA"):h(e.timestamp);return I(""+t)}},{Header:a(w?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataView))},{Header:a(w?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataViewedBy))},{Header:a("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return I(""+(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.HeaderComponent,null,a("PRIVACY_AUDIT_REPORT"))," "),o.createElement(t.SearchForm,{className:"audit-card",onSubmit:r,handleSubmit:v},o.createElement(gn,{register:d,control:p,reset:E,tenantId:l,t:a,previousPage:O})),o.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=i&&i.display?o.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},a(i.display).split("\\n").map((e,t)=>o.createElement("p",{key:t,style:{textAlign:"center"}},e))):""!==i?o.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},o.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},o.createElement(N,{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")})(b)})),o.createElement(s.Table,{t:a,data:i,totalRecords:c,columns:_,getCellProps:e=>({style:{minWidth:e.column.Header===a("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){f("limit",Number(e.target.value)),v(r)()},currentPage:g("offset")/g("limit"),onNextPage:function(){f("offset",g("offset")+g("limit")),v(r)()},onPrevPage:O,manualPagination:!1,pageSizeLimit:g("limit"),onSort:C,disableSort:!1,sortParams:[{id:g("sortBy"),desc:"DESC"===g("sortOrder")}]})):o.createElement(t.Loader,null)))},Sn=e=>{var t,a;const{t:r}=l.useTranslation(),i=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=m({},e);c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>m({},e,{[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);const d={enabled:!!(s&&Object.keys(s).length>0)},p=m({},s),{isLoading:v,data:f}=Digit.Hooks.useAudit({tenantId:i,filters:m({},p),config:d});return o.createElement(bn,{t:r,tenantId:i,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});const t=m({},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)=>m({},e,{[n]:t[n]}),{}))},data:v?"":(null==f||null===(t=f.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==f?void 0:f.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==f||null===(a=f.ElasticSearchData)||void 0===a?void 0:a.length})},Nn=e=>{var n,a,r,i,s,c,u,d,m,p,v,f,g,E,y,h;let{moduleCode:b}=e;const{t:S}=l.useTranslation(),N=Digit.ULBService.getCitizenCurrentTenant(),{isLoading:C,data:O}=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),{isLoading:w,error:I,data:_}=Digit.Hooks.useDynamicData({moduleCode:b,tenantId:N,filters:{},t:S}),D=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==O||null===(n=O.MdmsRes["common-masters"])||void 0===n||null===(a=n.StaticData[0])||void 0===a?void 0:a[""+b],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 C||w?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!==(r=T.helpline)&&void 0!==r&&r.contactOne?o.createElement("div",{className:"call-center-card-content"},o.createElement("a",{href:"tel:"+(null==T||null===(i=T.helpline)||void 0===i?void 0:i.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==_||null===(null==_?void 0:_.dynamicDataOne)?o.createElement("div",null):o.createElement("div",{className:"dynamicDataCard"},o.createElement("div",{className:"dynamicData"},o.createElement(D,{module:b,styles:{width:"24px",height:"24px"}}),o.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataOne))),I||null==_||null===(null==_?void 0:_.dynamicDataTwo)?o.createElement("div",null):o.createElement("div",{className:"dynamicDataCard"},o.createElement("div",{className:"dynamicData"},o.createElement(D,{module:b,styles:{width:"24px",height:"24px"}}),o.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataTwo))),T&&null!=T&&T.staticDataOne?o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},o.createElement(A,{module:b}),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=P(b))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(p=P(b))||void 0===p?void 0:p.staticDataOneHeader),o.createElement("span",{className:"static-data-content-second"},""+(null===(v=P(b))||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:b}),o.createElement("span",{className:"static-data-content"},o.createElement("span",{className:"static-data-content-first"},null===(f=P(b))||void 0===f?void 0:f.staticDataTwoHeader),o.createElement("span",{className:"static-data-content-second"},null===(g=P(b))||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(b))||void 0===E?void 0:E.staticCommonContent),o.createElement("span",{className:"static-data-content-second"},null===(y=R(b))||void 0===y?void 0:y.validity)))):o.createElement("div",null),I||null==_||null==_||!_.staticData||null===(null==_?void 0:_.staticData)?o.createElement("div",null):o.createElement("div",{className:"staticDataCard"},o.createElement("div",{className:"staticData"},"PGR"===b?o.createElement(D,{module:b,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(b))||void 0===h?void 0:h.staticCommonContent),o.createElement("span",{className:"static-data-content-second"},null==_?void 0:_.staticData)))))):o.createElement(o.Fragment,null)};var Cn,On,wn,In,_n;const Dn=[(null===(Cn=window)||void 0===Cn?void 0:Cn.contextPath)+"/citizen/register/name","/"+(null===(On=window)||void 0===On?void 0:On.contextPath)+"/citizen/select-language","/"+(null===(wn=window)||void 0===wn?void 0:wn.contextPath)+"/citizen/select-location","/"+(null===(In=window)||void 0===In?void 0:In.contextPath)+"/citizen/login","/"+(null===(_n=window)||void 0===_n?void 0:_n.contextPath)+"/citizen/register/otp"],Tn=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code)),An=e=>{var n,a,r;let{stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:v,stateCode:f,modules:g,appTenants:E,pathname:y,initData:h}=e;const{isLoading:b,data:S,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},{})}}),C=Digit.Hooks.useRouteSubscription(y),{t:O}=l.useTranslation(),{path:w}=i.useRouteMatch(),I=i.useHistory(),_=Dn.some(e=>window.location.href.includes(e)),D=g.map((e,t)=>{let{code:n,tenants:l}=e;const a=Digit.ComponentRegistryService.getComponent(n+"Module");return a?o.createElement(i.Route,{key:t,path:w+"/"+n.toLowerCase()},o.createElement(a,{stateCode:f,moduleCode:n,userType:"citizen",tenants:Tn(l,E)})):null}),T=g.map((e,n)=>{let{code:l,bannerImage:a}=e,r=(Digit.ComponentRegistryService.getComponent(l+"Links"),N?ye(S,l,O):void 0);return"ACTION_TEST_WS"===(null==r?void 0:r.header)&&(null==r||r.links.sort((e,t)=>t.orderNumber-e.orderNumber)),o.createElement(o.Fragment,null,o.createElement(i.Route,{key:n,path:w+"/"+l.toLowerCase()+"-home"},o.createElement("div",{className:"moduleLinkHomePage"},o.createElement(le,{src:a||(null==s?void 0:s.bannerUrl),alt:"noimagefound"}),o.createElement(t.BackLink,{className:"moduleLinkHomePageBackButton",onClick:()=>window.history.back()}),o.createElement("h1",null,O("MODULE_"+l.toUpperCase())),o.createElement("div",{className:"moduleLinkHomePageModuleLinks"},r&&o.createElement(t.CitizenHomeCard,{header:O(null==r?void 0:r.header),links:null==r?void 0:r.links,Icon:()=>o.createElement("span",null),Info:"OBPS"===l?()=>o.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:O("CS_FILE_APPLICATION_INFO_LABEL"),text:O("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===l})),o.createElement(Nn,{moduleCode:null==l?void 0:l.toUpperCase()}))),o.createElement(i.Route,{key:"faq"+n,path:w+"/"+l.toLowerCase()+"-faq"},o.createElement(Ue,{module:null==l?void 0:l.toUpperCase()})),o.createElement(i.Route,{key:"hiw"+n,path:w+"/"+l.toLowerCase()+"-how-it-works"},o.createElement($e,{module:null==l?void 0:l.toUpperCase()})))});return o.createElement("div",{className:C},o.createElement(Me,{t:O,stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:p,logoUrl:v,showSidebar:!!u,linkData:S,islinkDataLoading:b}),o.createElement("div",{className:"main center-container citizen-home-container mb-25"},_?null:o.createElement("div",{className:"SideBarStatic"},o.createElement(Ae,{linkData:S,islinkDataLoading:b})),o.createElement(i.Switch,null,o.createElement(i.Route,{exact:!0,path:w},o.createElement(Be,null)),o.createElement(i.Route,{exact:!0,path:w+"/select-language"},o.createElement(je,null)),o.createElement(i.Route,{exact:!0,path:w+"/select-location"},o.createElement(Fe,null)),o.createElement(i.Route,{path:w+"/error"},o.createElement(ie,{initData:h,goToHome:()=>{var e,t,n,o;I.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(i.Route,{path:w+"/all-services"},o.createElement(Se,{userType:"citizen",modules:g,getCitizenMenu:S,fetchedCitizen:N,isLoading:b})),o.createElement(i.Route,{path:w+"/login"},o.createElement(vt,{stateCode:f})),o.createElement(i.Route,{path:w+"/register"},o.createElement(vt,{stateCode:f,isUserRegistered:!1})),o.createElement(i.Route,{path:w+"/user/profile"},o.createElement(Ke,{stateCode:f,userType:"citizen",cityDetails:d})),o.createElement(i.Route,{path:w+"/Audit"},o.createElement(Sn,null)),o.createElement(ce,{initData:h},D,T))),o.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},o.createElement(le,{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(a=n.globalConfigs)||void 0===a||null===(r=a.getConfig)||void 0===r?void 0:r.call(a,"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()}})))},Ln=e=>{let{children:t}=e;return o.createElement("div",{className:"banner banner-container"},t)},Rn=e=>{var n;let{showTenant:a=!0}=e;const{data:r,isLoading:i}=Digit.Hooks.useStore.getInitData(),{stateInfo:s}=r||{},{t:c}=l.useTranslation();return i?o.createElement(t.Loader,null):o.createElement("div",{className:"bannerHeader"},o.createElement(le,{className:"bannerLogo",src:null==s?void 0:s.logoUrl,style:a?{}:{borderRight:"unset"},alt:"Digit Banner"}),a&&(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()))))},Pn=e=>{var l,a,r;let{config:c,t:u}=e;const[d,p]=n.useState(null),{mobile_number:v,tenantId:f}=Digit.Hooks.useQueryParams(),g=i.useHistory(),[E,y]=n.useState(""),[h,b]=n.useState(!0),[S,N]=n.useState(null),C=()=>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";g.replace(n)},[d]);const O=()=>{N(null)},[w,I,_]=c.inputs,D=[{body:[{label:u(w.label),type:w.type,populators:{name:w.name},isMandatory:!0},{label:u(I.label),type:I.type,populators:{name:I.name},isMandatory:!0},{label:u(_.label),type:_.type,populators:{name:_.name},isMandatory:!0}]}];return o.createElement(Ln,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(Qe(function(){if(e.newPassword!==e.confirmPassword)return N(u("ERR_PASSWORD_DO_NOT_MATCH"));const t=m({},e,{otpReference:E,tenantId:f,type:C().toUpperCase()});return Promise.resolve(Digit.UserService.changePassword(t,f)).then(function(e){(()=>{var e;g.replace("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/login")})()})},function(e){var t,n,o,l,a;N((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===(a=l[0])||void 0===a?void 0:a.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(Rn,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 - ")," ",v)),o.createElement(lt,{t:u,userType:"employee",otp:E,onOtpChange:y,error:h,onResend:function(){try{function e(){setTimeout(O,5e3)}const t={otp:{mobileNumber:v,userType:C().toUpperCase(),type:"passwordreset",tenantId:f}},n=Qe(function(){return Promise.resolve(Digit.UserService.sendOtp(t,f)).then(function(){N(u("ES_OTP_RESEND"))})},function(e){var t,n;N((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)}}})),S&&o.createElement(t.Toast,{type:"error",label:u(S),onClose:O}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(le,{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(a=l.globalConfigs)||void 0===a||null===(r=a.getConfig)||void 0===r?void 0:r.call(a,"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()}})," "))};Pn.propTypes={loginParams:ne.any},Pn.defaultProps={loginParams:null};const xn=[{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"}]}],Mn=()=>{const{t:e}=l.useTranslation(),{path:t}=i.useRouteMatch(),a=n.useMemo(()=>xn.map(t=>{const n={};for(const o in t.texts)n[o]=e(t.texts[o]);return m({},t,{texts:n})},[xn]));return o.createElement(i.Switch,null,o.createElement(i.Route,{path:""+t,exact:!0},o.createElement(Pn,{config:a[0],t:e})))},kn=[{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"}]}],Un=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_LOGIN",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)}))}"}}},{key:"check",type:"component",disable:!1,component:"PrivacyComponent",populators:{name:"check"},customProps:{module:"HCM"},isMandatory:!1,withoutLabel:!0}]}],Bn=e=>{var t;let{bannerImages:a=[]}=e;const[r,i]=n.useState(0),{t:s}=l.useTranslation(),c=a||(null===(t=Un[0])||void 0===t?void 0:t.bannerImages)||[],u=()=>{i(e=>e===c.length-1?0:e+1)};return n.useEffect(()=>{const e=setInterval(()=>{u()},5e3);return()=>clearInterval(e)},[c.length]),o.createElement(n.Fragment,null,o.createElement("div",{className:"carousel-container"},c.sort((e,t)=>(null==e?void 0:e.id)-(null==t?void 0:t.id)).map((e,t)=>o.createElement("div",{key:e.id,className:"carousel-slide "+(t===r?"active":""),style:{backgroundImage:"url("+e.image+")"}},o.createElement("div",{className:"carousel-content"},o.createElement("h2",null,s(e.title)),o.createElement("p",null,s(e.description))))),o.createElement("div",{className:"carousel-controls"},o.createElement("button",{className:"carousel-nav",onClick:()=>{i(e=>0===e?c.length-1:e-1)}},"<"),o.createElement("div",{className:"carousel-indicators"},c.map((e,t)=>o.createElement("button",{key:t,className:"indicator "+(t===r?"active":""),onClick:()=>(e=>{i(e)})(t)}))),o.createElement("button",{className:"carousel-nav",onClick:u},">"))))},jn=e=>{const t=Digit.Utils.getConfigModuleName();return Digit.Hooks.useCommonMDMS(e,t,["LoginConfig"],{select:e=>{var n;return{config:null==e||null===(n=e[t])||void 0===n?void 0:n.LoginConfig}},retry:!1})},Fn=e=>{var l,a,r,s,c,u;let{config:d,t:m,stateCode:p}=e;const{data:v,isLoading:f}=Digit.Hooks.useTenants(),[g,E]=n.useState(null),y=i.useHistory(),[h,b]=n.useState(null),{data:S}=jn(p);if(null!=S&&S.config){var N;const e=null==S||null===(N=S.config[0])||void 0===N?void 0:N.bannerImages;d.bannerImages=e}n.useEffect(()=>{var e,t;if(!g)return void Digit.UserService.setType("employee");Digit.UserService.setUser(g);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee";y.replace(n)},[g]);const C=()=>{b(null)},O=function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();const t={otp:{userName:e.username,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=Qe(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;y.push("/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee/user/change-password?USERNAME="+e.username+"&tenantId="+e.city.code)})},function(e){var t,n,o,l,a;b((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===(a=l[0])||void 0===a?void 0:a.message)||"Invalid login credentials!"),setTimeout(C,5e3)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},w=()=>{var e;y.replace("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/login")},[I,_]=d.inputs,D=[{body:[{label:m("USERNAME"),type:"text",populators:{name:"username"},isMandatory:!0},{label:m(_.label),type:_.type,populators:{name:_.name,optionsKey:"name",required:!0,options:v},isMandatory:!0}]}];return f?o.createElement(t.Loader,{page:!0,variant:"PageLoader"}):null!=d&&d.bannerImages?o.createElement(o.Fragment,null,o.createElement("div",{className:"login-container"},o.createElement(Bn,{bannerImages:null==d?void 0:d.bannerImages}),o.createElement("div",{className:"login-form-container"},o.createElement(t.FormComposerV2,{onSubmit:O,noBoxShadow:!0,inline:!0,submitInForm:!0,config:D,label:d.texts.submitButtonLabel,secondaryActionLabel:d.texts.secondaryButtonLabel,onSecondayActionClick:w,heading:d.texts.header,description:d.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},o.createElement(Rn,null)),h&&o.createElement(t.Toast,{type:"error",label:m(h),onClose:C}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(le,{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(a=l.globalConfigs)||void 0===a||null===(r=a.getConfig)||void 0===r?void 0:r.call(a,"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()}})," ")))):o.createElement(Ln,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:O,noBoxShadow:!0,inline:!0,submitInForm:!0,config:D,label:d.texts.submitButtonLabel,secondaryActionLabel:d.texts.secondaryButtonLabel,onSecondayActionClick:w,heading:d.texts.header,description:d.texts.description,headingStyle:{textAlign:"center",fontWeight:"bold",color:"#363636"},descriptionStyles:{color:"#787878",textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},o.createElement(Rn,null)),h&&o.createElement(t.Toast,{type:"error",label:m(h),onClose:C}),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(le,{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()}})," "))};Fn.propTypes={loginParams:ne.any},Fn.defaultProps={loginParams:null};const Hn=e=>{let{stateCode:t}=e;const{t:a}=l.useTranslation(),{path:r}=i.useRouteMatch(),s=n.useMemo(()=>kn.map(e=>{const t={};for(const n in e.texts)t[n]=a(e.texts[n]);return m({},e,{texts:t})},[kn]));return o.createElement(i.Switch,null,o.createElement(i.Route,{path:""+r,exact:!0},o.createElement(Fn,{config:s[0],t:a,stateCode:t})))},zn=(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)}),Gn=e=>{var t;let{stateCode:n,userType:l,modules:a,appTenants:r,additionalComponent:s}=e;Digit;const{path:c}=i.useRouteMatch(),u=i.useLocation(),d=Digit.UserService.getUser();var m;if(!d||null==d||!d.access_token||null==d||!d.info)return o.createElement(i.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==a?void 0:a.map((e,t)=>{var a;let{code:s,tenants:u}=e;const d=Digit.ComponentRegistryService.getComponent(s+"Module");return o.createElement(i.Route,{key:t,path:c+"/"+s.toLowerCase()},d?o.createElement(d,{stateCode:n,moduleCode:s,userType:l,tenants:zn(u,r)}):o.createElement(i.Redirect,{to:"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/employee/user/error?type=notfound&module="+s}))}),v=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return u.pathname.includes(c+"/productDetailsPage/"),o.createElement("div",{className:v?"":"ground-container digit-home-ground"},o.createElement(i.Switch,null,p,o.createElement(i.Route,{path:c+"/login"},o.createElement(i.Redirect,{to:{pathname:"/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee/user/login",state:{from:u.pathname+u.search}}})),o.createElement(i.Route,{path:c+"/forgot-password"},o.createElement(Hn,null)),o.createElement(i.Route,{path:c+"/change-password"},o.createElement(Mn,null)),o.createElement(i.Route,null,o.createElement(Se,{userType:l,modules:a,additionalComponent:s}))))};var Vn,Wn,Qn;const Xn={label:"English",value:null===(Vn=Digit)||void 0===Vn||null===(Wn=Vn.Utils)||void 0===Wn||null===(Qn=Wn.getDefaultLanguage)||void 0===Qn?void 0:Qn.call(Wn)},qn=()=>{var e,a,r,c,u;const{data:d,isLoading:m}=Digit.Hooks.useStore.getInitData(),{t:p}=l.useTranslation(),v=i.useHistory(),{languages:f,stateInfo:g}=d||{};let E=f;E&&0!=(null===(e=E)||void 0===e?void 0:e.length)||(E=[Xn]);const y=Digit.StoreData.getCurrentLanguage(),[h,b]=n.useState(y),S=(null==f?void 0:f.length)>1;return m?o.createElement(t.Loader,null):S?o.createElement(Ln,null,o.createElement(t.Card,{className:"bannerCard removeBottomMargin languageSelection"},o.createElement("div",{className:"bannerHeader"},o.createElement(le,{className:"bannerLogo",src:null==g?void 0:g.logoUrl,alt:"Digit Banner Image"}),o.createElement("p",null,p("TENANT_TENANTS_"+(null==g||null===(a=g.code)||void 0===a?void 0:a.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=>{b(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("/"+((t=window.contextPath)&&"string"==typeof t?t.split("/")[0]:"")+"/user/login?ts="+Date.now())}})),o.createElement("div",{className:"EmployeeLoginFooter"},o.createElement(le,{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(c=r.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()}})," ")):o.createElement(i.Redirect,{to:"/"+(null===(N=window)||void 0===N?void 0:N.contextPath)+"/employee/user/login"});var N},Zn=[{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:!0,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"Sandbox"},populators:{name:"check"}}]}],Yn=["UserRequest"],Jn=e=>{var l,a,r,s,c,u,d,v,f,g;let{config:E,t:y,isDisabled:h,loginOTPBased:b}=e;const{isLoading:S}=Digit.Hooks.useTenants(),{data:N,isLoading:C}=Digit.Hooks.useStore.getInitData(),{stateInfo:O}=N||{},[w,I]=n.useState(null),[_,D]=n.useState(null),[T,A]=n.useState(!1),L=null===(l=Digit.ComponentRegistryService)||void 0===l?void 0:l.getComponent("DynamicLoginComponent"),R=i.useHistory();n.useEffect(()=>{var e,t,n,o,l,a,r,i,s,c,u,d,m,p,v,f,g,E;if(!w)return;Digit.SessionStorage.set("citizen.userRequestObject",w);const y=null==w||null===(e=w.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==w||null===(n=w.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.length)>0&&(w.info.roles=y),Digit.UserService.setUser(w),((e,t)=>{var n;if(Digit.Utils.getMultiRootTenant()&&"development"!==process.env.NODE_ENV)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==w?void 0:w.info,null==w?void 0:w.access_token);let h="/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/employee";var b,S,N,C,O,I,_;null!==(a=window)&&void 0!==a&&null!==(r=a.location)&&void 0!==r&&null!==(i=r.href)&&void 0!==i&&i.includes("from=")&&(h=decodeURIComponent(null===(b=window)||void 0===b||null===(S=b.location)||void 0===S||null===(N=S.href)||void 0===N||null===(C=N.split("from="))||void 0===C?void 0:C[1])||"/"+(null===(O=window)||void 0===O?void 0:O.contextPath)+"/employee"),null!=w&&null!==(s=w.info)&&void 0!==s&&s.roles&&(null==w||null===(c=w.info)||void 0===c||null===(u=c.roles)||void 0===u?void 0:u.length)>0&&null!=w&&null!==(d=w.info)&&void 0!==d&&null!==(m=d.roles)&&void 0!==m&&m.every(e=>"NATADMIN"===e.code)&&(h="/"+(null===(I=window)||void 0===I?void 0:I.contextPath)+"/employee/dss/landing/NURT_DASHBOARD"),null!=w&&null!==(p=w.info)&&void 0!==p&&p.roles&&(null==w||null===(v=w.info)||void 0===v||null===(f=v.roles)||void 0===f?void 0:f.length)>0&&null!=w&&null!==(g=w.info)&&void 0!==g&&null!==(E=g.roles)&&void 0!==E&&E.every(e=>"STADMIN"===e.code)&&(h="/"+(null===(_=window)||void 0===_?void 0:_.contextPath)+"/employee/dss/landing/home"),R.replace(h)},[w]);const P=function(e){try{var t,n,o;function l(){A(!1)}null!=e&&e.username&&(e.username=e.username.trim()),null!=e&&e.password&&(e.password=e.password.trim()),A(!0);const a=m({},e,G,{userType:"EMPLOYEE"});a.tenantId=(null==a||null===(t=a.city)||void 0===t?void 0:t.code)||(null===(n=Digit)||void 0===n||null===(o=n.ULBService)||void 0===o?void 0:o.getStateId()),delete a.city;const r=Qe(function(){return Promise.resolve(Digit.UserService.authenticate(a)).then(function(e){let{UserRequest:t}=e,n=p(e,Yn);Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),I(m({info:t},n))})},function(e){var t,n;D((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)&&y("ES_ERROR_USER_NOT_PERMITTED")||y("INVALID_LOGIN_CREDENTIALS")),setTimeout(U,5e3)});return Promise.resolve(r&&r.then?r.then(l):l())}catch(e){return Promise.reject(e)}},x={url:"/user-otp/v1/_send",params:{tenantId:null===(a=Digit)||void 0===a||null===(r=a.ULBService)||void 0===r?void 0:r.getStateId()},body:{},config:{enable:!1}},M=Digit.Hooks.useCustomAPIMutationHook(x),k=function(e){try{var t,n;const o=e.email;return Promise.resolve(M.mutate({body:{otp:{userName:e.email,type:"login",tenantId:null===(t=Digit)||void 0===t||null===(n=t.ULBService)||void 0===n?void 0:n.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,a,r,i,s;D(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===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(i=r.Errors)||void 0===i||null===(s=i[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"),setTimeout(U,5e3)},onSuccess:function(e){try{var t,n,l;return R.push("/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/employee/user/login/otp",{state:{email:o,tenant:null===(n=Digit)||void 0===n||null===(l=n.ULBService)||void 0===l?void 0:l.getStateId()}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},U=()=>{D(null)},B=()=>{var e;R.push("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/employee/user/forgot-password")},j=Digit.ULBService.getStateId(),F={code:j,name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+j)};let H=[{body:null==E?void 0:E.inputs}];const{mode:z}=Digit.Hooks.useQueryParams();"admin"===z&&!1===(null==H||null===(s=H[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u?void 0:u.disable)&&null==(null==H||null===(d=H[0])||void 0===d||null===(v=d.body)||void 0===v||null===(f=v[2])||void 0===f||null===(g=f.populators)||void 0===g?void 0:g.defaultValue)&&(H[0].body[2].disable=!0,H[0].body[2].isMandatory=!1,H[0].body[2].populators.defaultValue=F);const G=n.useMemo(()=>Object.fromEntries(H[0].body.filter(e=>{var t,n;return(null==e||null===(t=e.populators)||void 0===t?void 0:t.defaultValue)&&(null==e||null===(n=e.populators)||void 0===n?void 0:n.name)}).map(e=>[e.populators.name,e.populators.defaultValue])),[]),V=(e,t,n)=>{const o=H[0].body.filter(e=>null==e?void 0:e.isMandatory).map(e=>null==e?void 0:e.key).some(e=>{const n=t[e];return null==n||""===n||!1===n});A(o)},W=H.map(e=>m({},e,{body:e.body.map(e=>"check"===e.key?m({},e,{isMandatory:!0}):e)})),Q=function(e,n,l){var a,r,i;return void 0===e&&(e=""),void 0===n&&(n=""),void 0===l&&(l=""),o.createElement(t.FormComposerV2,{onSubmit:b?k:P,isDisabled:h||T,noBoxShadow:!0,inline:!0,submitInForm:!0,config:W,label:null==E||null===(a=E.texts)||void 0===a?void 0:a.submitButtonLabel,secondaryActionLabel:(null==E||null===(r=E.texts)||void 0===r?void 0:r.secondaryButtonLabel)+(e.includes("login-form-container")?"?":""),onSecondayActionClick:B,onFormValueChange:V,heading:null==E||null===(i=E.texts)||void 0===i?void 0:i.header,className:""+l,cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:n,buttonClassName:"buttonClassName",defaultValues:G},o.createElement(Rn,null!=O&&O.code?null:{showTenant:!1}))},X=e=>{var t,n,l;return o.createElement("div",{className:e,style:{backgroundColor:"unset"}},o.createElement(le,{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(n=t.globalConfigs)||void 0===n||null===(l=n.getConfig)||void 0===l?void 0:l.call(n,"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()}}))};return S||C?o.createElement(t.Loader,{page:!0,variant:"PageLoader"}):null!=E&&E.bannerImages?o.createElement("div",{className:"login-container"},o.createElement(Bn,{bannerImages:null==E?void 0:E.bannerImages}),o.createElement("div",{className:"login-form-container"},Q("login-form-container","",b?"sandbox-onboarding-wrapper":""),L&&o.createElement(L,null),_&&o.createElement(t.Toast,{type:"error",label:y(_),onClose:U}),X("EmployeeLoginFooter"))):o.createElement(Ln,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),Q("loginFormStyleEmployee","loginCardClassName",b?"sandbox-onboarding-wrapper":""),L&&o.createElement(L,null),_&&o.createElement(t.Toast,{type:"error",label:y(_),onClose:U}),X("employee-login-home-footer"))};Jn.propTypes={loginParams:ne.any},Jn.defaultProps={loginParams:null};const Kn=e=>{var a,r;let{stateCode:s}=e;const{t:c}=l.useTranslation(),{path:u}=i.useRouteMatch(),[d,p]=n.useState(Un),[v,f]=n.useState(Zn),g=Digit.StoreData.getCurrentLanguage(),E=(null===(a=window)||void 0===a||null===(r=a.globalConfigs)||void 0===r?void 0:r.getConfig("OTP_BASED_LOGIN"))||!1,{data:y,isLoading:h}=jn(s),b=i.useHistory(),S=i.useLocation();n.useEffect(()=>{if(!new URLSearchParams(S.search).get("ts")){const e=Date.now();b.replace({pathname:S.pathname,search:"?ts="+e})}},[S,b]),Digit.Services.useStore({stateCode:s,moduleCode:["privacy-policy"],language:g,modulePrefix:"digit"}),n.useEffect(()=>{p(0==h&&null!=y&&y.config?null==y?void 0:y.config:Un)},[y,h]);const N=n.useMemo(()=>d.map(e=>{const t={};for(const n in e.texts)t[n]=c(e.texts[n]);return m({},e,{texts:t})},[d])),C=n.useMemo(()=>v.map(e=>{const t={};for(const n in e.texts)t[n]=c(e.texts[n]);return m({},e,{texts:t})},[v]));return h?o.createElement(t.Loader,{page:!1,variant:"PageLoader"}):o.createElement(i.Switch,null,o.createElement(i.Route,{path:""+u,exact:!0},o.createElement(Jn,E?{config:C[0],t:c,loginOTPBased:E}:{config:N[0],t:c})))};var $n,eo,to,no;function oo(){return(oo=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)}function lo(e){return n.createElement("svg",oo({width:319,height:48,fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),$n||($n=n.createElement("path",{fill:"url(#SandboxHeader_svg__pattern0_27111_38436)",d:"M0 0h138v48H0z"})),eo||(eo=n.createElement("path",{stroke:"#000",d:"M152.5 7v34"})),to||(to=n.createElement("path",{d:"M184.62 15.34c-.16.28-.333.487-.52.62-.173.12-.393.18-.66.18-.28 0-.587-.1-.92-.3a17.66 17.66 0 00-1.16-.7 9.019 9.019 0 00-1.6-.68c-.6-.213-1.313-.32-2.14-.32-.747 0-1.4.093-1.96.28-.56.173-1.033.42-1.42.74a3.03 3.03 0 00-.84 1.16c-.187.44-.28.927-.28 1.46 0 .68.187 1.247.56 1.7.387.453.893.84 1.52 1.16.627.32 1.34.607 2.14.86s1.62.527 2.46.82c.84.28 1.66.613 2.46 1 .8.373 1.513.853 2.14 1.44a6.286 6.286 0 011.5 2.12c.387.84.58 1.86.58 3.06a9.924 9.924 0 01-.68 3.68 8.4 8.4 0 01-1.96 2.98c-.853.84-1.9 1.507-3.14 2-1.24.48-2.66.72-4.26.72-.92 0-1.827-.093-2.72-.28a14.04 14.04 0 01-2.58-.76 13.939 13.939 0 01-2.3-1.2 11.14 11.14 0 01-1.92-1.56l1.58-2.58a1.58 1.58 0 01.52-.46c.213-.133.44-.2.68-.2.333 0 .693.14 1.08.42.387.267.847.567 1.38.9.533.333 1.153.64 1.86.92.72.267 1.58.4 2.58.4 1.533 0 2.72-.36 3.56-1.08.84-.733 1.26-1.78 1.26-3.14 0-.76-.193-1.38-.58-1.86-.373-.48-.873-.88-1.5-1.2a10.859 10.859 0 00-2.14-.84c-.8-.227-1.613-.473-2.44-.74a21.03 21.03 0 01-2.44-.96 7.909 7.909 0 01-2.14-1.46c-.627-.6-1.133-1.347-1.52-2.24-.373-.907-.56-2.02-.56-3.34 0-1.053.207-2.08.62-3.08.427-1 1.04-1.887 1.84-2.66.8-.773 1.787-1.393 2.96-1.86 1.173-.467 2.52-.7 4.04-.7 1.707 0 3.28.267 4.72.8s2.667 1.28 3.68 2.24l-1.34 2.54zm16.34 14.9c-1.427.067-2.627.193-3.6.38-.974.173-1.754.4-2.34.68-.587.28-1.007.607-1.26.98-.254.373-.38.78-.38 1.22 0 .867.253 1.487.76 1.86.52.373 1.193.56 2.02.56 1.013 0 1.886-.18 2.62-.54.746-.373 1.473-.933 2.18-1.68v-3.46zm-11.32-8.9c2.36-2.16 5.2-3.24 8.52-3.24 1.2 0 2.273.2 3.22.6a6.645 6.645 0 012.4 1.64c.653.693 1.146 1.527 1.48 2.5.346.973.52 2.04.52 3.2V39h-2.24c-.467 0-.827-.067-1.08-.2-.254-.147-.454-.433-.6-.86l-.44-1.48c-.52.467-1.027.88-1.52 1.24a9.384 9.384 0 01-1.54.88c-.534.24-1.107.42-1.72.54-.6.133-1.267.2-2 .2a8.09 8.09 0 01-2.4-.34 5.385 5.385 0 01-1.9-1.06 4.703 4.703 0 01-1.24-1.74c-.294-.693-.44-1.5-.44-2.42 0-.52.086-1.033.26-1.54.173-.52.453-1.013.84-1.48.4-.467.913-.907 1.54-1.32.626-.413 1.393-.773 2.3-1.08.92-.307 1.986-.553 3.2-.74 1.213-.2 2.6-.32 4.16-.36v-1.2c0-1.373-.294-2.387-.88-3.04-.587-.667-1.434-1-2.54-1-.8 0-1.467.093-2 .28-.52.187-.98.4-1.38.64-.4.227-.767.433-1.1.62-.32.187-.68.28-1.08.28-.347 0-.64-.087-.88-.26-.24-.187-.434-.4-.58-.64l-.88-1.58zm25.412-.34c.414-.413.847-.793 1.3-1.14.467-.36.954-.66 1.46-.9a7.656 7.656 0 011.66-.58 7.909 7.909 0 011.92-.22c1.12 0 2.114.193 2.98.58a5.654 5.654 0 012.16 1.6c.587.68 1.027 1.5 1.32 2.46.307.947.46 1.993.46 3.14V39h-4.94V25.94c0-1.253-.286-2.22-.86-2.9-.573-.693-1.446-1.04-2.62-1.04-.853 0-1.653.193-2.4.58a8.62 8.62 0 00-2.12 1.58V39h-4.94V18.48h3.02c.64 0 1.06.3 1.26.9l.34 1.62zm30.838 2.72c-.56-.68-1.173-1.16-1.84-1.44a5.323 5.323 0 00-2.12-.42c-.746 0-1.42.14-2.02.42-.6.28-1.113.707-1.54 1.28-.426.56-.753 1.28-.98 2.16-.226.867-.34 1.893-.34 3.08 0 1.2.094 2.22.28 3.06.2.827.48 1.507.84 2.04.36.52.8.9 1.32 1.14.52.227 1.1.34 1.74.34 1.027 0 1.9-.213 2.62-.64.72-.427 1.4-1.033 2.04-1.82v-9.2zm4.94-14.44V39h-3.02c-.653 0-1.066-.3-1.24-.9l-.42-1.98a10.293 10.293 0 01-2.86 2.3c-1.066.587-2.313.88-3.74.88-1.12 0-2.146-.233-3.08-.7-.933-.467-1.74-1.14-2.42-2.02-.666-.893-1.186-1.993-1.56-3.3-.36-1.307-.54-2.8-.54-4.48 0-1.52.207-2.933.62-4.24.414-1.307 1.007-2.44 1.78-3.4a8.202 8.202 0 012.78-2.24c1.08-.547 2.294-.82 3.64-.82 1.147 0 2.127.18 2.94.54.814.36 1.54.847 2.18 1.46V9.28h4.94zm9.816 24.4c.56.68 1.166 1.16 1.82 1.44.666.28 1.366.42 2.1.42.76 0 1.44-.133 2.04-.4a4.001 4.001 0 001.56-1.28c.426-.587.753-1.327.98-2.22.226-.907.34-1.987.34-3.24 0-2.253-.374-3.88-1.12-4.88-.747-1.013-1.82-1.52-3.22-1.52-.947 0-1.774.22-2.48.66-.707.427-1.38 1.033-2.02 1.82v9.2zm0-12.68a10.055 10.055 0 012.74-2.06c1.013-.52 2.166-.78 3.46-.78 1.186 0 2.253.233 3.2.7a6.715 6.715 0 012.44 2.02c.68.867 1.2 1.92 1.56 3.16.36 1.24.54 2.633.54 4.18 0 1.667-.207 3.18-.62 4.54-.414 1.36-1.007 2.527-1.78 3.5a8.002 8.002 0 01-2.76 2.24c-1.08.533-2.28.8-3.6.8-.64 0-1.22-.067-1.74-.2a6.148 6.148 0 01-2.66-1.34c-.36-.333-.707-.7-1.04-1.1l-.22 1.38c-.08.347-.22.593-.42.74-.187.147-.447.22-.78.22h-3.26V9.28h4.94V21zm26.835-2.84c1.52 0 2.9.247 4.14.74 1.253.493 2.32 1.193 3.2 2.1.893.907 1.58 2.013 2.06 3.32s.72 2.767.72 4.38c0 1.627-.24 3.093-.72 4.4-.48 1.307-1.167 2.42-2.06 3.34-.88.92-1.947 1.627-3.2 2.12-1.24.493-2.62.74-4.14.74-1.533 0-2.927-.247-4.18-.74a9.04 9.04 0 01-3.22-2.12c-.88-.92-1.567-2.033-2.06-3.34-.48-1.307-.72-2.773-.72-4.4 0-1.613.24-3.073.72-4.38.493-1.307 1.18-2.413 2.06-3.32.893-.907 1.967-1.607 3.22-2.1 1.253-.493 2.647-.74 4.18-.74zm0 17.34c1.707 0 2.967-.573 3.78-1.72.827-1.147 1.24-2.827 1.24-5.04s-.413-3.9-1.24-5.06c-.813-1.16-2.073-1.74-3.78-1.74-1.733 0-3.02.587-3.86 1.76-.827 1.16-1.24 2.84-1.24 5.04s.413 3.88 1.24 5.04c.84 1.147 2.127 1.72 3.86 1.72zm31.271 3.5h-4.76c-.36 0-.653-.093-.88-.28a2.772 2.772 0 01-.54-.64l-4.34-7.14c-.066.227-.146.44-.24.64-.08.2-.173.387-.28.56l-3.84 5.94a3.39 3.39 0 01-.54.64c-.213.187-.48.28-.8.28h-4.42l7.04-10.58-6.76-9.94h4.76c.36 0 .627.053.8.16.174.093.327.253.46.48l4.3 6.84c.147-.453.354-.9.62-1.34l3.46-5.4c.294-.493.674-.74 1.14-.74h4.54l-6.74 9.72 7.02 10.8z",fill:"#4F5052"})),no||(no=n.createElement("defs",null,n.createElement("pattern",{id:"SandboxHeader_svg__pattern0_27111_38436",patternContentUnits:"objectBoundingBox",width:1,height:1},n.createElement("use",{xlinkHref:"#SandboxHeader_svg__image0_27111_38436",transform:"scale(.00229 .00658)"})),n.createElement("image",{id:"SandboxHeader_svg__image0_27111_38436",width:437,height:152,preserveAspectRatio:"none",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbUAAACYCAYAAABj73eBAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDIzLTA2LTE2VDEyOjI1OjU2KzA1OjMwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAyMy0wNi0xNlQxMjoyNzowNSswNTozMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAyMy0wNi0xNlQxMjoyNzowNSswNTozMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHBob3Rvc2hvcDpDb2xvck1vZGU9IjMiIHBob3Rvc2hvcDpJQ0NQcm9maWxlPSJzUkdCIElFQzYxOTY2LTIuMSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0MjIxNmQ5Ni02YWMw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"}))))}const ao=e=>{var n;let{showTenant:a=!0}=e;const{data:r,isLoading:i}=Digit.Hooks.useStore.getInitData(),{stateInfo:s}=r||{},{t:c}=l.useTranslation();return i?o.createElement(t.Loader,null):o.createElement("div",{className:"bannerHeader"},o.createElement("div",{className:"SandboxLogoAlignCenter"},o.createElement(lo,null)),a&&(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()))))},ro=e=>{let{bannerImages:t}=e;const[l,a]=n.useState(0),[r,i]=n.useState(!1);if(n.useEffect(()=>{const e=setInterval(()=>{i(!0),setTimeout(()=>{a(e=>(e+1)%t.length),i(!1)},200)},5e3);return()=>clearInterval(e)},[t.length]),!t||0===t.length)return o.createElement("div",null,"No images available");const{image:s,title:c,description:u}=t[l];return o.createElement("div",{className:"carousel-container",style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"}},o.createElement("div",{style:{position:"relative",width:"100%",height:"100%",transition:"opacity 0.4s ease-in-out, transform 0.4s ease-in-out",opacity:r?.7:1,transform:r?"scale(1.02)":"scale(1)"}},o.createElement("img",{className:"carousel-img",src:s,alt:c,style:{width:"100%",height:"100%",objectFit:"cover",display:"block",transition:"filter 0.4s ease-in-out",filter:r?"blur(1px)":"blur(0px)"}})),o.createElement("div",{style:{position:"absolute",left:0,bottom:0,width:"100%",height:"60%",background:"linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0) 100%)",zIndex:1,pointerEvents:"none"}}),o.createElement("div",{className:"carousel-overlay",style:{position:"absolute",bottom:"10rem",left:"2rem",maxWidth:"70%",color:"#fff",zIndex:2,transition:"opacity 0.4s ease-in-out, transform 0.4s ease-in-out",opacity:r?.6:1,transform:r?"translateY(10px)":"translateY(0px)"}},o.createElement("h2",{style:{margin:"0 0 1rem",fontSize:"2.5rem",fontWeight:"bold",textShadow:"2px 2px 4px rgba(0, 0, 0, 0.8)",lineHeight:1.2,transition:"all 0.4s ease-in-out"}},c),o.createElement("p",{style:{margin:0,fontSize:"1.1rem",lineHeight:1.6,textShadow:"1px 1px 2px rgba(0, 0, 0, 0.8)",opacity:.95,transition:"all 0.4s ease-in-out"}},u)),o.createElement("div",{style:{position:"absolute",bottom:"3.5rem",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:3,gap:"1rem"}},o.createElement("button",{onClick:()=>{i(!0),setTimeout(()=>{a(e=>(e-1+t.length)%t.length),i(!1)},200)},style:{backgroundColor:"transparent",border:"none",color:"white",fontSize:"1.5rem",cursor:"pointer",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}},"‹"),o.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.75rem"}},t.map((e,t)=>o.createElement("button",{key:t,onClick:()=>(e=>{e!==l&&(i(!0),setTimeout(()=>{a(e),i(!1)},200))})(t),style:{width:"10px",height:"10px",borderRadius:"50%",border:t===l?"1px solid rgba(255, 255, 255, 0.8)":"1px solid rgba(255, 255, 255, 0.3)",padding:0,background:t===l?"white":"rgba(255, 255, 255, 0.4)",cursor:"pointer",transition:"all 0.3s ease",transform:t===l?"scale(1.4)":"scale(1)",boxShadow:t===l?"0 0 8px rgba(255, 255, 255, 0.5)":"none"},onMouseEnter:e=>{t!==l&&(e.target.style.background="rgba(255, 255, 255, 0.7)",e.target.style.transform="scale(1.2)")},onMouseLeave:e=>{t!==l&&(e.target.style.background="rgba(255, 255, 255, 0.4)",e.target.style.transform="scale(1)")}}))),o.createElement("button",{onClick:()=>{i(!0),setTimeout(()=>{a(e=>(e+1)%t.length),i(!1)},200)},style:{backgroundColor:"transparent",border:"none",color:"white",fontSize:"1.5rem",cursor:"pointer",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}},"›")))},io=["UserRequest"],so=e=>{var a,r,c;let{isLogin:u=!1}=e;const{t:d}=l.useTranslation(),v=(i.useRouteMatch(),i.useHistory()),f=i.useLocation(),[g,E]=n.useState(null),[y,h]=n.useState(!1),[b,S]=n.useState(null),N=(null==f||null===(a=f.state)||void 0===a?void 0:a.email)||sessionStorage.getItem("otpEmail")||"",C=(null==f||null===(r=f.state)||void 0===r?void 0:r.tenant)||sessionStorage.getItem("otpTenant")||"",{data:O}=Digit.Hooks.useCustomMDMS(C,"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==O||null===(c=O[0])||void 0===c?void 0:c.url,I=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:N,tenant:C},populators:{required:!0}}],bannerImages:[{id:1,image:"https://images.unsplash.com/photo-1746277121508-f44615ff09bb",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:2,image:"https://images.unsplash.com/photo-1581094271901-8022df4466f9",title:"Digital Headquarters for National Health Agencies",description:"Access real-time data dashboards and manage complaints."}]}],_=()=>E(null);n.useEffect(()=>{var e,t,n,o,l;if(!b)return;Digit.SessionStorage.set("citizen.userRequestObject",b);const a=null==b||null===(e=b.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==b||null===(n=b.info)||void 0===n||null===(o=n.roles)||void 0===o?void 0:o.length)>0&&(b.info.roles=a),Digit.UserService.setUser(b),((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==b?void 0:b.info,null==b?void 0:b.access_token);const r=((e,t,n,o)=>{var l,a,r,i,s,c;const u="SUPERUSER"===(null==t||null===(l=t.info)||void 0===l||null===(a=l.roles)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.code),d=null===(i=window)||void 0===i?void 0:i.contextPath;switch(!0){case"/sandbox-ui/user/otp"===e&&u:return"/"+d+"/employee/sandbox/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"}})(f.pathname,b,O,w);v.push(u?r:{pathname:"/"+(null===(l=window)||void 0===l?void 0:l.globalPath)+"/user/setup",state:{tenant:C}})},[b]);const D=function(e){try{var t;const n={username:N,password:null==e||null===(t=e.OtpComponent)||void 0===t?void 0:t.otp,tenantId:C,userType:"EMPLOYEE"},o=Qe(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){let{UserRequest:t}=e,n=p(e,io);Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),S(m({info:t},n))})},function(e){var t,n;E((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)&&d("ES_ERROR_USER_NOT_PERMITTED")||d("INVALID_LOGIN_CREDENTIALS")),setTimeout(_,5e3)});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},T=window.innerWidth<=768,A=()=>{var e,n,l;return o.createElement("div",{style:{padding:T?"1rem":"2rem",width:T?"100%":"30%",backgroundColor:"#fff",overflowY:"auto",justifyContent:"center",display:"flex",alignItems:"center",flexDirection:"column",height:T?"100vh":"auto"}},o.createElement("div",{className:"employeeBackbuttonAlign",style:{alignSelf:"flex-start",marginBottom:"1rem"}},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(s.FormComposerV2,{onSubmit:D,noBoxShadow:!0,inline:!0,submitInForm:!0,config:I,label:d("CORE_COMMON_SUBMIT"),headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper",buttonClassName:"sandbox-otp-submit-button",buttonStyle:{width:"100%",maxWidth:"408px",backgroundColor:"#F47738",borderColor:"#F47738",color:"#fff",fontWeight:"500",padding:"12px 24px",borderRadius:"4px",fontSize:"16px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center"},onFormValueChange:(e,t)=>{var n,o;return h(6===(null==t||null===(n=t.OtpComponent)||void 0===n||null===(o=n.otp)||void 0===o?void 0:o.length))},isDisabled:!y},o.createElement(ao,{showTenant:!1})),g&&o.createElement(t.Toast,{type:"error",label:d(g),onClose:_}),o.createElement("div",{className:"EmployeeLoginFooter",style:{marginTop:"auto"}},o.createElement(le,{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(n=e.globalConfigs)||void 0===n||null===(l=n.getConfig)||void 0===l?void 0:l.call(n,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;return 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()}})))};return T?A():o.createElement("div",{style:{display:"flex",height:"100vh"}},o.createElement("div",{style:{width:"70%",position:"relative"}},o.createElement(ro,{bannerImages:I[0].bannerImages})),A())},co=["user/landing","user/profile","user/error","user/productPage"],uo=e=>{var a,r,s,c,u,d;let{stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:f,mobileView:g,handleUserDropdownSelection:E,logoUrl:y,logoUrlWhite:h,DSO:b,stateCode:S,modules:N,appTenants:C,initData:O,noTopBar:w=!1}=e;const I=i.useHistory(),{t:_}=l.useTranslation(),{path:D}=i.useRouteMatch(),T=i.useLocation(),A=null==T||null===(a=T.pathname)||void 0===a?void 0:a.includes("language-selection"),L=co.some(e=>{var t;return null==T||null===(t=T.pathname)||void 0===t?void 0:t.includes(e)});n.useEffect(()=>{Digit.UserService.setType("employee")},[]);const R=null==O||null===(r=O.modules)||void 0===r||null===(s=r.filter(e=>null==e?void 0:e.additionalComponent))||void 0===s?void 0:s.map(e=>null==e?void 0:e.additionalComponent),P=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant(),x=T.pathname.includes("employee/sandbox/productDetailsPage/");return n.useEffect(()=>{const e=T.pathname===D||T.pathname===D+"/",t="sandbox"===new URLSearchParams(T.search).get("from");P&&e&&!t&&I.replace(D+"/sandbox/productPage")},[T.pathname,T.search,D,I,P]),o.createElement("div",{className:"employee"},o.createElement(i.Switch,null,o.createElement(i.Route,{path:D+"/user"},L&&o.createElement(Me,{t:_,stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:f,mobileView:g,handleUserDropdownSelection:E,logoUrl:y,logoUrlWhite:h,showSidebar:!!L,showLanguageChange:!A}),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(i.Switch,null,!Digit.Utils.getMultiRootTenant()&&o.createElement(i.Route,{exact:!0,path:D+"/user/login"},o.createElement(Kn,{stateCode:S})),o.createElement(i.Route,{exact:!0,path:D+"/user/login/otp"},o.createElement(so,{isLogin:!0})),o.createElement(i.Route,{path:D+"/user/forgot-password"},o.createElement(Hn,{stateCode:S})),o.createElement(i.Route,{path:D+"/user/change-password"},o.createElement(Mn,null)),o.createElement(t.PrivateRoute,{path:D+"/user/profile",component:()=>o.createElement(Ke,{stateCode:S,userType:"employee",cityDetails:f})}),o.createElement(i.Route,{path:D+"/user/error"},o.createElement(ie,{initData:O,goToHome:()=>{var e,t,n,o;I.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(i.Route,{path:D+"/user/language-selection"},o.createElement(qn,null)),o.createElement(i.Route,null,o.createElement(i.Redirect,{to:D+"/user/language-selection"}))))),o.createElement(i.Route,null,!w&&o.createElement(Me,{t:_,stateInfo:m,userDetails:p,CITIZEN:v,cityDetails:f,mobileView:g,handleUserDropdownSelection:E,logoUrl:y,logoUrlWhite:h,modules:N}),o.createElement("div",{className:w?"":(P?"":"main")+" "+(b?"m-auto":"")+" digit-home-main"},o.createElement("div",{className:w?"":(P&&x?"":"employee-app-wrapper")+" digit-home-app-wrapper"},o.createElement(ce,{initData:O},o.createElement(Gn,{stateCode:S,userType:"employee",modules:N,appTenants:C,additionalComponent:R}))),o.createElement("div",{className:"employee-home-footer"},o.createElement(le,{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(i.Route,null,o.createElement(i.Redirect,{to:D+"/user/language-selection"}))))},mo=()=>{var e,a,r,s,c,u;const{t:d}=l.useTranslation(),m=i.useLocation(),{tenant:p}=m.state||{},v=(i.useHistory(),n.useRef(null)),f=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(a=e.info)||void 0===a?void 0:a.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(Ln,null,o.createElement("div",{className:"employeeBackbuttonAlign"},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.Card,{className:"card-sandbox"},o.createElement(Rn,{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===(r=window)||void 0===r?void 0:r.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(le,{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()}})))},po=e=>{const{state:n={}}=i.useLocation(),{t:a}=l.useTranslation(),r=i.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:()=>{r.push("/"+window.globalPath+"/")}};return o.createElement(Ln,null,o.createElement(t.Card,{className:"digit-employee-card customError"},o.createElement(Rn,{showTenant:!1}),o.createElement(t.CardHeader,{className:"center"},a(s.infoHeader)),o.createElement(t.CardText,{className:"center"},a(s.infoMessage)),o.createElement(t.Button,{className:"customErrorButton",label:a(null==s?void 0:s.buttonInfo),variation:"primary",isSuffix:!0,onClick:e=>{e.preventDefault(),null==s||s.action()}})))},vo=()=>{var e,t;const[a,r]=n.useState(0),s=(i.useHistory(),i.useLocation()),{t:u}=l.useTranslation(),{tenant:d}=s.state||{},m=["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"];n.useEffect(()=>{const e=setInterval(()=>{a<m.length&&r(e=>e+1)},2e3);if(a===m.length){clearInterval(e);const t=setTimeout(()=>{var e,t;y(p,g)?window.location.href="/"+(null===(e=window)||void 0===e?void 0:e.globalPath)+"/"+d+E:window.location.href="/"+(null===(t=window)||void 0===t?void 0:t.globalPath)+"/"+d+"/employee"},1e3);return()=>clearTimeout(t)}return()=>{clearInterval(e)}},[a]),n.useRef(null);const p=null===(e=Digit.SessionStorage.get("User"))||void 0===e||null===(t=e.info)||void 0===t?void 0:t.roles,[v,f]=n.useState(!0),{data:g}=Digit.Hooks.useCustomMDMS(d,"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!=g&&g[0].url&&f(!1)},[g]);const E=null==g?void 0:g[0].url,y=(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"))};return o.createElement("div",{className:"sandbox-loader-screen"},o.createElement("div",{className:"sandbox-loader"}),o.createElement("ul",{className:"sandbox-installation-steps"},m.map((e,t)=>o.createElement("li",{key:t,className:"sandbox-step "+(t<a?"sandbox-visible":"")},o.createElement("span",{className:"sandbox-step-text"},u(e)),t<a&&o.createElement(c.CheckCircle,{fill:"#00703C"})))))},fo=[{texts:{header:"CORE_COMMON_SIGN_UP",submitButtonLabel:"CORE_COMMON_SIGN_UP_BUTTON"},inputs:[{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,pattern:/^[A-Za-z]+( [A-Za-z]+)*$/,maxLength:50},error:"ERR_ACCOUNT_NAME_REQUIRED"},infoMessage:"SANDBOX_SIGNUP_ACCOUNT_NAME_TOOLTIP"},{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,}$/,maxLength:64},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!1,key:"PrivacyComponent",key:"check",type:"component",component:"LoginSignupSelector",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{required:!1,name:"check"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,required:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check",required:!1}}],bannerImages:[{id:1,image:"https://images.unsplash.com/photo-1746277121508-f44615ff09bb",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:2,image:"https://images.unsplash.com/photo-1581094271901-8022df4466f9",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:3,image:"https://images.unsplash.com/photo-1624555130581-1d9cca783bc0",title:"Digital Headquarters for National Health Agencies",description:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Cupiditate aut autem aperiam et modi saepe obcaecati doloremque voluptatem iusto quidem!"},{id:4,image:"https://images.unsplash.com/photo-1547481887-a26e2cacb5b2",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:5,image:"https://images.unsplash.com/photo-1536782376847-5c9d14d97cc0",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:6,image:"https://images.unsplash.com/photo-1490730141103-6cac27aaab94",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."}]}],go=e=>{var l,a,r,s,c,u,d;let{config:m,t:p,isDisabled:v}=e;const{isLoading:f}=Digit.Hooks.useTenants(),{isLoading:g}=Digit.Hooks.useStore.getInitData(),[E,y]=n.useState(null),[h,b]=n.useState(!1),S=i.useHistory(),N=Digit.Hooks.useCustomAPIMutationHook({url:"/tenant-management/tenant/_create",params:{},body:{},config:{enable:!1}}),C=function(e){try{return Promise.resolve(N.mutate({body:{tenant:{name:e.accountName,email:e.email}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l,a,r,i,s,c;y({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!==(a=l[0])&&void 0!==a&&a.code?"SANDBOX_SIGNUP_"+(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i||null===(s=i.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 S.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)}},O=()=>{y(null)};let w=[{body:null==m?void 0:m.inputs}];const{mode:I}=Digit.Hooks.useQueryParams();"admin"===I&&!1===(null==w||null===(l=w[0])||void 0===l||null===(a=l.body)||void 0===a||null===(r=a[2])||void 0===r?void 0:r.disable)&&void 0===(null==w||null===(s=w[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)&&(w[0].body[2].disable=!0,w[0].body[2].isMandatory=!1,w[0].body[2].populators.defaultValue=defaultValue);const _=(e,t,n)=>{const o=w[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});b(o)},D=window.innerWidth<=768,T=()=>{var e,n,l,a,r,i;return o.createElement("div",{style:{padding:D?"1rem":"2rem",width:D?"100%":"30%",backgroundColor:"#fff",overflowY:"auto",justifyContent:"center",display:"flex",alignItems:"center",flexDirection:"column"}},o.createElement("div",{className:"employeeBackbuttonAlign",style:{alignSelf:"flex-start",marginBottom:"1rem"}},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:C,isDisabled:v||h,noBoxShadow:!0,inline:!0,submitInForm:!0,config:w,label:null==m||null===(e=m.texts)||void 0===e?void 0:e.submitButtonLabel,secondaryActionLabel:null==m||null===(n=m.texts)||void 0===n?void 0:n.secondaryButtonLabel,onFormValueChange:_,heading:null==m||null===(l=m.texts)||void 0===l?void 0:l.header,className:"sandbox-signup-form",cardClassName:"sandbox-onboarding-wrapper"},o.createElement(ao,{showTenant:!1})),E&&o.createElement(t.Toast,{type:"error",label:p(null==E?void 0:E.label),onClose:O}),o.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset",marginTop:"auto"}},o.createElement(le,{alt:"Powered by DIGIT",src:null===(a=window)||void 0===a||null===(r=a.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()}})))};return f||g?o.createElement(t.Loader,null):D?T():o.createElement("div",{style:{display:"flex",height:"100vh"}},o.createElement("div",{style:{width:"70%",position:"relative"}},o.createElement(ro,{bannerImages:m.bannerImages})),T())};go.propTypes={loginParams:ne.any},go.defaultProps={loginParams:null};const Eo=e=>{let{stateCode:t}=e;const{t:a}=l.useTranslation(),{path:r}=i.useRouteMatch(),[s,c]=n.useState(fo),u=Digit.StoreData.getCurrentLanguage(),d=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:u,modulePrefix:"digit"}),i.useHistory()),p=i.useLocation();n.useEffect(()=>{if(!new URLSearchParams(p.search).get("ts")){const e=Date.now();d.replace({pathname:p.pathname,search:"?ts="+e})}},[p,d]);const{data:v,isLoading:f}=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==f&&null!=v&&v.config?null==v?void 0:v.config:fo)},[v,f]);const g=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=a(e.texts[n]);return m({},e,{texts:t})},[s]));return o.createElement(i.Switch,null,o.createElement(i.Route,{path:""+r,exact:!0},o.createElement(go,{config:g[0],t:a})))},yo=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,pattern:/^[A-Za-z]+( [A-Za-z]+)*$/,maxLength:50},error:"ERR_ACCOUNT_NAME_REQUIRED"}},{isMandatory:!1,key:"PrivacyComponent",key:"check",type:"component",component:"ForgotOrganizationTooltip",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{required:!1,name:"check"}},{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,}$/,maxLength:64},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!1,key:"PrivacyComponent",key:"check",type:"component",component:"LoginSignupSelector",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{required:!1,name:"check"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check"}}],bannerImages:[{id:1,image:"https://images.unsplash.com/photo-1746277121508-f44615ff09bb",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:2,image:"https://images.unsplash.com/photo-1581094271901-8022df4466f9",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:3,image:"https://images.unsplash.com/photo-1624555130581-1d9cca783bc0",title:"Digital Headquarters for National Health Agencies",description:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Cupiditate aut autem aperiam et modi saepe obcaecati doloremque voluptatem iusto quidem!"},{id:4,image:"https://images.unsplash.com/photo-1547481887-a26e2cacb5b2",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:5,image:"https://images.unsplash.com/photo-1536782376847-5c9d14d97cc0",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."},{id:6,image:"https://images.unsplash.com/photo-1490730141103-6cac27aaab94",title:"Digital Headquarters for National Health Agencies",description:"Set up and configure multiple campaigns, access real-time data dashboards, manage centralized help desks and complaints, and easily integrate with DHIS2 and other open-source products."}]}],ho=e=>{var l,a,r,s,c,u,d,m,p;let{config:v,t:f,isDisabled:g}=e;const{isLoading:E}=Digit.Hooks.useTenants(),{isLoading:y}=Digit.Hooks.useStore.getInitData(),[h,b]=n.useState(null),[S,N]=n.useState(!1);i.useHistory();const C={url:"/user-otp/v1/_send",params:{tenantId:null===(l=Digit)||void 0===l||null===(a=l.ULBService)||void 0===a?void 0:a.getStateId()},body:{},config:{enable:!1}},O=Digit.Hooks.useCustomAPIMutationHook(C),w=function(e){try{const t=e.email,n=e.accountName;return Promise.resolve(O.mutate({params:{tenantId:n},body:{otp:{userName:e.email,type:"login",tenantId:n,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,o,l;b({key:"error",label:null==e||null===(n=e.response)||void 0===n||null===(o=n.data)||void 0===o||null===(l=o.error)||void 0===l?void 0:l.message}),setTimeout(I,5e3)},onSuccess:function(e){try{var o;sessionStorage.setItem("otpEmail",t),sessionStorage.setItem("otpTenant",n);const e=function(e,t){const n=(e||"").split("/").filter(Boolean).join("/");return n.includes("/")?"/"+n+"/employee/user/login/otp":"/"+n+"/"+t+"/employee/user/login/otp"}(null===(o=window)||void 0===o?void 0:o.contextPath,n);return window.location.replace(e),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},I=()=>{b(null)};let _=[{body:null==v?void 0:v.inputs}];const{mode:D}=Digit.Hooks.useQueryParams();"admin"===D&&0==(null==_||null===(r=_[0])||void 0===r||null===(s=r.body)||void 0===s||null===(c=s[2])||void 0===c?void 0:c.disable)&&null==(null==_||null===(u=_[0])||void 0===u||null===(d=u.body)||void 0===d||null===(m=d[2])||void 0===m||null===(p=m.populators)||void 0===p?void 0:p.defaultValue)&&(_[0].body[2].disable=!0,_[0].body[2].isMandatory=!1,_[0].body[2].populators.defaultValue=defaultValue);const T=(e,t,n)=>{const o=_[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});N(o)},A=window.innerWidth<=768,L=()=>{var e,n,l,a,r,i;return o.createElement("div",{style:{padding:A?"1rem":"2rem",width:A?"100%":"30%",backgroundColor:"#fff",overflowY:"auto",justifyContent:"center",display:"flex",alignItems:"center",flexDirection:"column"}},o.createElement("div",{className:"employeeBackbuttonAlign",style:{alignSelf:"flex-start",marginBottom:"1rem"}},o.createElement(t.BackLink,{onClick:()=>window.history.back()})),o.createElement(t.FormComposerV2,{onSubmit:w,isDisabled:g||S,noBoxShadow:!0,inline:!0,submitInForm:!0,config:_,label:null==v||null===(e=v.texts)||void 0===e?void 0:e.submitButtonLabel,secondaryActionLabel:null==v||null===(n=v.texts)||void 0===n?void 0:n.secondaryButtonLabel,onFormValueChange:T,heading:null==v||null===(l=v.texts)||void 0===l?void 0:l.header,className:"sandbox-signup-form",cardClassName:"sandbox-onboarding-wrapper"},o.createElement(ao,{showTenant:!1})),h&&o.createElement(t.Toast,{type:"error",label:f(null==h?void 0:h.label),onClose:I}),o.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset",marginTop:"auto"}},o.createElement(le,{alt:"Powered by DIGIT",src:null===(a=window)||void 0===a||null===(r=a.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()}})))};return E||y?o.createElement(t.Loader,null):A?L():o.createElement("div",{style:{display:"flex",height:"100vh"}},o.createElement("div",{style:{width:"70%",position:"relative"}},o.createElement(ro,{bannerImages:v.bannerImages})),L())};ho.propTypes={loginParams:ne.any},ho.defaultProps={loginParams:null};const bo=e=>{let{stateCode:t}=e;const{t:a}=l.useTranslation(),{path:r}=i.useRouteMatch(),[s,c]=n.useState(yo),u=Digit.StoreData.getCurrentLanguage(),d=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:u,modulePrefix:"digit"}),i.useHistory()),p=i.useLocation();n.useEffect(()=>{if(!new URLSearchParams(p.search).get("ts")){const e=Date.now();d.replace({pathname:p.pathname,search:"?ts="+e})}},[p,d]);const{data:v,isLoading:f}=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==f&&null!=v&&v.config?null==v?void 0:v.config:yo)},[v,f]);const g=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=a(e.texts[n]);return m({},e,{texts:t})},[s]));return o.createElement(i.Switch,null,o.createElement(i.Route,{path:""+r,exact:!0},o.createElement(ho,{config:g[0],t:a})))},So=e=>{var t,l,a,r,s;let{stateCode:c,modules:u,appTenants:d,logoUrl:p,logoUrlWhite:v,initData:f,defaultLanding:g="citizen",allowedUserTypes:E=["citizen","employee"]}=e;const y=i.useHistory(),{pathname:h}=i.useLocation(),b=window.innerWidth,S=Digit.ULBService.getCurrentUlb(),N=Digit.UserService.getUser(),{data:C}=Digit.Hooks.useStore.getInitData(),{stateInfo:O}=C||{},w=Digit.UserService.hasAccess(["FSM_DSO"]);let I="CITIZEN"===(null==N||null===(t=N.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(I=!1),n.useEffect(()=>{var e,t,n;null!=h&&h.includes("application-details")||(null!=h&&h.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=h&&h.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=h&&h.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==h?void 0:h.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==h?void 0:h.toString())!=="/"+(null===(t=window)||void 0===t?void 0:t.contextPath)+"/citizen"&&(null==h?void 0:h.toString())!=="/"+(null===(n=window)||void 0===n?void 0:n.contextPath)+"/employee"||Digit.SessionStorage.del("WS_DISCONNECTION")},[h]),y.listen(()=>{var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});const _={stateInfo:O,userDetails:N,CITIZEN:I,cityDetails:S,mobileView:b<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:p,logoUrlWhite:v,DSO:w,stateCode:c,modules:u,appTenants:d,sourceUrl:window.location.origin+"/citizen",pathname:h,initData:f};return o.createElement(i.Switch,null,(null==E?void 0:E.some(e=>"employee"==e))&&o.createElement(i.Route,{path:"/"+(null===(l=window)||void 0===l?void 0:l.contextPath)+"/employee"},o.createElement(uo,_)),(null==E?void 0:E.some(e=>"citizen"==e))&&o.createElement(i.Route,{path:"/"+(null===(a=window)||void 0===a?void 0:a.contextPath)+"/citizen"},o.createElement(An,_)),(null==E?void 0:E.some(e=>"employee"==e))&&o.createElement(i.Route,{path:"/"+(null===(r=window)||void 0===r?void 0:r.contextPath)+"/no-top-bar/employee"},o.createElement(uo,m({},_,{noTopBar:!0}))),o.createElement(i.Route,null,o.createElement(i.Redirect,{to:"/"+(null===(s=window)||void 0===s?void 0:s.contextPath)+"/"+g})))},No=e=>{var t,n,l,a,r,s,c,u,d,m,p;let{stateCode:v,modules:f,appTenants:g,logoUrl:E,logoUrlWhite:y,initData:h,defaultLanding:b="citizen",allowedUserTypes:S}=e;const{data:N}=Digit.Hooks.useStore.getInitData(),{stateInfo:C}=N||{},O=["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)}),w=Digit.UserService.getUser();let I="CITIZEN"===(null==w||null===(t=w.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");const _=window.innerWidth<=640;return o.createElement("div",{className:O?"grounded-container":"loginContainer",style:O?{padding:0,paddingTop:I?"0":_&&!I?"3rem":"80px",marginLeft:I||_?"0":"40px"}:{"--banner-url":"url("+(null==C?void 0:C.bannerUrl)+")",padding:"0px"}},o.createElement(i.Switch,null,o.createElement(i.Route,{exact:!0,path:"/"+(null===(n=window)||void 0===n?void 0:n.globalPath)+"/user/invalid-url"},o.createElement(po,null)),o.createElement(i.Route,{exact:!0,path:"/"+(null===(l=window)||void 0===l?void 0:l.globalPath)+"/user/sign-up"},o.createElement(Eo,{stateCode:v})),o.createElement(i.Route,{exact:!0,path:"/"+(null===(a=window)||void 0===a?void 0:a.globalPath)+"/user/login"},o.createElement(bo,{stateCode:v})),o.createElement(i.Route,{exact:!0,path:"/"+(null===(r=window)||void 0===r?void 0:r.globalPath)+"/user/otp"},o.createElement(so,null)),o.createElement(i.Route,{exact:!0,path:"/"+(null===(s=window)||void 0===s?void 0:s.globalPath)+"/user/setup"},o.createElement(vo,null)),o.createElement(i.Route,{exact:!0,path:"/"+(null===(c=window)||void 0===c?void 0:c.globalPath)+"/user/url"},o.createElement(mo,null)),(null===(u=window)||void 0===u?void 0:u.globalPath)!==(null===(d=window)||void 0===d?void 0:d.contextPath)&&o.createElement(i.Route,{path:"/"+(null===(m=window)||void 0===m?void 0:m.contextPath)},o.createElement(So,{stateCode:v,modules:f,appTenants:g,logoUrl:E,logoUrlWhite:y,initData:h,defaultLanding:b,allowedUserTypes:S})),o.createElement(i.Route,null,o.createElement(i.Redirect,{to:"/"+(null===(p=window)||void 0===p?void 0:p.globalPath)+"/user/sign-up"}))))},Co=[d],Oo=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):u.compose)(u.applyMiddleware(...Co)),wo=["onSelect","formData","control","formState"],Io=e=>{let{onSelect:a}=e,r=p(e,wo);const{t:i}=l.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,u]=n.useState(!1),[d,m]=n.useState(!1),v=Digit.Utils.getConfigModuleName(),{data:f}=Digit.Hooks.useCustomMDMS(s,v,[{name:"PrivacyPolicy"}],{select:e=>{var t,n;return null==e||null===(t=e[v])||void 0===t||null===(n=t.PrivacyPolicy)||void 0===n?void 0:n.find(e=>{var t;return e.module===(null==r||null===(t=r.props)||void 0===t?void 0:t.module)})}});return n.useEffect(()=>{a("check",c)},[c]),o.createElement(o.Fragment,null,o.createElement("div",{className:"digit-privacy-checkbox digit-privacy-checkbox-align"},o.createElement(t.CheckBox,{label:i("ES_BY_CLICKING"),checked:c,onChange:e=>{u(e.target.checked)},id:"privacy-component-check"}),o.createElement(t.Button,{label:i("ES_PRIVACY_POLICY"),variation:"link",size:"small",onClick:()=>{m(!0)},style:{marginBottom:"1rem",paddingLeft:"0.2rem"}})),d&&o.createElement(t.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:i(null==f?void 0:f.header),onOverlayClick:()=>{m(!1)},footerChildren:[o.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:i("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{u(!1),m(!1)}}),o.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:i("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"},i("DIGIT_TABLE_OF_CONTENTS")),o.createElement("ul",null,null==f?void 0:f.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:i(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)},style:{justifyContent:"flex-start"}}))))),null==f?void 0:f.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"}},i(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,". "),i(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"}}," "),i(e.text))))))))))},_o=["onSelect","formData","control","formState"],Do=["onSelect","formData","control","formState"],To=e=>{var n,a,s;let{stateCode:c,enabledModules:d,moduleReducers:p,defaultLanding:v,allowedUserTypes:f}=e;const{isLoading:g,data:E={}}=Digit.Hooks.useInitStore(c,d);if(g)return o.createElement(t.Loader,{page:!0,variant:"PageLoader"});const y=function(e,t){return void 0===t&&(t={}),u.createStore(((e,t)=>{return u.combineReducers(m({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return m({},e,{selectedLanguage:t.payload});default:return e}})},t));var n})(e,t),Oo)}(E,p(E))||{};return l.getI18n(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",Io),o.createElement(r.Provider,{store:y},o.createElement(i.BrowserRouter,null,o.createElement(t.BodyContainer,null,Digit.Utils.getMultiRootTenant()?o.createElement(No,{initData:E,stateCode:c,modules:null==E?void 0:E.modules,appTenants:E.tenants,logoUrl:null==E||null===(n=E.stateInfo)||void 0===n?void 0:n.logoUrl,logoUrlWhite:null==E||null===(a=E.stateInfo)||void 0===a?void 0:a.logoUrlWhite,defaultLanding:v,allowedUserTypes:f}):o.createElement(So,{initData:E,stateCode:c,modules:null==E?void 0:E.modules,appTenants:E.tenants,logoUrl:null==E||null===(s=E.stateInfo)||void 0===s?void 0:s.logoUrl,defaultLanding:v,allowedUserTypes:f}))))},Ao={SelectOtp:lt,ChangeCity:Ce,ChangeLanguage:Oe,LoginSignupSelector:e=>{let{onSelect:a}=e;p(e,_o);const{t:r}=l.useTranslation(),[i,s]=n.useState(!0);n.useEffect(()=>{a("check",i)},[i]);const c=window.location.href.includes("sandbox-ui/user/sign-up");return o.createElement(o.Fragment,null,o.createElement("div",{className:"loginSignUpSelector",style:{marginTop:"-2rem"}},o.createElement(t.Button,c?{label:r("SB_ALREADY_HAVE_ACCOUNT"),variation:"link",size:"small",onClick:()=>{var e;window.location.replace("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/user/login")},style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}}:{label:r("SB_DONT_HAVE_ACCOUNT"),variation:"link",size:"small",onClick:()=>{var e;window.location.replace("/"+(null===(e=window)||void 0===e?void 0:e.contextPath)+"/user/sign-up")},style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}})))},ForgotOrganizationTooltip:e=>{const{t:a}=l.useTranslation(),[r,i]=n.useState(!1),s=n.useRef(null);return n.useEffect(()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&i(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),o.createElement("div",{ref:s,className:"loginSignUpSelector",style:{position:"relative",marginTop:"-2rem"}},o.createElement(t.Button,{label:a("SB_FORGOTORGANIZATION_TOOLTIP"),variation:"link",size:"small",onClick:()=>i(e=>!e),style:{marginBottom:"0.5rem",paddingLeft:"0.2rem"}}),r&&o.createElement("div",{style:{position:"absolute",bottom:"100%",left:"50%",transform:"translateY(-4px)",backgroundColor:"#0b4b66",color:"white",padding:"6px 10px",borderRadius:"4px",whiteSpace:"normal",wordBreak:"break-word",maxWidth:"20rem",zIndex:1e3,fontSize:"0.875rem"}},a("SB_FORGOTORGANIZATION_TOOLTIP_TEXT")))},PrivacyComponent:Io,OtpComponent:e=>{var a,r;let{onSelect:c}=e,u=p(e,Do);const{t:d}=l.useTranslation(),[v,f]=(i.useLocation(),n.useState(null)),[g,E]=n.useState({}),[y,h]=n.useState(!0),[b,S]=n.useState(30),N=()=>{f(null)};ot(()=>{S(b-1)},b>0?1e3:null),n.useEffect(()=>{c("OtpComponent",g)},[g]);const C={url:"/user-otp/v1/_send",params:{tenantId:null==u||null===(a=u.props)||void 0===a?void 0:a.code},body:{},config:{enable:!1}},O=Digit.Hooks.useCustomAPIMutationHook(C);return o.createElement(n.Fragment,null,o.createElement(t.CardLabel,{className:"sandbox-custom-otp-subheader"},d("SANDBOX_ENTER_OTP")),o.createElement(t.CardLabel,{className:"sandbox-custom-otp-header"},d("CS_OTP_EMAIL")),o.createElement(t.CardLabel,{className:"sandbox-custom-otp-email",style:{fontWeight:"bold"}},null==u||null===(r=u.props)||void 0===r?void 0:r.email),o.createElement(s.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{E(m({},g,{otp:e}))},value:null==g?void 0:g.otp}),b>0?o.createElement(t.CardText,{className:"sandbox-resend-otp"},d("CS_RESEND_ANOTHER_OTP")+" "+b+" "+d("CS_RESEND_SECONDS")):o.createElement("p",{className:"card-text-button sandbox-otp-input",onClick:function(){try{var e,t;return S(30),Promise.resolve(O.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,a,r,i,s;f({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===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(i=r.Errors)||void 0===i||null===(s=i[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(N,5e3)},onSuccess:function(e){try{return f({key:"info",label:d("OTP_RESNED_SUCCESFULL")}),setTimeout(N,5e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}},d("CS_RESEND_OTP")),!y&&o.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")),v&&o.createElement(t.Toast,{type:null==v?void 0:v.key,label:d(null==v?void 0:v.label),onClose:N}))}};exports.DigitUI=e=>{let{stateCode:t,registry:l,enabledModules:r,moduleReducers:i,defaultLanding:s,allowedUserTypes:c}=e;const[u,d]=n.useState(Digit.Utils.getPrivacyObject()||{}),p=(Digit.UserService.getType(),new a.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retry:!1,retryDelay:e=>Infinity}}})),v=Digit.Contexts.ComponentProvider,f=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),o.createElement("div",null,o.createElement(ce,null,o.createElement(a.QueryClientProvider,{client:p},o.createElement(v.Provider,{value:l},o.createElement(f.Provider,{value:{privacy:null==u?void 0:u[window.location.pathname],resetPrivacy:e=>{Digit.Utils.setPrivacyObject({}),d({})},getPrivacy:()=>{const e=Digit.Utils.getPrivacyObject();return d(e),e},updatePrivacyDescoped:e=>{const t=Digit.Utils.getAllPrivacyObject(),n=m({},t,{[window.location.pathname]:e});Digit.Utils.setPrivacyObject(m({},n)),d((null==t?void 0:t[window.location.pathname])||{})},updatePrivacy:(e,t)=>{d(Digit.Utils.updatePrivacy(e,t)||{})}}},o.createElement(To,{stateCode:t,enabledModules:r,moduleReducers:i,defaultLanding:s,allowedUserTypes:c}))))))},exports.initCoreComponents=()=>{Object.entries(Ao).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};