@egovernments/digit-ui-module-core 1.6.0-alpha.4 → 1.7.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),n=e(t),r=require("react-query"),i=require("react-redux"),a=require("react-router-dom"),l=require("react-i18next"),o=require("@egovernments/digit-ui-react-components"),u=e(require("react-tooltip")),c=require("redux"),s=e(require("redux-thunk"));function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g=function(e,t,n){var r=null==e?void 0:e[""+t];r&&r.map(function(e){e.link=e.navigationURL,e.i18nKey=n(e.name)});var i={links:null==r?void 0:r.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:"CITIZEN_"+t+"_ICON"};return"FSM"===t&&[{role:"FSM_DSO",from:"/digit-ui/citizen/fsm/dso-dashboard",dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(function(e){var t,r,a=e.from,l=e.loginLink,o=e.dashoardLink;Digit.UserService.hasAccess(e.role)?null==i||null===(t=i.links)||void 0===t||t.push({link:a,i18nKey:n(o)}):null==i||null===(r=i.links)||void 0===r||r.push({link:"/digit-ui/citizen/login",state:{role:"FSM_DSO",from:a},i18nKey:n(l)})}),i},E=function(e){var t=e.modules,r=e.getCitizenMenu,i=e.fetchedCitizen,a=e.isLoading,u=t.filter(function(e){return"Payment"===e.code})[0],c=t.filter(function(e){return"Payment"!==e.code}),s=[u].concat(c),d=l.useTranslation().t;return a?n.createElement(o.Loader,null):n.createElement(n.Fragment,null,n.createElement("div",{className:"citizen-all-services-wrapper"},n.createElement(o.BackButton,null),n.createElement("div",{className:"citizenAllServiceGrid"},s.filter(function(e){return e}).map(function(e,t){var a,l,u,c,s,m,f,v=e.code;return i&&(u=i?g(r,v,d):void 0),(null===(a=u)||void 0===a||null===(l=a.links)||void 0===l?void 0:l.length)>0?n.createElement(o.CitizenHomeCard,{header:d(null===(c=u)||void 0===c?void 0:c.header),links:null===(s=u)||void 0===s||null===(m=s.links)||void 0===m||null===(f=m.filter(function(e){return null==e?void 0:e.link}))||void 0===f?void 0:f.sort(function(e,t){return(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)}),Icon:function(){return function(e){switch(e){case"PT":return n.createElement(o.PTIcon,{className:"fill-path-primary-main"});case"WS":return n.createElement(o.WSICon,{className:"fill-path-primary-main"});case"FSM":return n.createElement(o.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return n.createElement(o.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return n.createElement(o.PGRIcon,{className:"fill-path-primary-main"});case"TL":return n.createElement(o.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return n.createElement(o.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return n.createElement(o.BillsIcon,{className:"fill-path-primary-main"});default:return n.createElement(o.PTIcon,{className:"fill-path-primary-main"})}}(v)},Info:"OBPS"===v?function(){return n.createElement(o.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:d("CS_FILE_APPLICATION_INFO_LABEL"),text:d("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")})}:null,isInfo:"OBPS"===v}):n.createElement(n.Fragment,null)}))))},y=function(e){return n.createElement("div",{className:"employee-app-container"},n.createElement("div",{className:"ground-container moduleCardWrapper gridModuleWrapper"},e.modules.map(function(e,t){var r=Digit.ComponentRegistryService.getComponent(e.code+"Card")||function(){return n.createElement(n.Fragment,null)};return n.createElement(r,{key:t})})))},h=function(e){var t=e.modules;return"citizen"===e.userType?n.createElement(E,{modules:t,getCitizenMenu:e.getCitizenMenu,fetchedCitizen:e.fetchedCitizen,isLoading:e.isLoading}):n.createElement(y,{modules:t})},C=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{b(r,1,a(this.v))}catch(e){b(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?b(r,1,t?t(i):i):n?b(r,1,n(i)):b(r,2,i)}catch(e){b(r,2,e)}},r},e}();function b(e,t,n){if(!e.s){if(n instanceof C){if(!n.s)return void(n.o=b.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(b.bind(null,e,t),b.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}function O(e){return e instanceof C&&1&e.s}var S="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function N(e,t,n){if("function"==typeof e[S]){var r,i,a,l=e[S]();if(function e(o){try{for(;!((r=l.next()).done||n&&n());)if((o=t(r.value))&&o.then){if(!O(o))return void o.then(e,a||(a=b.bind(null,i=new C,2)));o=o.v}i?b(i,1,o):i=o}catch(e){b(i||(i=new C),2,e)}}(),l.return){var o=function(e){try{r.done||l.return()}catch(e){}return e};if(i&&i.then)return i.then(o,function(e){throw o(e)});o()}return i}if(!("length"in e))throw new TypeError("Object is not iterable");for(var u=[],c=0;c<e.length;c++)u.push(e[c]);return function(e,t,n){var r,i,a=-1;return function l(o){try{for(;++a<e.length&&(!n||!n());)if((o=t(a))&&o.then){if(!O(o))return void o.then(l,i||(i=b.bind(null,r=new C,2)));o=o.v}r?b(r,1,o):r=o}catch(e){b(r||(r=new C),2,e)}}(),r}(u,function(e){return t(u[e])},n)}function I(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var _=[{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,pattern:/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i}}]}],D=function(e){var t=e.mobileNumber;return n.createElement(o.FormStep,{isDisabled:!(10===t.length&&e.canSubmit),onSelect:e.onSelect,config:e.config,t:e.t,componentInFront:"+91",onChange:e.onMobileChange,value:t})},w=function(e){var r,i,a,l=e.config,u=e.otp,c=e.onOtpChange,s=e.onResend,d=e.onSelect,m=e.t,f=e.error,v=e.userType,p=void 0===v?"citizen":v,g=e.canSubmit,E=t.useState(30),y=E[0],h=E[1];r=function(){h(y-1)},i=y>0?1e3:null,a=t.useRef(),t.useEffect(function(){a.current=r},[r]),t.useEffect(function(){if(null!==i){var e=setInterval(function(){a.current()},i);return function(){return clearInterval(e)}}},[i]);var C=function(){s(),h(2)};return"employee"===p?n.createElement(t.Fragment,null,n.createElement(o.OTPInput,{length:6,onChange:c,value:u}),y>0?n.createElement(o.CardText,null,m("CS_RESEND_ANOTHER_OTP")+" "+y+" "+m("CS_RESEND_SECONDS")):n.createElement("p",{className:"card-text-button",onClick:C},m("CS_RESEND_OTP")),!f&&n.createElement(o.CardLabelError,null,m("CS_INVALID_OTP"))):n.createElement(o.FormStep,{onSelect:d,config:l,t:m,isDisabled:!(6===(null==u?void 0:u.length)&&g)},n.createElement(o.OTPInput,{length:6,onChange:c,value:u}),y>0?n.createElement(o.CardText,null,m("CS_RESEND_ANOTHER_OTP")+" "+y+" "+m("CS_RESEND_SECONDS")):n.createElement("p",{className:"card-text-button",onClick:C},m("CS_RESEND_OTP")),!f&&n.createElement(o.CardLabelError,null,m("CS_INVALID_OTP")))},T=function(e){return n.createElement(o.FormStep,{config:e.config,onSelect:e.onSelect,t:e.t,isDisabled:e.isDisabled})},L=["ResponseInfo","UserRequest"],A=["ResponseInfo","UserRequest"],R={type:"register"},M={type:"login"},P=function(e,t){return(null==e?void 0:e.from)||(null==t?void 0:t.from)||"/digit-ui/citizen"},x=function(e){var r,i,u=e.stateCode,c=e.isUserRegistered,s=void 0===c||c,m=l.useTranslation().t,v=a.useLocation(),p=a.useRouteMatch().path,g=a.useHistory(),E=t.useState(null),y=E[0],h=E[1],C=t.useState(null),b=C[0],O=C[1],S=t.useState(!0),N=S[0],x=S[1],k=(t.useState(null),t.useState(s?{}:null==v||null===(r=v.state)||void 0===r?void 0:r.data)),U=k[0],B=k[1],F=t.useState(null),j=F[0],V=F[1],H=Digit.Hooks.useQueryParams(),G=t.useState(!1),z=G[0],W=G[1],q=t.useState(!0),X=q[0],Z=q[1],Y=t.useState(!0),K=Y[0],J=Y[1];t.useEffect(function(){var e;return b&&(j&&(clearTimeout(j),V(null)),e=setTimeout(function(){O("")},5e3),V(e)),function(){e&&clearTimeout(e)}},[b]),t.useEffect(function(){var e;if(y){var t,n,r,i,a,l;Digit.SessionStorage.set("citizen.userRequestObject",y),Digit.UserService.setUser(y),t=null==y?void 0:y.info,n=null==y?void 0:y.access_token,r=u,l=null===(i=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===i||null===(a=i.value)||void 0===a?void 0:a.selectedLanguage,localStorage.setItem("Citizen.tenant-id",r),localStorage.setItem("tenant-id",r),localStorage.setItem("citizen.userRequestObject",JSON.stringify(t)),localStorage.setItem("locale",l),localStorage.setItem("Citizen.locale",l),localStorage.setItem("token",n),localStorage.setItem("Citizen.token",n),localStorage.setItem("user-info",JSON.stringify(t)),localStorage.setItem("Citizen.user-info",JSON.stringify(t));var o=(null===(e=v.state)||void 0===e?void 0:e.from)||"/digit-ui/citizen";Digit.ULBService.getCitizenCurrentTenant(!0)?g.replace(o):g.replace("/digit-ui/citizen/select-location",{redirectBackTo:o})}},[y]);var Q=t.useMemo(function(){return _.map(function(e){var t={};for(var n in e.texts)t[n]=m(e.texts[n]);return d({},e,{texts:t})},[_])}),$=function(){return Digit.UserService.getType()},ee=function(e){return Promise.resolve(I(function(){return Promise.resolve(Digit.UserService.sendOtp(e,u)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return n.createElement("div",{className:"citizen-form-wrapper"},n.createElement(a.Switch,null,n.createElement(o.AppContainer,null,n.createElement(o.BackButton,null),n.createElement(a.Route,{path:""+p,exact:!0},n.createElement(D,{onSelect:function(e){try{J(!1),B(d({},U,e));var t=d({},e,{tenantId:u,userType:$()});return Promise.resolve(s?Promise.resolve(ee({otp:d({},t,M)})).then(function(e){var n,r,i;if(!e[1])return J(!0),void g.replace(p+"/otp",{from:P(v.state,H),role:null===(r=v.state)||void 0===r?void 0:r.role});J(!0),v.state&&"FSM_DSO"===v.state.role||g.push("/digit-ui/citizen/register/name",{from:P(v.state,H),data:t}),null!==(n=v.state)&&void 0!==n&&n.role&&(J(!0),O("FSM_DSO"===(null===(i=v.state)||void 0===i?void 0:i.role)?m("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(ee({otp:d({},t,R)})).then(function(e){if(!e[1])return J(!0),void g.replace(p+"/otp",{from:P(v.state,H)});J(!0)}))}catch(e){return Promise.reject(e)}},config:Q[0],mobileNumber:U.mobileNumber||"",onMobileChange:function(e){B(d({},U,{mobileNumber:e.target.value}))},canSubmit:K,showRegisterLink:s&&!(null!==(i=v.state)&&void 0!==i&&i.role),t:m})),n.createElement(a.Route,{path:p+"/otp"},n.createElement(w,{config:d({},Q[1],{texts:d({},Q[1].texts,{cardText:Q[1].texts.cardText+" "+(U.mobileNumber||"")})}),onOtpChange:function(e){B(d({},U,{otp:e}))},onResend:function(){try{var e={mobileNumber:U.mobileNumber,tenantId:u,userType:$()},t=function(){if(!s)return Promise.resolve(ee({otp:d({},e,R)})).then(function(){});var t=function(){if(s)return Promise.resolve(ee({otp:d({},e,M)})).then(function(){})}();return t&&t.then?t.then(function(){}):void 0}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(I(function(){x(!0),Z(!1);var e=U.mobileNumber,t=U.otp,n=U.name;return function(){if(s){var r={username:e,password:t,tenantId:u,userType:$()};return Promise.resolve(Digit.UserService.authenticate(r)).then(function(e){var t,n,r,i=e.UserRequest,a=f(e,L);if(null!==(t=v.state)&&void 0!==t&&t.role){var l=i.roles.find(function(e){return e.code===v.state.role});if(!l||!l.code)return O(m("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(function(){return g.replace("/digit-ui/citizen")},5e3)}null!==(n=window)&&void 0!==n&&null!==(r=n.globalConfigs)&&void 0!==r&&r.getConfig("ENABLE_SINGLEINSTANCE")&&(i.tenantId=Digit.ULBService.getStateId()),h(d({info:i},a))})}var i=function(){if(!s)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:u},u)).then(function(e){var t,n,r=e.UserRequest,i=f(e,A);null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(r.tenantId=Digit.ULBService.getStateId()),h(d({info:r},i))})}();if(i&&i.then)return i.then(function(){})}()},function(){Z(!0),x(!1)}))}catch(e){return Promise.reject(e)}},otp:U.otp,error:N,canSubmit:X,t:m})),n.createElement(a.Route,{path:p+"/name"},n.createElement(T,{config:Q[2],onSelect:function(e){try{var t=d({},U,{tenantId:u,userType:$()},e);return B(d({},U,e)),W(!0),Promise.resolve(ee({otp:d({},t,R)})).then(function(e){e[0]?(W(!1),g.replace(p+"/otp",{from:P(v.state,H)})):W(!1)})}catch(e){return Promise.reject(e)}},t:m,isDisabled:z})),b&&n.createElement(o.Toast,{error:!0,label:b,onClose:function(){return O(null)}}))))},k=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",name:"username",error:"ERR_HRMS_INVALID_USER_ID"},{label:"CORE_LOGIN_PASSWORD",type:"password",name:"password",error:"ERR_HRMS_WRONG_PASSWORD"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}];function U(e,t){return e(t={exports:{}},t.exports),t.exports}var B="function"==typeof Symbol&&Symbol.for,F=B?Symbol.for("react.element"):60103,j=B?Symbol.for("react.portal"):60106,V=B?Symbol.for("react.fragment"):60107,H=B?Symbol.for("react.strict_mode"):60108,G=B?Symbol.for("react.profiler"):60114,z=B?Symbol.for("react.provider"):60109,W=B?Symbol.for("react.context"):60110,q=B?Symbol.for("react.async_mode"):60111,X=B?Symbol.for("react.concurrent_mode"):60111,Z=B?Symbol.for("react.forward_ref"):60112,Y=B?Symbol.for("react.suspense"):60113,K=B?Symbol.for("react.suspense_list"):60120,J=B?Symbol.for("react.memo"):60115,Q=B?Symbol.for("react.lazy"):60116,$=B?Symbol.for("react.block"):60121,ee=B?Symbol.for("react.fundamental"):60117,te=B?Symbol.for("react.responder"):60118,ne=B?Symbol.for("react.scope"):60119;function re(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case F:switch(e=e.type){case q:case X:case V:case G:case H:case Y:return e;default:switch(e=e&&e.$$typeof){case W:case Z:case Q:case J:case z:return e;default:return t}}case j:return t}}}function ie(e){return re(e)===X}var ae={AsyncMode:q,ConcurrentMode:X,ContextConsumer:W,ContextProvider:z,Element:F,ForwardRef:Z,Fragment:V,Lazy:Q,Memo:J,Portal:j,Profiler:G,StrictMode:H,Suspense:Y,isAsyncMode:function(e){return ie(e)||re(e)===q},isConcurrentMode:ie,isContextConsumer:function(e){return re(e)===W},isContextProvider:function(e){return re(e)===z},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===F},isForwardRef:function(e){return re(e)===Z},isFragment:function(e){return re(e)===V},isLazy:function(e){return re(e)===Q},isMemo:function(e){return re(e)===J},isPortal:function(e){return re(e)===j},isProfiler:function(e){return re(e)===G},isStrictMode:function(e){return re(e)===H},isSuspense:function(e){return re(e)===Y},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===V||e===X||e===G||e===H||e===Y||e===K||"object"==typeof e&&null!==e&&(e.$$typeof===Q||e.$$typeof===J||e.$$typeof===z||e.$$typeof===W||e.$$typeof===Z||e.$$typeof===ee||e.$$typeof===te||e.$$typeof===ne||e.$$typeof===$)},typeOf:re},le=U(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,l=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,p=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 C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var f=e.type;switch(f){case c:case s:case i:case l:case a:case m:return f;default:var g=f&&f.$$typeof;switch(g){case u:case d:case p:case v:case o:return g;default:return t}}case r:return t}}}var b=s,O=u,S=o,N=n,I=d,_=i,D=p,w=v,T=r,L=l,A=a,R=m,M=!1;function P(e){return C(e)===s}t.AsyncMode=c,t.ConcurrentMode=b,t.ContextConsumer=O,t.ContextProvider=S,t.Element=N,t.ForwardRef=I,t.Fragment=_,t.Lazy=D,t.Memo=w,t.Portal=T,t.Profiler=L,t.StrictMode=A,t.Suspense=R,t.isAsyncMode=function(e){return M||(M=!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.")),P(e)||C(e)===c},t.isConcurrentMode=P,t.isContextConsumer=function(e){return C(e)===u},t.isContextProvider=function(e){return C(e)===o},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return C(e)===d},t.isFragment=function(e){return C(e)===i},t.isLazy=function(e){return C(e)===p},t.isMemo=function(e){return C(e)===v},t.isPortal=function(e){return C(e)===r},t.isProfiler=function(e){return C(e)===l},t.isStrictMode=function(e){return C(e)===a},t.isSuspense=function(e){return C(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===l||e===a||e===m||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===v||e.$$typeof===o||e.$$typeof===u||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=C}()}),oe=U(function(e){e.exports="production"===process.env.NODE_ENV?ae:le}),ue=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;function de(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var me=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 r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=de(e),a=1;a<arguments.length;a++){for(var l in n=Object(arguments[a]))ce.call(n,l)&&(i[l]=n[l]);if(ue){r=ue(n);for(var o=0;o<r.length;o++)se.call(n,r[o])&&(i[r[o]]=n[r[o]])}}return i},fe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ve=Function.call.bind(Object.prototype.hasOwnProperty),pe=function(){};if("production"!==process.env.NODE_ENV){var ge=fe,Ee={},ye=ve;pe=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function he(e,t,n,r,i){if("production"!==process.env.NODE_ENV)for(var a in e)if(ye(e,a)){var l;try{if("function"!=typeof e[a]){var o=Error((r||"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 o.name="Invariant Violation",o}l=e[a](t,a,r,n,null,ge)}catch(e){l=e}if(!l||l instanceof Error||pe((r||"React class")+": type specification of "+n+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof l+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),l instanceof Error&&!(l.message in Ee)){Ee[l.message]=!0;var u=i?i():"";pe("Failed "+n+" type: "+l.message+(null!=u?u:""))}}}he.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(Ee={})};var Ce=he,be=function(){};function Oe(){return null}function Se(){}function Ne(){}"production"!==process.env.NODE_ENV&&(be=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Ne.resetWarningCache=Se;var Ie=U(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:o("array"),bigint:o("bigint"),bool:o("boolean"),func:o("function"),number:o("number"),object:o("object"),string:o("string"),symbol:o("symbol"),any:l(Oe),arrayOf:function(e){return l(function(t,n,r,i,l){if("function"!=typeof e)return new a("Property `"+l+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var o=t[n];if(!Array.isArray(o))return new a("Invalid "+i+" `"+l+"` of type `"+s(o)+"` supplied to `"+r+"`, expected an array.");for(var u=0;u<o.length;u++){var c=e(o,u,r,i,l+"["+u+"]",fe);if(c instanceof Error)return c}return null})},element:l(function(t,n,r,i,l){var o=t[n];return e(o)?null:new a("Invalid "+i+" `"+l+"` of type `"+s(o)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:l(function(e,t,n,r,i){var l=e[t];return oe.isValidElementType(l)?null:new a("Invalid "+r+" `"+i+"` of type `"+s(l)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return l(function(t,n,r,i,l){var o;return t[n]instanceof e?null:new a("Invalid "+i+" `"+l+"` of type `"+((o=t[n]).constructor&&o.constructor.name?o.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:l(function(e,t,n,r,i){return c(e[t])?null:new a("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return l(function(t,n,r,i,l){if("function"!=typeof e)return new a("Property `"+l+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var o=t[n],u=s(o);if("object"!==u)return new a("Invalid "+i+" `"+l+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var c in o)if(ve(o,c)){var d=e(o,c,r,i,l+"."+c,fe);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&be(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."),Oe;function t(t,n,r,l,o){for(var u=t[n],c=0;c<e.length;c++)if(i(u,e[c]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new a("Invalid "+l+" `"+o+"` of value `"+String(u)+"` supplied to `"+r+"`, expected one of "+s+".")}return l(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&be("Invalid argument supplied to oneOfType, expected an instance of array."),Oe;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return be("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),Oe}return l(function(t,n,r,i,l){for(var o=[],u=0;u<e.length;u++){var c=(0,e[u])(t,n,r,i,l,fe);if(null==c)return null;c.data&&ve(c.data,"expectedType")&&o.push(c.data.expectedType)}return new a("Invalid "+i+" `"+l+"` supplied to `"+r+"`"+(o.length>0?", expected one of type ["+o.join(", ")+"]":"")+".")})},shape:function(e){return l(function(t,n,r,i,l){var o=t[n],c=s(o);if("object"!==c)return new a("Invalid "+i+" `"+l+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var m in e){var f=e[m];if("function"!=typeof f)return u(r,i,l,m,d(f));var v=f(o,m,r,i,l+"."+m,fe);if(v)return v}return null})},exact:function(e){return l(function(t,n,r,i,l){var o=t[n],c=s(o);if("object"!==c)return new a("Invalid "+i+" `"+l+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var m=me({},t[n],e);for(var f in m){var v=e[f];if(ve(e,f)&&"function"!=typeof v)return u(r,i,l,f,d(v));if(!v)return new a("Invalid "+i+" `"+l+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=v(o,f,r,i,l+"."+f,fe);if(p)return p}return null})}};function i(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 l(e){function t(t,n,r,i,l,o,u){if(i=i||"<<anonymous>>",o=o||r,u!==fe){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[r]?t?new a(null===n[r]?"The "+l+" `"+o+"` is marked as required in `"+i+"`, but its value is `null`.":"The "+l+" `"+o+"` is marked as required in `"+i+"`, but its value is `undefined`."):null:e(n,r,i,l,o)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function o(e){return l(function(t,n,r,i,l,o){var u=t[n];return s(u)!==e?new a("Invalid "+i+" `"+l+"` of type `"+d(u)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,r,i){return new a((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}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 r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var i,a=r.call(t);if(r!==t.entries){for(;!(i=a.next()).done;)if(!c(i.value))return!1}else for(;!(i=a.next()).done;){var l=i.value;if(l&&!c(l[1]))return!1}return!0;default:return!1}}function s(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=s(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,r.checkPropTypes=Ce,r.resetWarningCache=Ce.resetWarningCache,r.PropTypes=r,r}(oe.isElement):function(){function e(e,t,n,r,i,a){if(a!==fe){var l=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 l.name="Invariant Violation",l}}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:Ne,resetWarningCache:Se};return n.PropTypes=n,n}()}),_e=function(e){return n.createElement("div",{className:"banner banner-container"},e.children)},De=function(){var e=Digit.Hooks.useStore.getInitData(),t=e.isLoading,r=(e.data||{}).stateInfo,i=l.useTranslation().t;return t?n.createElement(o.Loader,null):n.createElement("div",{className:"bannerHeader"},n.createElement("img",{className:"bannerLogo",src:null==r?void 0:r.logoUrl}),n.createElement("p",null,i("TENANT_TENANTS_"+(null==r?void 0:r.code.toUpperCase()))))},we=["UserRequest"],Te=function(e){var r,i,l,u=e.config,c=e.t,s=e.isDisabled,m=Digit.Hooks.useTenants(),v=m.data,p=m.isLoading,g=Digit.Hooks.useStore.getInitData().isLoading,E=t.useState(null),y=E[0],h=E[1],C=t.useState(null),b=C[0],O=C[1],S=t.useState(!1),N=S[0],_=S[1],D=a.useHistory();t.useEffect(function(){var e,t,n,r,i,a,l,o,u,c,s,d,m;if(y){Digit.SessionStorage.set("citizen.userRequestObject",y);var f,v,p,g,E=null==y||null===(e=y.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(function(e){return e.tenantId===Digit.SessionStorage.get("Employee.tenantId")});(null==y||null===(n=y.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.length)>0&&(y.info.roles=E),Digit.UserService.setUser(y),f=null==y?void 0:y.info,v=null==y?void 0:y.access_token,g=(null===(p=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===p?void 0:p.value)||"en_IN",localStorage.setItem("Employee.tenant-id",null==f?void 0:f.tenantId),localStorage.setItem("tenant-id",null==f?void 0:f.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(f)),localStorage.setItem("locale",g),localStorage.setItem("Employee.locale",g),localStorage.setItem("token",v),localStorage.setItem("Employee.token",v),localStorage.setItem("user-info",JSON.stringify(f)),localStorage.setItem("Employee.user-info",JSON.stringify(f));var h,C,b,O,S="/digit-ui/employee";null!==(i=window)&&void 0!==i&&null!==(a=i.location)&&void 0!==a&&null!==(l=a.href)&&void 0!==l&&l.includes("from=")&&(S=decodeURIComponent(null===(h=window)||void 0===h||null===(C=h.location)||void 0===C||null===(b=C.href)||void 0===b||null===(O=b.split("from="))||void 0===O?void 0:O[1])||"/digit-ui/employee"),null!=y&&null!==(o=y.info)&&void 0!==o&&o.roles&&null!=y&&null!==(u=y.info)&&void 0!==u&&null!==(c=u.roles)&&void 0!==c&&c.every(function(e){return"NATADMIN"===e.code})&&(S="/digit-ui/employee/dss/landing/NURT_DASHBOARD"),null!=y&&null!==(s=y.info)&&void 0!==s&&s.roles&&null!=y&&null!==(d=y.info)&&void 0!==d&&null!==(m=d.roles)&&void 0!==m&&m.every(function(e){return"STADMIN"===e.code})&&(S="/digit-ui/employee/dss/landing/home"),D.replace(S)}},[y]);var w=function(){O(null)},T=u.inputs,L=T[0],A=T[1],R=T[2],M=[{body:[{label:c(L.label),type:L.type,populators:{name:L.name},isMandatory:!0},{label:c(A.label),type:A.type,populators:{name:A.name},isMandatory:!0},{label:c(R.label),type:R.type,populators:{name:R.name,customProps:{},component:function(e,t){return n.createElement(o.Dropdown,d({option:v,className:"login-city-dd",optionKey:"i18nKey",select:function(t){e.onChange(t)},t:c},t))}},isMandatory:!0}]}];return p||g?n.createElement(o.Loader,null):n.createElement(_e,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(o.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(o.FormComposer,{onSubmit:function(e){try{var t=function(){_(!1)};if(!e.city)return alert("Please Select City!"),Promise.resolve();_(!0);var n=d({},e,{userType:"EMPLOYEE"});n.tenantId=e.city.code,delete n.city;var r=I(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t=e.UserRequest,n=f(e,we);Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),h(d({info:t},n))})},function(e){var t,n;O((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"Invalid login credentials!"),setTimeout(w,5e3)});return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},isDisabled:s||N,noBoxShadow:!0,inline:!0,submitInForm:!0,config:M,label:u.texts.submitButtonLabel,secondaryActionLabel:u.texts.secondaryButtonLabel,onSecondayActionClick:function(){D.push("/digit-ui/employee/user/forgot-password")},heading:u.texts.header,headingStyle:{textAlign:"center"},cardStyle:{margin:"auto",minWidth:"408px"},className:"loginFormStyleEmployee",buttonStyle:{maxWidth:"100%",width:"100%"}},n.createElement(De,null)),b&&n.createElement(o.Toast,{error:!0,label:c(b),onClose:w}),n.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(l=i.getConfig)||void 0===l?void 0:l.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};Te.propTypes={loginParams:Ie.any},Te.defaultProps={loginParams:null};var Le=function(){var e=l.useTranslation().t,r=a.useRouteMatch().path,i=t.useMemo(function(){return k.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[k])});return n.createElement(a.Switch,null,n.createElement(a.Route,{path:""+r,exact:!0},n.createElement(Te,{config:i[0],t:e})))},Ae=[{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"}]}],Re=function(e){var r,i,l,u=e.config,c=e.t,s=t.useState(null)[0],m=Digit.Hooks.useQueryParams(),f=m.mobile_number,v=m.tenantId,p=a.useHistory(),g=t.useState(""),E=g[0],y=g[1],h=t.useState(!0)[0],C=t.useState(null),b=C[0],O=C[1],S=function(){return Digit.UserService.getType()};t.useEffect(function(){var e;if(s){Digit.UserService.setUser(s);var t=(null===(e=location.state)||void 0===e?void 0:e.from)||"/digit-ui/employee";p.replace(t)}else Digit.UserService.setType("employee")},[s]);var N=function(){O(null)},_=u.inputs,D=_[0],T=_[1],L=_[2],A=[{body:[{label:c(D.label),type:D.type,populators:{name:D.name},isMandatory:!0},{label:c(T.label),type:T.type,populators:{name:T.name},isMandatory:!0},{label:c(L.label),type:L.type,populators:{name:L.name},isMandatory:!0}]}];return n.createElement(_e,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(o.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(o.FormComposer,{onSubmit:function(e){try{return Promise.resolve(I(function(){if(e.newPassword!==e.confirmPassword)return O(c("ERR_PASSWORD_DO_NOT_MATCH"));var t=d({},e,{otpReference:E,tenantId:v,type:S().toUpperCase()});return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){p.replace("/digit-ui/employee/user/login")})},function(e){var t,n,r,i,a;O((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.message)||c("ES_SOMETHING_WRONG")),setTimeout(N,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:A,label:u.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},n.createElement(De,null),n.createElement(o.CardSubHeader,{style:{textAlign:"center"}}," ",u.texts.header," "),n.createElement(o.CardText,null,c("CS_LOGIN_OTP_TEXT")+" ",n.createElement("b",null," ",""+c("+ 91 - ")," ",f)),n.createElement(w,{t:c,userType:"employee",otp:E,onOtpChange:y,error:h,onResend:function(){try{var e=function(){setTimeout(N,5e3)},t={otp:{mobileNumber:f,userType:S().toUpperCase(),type:"passwordreset",tenantId:v}},n=I(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){O(c("ES_OTP_RESEND"))})},function(e){var t,n;O((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||c("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),b&&n.createElement(o.Toast,{error:!0,label:c(b),onClose:N}),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(l=i.getConfig)||void 0===l?void 0:l.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};Re.propTypes={loginParams:Ie.any},Re.defaultProps={loginParams:null};var Me=function(){var e=l.useTranslation().t,r=a.useRouteMatch().path,i=t.useMemo(function(){return Ae.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[Ae])});return n.createElement(a.Switch,null,n.createElement(a.Route,{path:""+r,exact:!0},n.createElement(Re,{config:i[0],t:e})))},Pe=[{texts:{header:"CORE_COMMON_FORGOT_PASSWORD_LABEL",description:"ES_FORGOT_PASSWORD_DESC",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOBILE_NUMBER"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],xe=function(e){var r,i,l,u=e.config,c=e.t,s=Digit.Hooks.useTenants(),m=s.data,f=s.isLoading,v=t.useState(null)[0],p=a.useHistory(),g=t.useState(null),E=g[0],y=g[1];t.useEffect(function(){var e;if(v){Digit.UserService.setUser(v);var t=(null===(e=location.state)||void 0===e?void 0:e.from)||"/digit-ui/employee";p.replace(t)}else Digit.UserService.setType("employee")},[v]);var h=function(){y(null)},C=u.inputs,b=C[0],O=C[1],S=[{body:[{label:c(b.label),type:b.type,populators:{name:b.name,componentInFront:"+91"},isMandatory:!0},{label:c(O.label),type:O.type,populators:{name:O.name,customProps:{},component:function(e,t){return n.createElement(o.Dropdown,d({option:m,optionKey:"name",id:O.name,className:"login-city-dd",select:function(t){e.onChange(t)}},t))}},isMandatory:!0}]}];return f?n.createElement(o.Loader,null):n.createElement(_e,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(o.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(o.FormComposer,{onSubmit:function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();var t={otp:{mobileNumber:e.mobileNumber,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=I(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){p.push("/digit-ui/employee/user/change-password?mobile_number="+e.mobileNumber+"&tenantId="+e.city.code)})},function(e){var t,n,r,i,a;y((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.message)||"Invalid login credentials!"),setTimeout(h,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:S,label:u.texts.submitButtonLabel,secondaryActionLabel:u.texts.secondaryButtonLabel,onSecondayActionClick:function(){p.replace("/digit-ui/employee/login")},heading:u.texts.header,description:u.texts.description,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},n.createElement(De,null)),E&&n.createElement(o.Toast,{error:!0,label:c(E),onClose:h}),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(l=i.getConfig)||void 0===l?void 0:l.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};xe.propTypes={loginParams:Ie.any},xe.defaultProps={loginParams:null};var ke=function(){var e=l.useTranslation().t,r=a.useRouteMatch().path,i=t.useMemo(function(){return Pe.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[Pe])});return n.createElement(a.Switch,null,n.createElement(a.Route,{path:""+r,exact:!0},n.createElement(xe,{config:i[0],t:e})))},Ue=function(){var e,r,i,u=Digit.Hooks.useStore.getInitData(),c=u.data,s=u.isLoading,d=l.useTranslation().t,m=a.useHistory(),f=c||{},v=f.languages,p=f.stateInfo,g=Digit.StoreData.getCurrentLanguage(),E=t.useState(g),y=E[0],h=E[1];return s?null:n.createElement(_e,null,n.createElement(o.Card,{className:"bannerCard removeBottomMargin"},n.createElement("div",{className:"bannerHeader"},n.createElement("img",{className:"bannerLogo",src:null==p?void 0:p.logoUrl,alt:"Digit"}),n.createElement("p",null,d("TENANT_TENANTS_"+(null==p?void 0:p.code.toUpperCase())))),n.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},v.map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(o.CustomButton,{selected:e.value===y,text:e.label,onClick:function(){return function(e){h(e.value),Digit.LocalizationService.changeLanguage(e.value,p.code)}(e)}}))})),n.createElement(o.SubmitBar,{style:{width:"100%"},label:d("CORE_COMMON_CONTINUE"),onSubmit:function(e){m.push("/digit-ui/employee/user/login")}})),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(r=e.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))},Be=function(e,t){return t.filter(function(t){var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,function(e){return e.code}).includes(t.code)})},Fe=function(e){var t=e.stateCode,r=e.userType,i=e.modules,l=e.appTenants,o=(Digit,a.useRouteMatch().path),u=a.useLocation(),c=Digit.UserService.getUser();if(!c||null==c||!c.access_token||null==c||!c.info)return n.createElement(a.Redirect,{to:{pathname:"/digit-ui/employee/user/login",state:{from:u.pathname+u.search}}});var s=i.map(function(e,i){var c=e.code,s=e.tenants,d=Digit.ComponentRegistryService.getComponent(c+"Module");return n.createElement(a.Route,{key:i,path:o+"/"+c.toLowerCase()},d?n.createElement(d,{stateCode:t,moduleCode:c,userType:r,tenants:Be(s,l)}):n.createElement(a.Redirect,{to:{pathname:"/digit-ui/employee/user/error?type=notfound",state:{from:u.pathname+u.search}}}))});return n.createElement("div",{className:"ground-container"},n.createElement(a.Switch,null,s,n.createElement(a.Route,{path:o+"/login"},n.createElement(a.Redirect,{to:{pathname:"/digit-ui/employee/user/login",state:{from:u.pathname+u.search}}})),n.createElement(a.Route,{path:o+"/forgot-password"},n.createElement(ke,null)),n.createElement(a.Route,{path:o+"/change-password"},n.createElement(Me,null)),n.createElement(a.Route,null,n.createElement(h,{userType:r,modules:i}))))},je={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:"CORE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},Ve=function(e){var t=Digit.Hooks.useQueryParams().type,r=je[void 0===t?"error":t],i=l.useTranslation().t;return n.createElement("div",{className:"error-boundary"},n.createElement("div",{className:"error-container"},n.createElement("img",{src:r.imgUrl,alt:"error"}),n.createElement("h1",null,i(r.infoMessage)),n.createElement("button",{onClick:function(){e.goToHome()}},i(r.buttonInfo))))},He=function(){var e="employee"===Digit.UserService.getType()?"/digit-ui/employee/user/error":"/digit-ui/citizen/error";return window.location.href.includes("employee/user/error")||window.location.href.includes("citizen/error")||"development"===process.env.NODE_ENV||(window.location.href=e),n.createElement("span",null)},Ge=function(e){var t,r;function i(t){var n;return(n=e.call(this,t)||this).state={error:null,errorStack:null,hasError:!1},n}r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,m(t,r),i.getDerivedStateFromError=function(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack}};var a=i.prototype;return a.componentDidCatch=function(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})},a.render=function(){return this.state.hasError?n.createElement("div",{className:"error-boundary"},n.createElement(He,null),n.createElement(Ve,{initData:this.props.initData})):this.props.children},i}(n.Component),ze=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(r=e)&&void 0!==r&&r.includes(t);){var r,i;e=null===(i=e)||void 0===i?void 0:i.replace(t,n)}return e},We=function(e){var r,i=t.useState(null),l=i[0],u=i[1],c=t.useState([]),s=c[0],d=c[1],m=(t.useState([]),a.useHistory());return t.useEffect(function(){var t,n,r=Digit.SessionStorage.get("citizen.userRequestObject"),i=[],a=[];null==r||null===(t=r.info)||void 0===t||null===(n=t.roles)||void 0===n||n.forEach(function(e){return i.push(e.tenantId)});var l=i.filter(function(e,t,n){return n.indexOf(e)===t});null==l||l.forEach(function(t){var n;a.push({label:null==e?void 0:e.t("TENANT_TENANTS_"+(null===(n=ze(t,".","_"))||void 0===n?void 0:n.toUpperCase())),value:t})}),null==a||a.filter(function(e){return e.value==Digit.SessionStorage.get("Employee.tenantId")}),d(a)},[l]),n.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},n.createElement(o.Dropdown,{option:s,selected:s.find(function(e){return e.value===(null==l?void 0:l.value)}),optionKey:"label",select:function(e){var t,n,r,i=Digit.SessionStorage.get("citizen.userRequestObject"),a=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.filter(function(t){return t.tenantId===e.value});if((null==a?void 0:a.length)>0&&(i.info.roles=a,i.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(i),u(e),window.location.href.includes("/digit-ui/employee/")){var l,o=(null===(l=location.state)||void 0===l?void 0:l.from)||"/digit-ui/employee";m.replace(o)}window.location.reload()},freeze:!0,customSelector:n.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(r=ze(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===r?void 0:r.toUpperCase())))}))},qe=function(e){var r=e.dropdown||!1,i=Digit.Hooks.useStore.getInitData(),a=i.isLoading,l=i.data||{},u=l.languages,c=l.stateInfo,s=Digit.StoreData.getCurrentLanguage(),d=t.useState(s),m=d[0],f=d[1],v=function(e){f(e.value),Digit.LocalizationService.changeLanguage(e.value,c.code)};return a?null:r?n.createElement("div",null,n.createElement(o.Dropdown,{option:u,selected:u.find(function(e){return e.value===s}),optionKey:"label",select:v,freeze:!0,customSelector:n.createElement("label",{className:"cp"},u.find(function(e){return e.value===m}).label)})):n.createElement(n.Fragment,null,n.createElement("div",{style:{marginBottom:"5px"}},"Language"),n.createElement("div",{className:"language-selector"},u.map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(o.CustomButton,{selected:e.value===m,text:e.label,onClick:function(){return v(e)}}))})))},Xe=function(e){var t,r;return n.createElement("span",{className:"user-img-txt",onClick:e.toggleMenu,title:e.name},null==e||null===(t=e.name)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.toUpperCase())},Ze=function(e){var t,r,i,l,u,c,s,d=e.t,m=e.stateInfo,f=e.toggleSidebar,v=e.handleLogout,p=e.userDetails,g=e.CITIZEN,E=e.cityDetails,y=e.mobileView,h=e.userOptions,C=e.handleUserDropdownSelection,b=e.logoUrl,O=e.showLanguageChange,S=void 0===O||O,N=n.useState(null),I=N[0],_=N[1];n.useEffect(function(){try{var e,t=Digit.ULBService.getCurrentTenantId(),n=null==p||null===(e=p.info)||void 0===e?void 0:e.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");_(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==I,null==p||null===(t=p.info)||void 0===t?void 0:t.uuid]);var D,w,T,L,A,R,M=Digit.ULBService.getCitizenCurrentTenant(!0),P=a.useHistory(),x=a.useLocation().pathname,k=Digit.Hooks.useNotificationCount({tenantId:M,config:{enabled:"EMPLOYEE"!==(null===(D=Digit.UserService)||void 0===D||null===(w=D.getUser())||void 0===w||null===(T=w.info)||void 0===T?void 0:T.type)&&"CITIZEN"===(null===(L=Digit.UserService)||void 0===L||null===(A=L.getUser())||void 0===A||null===(R=A.info)||void 0===R?void 0:R.type)&&!!M}}),U=k.data,B=(U=void 0===U?{}:U).unreadCount;if(g)return n.createElement("div",null,n.createElement(o.TopBar,{img:null==m?void 0:m.logoUrlWhite,isMobile:!0,toggleSidebar:function(){Digit.clikOusideFired?Digit.clikOusideFired=!1:f(!0)},logoUrl:null==m?void 0:m.logoUrlWhite,onLogout:v,userDetails:p,notificationCount:B<99?B:99,notificationCountLoaded:k.isSuccess,cityOfCitizenShownBesideLogo:d(M),onNotificationIconClick:function(){P.push("/digit-ui/citizen/engagement/notifications")},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:function(e){var t,n;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&["/digit-ui/citizen/select-language","/digit-ui/citizen/select-location"].includes(e)}(x),changeLanguage:y?null:n.createElement(qe,{dropdown:!0})}));var F=!(null==p||!p.access_token);return n.createElement("div",{className:"topbar"},y?n.createElement(o.Hamburger,{handleClick:f,color:"#9E9E9E"}):null,n.createElement("img",{className:"city",src:F?null==E?void 0:E.logoId:null==m?void 0:m.statelogo}),n.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},F&&(null!=E&&null!==(r=E.city)&&void 0!==r&&r.ulbGrade?n.createElement("p",{className:"ulb",style:y?{fontSize:"14px",display:"inline-block"}:{}},d(null==E?void 0:E.i18nKey).toUpperCase()," ",d("ULBGRADE_"+(null==E||null===(i=E.city)||void 0===i?void 0:i.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):n.createElement("img",{className:"state",src:b})),!F&&n.createElement("p",{className:"ulb",style:y?{fontSize:"14px",display:"inline-block"}:{}},d("MYCITY_"+(null==m||null===(l=m.code)||void 0===l?void 0:l.toUpperCase())+"_LABEL")," ",d("MYCITY_STATECODE_LABEL")),!y&&n.createElement("div",{className:y?"right":"flex-right right w-80 column-gap-15",style:F?{}:{width:"80%"}},n.createElement("div",{className:"left"},!window.location.href.includes("employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&n.createElement(We,{dropdown:!0,t:d})),n.createElement("div",{className:"left"},S&&n.createElement(qe,{dropdown:!0})),(null==p?void 0:p.access_token)&&n.createElement("div",{className:"left"},n.createElement(o.Dropdown,{option:h,optionKey:"name",select:C,showArrow:!0,freeze:!0,style:y?{right:0}:{},optionCardStyles:{overflow:"revert"},customSelector:null==I?n.createElement(Xe,{name:(null==p||null===(u=p.info)||void 0===u?void 0:u.name)||(null==p||null===(c=p.info)||void 0===c||null===(s=c.userInfo)||void 0===s?void 0:s.name)||"Employee"}):n.createElement("img",{src:I,style:{height:"48px",width:"48px",borderRadius:"50%"}})})),n.createElement("img",{className:"state",src:b}))))},Ye=function(e,t,r,i,a,l){var o,u,c=(null==a||null===(o=a.tenants.filter(function(e){return e.code===l})[0])||void 0===o?void 0:o.contactNumber)||(null==a||null===(u=a.tenants[0])||void 0===u?void 0:u.contactNumber);return[{type:"link",element:"HOME",text:e("COMMON_BOTTOM_NAVIGATION_HOME"),link:i?"/digit-ui/employee":"/digit-ui/citizen",icon:"HomeIcon",populators:{onClick:t}},{type:"component",element:"LANGUAGE",action:n.createElement(qe,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:"LoginIcon",populators:{onClick:r}},{id:"help-line",text:n.createElement(n.Fragment,null,e("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+c},c)))),element:"Helpline",icon:"Phone"}]},Ke=function(e){return n.createElement("h1",{className:"heading-m"},e.label)},Je=function(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))},Qe=function(e){return n.createElement("div",{onClick:null==e?void 0:e.onClick,style:null!=e&&e.isMobileView?{padding:5}:null},null!=e&&e.isMobileView?n.createElement(o.CloseSvg,null):n.createElement("div",{className:"icon-bg-secondary",style:{backgroundColor:"#505A5F"}}," ",n.createElement(Je,null)," "))},$e=function(e){var t=e.onSelect,r=e.onCancel,i=e.onDismiss,a=l.useTranslation().t,u=n.useState(window.innerWidth<=780),c=u[0],s=u[1],d=function(){window.innerWidth<=780?c||s(!0):c&&s(!1)};return n.useEffect(function(){return window.addEventListener("resize",function(){d()}),function(){window.addEventListener("resize",function(){d()})}}),c?n.createElement(o.Modal,{popupStyles:{height:"174px",maxHeight:"174px",width:"324px",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},popupModuleActionBarStyles:{display:"flex",flex:1,justifyContent:"flex-start",width:"100%",position:"absolute",left:0,bottom:0,padding:"18px"},style:{flex:1},popupModuleMianStyles:{padding:"18px"},headerBarMain:n.createElement(Ke,{label:a("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:n.createElement(Qe,{onClick:i,isMobileView:c}),actionCancelLabel:a("TL_COMMON_NO"),actionCancelOnSubmit:r,actionSaveLabel:a("TL_COMMON_YES"),actionSaveOnSubmit:t,formId:"modal-action"},n.createElement("div",null,n.createElement(o.CardText,{style:{margin:0}},a("CORE_LOGOUT_MOBILE_CONFIRMATION_MESSAGE")+" "))):n.createElement(o.Modal,{popupModuleMianStyles:{paddingTop:"30px"},headerBarMain:n.createElement(Ke,{label:a("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:n.createElement(Qe,{onClick:i,isMobileView:!1}),actionCancelLabel:a("CORE_LOGOUT_CANCEL"),actionCancelOnSubmit:r,actionSaveLabel:a("CORE_LOGOUT_WEB_YES"),actionSaveOnSubmit:t,formId:"modal-action"},n.createElement("div",null,n.createElement(o.CardText,{style:{marginBottom:"54px",marginLeft:"8px",marginRight:"8px"}},a("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",n.createElement("strong",null,a("CORE_LOGOUT_MESSAGE"),"?"))))},et=function(e){var t=e.info,r=e.t;return n.createElement("div",{className:"profile-section"},n.createElement("div",{className:"imageloader imageloader-loaded"},n.createElement("img",{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC"})),n.createElement("div",{id:"profile-name",className:"label-container name-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),n.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&n.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",t.emailId," ")),n.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")&&n.createElement(We,{t:r,mobileView:!0}))},tt={CommonPTIcon:n.createElement(o.PTIcon,{className:"icon"}),OBPSIcon:n.createElement(o.OBPSIcon,{className:"icon"}),propertyIcon:n.createElement(o.PropertyHouse,{className:"icon"}),TLIcon:n.createElement(o.CaseIcon,{className:"icon"}),PGRIcon:n.createElement(o.PGRIcon,{className:"icon"}),FSMIcon:n.createElement(o.FSMIcon,{className:"icon"}),WSIcon:n.createElement(o.WSICon,{className:"icon"}),MCollectIcon:n.createElement(o.MCollectIcon,{className:"icon"}),BillsIcon:n.createElement(o.CollectionIcon,{className:"icon"}),BirthIcon:n.createElement(o.BirthIcon,{className:"icon"}),DeathIcon:n.createElement(o.DeathIcon,{className:"icon"}),FirenocIcon:n.createElement(o.FirenocIcon,{className:"icon"}),HomeIcon:n.createElement(o.HomeIcon,{className:"icon"}),EditPencilIcon:n.createElement(o.EditPencilIcon,{className:"icon"}),LogoutIcon:n.createElement(o.LogoutIcon,{className:"icon"}),Phone:n.createElement(o.Phone,{className:"icon"}),LoginIcon:n.createElement(o.LoginIcon,{className:"icon"})},nt=function(e){var r,i,u,c,s,m=e.linkData,f=e.islinkDataLoading,v=l.useTranslation().t,p=a.useHistory(),g=a.useLocation().pathname,E=Digit.Hooks.useStore.getInitData(),y=E.data,h=E.isFetched,C=(y||{}).stateInfo,b=Digit.UserService.getUser(),O=window.Digit.Utils.browser.isMobile(),S=t.useState(!1)[0],N=t.useState(!1)[1],I=t.useState(!1),_=I[0],D=I[1],w=function(){D(!1)};if(f||!h)return n.createElement(o.Loader,null);var T=function(){p.push("/digit-ui/citizen/user/profile")},L=Digit.ULBService.getCitizenCurrentTenant(),A=(null==y||null===(r=y.tenants.filter(function(e){return e.code===L})[0])||void 0===r?void 0:r.contactNumber)||(null==y||null===(i=y.tenants[0])||void 0===i?void 0:i.contactNumber),R=[].concat(Ye(v,T,function(){p.push("/digit-ui/citizen/login")},S,y,L));R=R.filter(function(e){return"LANGUAGE"!==e.element});var M,P=function(e){var t,r,i,l=e.item,o=(null==l?void 0:l.icon)||(null===(t=l.icon)||void 0===t||null===(r=t.type)||void 0===r?void 0:r.name),u=o?tt[o]:tt.BillsIcon;i="component"===l.type?l.action:l.text;var c=function(){return n.createElement("span",d({className:"menu-item"},l.populators),u,n.createElement("div",{className:"menu-label"},i))};return"external-link"===l.type?n.createElement("a",{href:l.link},n.createElement(c,null)):"link"===l.type?n.createElement(a.Link,{to:null==l?void 0:l.link},n.createElement(c,null)):n.createElement(c,null)};return h&&b&&b.access_token&&(M=n.createElement(et,{info:null==b?void 0:b.info,stateName:null==C?void 0:C.name,t:v}),R=R.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)&&"help-line"!==(null==e?void 0:e.id)}),R=[].concat(R,[{text:v("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:T}},{text:v("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:function(){N(!1),D(!0)}}},{text:n.createElement(n.Fragment,null,v("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+A},A)))),element:"Helpline",icon:"Phone"}])),null===(u=Object.keys(m))||void 0===u||null===(c=u.sort(function(e,t){return t.localeCompare(e)}))||void 0===c||c.map(function(e){var t,n,r,i,a;"digit-ui-links"===(null===(t=m[e][0])||void 0===t?void 0:t.sidebar)&&R.splice(1,0,{type:null!==(n=m[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes("digit-ui")?"link":"external-link",text:v("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:m[e],icon:null===(i=m[e][0])||void 0===i?void 0:i.leftIcon,link:null===(a=m[e][0])||void 0===a?void 0:a.sidebarURL})}),n.createElement(n.Fragment,null,n.createElement("div",null,n.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),n.createElement("div",{style:{display:"flex",flexDirection:"column",height:O?"calc(100vh - 56px)":"auto",zIndex:"99"}},M,n.createElement("div",{className:"drawer-desktop"},null===(s=R)||void 0===s?void 0:s.map(function(e,t){return n.createElement("div",{className:"sidebar-list "+(g===(null==e?void 0:e.link)||g===(null==e?void 0:e.sidebarURL)?"active":""),key:t},n.createElement(P,{item:e}))}))),n.createElement("div",null,_&&n.createElement($e,{onSelect:function(){Digit.UserService.logout(),D(!1)},onCancel:w,onDismiss:w}))))},rt=function(e){var t=e.info,r=e.t,i=n.useState(null),a=i[0],l=i[1];return n.useEffect(function(){try{var e=Digit.ULBService.getCurrentTenantId(),n=null==t?void 0:t.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(e,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");l(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==a]),n.createElement("div",{className:"profile-section"},n.createElement("div",{className:"imageloader imageloader-loaded"},n.createElement("img",{className:"img-responsive img-circle img-Profile",src:a||"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",style:{objectFit:"cover",objectPosition:"center"}})),n.createElement("div",{id:"profile-name",className:"label-container name-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),n.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&n.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",t.emailId," ")),n.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")&&n.createElement(We,{t:r,mobileView:!0}))},it=function(){var e,t,r;return n.createElement("div",{className:"digit-footer",style:{marginBottom:0}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(r=t.getConfig)||void 0===r?void 0:r.call(t,"DIGIT_FOOTER"),style:{cursor:"pointer"},onClick:function(){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()}})," ")},at=function(e){var r,i,u=e.isOpen,c=e.isMobile,s=void 0!==c&&c,m=e.toggleSidebar,f=e.onLogout,v=e.isEmployee,p=void 0!==v&&v,g=e.linkData,E=e.islinkDataLoading,y=Digit.Hooks.useStore.getInitData(),h=y.data,C=y.isFetched,b=(h||{}).stateInfo,O=Digit.UserService.getUser(),S=t.useState(""),N=S[0],I=S[1],_=l.useTranslation().t,D=a.useHistory(),w=function(){Digit.clikOusideFired=!0,m(!1)},T=Digit.Hooks.useAccessControl(),L=T.isLoading,A=T.data,R=Digit.ULBService.getCitizenCurrentTenant();if(E||L||!C)return n.createElement(o.Loader,null);var M,P=(null==h||null===(r=h.tenants.filter(function(e){return e.code===R})[0])||void 0===r?void 0:r.contactNumber)||(null==h||null===(i=h.tenants[0])||void 0===i?void 0:i.contactNumber),x=[].concat(Ye(_,w,function(){D.push("/digit-ui/citizen/login"),w()},p,h,R));C&&O&&O.access_token&&(M=n.createElement(rt,{info:null==O?void 0:O.info,stateName:null==b?void 0:b.name,t:_}),x=x.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)&&"help-line"!==(null==e?void 0:e.id)}),x=[].concat(x,[{text:_("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:function(){D.push(p?"/digit-ui/employee/user/profile":"/digit-ui/citizen/user/profile"),w()}}},{text:_("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:f}},{text:n.createElement(n.Fragment,null,_("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+P},P)))),element:"Helpline",icon:"Phone"}]));var k,U,B={};return p?function(){var e;null==A||A.actions.filter(function(e){return"url"===e.url&&"Home"!==e.displayName}).forEach(function(e){var t;if(""==N&&""!==e.path){var n=e.path.split(".")[0];"TradeLicense"===n&&(n="Trade License"),B[n]?B[n].push(e):B[n]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(N.toLowerCase())){var r=e.path.split(".")[0];"TradeLicense"===r&&(r="Trade License"),B[r]?B[r].push(e):B[r]=[e]}});for(var t=Object.keys(B),n=function(e){var n,r,i,a,l,o,u,c,s,m,f,v=null===(n=B[t[e]][0])||void 0===n||null===(r=n.displayName)||void 0===r||null===(i=r.toUpperCase())||void 0===i?void 0:i.replace(/[ -]/g,"_"),p=null===(a=t[e])||void 0===a||null===(l=a.toUpperCase())||void 0===l?void 0:l.replace(/[ -]/g,"_");-1===B[t[e]][0].path.indexOf(".")?x.splice(1,0,{type:"link",text:_("ACTION_TEST_"+v),link:null===(o=B[t[e]][0])||void 0===o?void 0:o.navigationURL,icon:null===(u=B[t[e]][0])||void 0===u||null===(c=u.leftIcon)||void 0===c||null===(s=c.split)||void 0===s?void 0:s.call(c,":")[1],populators:{onClick:function(){var n;D.push(null===(n=B[t[e]][0])||void 0===n?void 0:n.navigationURL),w()}}}):x.splice(1,0,{type:"dynamic",moduleName:_("ACTION_TEST_"+p),links:null===(m=B[t[e]])||void 0===m?void 0:m.map(function(e){var t,n;return d({},e,{displayName:_("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===(f=B[t[e]][1])||void 0===f?void 0:f.leftIcon})},r=0;r<t.length;r++)n(r);var i=x.findIndex(function(e){return"HOME"===e.element}),a=x.splice(i,1),l=x.findIndex(function(e){return"LANGUAGE"===e.element}),o=x.splice(l,(null===(e=x)||void 0===e?void 0:e.length)-l);x.sort(function(e,t){return("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==a?void 0:a[0])&&x.splice(0,0,a[0]),x=(null==o?void 0:o.length)>0?x.concat(o):x}():null===(k=Object.keys(g))||void 0===k||null===(U=k.sort(function(e,t){return t.localeCompare(e)}))||void 0===U||U.map(function(e){var t,n,r,i,a;"digit-ui-links"===(null===(t=g[e][0])||void 0===t?void 0:t.sidebar)&&x.splice(1,0,{type:null!==(n=g[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes("digit-ui")?"link":"external-link",text:_("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:g[e],icon:null===(i=g[e][0])||void 0===i?void 0:i.leftIcon,link:null===(a=g[e][0])||void 0===a?void 0:a.sidebarURL})}),D.location.pathname.includes("/openlink")&&(M=n.createElement("span",null),x=x.filter(function(e){return"LANGUAGE"===e.element})),s?n.createElement(o.NavBar,{open:u,toggleSidebar:m,profileItem:M,onClose:w,menuItems:x,Footer:n.createElement(it,null),isEmployee:p,search:N,setSearch:I}):n.createElement(nt,{logout:f})},lt=function(e){var r,i,c,s,d,m,f,v=e.item,p=t.useState(!1),g=p[0],E=p[1],y=a.useLocation().pathname,h=l.useTranslation().t,C={home:n.createElement(o.HomeIcon,null),announcement:n.createElement(o.ComplaintIcon,null),business:n.createElement(o.BPAHomeIcon,null),store:n.createElement(o.PropertyHouse,null),assignment:n.createElement(o.CaseIcon,null),receipt:n.createElement(o.ReceiptIcon,null),"business-center":n.createElement(o.PersonIcon,null),description:n.createElement(o.DocumentIconSolid,null),"water-tap":n.createElement(o.DropIcon,null),"collections-bookmark":n.createElement(o.CollectionsBookmarIcons,null),"insert-chart":n.createElement(o.FinanceChartIcon,null),edcr:n.createElement(o.CollectionIcon,null),collections:n.createElement(o.CollectionIcon,null)},b=C[(null==v||null===(r=v.icon)||void 0===r||null===(i=r.leftIcon)||void 0===i||null===(c=i.split)||void 0===c||null===(s=c.call(i,":"))||void 0===s?void 0:s[1])||(null==v||null===(d=v.leftIcon)||void 0===d||null===(m=d.split)||void 0===m?void 0:m.call(d,":")[1])]||C.collections,O=null==v||null===(f=v.moduleName)||void 0===f?void 0:f.replace(/[ -]/g,"_"),S=h("ACTION_TEST_"+O),N=h((null==S?void 0:S.length)>20?S.substring(0,20)+"...":S);if("single"===v.type){var I,_=window.location.origin;return n.createElement("div",{className:"submenu-container"},n.createElement("div",{className:"sidebar-link "+(y===(null==v?void 0:v.navigationURL)?"active":"")},n.createElement("div",{className:"actions"},b,-1===(null===(I=v.navigationURL)||void 0===I?void 0:I.indexOf("/digit-ui"))?n.createElement("a",{"data-tip":"React-tooltip","data-for":"jk-side-"+O,className:"custom-link",href:_+"/employee/"+v.navigationURL},n.createElement("span",null," ",N," "),(null==N?void 0:N.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+O},h("ACTION_TEST_"+O))):n.createElement(a.Link,{className:"custom-link",to:v.navigationURL},n.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+O},n.createElement("span",null," ",N," "),(null==N?void 0:N.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+O},h("ACTION_TEST_"+O)))))))}return n.createElement(n.Fragment,null,n.createElement("div",{className:"submenu-container"},n.createElement("div",{onClick:v.links&&function(){return E(!g)},className:"sidebar-link"},n.createElement("div",{className:"actions"},b,n.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+O},n.createElement("span",null," ",N," "),(null==N?void 0:N.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+O},h("ACTION_TEST_"+O)))),n.createElement("div",null," ",v.links&&g?n.createElement(o.ArrowVectorDown,null):v.links?n.createElement(o.ArrowForward,null):null," "))),g&&v.links.sort(function(e,t){return e.orderNumber-t.orderNumber}).filter(function(e){return"url"===e.url||""!==e.url}).map(function(e,t){var r,i,l=null==e||null===(r=e.displayName)||void 0===r||null===(i=r.toUpperCase())||void 0===i?void 0:i.replace(/[ -]/g,"_"),o=h("ACTION_TEST_"+l),c=h((null==o?void 0:o.length)>20?o.substring(0,20)+"...":o);if(-1===e.navigationURL.indexOf("/digit-ui")){var s=window.location.origin;return n.createElement("a",{key:t,className:"dropdown-link "+(y===e.link?"active":""),href:s+"/employee/"+e.navigationURL},n.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},n.createElement("span",null," ",c," "),(null==c?void 0:c.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},h("ACTION_TEST_"+l))))}return n.createElement(a.Link,{to:(null==e?void 0:e.link)||e.navigationURL,key:t,className:"dropdown-link "+(y===(null==e?void 0:e.link)||y===(null==e?void 0:e.navigationURL)?"active":"")},n.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},n.createElement("span",null," ",c," "),(null==c?void 0:c.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},h("ACTION_TEST_"+l))))}))},ot=function(){var e=t.useRef(null),r=Digit.Hooks.useAccessControl(),i=r.isLoading,a=r.data,u=t.useState(""),c=u[0],s=u[1],d=l.useTranslation().t;t.useEffect(function(){if(i)return n.createElement(o.Loader,null);e.current.style.cursor="pointer",m()},[i]);var m=function(){e.current.style.width="55px",e.current.style.overflow="hidden",e.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="none"}),e.current.querySelectorAll(".actions").forEach(function(e){e.style.padding="0"})},f={};null==a||a.actions.filter(function(e){return"url"===e.url}).forEach(function(e){var t,n,r,i=e.path.split(".")[0];(""==c&&""!==e.path||""!==e.path&&null!==(t=d("ACTION_TEST_"+(null===(n=i)||void 0===n||null===(r=n.toUpperCase())||void 0===r?void 0:r.replace(/[ -]/g,"_"))))&&void 0!==t&&t.toLowerCase().includes(c.toLowerCase()))&&("TradeLicense"===(i=e.path.split(".")[0])&&(i="Trade License"),f[i]?f[i].push(e):f[i]=[e])});var v=[];return i?n.createElement(o.Loader,null):v?n.createElement("div",{className:"sidebar",ref:e,onMouseOver:function(){e.current.style.width="260px",e.current.style.overflow="auto",e.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="flex"})},onMouseLeave:m},n.createElement("div",{className:"submenu-container"},n.createElement("div",{className:"sidebar-link"},n.createElement("div",{className:"actions search-icon-wrapper"},n.createElement(o.SearchIcon,{className:"search-icon"}),n.createElement("input",{className:"employee-search-input",type:"text",placeholder:d("ACTION_TEST_SEARCH"),name:"search",value:c,onChange:function(e){return s(e.target.value)}})))),function(){var e=Object.keys(f);e.sort(function(e,t){return e.orderNumber-t.orderNumber});for(var t=0;t<e.length;t++)if(-1===f[e[t]][0].path.indexOf("."))if("Home"===f[e[t]][0].displayName)v.unshift({moduleName:e[t].toUpperCase(),icon:f[e[t]][0],navigationURL:"/digit-ui/employee",type:"single"});else{var r;v.push({moduleName:null===(r=f[e[t]][0])||void 0===r?void 0:r.displayName.toUpperCase(),type:"single",icon:f[e[t]][0],navigationURL:f[e[t]][0].navigationURL})}else v.push({moduleName:e[t].toUpperCase(),links:f[e[t]],icon:f[e[t]][0],orderNumber:f[e[t]][0].orderNumber});if(v.find(function(e){return"HOME"===e.moduleName})){v.splice(0,1);var i=v.findIndex(function(e){return"HOME"===e.moduleName}),a=v.splice(i,1);v.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)}),(null==a?void 0:a[0])&&v.splice(0,0,a[0])}else v.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)});return v.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)}).map(function(e,t){return n.createElement(lt,{item:e,key:t+1})})}()):""},ut=function(e){var t=e.isSidebarOpen,r=e.toggleSidebar,i=e.handleLogout,a=e.mobileView,l=e.userDetails,o=e.modules;return e.CITIZEN?n.createElement(at,{isOpen:t,isMobile:!0,toggleSidebar:r,onLogout:i,linkData:e.linkData,islinkDataLoading:e.islinkDataLoading}):!a&&null!=l&&l.access_token?n.createElement(ot,{mobileView:a,userDetails:l,modules:o}):n.createElement(at,{isOpen:t,isMobile:!0,toggleSidebar:r,onLogout:i,isEmployee:!0})},ct=function(e){var r=e.t,i=e.stateInfo,l=e.userDetails,u=e.CITIZEN,c=e.cityDetails,s=e.mobileView,d=e.handleUserDropdownSelection,m=e.logoUrl,f=e.showSidebar,v=void 0===f||f,p=e.showLanguageChange,g=e.linkData,E=e.islinkDataLoading,y=t.useState(!1),h=y[0],C=y[1],b=a.useHistory(),O=t.useState(!1),S=O[0],N=O[1],I=function(){C(!1),N(!0)},_=function(){N(!1)},D=[{name:r("EDIT_PROFILE"),icon:n.createElement(o.EditPencilIcon,{className:"icon"}),func:function(){b.push("/digit-ui/employee/user/profile")}},{name:r("CORE_COMMON_LOGOUT"),icon:n.createElement(o.LogoutIcon,{className:"icon"}),func:I}];return n.createElement(n.Fragment,null,n.createElement(Ze,{t:r,stateInfo:i,toggleSidebar:C,isSidebarOpen:h,handleLogout:I,userDetails:l,CITIZEN:u,cityDetails:c,mobileView:s,userOptions:D,handleUserDropdownSelection:d,logoUrl:m,showLanguageChange:p}),S&&n.createElement($e,{onSelect:function(){Digit.UserService.logout(),N(!1)},onCancel:_,onDismiss:_}),v&&n.createElement(ut,{t:r,CITIZEN:u,isSidebarOpen:h,toggleSidebar:C,handleLogout:I,mobileView:s,userDetails:l,linkData:g,islinkDataLoading:E}))};function st(e){var r=e.setProfilePic,i=e.closeDrawer,a=e.userType,u=e.removeProfilePic,c=e.showToast,s=t.useState(null)[1],d=t.useState(""),m=d[0],f=d[1],v=t.useState(null)[1],p=l.useTranslation().t;return t.useEffect(function(){!function(){try{v(null);var e=function(){if(m){var e=function(){if(m.size>=1e6)c("error",p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),v(p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{var e=I(function(){return Promise.resolve(Digit.UploadServices.Filestorage(a+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var t,n;if((null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){var i,a,l=null==e||null===(i=e.data)||void 0===i||null===(a=i.files[0])||void 0===a?void 0:a.fileStoreId;s(l),r(l)}else c("error",p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),v(p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",p("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]),n.createElement(n.Fragment,null,n.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:function(){return i()}}),n.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:"2"}},n.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},n.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",n.createElement(o.GalleryIcon,null)),n.createElement("label",{style:{cursor:"pointer"}}," Gallery"),n.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:function(e){return f(e.target.files[0])},style:{display:"none"}})),n.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},n.createElement("button",{onClick:function(){u(),i()}},n.createElement(o.RemoveIcon,null)),n.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}var dt=function(e){var r,i,u,c,s,m,f,v,p,g,E=e.stateCode,y=e.userType,h=e.cityDetails,C=(a.useHistory(),l.useTranslation().t),b=window.location.href,O=Digit.ULBService.getStateId(),S=Digit.ULBService.getCurrentTenantId(),N=(null===(r=Digit.UserService.getUser())||void 0===r?void 0:r.info)||{},_=t.useState(null),D=_[0],w=_[1],T=t.useState(null!=N&&N.name?N.name:""),L=T[0],A=T[1],R=t.useState(null!=N&&N.emailId?N.emailId:""),M=R[0],P=R[1],x=t.useState(null==D?void 0:D.gender),k=x[0],U=x[1],B=t.useState(null!=N&&N.permanentCity?N.permanentCity:h.name),F=B[0],j=B[1],V=t.useState(null!=N&&N.mobileNumber?N.mobileNumber:""),H=V[0],G=V[1],z=t.useState(null),W=z[0],q=z[1],X=t.useState(""),Z=X[0],Y=X[1],K=t.useState(!1),J=K[0],Q=K[1],$=t.useState(!1),ee=$[0],te=$[1],ne=t.useState(""),re=ne[0],ie=ne[1],ae=t.useState(""),le=ae[0],oe=ae[1],ue=t.useState(""),ce=ue[0],se=ue[1],de=t.useState(null),me=de[0],fe=de[1],ve=t.useState(!1),pe=ve[0],ge=ve[1],Ee=n.useState(window.innerWidth),ye=Ee[0],he=Ee[1],Ce=n.useState({}),be=Ce[0],Oe=Ce[1],Se=window.Digit.Utils.browser.isMobile();n.useEffect(function(){return window.addEventListener("resize",function(){return he(window.innerWidth)}),function(){window.removeEventListener("resize",function(){return he(window.innerWidth)})}}),t.useEffect(function(){var e;ge(!0),function(){try{var e=null==N?void 0:N.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(S,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&w(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),U({i18nKey:void 0,code:null==D?void 0:D.gender,value:null==D?void 0:D.gender});var t=null==D||null===(e=D.photo)||void 0===e?void 0:e.split(",");Y(null==t?void 0:t.at(0)),ge(!1)},[null!==D]);var Ne=function(e){return U(e)},Ie=function(){return Q(!1)},_e=function(e){A(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?Oe(d({},be,{userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}})):Oe(d({},be,{userName:null}))},De=function(e){P(e),!e.length||e.includes("@")&&e.includes(".")?Oe(d({},be,{emailAddress:null})):Oe(d({},be,{emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}}))},we=function(e,t,n){void 0===n&&(n=5e3),fe({key:e,action:t}),setTimeout(function(){fe(null)},n)},Te=function(){try{var e=function(e){if(t)return e;ge(!1)},t=!1;ge(!0);var n=I(function(){var e=d({},N,{name:L,gender:null==k?void 0:k.value,emailId:M,photo:W});if(!new RegExp(/^([a-zA-Z ])*$/).test(L)||""===L||L.length>50||L.length<1)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_NAME_INVALID"});if("employee"===y&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(H))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"});if(M.length&&(!M.includes("@")||!M.includes(".")))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"});if(re.length||le.length||ce.length){if(le!==ce)throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_MISMATCH"});if(!(re.length&&le.length&&ce.length))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(le)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(ce))throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"})}return e.locale=Digit.StoreData.getCurrentLanguage(),Promise.resolve(Digit.UserService.updateUser(e,E)).then(function(e){var t=e.responseInfo;if(t&&"200"===t.status){var n=Digit.UserService.getUser();n&&Digit.UserService.setUser(d({},n,{info:d({},n.info,{name:L,mobileNumber:H,emailId:M,permanentCity:F})}))}return function(){if(re.length&&le.length&&ce.length){var e={existingPassword:re,newPassword:le,tenantId:S,type:"EMPLOYEE",username:null==N?void 0:N.userName,confirmPassword:ce};return function(){if(le===ce)return I(function(){return Promise.resolve(Digit.UserService.changePassword(e,S)).then(function(e){var t=e.responseInfo;if(null==t||!t.status||"200"!==t.status)throw"";we("success",C("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3)})},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",C("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){var t=JSON.parse(e);we(t.type,C(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}},Le=[],Ae=Digit.Hooks.pt.useGenderMDMS(O,"common-masters","GenderType").data;return Ae&&Ae.map(function(e){Le.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),pe?n.createElement(o.Loader,null):n.createElement("div",{className:"user-profile"},n.createElement("section",{style:{margin:"citizen"===y?"8px":"24px"}},"citizen"===y?n.createElement(o.BackButton,null):n.createElement(o.BreadCrumb,{crumbs:[{path:"/digit-ui/employee",content:C("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/user/profile",content:C("ES_COMMON_PAGE_1"),show:b.includes("/user/profile")}]})),n.createElement("div",{style:{display:"flex",flex:1,flexDirection:ye<768||"citizen"===y?"column":"row",margin:"citizen"===y?"8px":"16px",gap:"citizen"===y?"":"0 24px",boxShadow:"citizen"===y?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===y?"white":"",borderRadius:"citizen"===y?"4px":"",maxWidth:"citizen"===y?"960px":""}},n.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===y?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",height:"376px",borderRadius:"4px",boxShadow:"citizen"===y?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===y?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===y?"8px":"16px"}},n.createElement("div",{style:{position:"relative",height:"citizen"===y?"114px":"150px",width:"citizen"===y?"114px":"150px",margin:"16px"}},n.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:Z&&""!==Z?Z:"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"}),n.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:function(){return Q(!J)}},n.createElement(o.CameraIcon,null)))),n.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===y?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===y?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===y?"8px":"24px",paddingBottom:"20px"}},"citizen"===y?n.createElement(n.Fragment,null,n.createElement(o.LabelFieldPair,null,n.createElement(o.CardLabel,{style:{}},""+C("CORE_COMMON_PROFILE_NAME"),"*"),n.createElement("div",{style:{width:"100%",maxWidth:"960px"}},n.createElement(o.TextInput,d({t:C,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:L,onChange:function(e){return _e(e.target.value)}},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:C("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==be?void 0:be.userName)&&n.createElement(o.CardLabelError,null," ",null==be||null===(i=be.userName)||void 0===i?void 0:i.message," "))),n.createElement(o.LabelFieldPair,null,n.createElement(o.CardLabel,{style:{}},""+C("CORE_COMMON_PROFILE_GENDER")),n.createElement(o.Dropdown,{style:{width:"100%"},className:"form-field",selected:1===(null==k?void 0:k.length)?k[0]:k,disable:1===(null==k?void 0:k.length)||!1,option:Le,select:Ne,value:k,optionKey:"code",t:C,name:"gender"})),n.createElement(o.LabelFieldPair,null,n.createElement(o.CardLabel,{style:{}},""+C("CORE_COMMON_PROFILE_EMAIL")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:M,onChange:function(e){return De(e.target.value)},disable:!1}),(null==be?void 0:be.emailAddress)&&n.createElement(o.CardLabelError,null," ",null==be||null===(u=be.emailAddress)||void 0===u?void 0:u.message," "))),n.createElement("button",{onClick:Te,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:Se?"100%":"240px",borderBottom:"1px solid black"}},C("CORE_COMMON_SAVE"))):n.createElement(n.Fragment,null,n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_NAME"),"*"),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,d({t:C,type:"text",isMandatory:!1,name:"name",value:L,onChange:function(e){return _e(e.target.value)},placeholder:"Enter Your Name"},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:C("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==be?void 0:be.userName)&&n.createElement(o.CardLabelError,{style:{margin:0,padding:0}}," ",null==be||null===(c=be.userName)||void 0===c?void 0:c.message," "))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_GENDER")),n.createElement(o.Dropdown,{style:{width:"100%"},selected:1===(null==k?void 0:k.length)?k[0]:k,disable:1===(null==k?void 0:k.length)||!1,option:Le,select:Ne,value:k,optionKey:"code",t:C,name:"gender"})),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CITY")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,d({t:C,type:"text",isMandatory:!1,name:"city",value:C(F),onChange:function(e){return j(e.target.value)},placeholder:"Enter Your City Name"},{isRequired:!0,type:"text",title:C("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disable:!0})),n.createElement(o.CardLabelError,null))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},C("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),n.createElement("div",{style:{width:"100%"}},n.createElement(o.MobileNumber,{value:H,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:function(e){return function(e){G(e),"employee"!==y||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?Oe(d({},be,{mobileNumber:null})):Oe(d({},be,{mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}}))}(e)},disable:!0,required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:C("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==be?void 0:be.mobileNumber)&&n.createElement(o.CardLabelError,{style:{margin:0,padding:0}}," ",null==be||null===(s=be.mobileNumber)||void 0===s?void 0:s.message," "))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_EMAIL")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"email",isMandatory:!1,placeholder:"Enter a valid Email",optionKey:"i18nKey",name:"email",value:M,onChange:function(e){return De(e.target.value)},disable:!1}),(null==be?void 0:be.emailAddress)&&n.createElement(o.CardLabelError,null," ",null==be||null===(m=be.emailAddress)||void 0===m?void 0:m.message," "))),n.createElement(o.LabelFieldPair,null,n.createElement("div",null,n.createElement("a",{style:(f={color:"orange",cursor:"default",marginBottom:"5"},f.cursor="pointer",f),onClick:function(){return te(!ee)}},C("CORE_COMMON_CHANGE_PASSWORD")),ee?n.createElement("div",{style:{marginTop:"10px"}},n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return ie(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Oe(d({},be,{currentPassword:null})):Oe(d({},be,{currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==be?void 0:be.currentPassword)&&n.createElement(o.CardLabelError,null,null==be||null===(v=be.currentPassword)||void 0===v?void 0:v.message))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_NEW_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return oe(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Oe(d({},be,{newPassword:null})):Oe(d({},be,{newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==be?void 0:be.newPassword)&&n.createElement(o.CardLabelError,null,null==be||null===(p=be.newPassword)||void 0===p?void 0:p.message))),n.createElement(o.LabelFieldPair,{style:{display:"flex"}},n.createElement(o.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(o.TextInput,{t:C,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return se(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Oe(d({},be,{confirmPassword:null})):Oe(d({},be,{confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}})));var t},disable:!1}),(null==be?void 0:be.confirmPassword)&&n.createElement(o.CardLabelError,null,null==be||null===(g=be.confirmPassword)||void 0===g?void 0:g.message)))):""))))),"employee"===y?n.createElement("div",{style:{height:"88px",backgroundColor:"#FFFFFF",display:"flex",justifyContent:"flex-end",marginTop:"64px",alignItems:"center"}},n.createElement("button",{onClick:Te,style:{marginTop:"24px",backgroundColor:"#F47738",width:ye<768?"100%":"248px",height:"40px",float:"right",margin:ye<768?"0 16px":"",marginRight:ye<768?"16px":"31px",color:"white",borderBottom:"1px solid black"}},C("CORE_COMMON_SAVE"))):"",me&&n.createElement(o.Toast,{error:"error"===me.key,label:C("success"===me.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":me.action),onClose:function(){return fe(null)},style:{maxWidth:"670px"}}),1==J?n.createElement(st,{setProfilePic:function(e){try{var t=function(e){Y(null==e?void 0:e.thumbs[0]),Ie()};return q(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(function(e){return e.url.split(",")[3]}),images:e.data.fileStoreIds.map(function(e){return Digit.Utils.getFileUrl(e.url)})}:null})}catch(e){return Promise.reject(e)}}([e],O)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:Ie,userType:y,removeProfilePic:function(){q(null),Y(null)},showToast:we}):"")},mt=["user/profile","user/error"],ft=function(e){var r,i,o,u,c=e.stateInfo,s=e.userDetails,d=e.CITIZEN,m=e.cityDetails,f=e.mobileView,v=e.handleUserDropdownSelection,p=e.logoUrl,g=e.DSO,E=e.stateCode,y=e.modules,h=e.appTenants,C=e.initData,b=a.useHistory(),O=l.useTranslation().t,S=a.useRouteMatch().path,N=a.useLocation(),I=null==N||null===(r=N.pathname)||void 0===r?void 0:r.includes("language-selection"),_=mt.some(function(e){var t;return null==N||null===(t=N.pathname)||void 0===t?void 0:t.includes(e)});return t.useEffect(function(){Digit.UserService.setType("employee")},[]),n.createElement("div",{className:"employee"},n.createElement(a.Switch,null,n.createElement(a.Route,{path:S+"/user"},_&&n.createElement(ct,{t:O,stateInfo:c,userDetails:s,CITIZEN:d,cityDetails:m,mobileView:f,handleUserDropdownSelection:v,logoUrl:p,showSidebar:!!_,showLanguageChange:!I}),n.createElement("div",{className:_?"grounded-container":"loginContainer",style:_?{padding:0,paddingTop:"80px",marginLeft:f?"":"64px"}:{"--banner-url":"url("+(null==c?void 0:c.bannerUrl)+")",padding:"0px"}},n.createElement(a.Switch,null,n.createElement(a.Route,{path:S+"/user/login"},n.createElement(Le,null)),n.createElement(a.Route,{path:S+"/user/forgot-password"},n.createElement(ke,null)),n.createElement(a.Route,{path:S+"/user/change-password"},n.createElement(Me,null)),n.createElement(a.Route,{path:S+"/user/profile"},n.createElement(dt,{stateCode:E,userType:"employee",cityDetails:m})),n.createElement(a.Route,{path:S+"/user/error"},n.createElement(Ve,{initData:C,goToHome:function(){b.push("/digit-ui/employee")}})),n.createElement(a.Route,{path:S+"/user/language-selection"},n.createElement(Ue,null)),n.createElement(a.Route,null,n.createElement(a.Redirect,{to:S+"/user/language-selection"}))))),n.createElement(a.Route,null,n.createElement(ct,{t:O,stateInfo:c,userDetails:s,CITIZEN:d,cityDetails:m,mobileView:f,handleUserDropdownSelection:v,logoUrl:p,modules:y}),n.createElement("div",{className:"main "+(g?"m-auto":"")},n.createElement("div",{className:"employee-app-wrapper"},n.createElement(Ge,{initData:C},n.createElement(Fe,{stateCode:E,userType:"employee",modules:y,appTenants:h}))),n.createElement("div",{className:"employee-home-footer"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(o=i.globalConfigs)||void 0===o||null===(u=o.getConfig)||void 0===u?void 0:u.call(o,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))),n.createElement(a.Route,null,n.createElement(a.Redirect,{to:S+"/user/language-selection"}))))},vt=function(){var e,t,r,i,u,c,s,m,f,v,p,g,E,y,h,C,b,O,S,N=l.useTranslation().t,I=a.useHistory(),_=Digit.ULBService.getCitizenCurrentTenant(!0),D=Digit.Hooks.useStore.getInitData(),w=D.data,T=(w=void 0===w?{}:w).uiHomePage,L=D.isLoading,A=window.Digit.Utils.browser.isMobile(),R=function(){var e,t,n,r,i;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===(r=Digit.UserService)||void 0===r||null===(i=r.getUser())||void 0===i||!i.access_token)},M=Digit.Hooks.useEvents({tenantId:_,variant:"whats-new",config:{enabled:R()}}),P=M.data,x=M.isLoading;_||(null===Digit.SessionStorage.get("locale")?I.push("/digit-ui/citizen/select-language"):I.push("/digit-ui/citizen/select-location"));var k=null==T?void 0:T.appBannerDesktop,U=null==T?void 0:T.appBannerMobile,B=null==T?void 0:T.citizenServicesCard,F=null==T?void 0:T.informationAndUpdatesCard,j=null==T?void 0:T.whatsAppBannerDesktop,V=null==T?void 0:T.whatsAppBannerMobile,H=null==T?void 0:T.whatsNewSection,G=function(e){window.open(null==e?void 0:e.navigationUrl)},z={header:N(null==B?void 0:B.headerLabel),sideOption:{name:N(null==B||null===(e=B.sideOption)||void 0===e?void 0:e.name),onClick:function(){var e;return I.push(null==B||null===(e=B.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:N(null==B||null===(t=B.props)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.label),Icon:n.createElement(o.ComplaintIcon,null),onClick:function(){var e,t;return I.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==B||null===(i=B.props)||void 0===i||null===(u=i[1])||void 0===u?void 0:u.label),Icon:n.createElement(o.PTIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return I.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==B||null===(c=B.props)||void 0===c||null===(s=c[2])||void 0===s?void 0:s.label),Icon:n.createElement(o.CaseIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return I.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==B||null===(m=B.props)||void 0===m||null===(f=m[3])||void 0===f?void 0:f.label),Icon:n.createElement(o.WSICon,null),onClick:function(){var e,t;return I.push(null==B||null===(e=B.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%"}},W={header:N(null==F?void 0:F.headerLabel),sideOption:{name:N(null==F||null===(v=F.sideOption)||void 0===v?void 0:v.name),onClick:function(){var e;return I.push(null==F||null===(e=F.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:N(null==F||null===(p=F.props)||void 0===p||null===(g=p[0])||void 0===g?void 0:g.label),Icon:n.createElement(o.HomeIcon,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==F||null===(E=F.props)||void 0===E||null===(y=E[1])||void 0===y?void 0:y.label),Icon:n.createElement(o.Calender,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==F||null===(h=F.props)||void 0===h||null===(C=h[2])||void 0===C?void 0:C.label),Icon:n.createElement(o.DocumentIcon,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:N(null==F||null===(b=F.props)||void 0===b||null===(O=b[3])||void 0===O?void 0:O.label),Icon:n.createElement(o.DocumentIcon,null),onClick:function(){var e,t;return I.push(null==F||null===(e=F.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 L?n.createElement(o.Loader,null):n.createElement("div",{className:"HomePageContainer"},n.createElement("div",{className:"HomePageWrapper"},n.createElement("div",{className:"BannerWithSearch"},n.createElement("img",A?{src:null==U?void 0:U.bannerUrl}:{src:null==k?void 0:k.bannerUrl}),n.createElement("div",{className:"ServicesSection"},n.createElement(o.CardBasedOptions,d({style:{marginTop:"-30px"}},z)),n.createElement(o.CardBasedOptions,d({style:A?{}:{marginTop:"-30px"}},W)))),(V||j)&&n.createElement("div",{className:"WhatsAppBanner"},n.createElement("img",A?{src:null==V?void 0:V.bannerUrl,onClick:function(){return G(V)}}:{src:null==j?void 0:j.bannerUrl,onClick:function(){return G(j)}})),R()?x?n.createElement(o.Loader,null):n.createElement("div",{className:"WhatsNewSection"},n.createElement("div",{className:"headSection"},n.createElement("h2",null,N(null==H?void 0:H.headerLabel)),n.createElement("p",{onClick:function(){var e;return I.push(null==H||null===(e=H.sideOption)||void 0===e?void 0:e.navigationUrl)}},N(null==H||null===(S=H.sideOption)||void 0===S?void 0:S.name))),n.createElement(o.WhatsNewCard,null==P?void 0:P[0])):null))},pt=function(){var e=l.useTranslation().t,r=a.useHistory(),i=Digit.Hooks.useStore.getInitData(),u=i.data,c=(u=void 0===u?{}:u).languages,s=u.stateInfo,d=i.isLoading,m=Digit.StoreData.getCurrentLanguage(),f=t.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]),v=t.useMemo(function(){return{options:c,optionsKey:"label",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:function(e){return Digit.LocalizationService.changeLanguage(e.value,s.code)},selectedOption:null==c?void 0:c.filter(function(e){return e.value===m})[0]}},[m,c]);return d?n.createElement(o.Loader,null):n.createElement("div",{className:"selection-card-wrapper"},n.createElement(o.PageBasedInput,{texts:f,onSubmit:function(){r.push("/digit-ui/citizen/select-location")}},n.createElement(o.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),n.createElement(o.RadioButtons,v)))},gt=function(){var e=l.useTranslation().t,r=a.useHistory(),i=a.useLocation(),u=Digit.Hooks.useTenants(),c=u.data,s=u.isLoading,m=t.useState(function(){return{code:Digit.ULBService.getCitizenCurrentTenant(!0)}}),f=m[0],v=m[1],p=t.useState(!1),g=p[0],E=p[1],y=t.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]);function h(e){v(e),E(!1)}var C=t.useMemo(function(){return{options:c,optionsKey:"i18nKey",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:h,selectedOption:f}},[c,e,f]);return s?n.createElement("loader",null):n.createElement("div",{className:"selection-card-wrapper"},n.createElement(o.BackButton,null),n.createElement(o.PageBasedInput,{texts:y,onSubmit:function(){if(f){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",f);var t=null===(e=i.state)||void 0===e?void 0:e.redirectBackTo;t?r.replace(t):r.push("/digit-ui/citizen")}else E(!0)},className:"location-selection-container"},n.createElement(o.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),n.createElement(o.SearchOnRadioButtons,d({},C,{placeholder:e("COMMON_TABLE_SEARCH")})),g?n.createElement(o.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},Et=function(e){var r=e.question,i=e.answer,a=e.subAnswer,u=e.lastIndex,c=t.useState(!1),s=c[0],d=c[1],m=l.useTranslation().t;return n.createElement("div",{className:"faqs border-none",onClick:function(){return d(!s)}},n.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:Digit.Utils.browser.isMobile()&&m(r).length>42&&s?"block":"flex"}},n.createElement("span",null,m(r)),n.createElement("span",{className:s?"faqicon rotate":"faqicon",style:{float:"right"}},n.createElement(o.ArrowForward,null))),n.createElement("div",{className:"faq-answer",style:s?{display:"block"}:{display:"none"}},n.createElement("span",null,m(i)+m(a))),u?null:n.createElement("div",{className:"cs-box-border"}))},yt=function(e){var r,i,a,u=e.module,c=Digit.UserService.getUser(),s=((null==c||null===(r=c.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation().t),d=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),m=d.data,f=null==m||null===(i=m.MdmsRes["common-masters"])||void 0===i||null===(a=i.faqs[0])||void 0===a?void 0:a[""+u].faqs;return d.isLoading?n.createElement(o.Loader,null):n.createElement(t.Fragment,null,n.createElement("div",{className:"faq-page"},n.createElement(o.BackButton,{style:{marginLeft:"unset"}}),n.createElement("div",{style:{marginBottom:"15px"}},n.createElement(o.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},s("FAQ_S"))),n.createElement("div",{className:"faq-list"},f.map(function(e,t){return n.createElement(Et,{key:"faq_"+t,question:e.question,answer:e.answer,subAnswer:e.subAnswer?e.subAnswer:"",lastIndex:t===(null==f?void 0:f.length)-1})}))))},ht=function(e){var r,i,a,u=e.module,c=window.Digit.Utils.browser.isMobile(),s=Digit.UserService.getUser(),d=((null==s||null===(r=s.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),l.useTranslation().t),m=Digit.SessionStorage.get("initData").stateInfo,f=Digit.StoreData.getCurrentLanguage(),v=t.useState(f),p=v[0],g=v[1],E=t.useState(!1),y=E[0],h=E[1],C=t.useState(""),b=C[0],O=C[1],S=function(){return n.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.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"}))},N=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),I=N.data,_=null==I||null===(i=I.MdmsRes["common-masters"])||void 0===i||null===(a=i.howItWorks[0])||void 0===a?void 0:a[""+u];return N.isLoading?n.createElement(o.Loader,null):n.createElement(t.Fragment,null,n.createElement("div",{className:"how-it-works-page"},n.createElement("div",{style:{marginLeft:"-10px"}},n.createElement(o.BackButton,null)),n.createElement("div",{className:"how-it-works-page-header"},n.createElement("div",{style:{marginLeft:c?"-15px":""}},n.createElement(o.Header,null,d("HOW_IT_WORKS")))),n.createElement("div",{className:"language-selector",style:{marginBottom:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(o.CustomButton,{selected:e.value===p,text:e.label,onClick:function(){return function(e){g(e.value),Digit.LocalizationService.changeLanguage(e.value,m.code)}(e)}}))})),_.videosJson.map(function(e,t){return n.createElement("div",null,n.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},n.createElement("div",{className:"video-icon",onClick:function(){return t=e,O("hi_IN"===p?t.hi_IN:t.en_IN),void h(!0);var t}},n.createElement("div",{className:"vid-svg"},n.createElement(S,null))),n.createElement("div",{className:"how-it-works-header-description"},n.createElement("h2",null,d(e.headerLabel)),n.createElement("p",null,d(e.description)))))}),n.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},n.createElement("div",{className:"how-it-works-pdf-section"},n.createElement("div",{className:"pdf-icon-header-desc"},n.createElement("div",{className:"pdf-icon"},n.createElement(o.PDFSvg,null)),n.createElement("div",{className:"pdf-header-desc"},n.createElement("h2",null,d(_.pdfHeader)),n.createElement("p",null,d(_.pdfDesc)))),n.createElement("div",{className:"download-icon"},n.createElement(o.DownloadImgIcon,null)))),y&&n.createElement("div",{className:"how-it-works-video-play"},n.createElement("div",{className:"close-button",style:{position:"absolute",right:"0",top:"10%",zIndex:"1"}},n.createElement(o.CloseSvg,{onClick:function(){h(!1)}})),n.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0,style:{position:"fixed",top:"0",left:"0",minWidth:"100%",minHeight:"100%",backgroundColor:"rgba(0,0,0,0.5)"}},n.createElement("source",{src:b,type:"video/mp4"})))))},Ct=function(e){var t,r,i,a,u,c,s,d,m,f,v,p,g,E,y,h,C=e.moduleCode,b=l.useTranslation().t,O=Digit.ULBService.getCitizenCurrentTenant(),S=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),N=S.isLoading,I=S.data,_=Digit.Hooks.useDynamicData({moduleCode:C,tenantId:O,filters:{},t:b}),D=_.error,w=_.data,T=function(e){var t=e.styles;switch(e.module){case"TL":return n.createElement(o.CaseIcon,{className:"fill-path-primary-main",styles:t});case"PT":return n.createElement(o.PTIcon,{className:"fill-path-primary-main",styles:t});case"MCOLLECT":return n.createElement(o.MCollectIcon,{className:"fill-path-primary-main",styles:t});case"PGR":return n.createElement(o.PTIcon,{className:"fill-path-primary-main",styles:t});case"WS":return n.createElement(o.WSICon,{className:"fill-path-primary-main",styles:t});case"OBPS":return n.createElement(o.BPAHomeIcon,{className:"fill-path-primary-main",styles:t});default:return n.createElement(o.CaseIcon,{className:"fill-path-primary-main",styles:t})}},L=null==I||null===(t=I.MdmsRes["common-masters"])||void 0===t||null===(r=t.StaticData[0])||void 0===r?void 0:r[""+C],A=function(e){switch(e.module){case"PT":case"WS":return n.createElement("span",{className:"timerIcon"},n.createElement(o.TimerIcon,null));default:return null}},R=function(e){switch(e.module){case"PT":return n.createElement("span",{className:"rupeeSymbol"},n.createElement(o.RupeeSymbol,null));case"WS":return n.createElement("span",{className:"timerIcon"},n.createElement(o.TimerIcon,null));default:return null}},M=function(e){switch(e){case"TL":return{staticCommonContent:b("TL_VALIDITY")};case"MCOLLECT":return{staticCommonContent:b("CHALLAN_VALIDITY")};case"PGR":return{staticCommonContent:b("CATEGORIES_OF_COMPLAINT_TYPES_CAN_BE_SUBMITTED_ON_GRIEVANCE_PORTAL")};case"OBPS":return{staticCommonContent:b("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==L?void 0:L.validity)+" "+b("1"===(null==L?void 0:L.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},P=function(e){switch(e){case"PT":return{staticDataOne:(null==L?void 0:L.staticDataOne)+" "+b("COMMON_DAYS"),staticDataOneHeader:b("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==L?void 0:L.staticDataTwo,staticDataTwoHeader:b("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:b("PAY_WATER_CHARGES_BY")+" "+(null==L?void 0:L.staticDataOne)+" "+b("COMMON_DAYS")+" "+b("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==L?void 0:L.staticDataTwo)+" "+b("COMMON_DAYS"),staticDataTwoHeader:b("APPLICATION_PROCESSING_TIME")};default:return{}}};return N||_.isLoading?n.createElement(o.Loader,null):L?n.createElement(n.Fragment,null,L&&null!=L&&L.payViaWhatsApp?n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"pay-whatsapp-card",onClick:function(){window.open(null==L?void 0:L.payViaWhatsApp)}},n.createElement("div",{className:"pay-whatsapp-text"},b("PAY_VIA_WHATSAPP")),n.createElement("div",{className:"whatsAppIconG"},n.createElement(o.WhatsappIconGreen,null)))):null,L&&null!=L&&L.helpline?n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"static-home-Card"},n.createElement("div",{className:"static-home-Card-header"},b("CALL_CENTER_HELPLINE")),n.createElement("div",{className:"helplineIcon"},n.createElement(o.HelpLineIcon,null))),n.createElement("div",{className:"call-center-card-text"},null!=L&&null!==(i=L.helpline)&&void 0!==i&&i.contactOne?n.createElement("div",{className:"call-center-card-content"},n.createElement("a",{href:"tel:"+(null==L||null===(a=L.helpline)||void 0===a?void 0:a.contactOne)},null==L||null===(u=L.helpline)||void 0===u?void 0:u.contactOne)):null,null!=L&&null!==(c=L.helpline)&&void 0!==c&&c.contactTwo?n.createElement("div",{className:"call-center-card-content"},n.createElement("a",{href:"tel:"+(null==L||null===(s=L.helpline)||void 0===s?void 0:s.contactTwo)},null==L||null===(d=L.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,L&&null!=L&&L.serviceCenter?n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"static-home-Card"},n.createElement("div",{className:"static-home-Card-header"},b("CITIZEN_SERVICE_CENTER")),n.createElement("div",{className:"serviceCentrIcon"},n.createElement(o.ServiceCenterIcon,null))),n.createElement("div",{className:"service-center-details-card"},n.createElement("div",{className:"service-center-details-text"},null==L?void 0:L.serviceCenter)),null!=L&&L.viewMapLocation?n.createElement("div",{className:"link"},n.createElement("a",{href:null==L?void 0:L.viewMapLocation},b("VIEW_ON_MAP"))):null):n.createElement("div",null),n.createElement(o.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},D||null==w||null===(null==w?void 0:w.dynamicDataOne)?n.createElement("div",null):n.createElement("div",{className:"dynamicDataCard"},n.createElement("div",{className:"dynamicData"},n.createElement("span",{style:{paddingTop:"2px"}},n.createElement(T,{module:C,styles:{width:"18px",height:"24px"}})),n.createElement("span",{className:"dynamicData-content"},null==w?void 0:w.dynamicDataOne))),D||null==w||null===(null==w?void 0:w.dynamicDataTwo)?n.createElement("div",null):n.createElement("div",{className:"dynamicDataCard"},n.createElement("div",{className:"dynamicData"},n.createElement("span",{style:{paddingTop:"2px"}},n.createElement(T,{module:C,styles:{width:"18px",height:"24px"}})),n.createElement("span",{className:"dynamicData-content"},null==w?void 0:w.dynamicDataTwo))),L&&null!=L&&L.staticDataOne?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement(A,{module:C}),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=P(C))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(f=P(C))||void 0===f?void 0:f.staticDataOneHeader),n.createElement("span",{className:"static-data-content-second"},""+(null===(v=P(C))||void 0===v?void 0:v.staticDataOne))))):n.createElement("div",null),L&&null!=L&&L.staticDataTwo?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement(R,{module:C}),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(p=P(C))||void 0===p?void 0:p.staticDataTwoHeader),n.createElement("span",{className:"static-data-content-second"},null===(g=P(C))||void 0===g?void 0:g.staticDataTwo)))):n.createElement("div",null),L&&null!=L&&L.validity?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement("span",{className:"validityIcon"},n.createElement(o.ValidityTimeIcon,null)),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(E=M(C))||void 0===E?void 0:E.staticCommonContent),n.createElement("span",{className:"static-data-content-second"},null===(y=M(C))||void 0===y?void 0:y.validity)))):n.createElement("div",null),D||null==w||null==w||!w.staticData||null===(null==w?void 0:w.staticData)?n.createElement("div",null):n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},"PGR"===C?n.createElement("span",{style:{paddingTop:"15px"}},n.createElement(o.TimerIcon,{module:C,styles:{width:"18px",height:"24px",marginLeft:"13px"}})):n.createElement("span",{className:"validityIcon"},n.createElement(o.ValidityTimeIcon,null)),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(h=M(C))||void 0===h?void 0:h.staticCommonContent),n.createElement("span",{className:"static-data-content-second"},null==w?void 0:w.staticData)))))):n.createElement(n.Fragment,null)},bt=function(e){return e instanceof HTMLElement},Ot=function(e){return null==e},St=function(e){return"object"==typeof e},Nt=function(e){return!Ot(e)&&!Array.isArray(e)&&St(e)&&!(e instanceof Date)},It=function(e){return/^\w*$/.test(e)},_t=function(e){return e.filter(Boolean)},Dt=function(e){return _t(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."))};function wt(e,t,n){for(var r=-1,i=It(t)?[t]:Dt(t),a=i.length,l=a-1;++r<a;){var o=i[r],u=n;if(r!==l){var c=e[o];u=Nt(c)||Array.isArray(c)?c:isNaN(+i[r+1])?{}:[]}e[o]=u,e=e[o]}return e}var Tt=function(e,t){for(var n in void 0===t&&(t={}),e)It(n)?t[n]=e[n]:wt(t,n,e[n]);return t},Lt=function(e){return void 0===e},At=function(e,t,n){void 0===e&&(e={});var r=_t(t.split(/[,[\].]+?/)).reduce(function(e,t){return Ot(e)?e:e[t]},e);return Lt(r)||r===e?Lt(e[t])?n:e[t]:r},Rt=function(e,t){bt(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))},Mt={isValid:!1,value:null},Pt=function(e){return Array.isArray(e)?e.reduce(function(e,t){return t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e},Mt):Mt},xt=function(e){return"radio"===e.type},kt=function(e){return"file"===e.type},Ut=function(e){return"checkbox"===e.type},Bt=function(e){return"select-multiple"===e.type},Ft={value:!1,isValid:!1},jt={value:!0,isValid:!0},Vt=function(e){if(Array.isArray(e)){if(e.length>1){var t=e.filter(function(e){return e&&e.ref.checked}).map(function(e){return e.ref.value});return{value:t,isValid:!!t.length}}var n=e[0].ref,r=n.value,i=n.attributes;return n.checked?i&&!Lt(i.value)?Lt(r)||""===r?jt:{value:r,isValid:!0}:jt:Ft}return Ft};function Ht(e,t,n,r,i){var a=e.current[t];if(a){var l=a.ref,o=l.value,u=a.ref,c=a.valueAsNumber,s=a.valueAsDate,d=a.setValueAs;if(l.disabled&&r)return;return kt(u)?u.files:xt(u)?Pt(a.options).value:Bt(u)?[].concat(u.options).filter(function(e){return e.selected}).map(function(e){return e.value}):Ut(u)?Vt(a.options).value:i?o:c?""===o?NaN:+o:s?u.valueAsDate:d?d(o):o}if(n)return At(n.current,t)}function Gt(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&Gt(e.parentNode)}var zt=function(e){return Nt(e)&&!Object.keys(e).length},Wt=function(e){return"boolean"==typeof e};function qt(e,t){var n,r=It(t)?[t]:Dt(t),i=1==r.length?e:function(e,t){for(var n=t.slice(0,-1).length,r=0;r<n;)e=Lt(e)?r++:e[t[r++]];return e}(e,r);i&&delete i[r[r.length-1]];for(var a=0;a<r.slice(0,-1).length;a++){var l=-1,o=void 0,u=r.slice(0,-(a+1)),c=u.length-1;for(a>0&&(n=e);++l<u.length;){var s=u[l];o=o?o[s]:e[s],c===l&&(Nt(o)&&zt(o)||Array.isArray(o)&&!o.filter(function(e){return Nt(e)&&!zt(e)||Wt(e)}).length)&&(n?delete n[s]:delete e[s]),n=o}}return e}var Xt=function(e,t){return e&&e.ref===t},Zt=function(e){return Ot(e)||!St(e)};function Yt(e,t){if(Zt(e)||Zt(t))return t;for(var n in t){var r=e[n],i=t[n];try{e[n]=Nt(r)&&Nt(i)||Array.isArray(r)&&Array.isArray(i)?Yt(r,i):i}catch(e){}}return e}function Kt(e,n,r){if(Zt(e)||Zt(n)||e instanceof Date||n instanceof Date)return e===n;if(!t.isValidElement(e)){var i=Object.keys(e),a=Object.keys(n);if(i.length!==a.length)return!1;for(var l=0,o=i;l<o.length;l++){var u=o[l],c=e[u];if(!r||"ref"!==u){var s=n[u];if((Nt(c)||Array.isArray(c))&&(Nt(s)||Array.isArray(s))?!Kt(c,s,r):c!==s)return!1}}}return!0}function Jt(e,t,n,r,i){for(var a=-1;++a<e.length;){for(var l in e[a]){var o;Array.isArray(e[a][l])?(!n[a]&&(n[a]={}),n[a][l]=[],Jt(e[a][l],At(t[a]||{},l,[]),n[a][l],n[a],l)):Kt(At(t[a]||{},l),e[a][l])?wt(n[a]||{},l):n[a]=Object.assign(Object.assign({},n[a]),((o={})[l]=!0,o))}r&&!n.length&&delete r[i]}return n}var Qt=function(e){return"string"==typeof e},$t=function(e,t,n,r,i){var a={},l=function(t){(Lt(i)||(Qt(i)?t.startsWith(i):Array.isArray(i)&&i.find(function(e){return t.startsWith(e)})))&&(a[t]=Ht(e,t,void 0,r))};for(var o in e.current)l(o);return n?Tt(a):Yt(t,Tt(a))},en=function(e){return e instanceof RegExp},tn=function(e){return Nt(e)&&!en(e)?e:{value:e,message:""}},nn=function(e){return"function"==typeof e},rn=function(e){return Qt(e)||t.isValidElement(e)};function an(e,t,n){if(void 0===n&&(n="validate"),rn(e)||Wt(e)&&!e)return{type:n,message:rn(e)?e:"",ref:t}}var ln=function(e,t,n,r,i){var a;return t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),(a={},a[r]=i||!0,a))}):{}},on=function(e,t,n,r){var i=n.ref,a=n.ref.value,l=n.options,o=n.required,u=n.maxLength,c=n.minLength,s=n.min,d=n.max,m=n.pattern,f=n.validate;try{var v=!1,p=i.name,g={},E=xt(i),y=Ut(i),h=E||y,C=""===a,b=ln.bind(null,p,t,g),O=function(e,t,n,r,a){void 0===r&&(r="maxLength"),void 0===a&&(a="minLength");var l=e?t:n;g[p]=Object.assign({type:e?r:a,message:l,ref:i},b(e?r:a,l))};if(o&&(!E&&!y&&(C||Ot(a))||Wt(a)&&!a||y&&!Vt(l).isValid||E&&!Pt(l).isValid)){var S=rn(o)?{value:!!o,message:o}:tn(o),I=S.message;if(S.value&&(g[p]=Object.assign({type:"required",message:I,ref:h?((e.current[p].options||[])[0]||{}).ref:i},b("required",I)),!t))return Promise.resolve(g)}if(!(Ot(s)&&Ot(d)||""===a)){var _,D,w=tn(d),T=tn(s);if(isNaN(a)){var L=i.valueAsDate||new Date(a);Qt(w.value)&&(_=L>new Date(w.value)),Qt(T.value)&&(D=L<new Date(T.value))}else{var A=i.valueAsNumber||parseFloat(a);Ot(w.value)||(_=A>w.value),Ot(T.value)||(D=A<T.value)}if((_||D)&&(O(!!_,w.message,T.message,"max","min"),!t))return Promise.resolve(g)}if(Qt(a)&&!C&&(u||c)){var R=tn(u),M=tn(c),P=!Ot(R.value)&&a.length>R.value,x=!Ot(M.value)&&a.length<M.value;if((P||x)&&(O(P,R.message,M.message),!t))return Promise.resolve(g)}if(Qt(a)&&m&&!C){var k=tn(m),U=k.value,B=k.message;if(en(U)&&!U.test(a)&&(g[p]=Object.assign({type:"pattern",message:B,ref:i},b("pattern",B)),!t))return Promise.resolve(g)}var F=function(){if(f){var n=Ht(e,p,r,!1,!0),a=h&&l?l[0].ref:i;return nn(f)?Promise.resolve(f(n)).then(function(e){var n=an(e,a);if(n&&(g[p]=Object.assign(Object.assign({},n),b("validate",n.message)),!t))return v=!0,g}):function(){if(Nt(f)){var e=function(){if(!zt(i)&&(g[p]=Object.assign({ref:a},i),!t))return v=!0,g},r=!1,i={},l=N(Object.entries(f),function(e){var l=e[0],o=e[1];if(zt(i)||t)return Promise.resolve(o(n)).then(function(e){var n=an(e,a,l);n&&(i=Object.assign(Object.assign({},n),b(l,n.message)),t&&(g[p]=i))});r=!0},function(){return r});return l&&l.then?l.then(e):e()}}()}}();return Promise.resolve(F&&F.then?F.then(function(e){return v?e:g}):v?F:g)}catch(e){return Promise.reject(e)}},un=function e(t,n,r){for(var i in void 0===r&&(r=[]),n){var a=t+(Nt(n)?"."+i:"["+i+"]");Zt(n[i])?r.push(a):e(a,n[i],r)}return r},cn=function(e,t,n,r,i){var a=void 0;return n.add(t),zt(e)||(a=At(e,t),(Nt(a)||Array.isArray(a))&&un(t,a).forEach(function(e){return n.add(e)})),Lt(a)?i?r:At(r,t):a},sn=function(e){var t=e.isBlurEvent,n=e.isSubmitted;return!e.isOnAll&&(!n&&e.isOnTouch?!(e.isTouched||t):(n?e.isReValidateOnBlur:e.isOnBlur)?!t:!(n?e.isReValidateOnChange:e.isOnChange)||t)},dn=function(e){return e.substring(0,e.indexOf("["))},mn=function(e,t){return[].concat(e).some(function(e){return function(e,t){return RegExp(("^"+t+"([|.)\\d+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e)}(t,e)})},fn="undefined"!=typeof window&&"undefined"!=typeof document;function vn(e){var t,n;if(Zt(e)||fn&&(e instanceof File||bt(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 new Date(e.getTime());if(e instanceof Set){n=new Set;for(var r,i=p(e);!(r=i()).done;)n.add(r.value);return n}if(e instanceof Map){n=new Map;for(var a,l=p(e.keys());!(a=l()).done;){var o=a.value;n.set(o,vn(e.get(o)))}return n}for(var u in n=Array.isArray(e)?[]:{},e)n[u]=vn(e[u]);return n}var pn=function(e){return{isOnSubmit:!e||"onSubmit"===e,isOnBlur:"onBlur"===e,isOnChange:"onChange"===e,isOnAll:"all"===e,isOnTouch:"onTouched"===e}},gn=function(e){return xt(e)||Ut(e)},En="undefined"==typeof window,yn=fn?"Proxy"in window:"undefined"!=typeof Proxy,hn=t.createContext(null);hn.displayName="RHFContext";var Cn=function(e){var n=e.as,r=e.render,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),a=function(e){var n=e.name,r=e.rules,i=e.defaultValue,a=e.control,l=e.onFocus,o=t.useContext(hn);if("production"!==process.env.NODE_ENV&&!a&&!o)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");var u=a||o.control,c=u.defaultValuesRef,s=u.setValue,d=u.register,m=u.unregister,f=u.trigger,v=u.mode,p=u.reValidateMode,g=p.isReValidateOnBlur,E=p.isReValidateOnChange,y=u.formState,h=u.formStateRef.current,C=h.isSubmitted,b=h.touched,O=h.errors,S=u.updateFormState,N=u.readFormStateRef,I=u.fieldsRef,_=u.shallowFieldsStateRef,D=!mn(u.fieldArrayNamesRef.current,n),w=function(){return!Lt(At(_.current,n))&&D?At(_.current,n):Lt(i)?At(c.current,n):i},T=t.useState(w()),L=T[0],A=T[1],R=t.useRef(L),M=t.useRef({focus:function(){return null}}),P=t.useRef(l||function(){nn(M.current.focus)&&M.current.focus(),"production"!==process.env.NODE_ENV&&(nn(M.current.focus)||console.warn("📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method"))}),x=t.useCallback(function(e){return!sn(Object.assign({isBlurEvent:e,isReValidateOnBlur:g,isReValidateOnChange:E,isSubmitted:C,isTouched:!!At(b,n)},v))},[g,E,C,b,n,v]),k=t.useCallback(function(e){var t,n=Zt(t=e[0])||!Nt(t.target)||Nt(t.target)&&!t.type?t:Lt(t.target.value)?t.target.checked:t.target.value;return A(n),R.current=n,n},[]),U=t.useCallback(function(e){if("production"!==process.env.NODE_ENV&&!n)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");I.current[n]?I.current[n]=Object.assign({ref:I.current[n].ref},r):(d(Object.defineProperties({name:n,focus:P.current},{value:{set:function(e){A(e),R.current=e},get:function(){return R.current}}}),r),e=Lt(At(c.current,n))),e&&D&&A(w())},[r,n,d]);t.useEffect(function(){return function(){return m(n)}},[n]),t.useEffect(function(){"production"!==process.env.NODE_ENV&&(Lt(L)&&console.warn("📋 "+n+" 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)"),!D&&Lt(i)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),U()},[U]),t.useEffect(function(){!I.current[n]&&U(!0)});var B=t.useCallback(function(){N.current.touched&&!At(b,n)&&(wt(b,n,!0),S({touched:b})),x(!0)&&f(n)},[n,S,x,f,N]);return{field:{onChange:t.useCallback(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s(n,k(t),{shouldValidate:x(),shouldDirty:!0})},[s,n,x]),onBlur:B,name:n,value:L,ref:M},meta:Object.defineProperties({invalid:!!At(O,n)},{isDirty:{get:function(){return!!At(y.dirtyFields,n)}},isTouched:{get:function(){return!!At(y.touched,n)}}})}}(e),l=a.field,o=a.meta,u=Object.assign(Object.assign({},i),l);return n?t.isValidElement(n)?t.cloneElement(n,u):t.createElement(n,u):r?r(l,o):null},bn=function(e){var r=e.control,i=e.t,a=window.Digit.Utils.browser.isMobile();return n.createElement(t.Fragment,null,n.createElement(o.SearchField,{className:"pt-form-field"},n.createElement("label",null,i("AUDIT_FROM_DATE_LABEL")),n.createElement(Cn,{render:function(e){return n.createElement(o.DatePicker,{date:e.value,onChange:e.onChange})},name:"fromDate",control:r})),n.createElement(o.SearchField,{className:"pt-form-field"},n.createElement("label",null,i("AUDIT_TO_DATE_LABEL")),n.createElement(Cn,{render:function(e){return n.createElement(o.DatePicker,{date:e.value,onChange:e.onChange})},name:"toDate",control:r})),n.createElement(o.SearchField,{className:"pt-search-action-submit"},n.createElement(o.SubmitBar,{style:{marginTop:a?"510px":"25px",marginLeft:a?"0":"-30px",maxWidth:a?"100%":"240px"},label:i("ES_COMMON_APPLY"),submit:!0})))},On=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Sn=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Nn=function(e){var r,i=e.Controller,a=e.register,l=e.control,u=e.t,c=e.reset,s=e.previousPage,m=e.handleSubmit,v=e.tenantId,p=e.data,g=e.onSubmit,E=e.isLoading,y=t.useState([]),h=y[0],C=y[1],b=function(e){return n.createElement("div",{onClick:e.onClick},n.createElement(o.DownloadBtnCommon,null))};t.useEffect(function(){(null==p?void 0:p.length)>0&&C([null==p?void 0:p.map(function(e){var t,n,r={};return r[u("AUDIT_DATE_LABEL")]=O(null==e?void 0:e.timestamp)||"-",r[u("AUDIT_TIME_LABEL")]=S(null==e?void 0:e.timestamp)||"-",r[u("AUDIT_DATAVIEWED_LABEL")]=(null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",r[u("AUDIT_DATAVIEWED_BY_LABEL")]=(null==e?void 0:e.dataViewedBy)||"-",r[u("AUDIT_ROLE_LABEL")]=(null==e||null===(n=e.roles)||void 0===n?void 0:n.map(function(e){return e.name}).join(", "))||"-",d({},r)})])},[p]);var O=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},S=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},N=t.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),I=N[0],_=N[1],D=function(){_({type:"remove"})},w=function(){return n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:D},n.createElement(o.CloseSvg,null))},T={Controller:i,register:a,control:l,t:u,reset:c,previousPage:s},L=t.useCallback(function(e){return function(e){var t=e.currentlyActiveMobileModal,r=e.searchFormFieldsComponentProps,i=e.tenantId,a=f(e,On),l=a.closeMobilePopupModal;switch(t){case"SearchFormComponent":return n.createElement(o.SearchForm,a,n.createElement(w,null),n.createElement("div",{className:"MobilePopupHeadingWrapper"},n.createElement("h2",null,u("PRIVACY_AUDIT_REPORT"),":")),n.createElement(bn,d({},r,{closeMobilePopupModal:l,tenantId:i,t:u})));default:return n.createElement("span",null)}}(d({currentlyActiveMobileModal:e.currentlyActiveMobileModal,searchFormFieldsComponentProps:e.searchFormFieldsComponentProps,tenantId:e.tenantId},f(e,Sn)))},[I]);null==p||null===(r=p.roles)||void 0===r||r.forEach(function(e){});var A=t.useMemo(function(){return null!=p&&p.display||""===p?[]:null==p?void 0:p.map(function(e){var t,n,r,i;return(i={})[u("AUDIT_DATE_LABEL")]=O(e.timestamp)||"-",i[u("AUDIT_TIME_LABEL")]=S(e.timestamp)||"-",i[u("AUDIT_DATAVIEWED_LABEL")]=(null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",i[u("AUDIT_DATAVIEWED_BY_LABEL")]=e.dataViewedBy||"-",i[u("AUDIT_ROLE_LABEL")]=(null===(n=e.roles)||void 0===n||null===(r=n.slice(0,3))||void 0===r?void 0:r.map(function(e){return e.name}).join(", "))||"-",i})},[p]);return n.createElement(n.Fragment,null,n.createElement(o.BackButton,null),n.createElement("div",{className:"sideContent",style:{marginLeft:"65%",marginTop:"-12%"}},n.createElement(b,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(h)}})),n.createElement(o.Header,null,u("PRIVACY_AUDIT_REPORT"),":"),n.createElement("div",{className:"searchBox"},n.createElement(o.SearchAction,{text:u("ES_COMMON_SEARCH"),handleActionClick:function(){return _({type:"set",payload:"SearchFormComponent"})},tenantId:v,t:u})),I?n.createElement(o.PopUp,null,n.createElement(L,{onSubmit:function(e){_({type:"remove"}),g(e)},handleSubmit:m,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:T,currentlyActiveMobileModal:I,closeMobilePopupModal:D,tenantId:v})):null,E&&n.createElement(o.Loader,null),n.createElement(o.DetailsCard,{data:A}))},In=function(e){var r=e.showLoader,i=e.isLoading,a=e.tenantId,l=e.t,u=e.onSubmit,c=e.data,s=e.count,m=function(e){var n=void 0===e?{}:e,r=n.mode,i=void 0===r?"onSubmit":r,a=n.reValidateMode,l=void 0===a?"onChange":a,o=n.resolver,u=n.context,c=n.defaultValues,s=void 0===c?{}:c,d=n.shouldFocusError,m=void 0===d||d,f=n.shouldUnregister,v=void 0===f||f,g=n.criteriaMode,E=t.useRef({}),y=t.useRef({}),h=t.useRef({}),C=t.useRef(new Set),b=t.useRef({}),O=t.useRef({}),S=t.useRef({}),I=t.useRef({}),_=t.useRef(s),D=t.useRef(!1),w=t.useRef(!1),T=t.useRef(),L=t.useRef({}),A=t.useRef({}),R=t.useRef(u),M=t.useRef(o),P=t.useRef(new Set),x=t.useRef(pn(i)),k=x.current,U=k.isOnSubmit,B=k.isOnTouch,F="all"===g,j=t.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!U,errors:{}}),V=j[0],H=j[1],G=t.useRef({isDirty:!yn,dirtyFields:!yn,touched:!yn||B,isValidating:!yn,isSubmitting:!yn,isValid:!yn}),z=t.useRef(V),W=t.useRef(),q=t.useRef(pn(l)).current,X=q.isOnBlur,Z=q.isOnChange;R.current=u,M.current=o,z.current=V,L.current=v?{}:zt(L.current)?vn(s):L.current;var Y=t.useCallback(function(e){void 0===e&&(e={}),D.current||(z.current=Object.assign(Object.assign({},z.current),e),H(z.current))},[]),K=function(){return G.current.isValidating&&Y({isValidating:!0})},J=t.useCallback(function(e,t,n,r,i){void 0===n&&(n=!1),void 0===r&&(r={});var a=n||function(e){var t=e.errors,n=e.name,r=e.error,i=e.validFields,a=e.fieldsWithValidation,l=Lt(r),o=At(t,n);return l&&!!o||!l&&!Kt(o,r,!0)||l&&At(a,n)&&!At(i,n)}({errors:z.current.errors,error:t,name:e,validFields:I.current,fieldsWithValidation:S.current}),l=At(z.current.errors,e);t?(qt(I.current,e),a=a||!l||!Kt(l,t,!0),wt(z.current.errors,e,t)):((At(S.current,e)||M.current)&&(wt(I.current,e,!0),a=a||l),qt(z.current.errors,e)),(a&&!Ot(n)||!zt(r)||G.current.isValidating)&&Y(Object.assign(Object.assign(Object.assign({},r),M.current?{isValid:!!i}:{}),{isValidating:!1}))},[]),Q=t.useCallback(function(e,t){var n=E.current[e],r=n.ref,i=n.options,a=fn&&bt(r)&&Ot(t)?"":t;xt(r)?(i||[]).forEach(function(e){var t=e.ref;return t.checked=t.value===a}):kt(r)&&!Qt(a)?r.files=a:Bt(r)?[].concat(r.options).forEach(function(e){return e.selected=a.includes(e.value)}):Ut(r)&&i?i.length>1?i.forEach(function(e){var t=e.ref;return t.checked=Array.isArray(a)?!!a.find(function(e){return e===t.value}):a===t.value}):i[0].ref.checked=!!a:r.value=a},[]),$=t.useCallback(function(e,t){if(G.current.isDirty){var n=ce();return e&&t&&wt(n,e,t),!Kt(n,_.current)}return!1},[]),ee=t.useCallback(function(e,t){if(void 0===t&&(t=!0),G.current.isDirty||G.current.dirtyFields){var n=!Kt(At(_.current,e),Ht(E,e,L)),r=At(z.current.dirtyFields,e),i=z.current.isDirty;n?wt(z.current.dirtyFields,e,!0):qt(z.current.dirtyFields,e);var a={isDirty:$(),dirtyFields:z.current.dirtyFields},l=G.current.isDirty&&i!==a.isDirty||G.current.dirtyFields&&r!==At(z.current.dirtyFields,e);return l&&t&&Y(a),l?a:{}}return{}},[]),te=t.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||E.current[e]?Promise.resolve(on(E,F,E.current[e],L)).then(function(n){var r=n[e];return J(e,r,t),Lt(r)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[J,F]),ne=t.useCallback(function(e){try{return Promise.resolve(M.current(ce(),R.current,F)).then(function(t){var n=t.errors,r=z.current.isValid;if(Array.isArray(e)){var i=e.map(function(e){var t=At(n,e);return t?wt(z.current.errors,e,t):qt(z.current.errors,e),!t}).every(Boolean);return Y({isValid:zt(n),isValidating:!1}),i}var a=At(n,e);return J(e,a,r!==zt(n),{},zt(n)),!a})}catch(e){return Promise.reject(e)}},[J,F]),re=t.useCallback(function(e){try{var t=function(e){return n?e:Promise.resolve(te(r))},n=!1,r=e||Object.keys(E.current);if(K(),M.current)return Promise.resolve(ne(r));var i=function(){if(Array.isArray(r))return!e&&(z.current.errors={}),Promise.resolve(Promise.all(r.map(function(e){try{return Promise.resolve(te(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){Y({isValidating:!1});var t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(i&&i.then?i.then(t):t(i))}catch(e){return Promise.reject(e)}},[ne,te]),ie=t.useCallback(function(e,t,n){var r=n.shouldDirty,i=n.shouldValidate,a={};wt(a,e,t);for(var l,o=p(un(e,t));!(l=o()).done;){var u=l.value;E.current[u]&&(Q(u,At(a,u)),r&&ee(u),i&&re(u))}},[re,Q,ee]),ae=t.useCallback(function(e,t,n){if(!v&&!Zt(t)&&wt(L.current,e,Array.isArray(t)?[].concat(t):Object.assign({},t)),E.current[e])Q(e,t),n.shouldDirty&&ee(e),n.shouldValidate&&re(e);else if(!Zt(t)&&(ie(e,t,n),P.current.has(e))){var r,i,a=dn(e)||e;wt(y.current,e,t),A.current[a](((r={})[a]=At(y.current,a),r)),(G.current.isDirty||G.current.dirtyFields)&&n.shouldDirty&&(wt(z.current.dirtyFields,e,function(e,t,n){return Yt(Jt(e,t,n.slice(0,e.length)),Jt(t,e,n.slice(0,e.length)))}(t,At(_.current,e,[]),At(z.current.dirtyFields,e,[]))),Y({isDirty:!Kt(Object.assign(Object.assign({},ce()),(i={},i[e]=t,i)),_.current)}))}!v&&wt(L.current,e,t)},[ee,Q,ie]),le=function(e){return w.current||C.current.has(e)||C.current.has((e.match(/\w+/)||[])[0])},oe=function(e){var t=!0;if(!zt(b.current))for(var n in b.current)e&&b.current[n].size&&!b.current[n].has(e)&&!b.current[n].has(dn(e))||(O.current[n](),t=!1);return t};function ue(e){if(!v){for(var t,n=vn(e),r=p(P.current);!(t=r()).done;){var i,a=t.value;It(a)&&!n[a]&&(n=Object.assign(Object.assign({},n),((i={})[a]=[],i)))}return n}return e}function ce(e){if(Qt(e))return Ht(E,e,L);if(Array.isArray(e)){for(var t,n={},r=p(e);!(t=r()).done;){var i=t.value;wt(n,i,Ht(E,i,L))}return n}return ue($t(E,vn(L.current),v))}T.current=T.current?T.current:function(e){var t=e.type,n=e.target;try{var r,i,a=n.name,l=E.current[a];return Promise.resolve(function(){if(l){var e=function(){!o&&oe(a),J(a,r,s,c,i)},o="blur"===t,u=sn(Object.assign({isBlurEvent:o,isReValidateOnChange:Z,isReValidateOnBlur:X,isTouched:!!At(z.current.touched,a),isSubmitted:z.current.isSubmitted},x.current)),c=ee(a,!1),s=!zt(c)||!o&&le(a);if(o&&!At(z.current.touched,a)&&G.current.touched&&(wt(z.current.touched,a,!0),c=Object.assign(Object.assign({},c),{touched:z.current.touched})),!v&&Ut(n)&&wt(L.current,a,Ht(E,a)),u)return!o&&oe(a),(!zt(c)||s&&zt(c))&&Y(c);K();var d=M.current?Promise.resolve(M.current(ce(),R.current,F)).then(function(e){var t=e.errors,l=z.current.isValid;if(r=At(t,a),Ut(n)&&!r&&M.current){var o=dn(a),u=At(t,o,{});u.type&&u.message&&(r=u),o&&(u||At(z.current.errors,o))&&(a=o)}l!==(i=zt(t))&&(s=!0)}):Promise.resolve(on(E,F,l,L)).then(function(e){r=e[a]});return d&&d.then?d.then(e):e()}}())}catch(e){return Promise.reject(e)}};var se=t.useCallback(function(e){void 0===e&&(e={});try{var t=zt(E.current)?_.current:{};return Promise.resolve(M.current(Object.assign(Object.assign(Object.assign({},t),ce()),e),R.current,F)).then(function(e){var t=zt(e.errors);z.current.isValid!==t&&Y({isValid:t})})}catch(e){return Promise.reject(e)}},[F]),de=t.useCallback(function(e,t){!function(e,t,n,r,i,a){var l=n.ref,o=n.ref.name,u=e.current[o];if(!i){var c=Ht(e,o,r);!Lt(c)&&wt(r.current,o,c)}l.type&&u?xt(l)||Ut(l)?Array.isArray(u.options)&&u.options.length?(_t(u.options).forEach(function(e,n){void 0===e&&(e={}),(Gt(e.ref)&&Xt(e,e.ref)||a)&&(Rt(e.ref,t),qt(u.options,"["+n+"]"))}),u.options&&!_t(u.options).length&&delete e.current[o]):delete e.current[o]:(Gt(l)&&Xt(u,l)||a)&&(Rt(l,t),delete e.current[o]):delete e.current[o]}(E,T.current,e,L,v,t),v&&(qt(I.current,e.ref.name),qt(S.current,e.ref.name))},[v]),me=t.useCallback(function(e){if(w.current)Y();else{for(var t,n=p(C.current);!(t=n()).done;)if(t.value.startsWith(e)){Y();break}oe(e)}},[]),fe=t.useCallback(function(e,t){e&&(de(e,t),v&&!_t(e.options||[]).length&&(qt(z.current.errors,e.ref.name),wt(z.current.dirtyFields,e.ref.name,!0),Y({isDirty:$()}),G.current.isValid&&M.current&&se(),me(e.ref.name)))},[se,de]),ve=t.useCallback(function(e,t,n){var r=n?b.current[n]:C.current,i=$t(E,vn(L.current),v,!1,e);if(Qt(e)){var a=dn(e)||e;return P.current.has(a)&&(i=Object.assign(Object.assign({},h.current),i)),cn(i,e,r,Lt(At(_.current,e))?t:At(_.current,e),!0)}var l=Lt(t)?_.current:t;return Array.isArray(e)?e.reduce(function(e,t){var n;return Object.assign(Object.assign({},e),((n={})[t]=cn(i,t,r,l),n))},{}):(w.current=Lt(n),Tt(!zt(i)&&i||l))},[]);function pe(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(P.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")}var n,r=e.name,i=e.type,a=e.value,l=Object.assign({ref:e},t),o=E.current,u=gn(e),c=mn(P.current,r),s=function(t){return fn&&(!bt(e)||t===e)},d=o[r],m=!0;if(d&&(u?Array.isArray(d.options)&&_t(d.options).find(function(e){return a===e.ref.value&&s(e.ref)}):s(d.ref)))o[r]=Object.assign(Object.assign({},d),t);else{d=i?u?Object.assign({options:[].concat(_t(d&&d.options||[]),[{ref:e}]),ref:{type:i,name:r}},t):Object.assign({},l):l,o[r]=d;var f=Lt(At(L.current,r));zt(_.current)&&f||(n=At(f?_.current:L.current,r),(m=Lt(n))||c||Q(r,n)),zt(t)||(wt(S.current,r,!0),!U&&G.current.isValid&&on(E,F,d,L).then(function(e){var t=z.current.isValid;zt(e)?wt(I.current,r,!0):qt(I.current,r),t!==zt(e)&&Y()})),!v||c&&m||!c&&qt(z.current.dirtyFields,r),i&&function(e,t,n){var r=e.ref;bt(r)&&n&&(r.addEventListener(t?"change":"input",n),r.addEventListener("blur",n))}(u&&d.options?d.options[d.options.length-1]:d,u||"select-one"===e.type,T.current)}}var ge=t.useCallback(function(e,t){return function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());var r={},i=ue($t(E,vn(L.current),v,!0));return G.current.isSubmitting&&Y({isSubmitting:!0}),Promise.resolve(function(a,l){try{var o=function(){function a(){var a=function(){if(zt(r)&&Object.keys(z.current.errors).every(function(e){return e in E.current}))return Y({errors:{},isSubmitting:!0}),Promise.resolve(e(i,n)).then(function(){});var a=function(e){m&&function(e,t){for(var n in e)if(At(t,n)){var r=e[n];if(r){if(r.ref.focus&&Lt(r.ref.focus()))break;if(r.options){r.options[0].ref.focus();break}}}}(E.current,z.current.errors)};return z.current.errors=Object.assign(Object.assign({},z.current.errors),r),t?Promise.resolve(t(z.current.errors,n)).then(a):a()}();if(a&&a.then)return a.then(function(){})}var l=M.current?Promise.resolve(M.current(i,R.current,F)).then(function(e){var t=e.values;z.current.errors=r=e.errors,i=t}):N(Object.values(E.current),function(e){var t=function(){if(e){var t=e.ref.name;return Promise.resolve(on(E,F,e,L)).then(function(e){e[t]?(wt(r,t,e[t]),qt(I.current,t)):At(S.current,t)&&(qt(z.current.errors,t),wt(I.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return l&&l.then?l.then(a):a()}()}catch(e){return l(!0,e)}return o&&o.then?o.then(l.bind(null,!1),l.bind(null,!0)):l(!1,o)}(0,function(e,t){if(z.current.isSubmitting=!1,Y({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:zt(z.current.errors),submitCount:z.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}}},[m,F]);t.useEffect(function(){o&&G.current.isValid&&se(),W.current=W.current||!fn?W.current:function(e,t){var n=new MutationObserver(function(){for(var n=0,r=Object.values(e.current);n<r.length;n++){var i=r[n];if(i&&i.options)for(var a,l=p(i.options);!(a=l()).done;){var o=a.value;o&&o.ref&&Gt(o.ref)&&t(i)}else i&&Gt(i.ref)&&t(i)}});return n.observe(window.document,{childList:!0,subtree:!0}),n}(E,fe)},[fe,_.current]),t.useEffect(function(){return function(){W.current&&W.current.disconnect(),D.current=!0,"production"===process.env.NODE_ENV&&Object.values(E.current).forEach(function(e){return fe(e,!0)})}},[]),!o&&G.current.isValid&&(V.isValid=Kt(I.current,S.current)&&zt(z.current.errors));var Ee={trigger:re,setValue:t.useCallback(function(e,t,n){ae(e,t,n||{}),le(e)&&Y(),oe(e)},[ae,re]),getValues:t.useCallback(ce,[]),register:t.useCallback(function(e,t){if(!En)if(Qt(e))pe({name:e},t);else{if(!Nt(e)||!("name"in e))return function(t){return t&&pe(t,e)};pe(e,t)}},[_.current]),unregister:t.useCallback(function(e){for(var t,n=p(Array.isArray(e)?e:[e]);!(t=n()).done;)fe(E.current[t.value],!0)},[]),formState:yn?new Proxy(V,{get:function(e,t){if("production"!==process.env.NODE_ENV&&"isValid"===t&&U&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return G.current[t]=!0,e[t]}}):V},ye=t.useMemo(function(){return Object.assign({isFormDirty:$,updateWatchedValue:me,shouldUnregister:v,updateFormState:Y,removeFieldEventListener:de,watchInternal:ve,mode:x.current,reValidateMode:{isReValidateOnBlur:X,isReValidateOnChange:Z},validateResolver:o?se:void 0,fieldsRef:E,resetFieldArrayFunctionRef:A,useWatchFieldsRef:b,useWatchRenderFunctionsRef:O,fieldArrayDefaultValuesRef:y,validFieldsRef:I,fieldsWithValidationRef:S,fieldArrayNamesRef:P,readFormStateRef:G,formStateRef:z,defaultValuesRef:_,shallowFieldsStateRef:L,fieldArrayValuesRef:h},Ee)},[_.current,me,v,de,ve]);return Object.assign({watch:function(e,t){return ve(e,t)},control:ye,handleSubmit:ge,reset:t.useCallback(function(e,t){if(void 0===t&&(t={}),fn)for(var n=0,r=Object.values(E.current);n<r.length;n++){var i=r[n];if(i){var a=i.ref,l=i.options,o=gn(a)&&Array.isArray(l)?l[0].ref:a;if(bt(o))try{o.closest("form").reset();break}catch(e){}}}var u,c,s,d,m,f,p,g;E.current={},_.current=Object.assign({},e||_.current),e&&oe(""),Object.values(A.current).forEach(function(e){return nn(e)&&e()}),L.current=v?{}:vn(e||_.current),c=(u=t).errors,s=u.isDirty,d=u.isSubmitted,m=u.touched,p=u.submitCount,g=u.dirtyFields,(f=u.isValid)||(I.current={},S.current={}),y.current={},C.current=new Set,w.current=!1,Y({submitCount:p?z.current.submitCount:0,isDirty:!!s&&z.current.isDirty,isSubmitted:!!d&&z.current.isSubmitted,isValid:!!f&&z.current.isValid,dirtyFields:g?z.current.dirtyFields:{},touched:m?z.current.touched:{},errors:c?z.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},[]),clearErrors:t.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(function(e){return E.current[e]&&It(e)?delete z.current.errors[e]:qt(z.current.errors,e)}),Y({errors:e?z.current.errors:{}})},[]),setError:t.useCallback(function(e,t){var n=(E.current[e]||{}).ref;wt(z.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),Y({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:V.errors},Ee)}({defaultValues:Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:10,sortOrder:"ASC"}}),f=m.register,v=m.control,g=m.handleSubmit,E=m.setValue,y=m.getValues,h=m.reset,C=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},b=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},O=t.useState([]),S=O[0],I=O[1],_=function(e){return n.createElement("div",{onClick:e.onClick},n.createElement(o.DownloadBtnCommon,null))};t.useEffect(function(){f("offset",0),f("limit",10)},[f]),t.useEffect(function(){(null==c?void 0:c.length)>0&&I([null==c?void 0:c.map(function(e){var t,n,r={};return r[l("AUDIT_DATE_LABEL")]=C(null==e?void 0:e.timestamp)||"-",r[l("AUDIT_TIME_LABEL")]=b(null==e?void 0:e.timestamp)||"-",r[l("AUDIT_DATAVIEWED_LABEL")]=(null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",r[l("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,r[l("AUDIT_ROLE_LABEL")]=(null==e||null===(n=e.roles)||void 0===n?void 0:n.map(function(e){return e.name}).join(", "))||"-",d({},r)})])},[c]);var D=t.useCallback(function(e){0!==e.length&&(E("sortBy",e.id),E("sortOrder",e.desc?"DESC":"ASC"))},[]);function w(){E("offset",y("offset")-y("limit")),g(u)()}var T=window.Digit.Utils.browser.isMobile();if(T)return n.createElement(Nn,{Controller:Cn,isLoading:i,showLoader:r,register:f,control:v,t:l,reset:h,previousPage:w,handleSubmit:g,tenantId:a,data:c,onSubmit:u});var L=function(e){return n.createElement("span",{className:"cell-text"},e)},A=t.useMemo(function(){return[{Header:l("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?l("WS_NA"):C(e.timestamp);return L(""+(t||"-"))}},{Header:l("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?l("WS_NA"):b(e.timestamp);return L(""+(t||"-"))}},{Header:l(T?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:function(e){var t;return L(""+((null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-"))}},{Header:l(T?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:function(e){return L(""+((null==e?void 0:e.dataViewedBy)||"-"))}},{Header:l("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:function(e){var t,n,r;return L(""+((null==e||null===(t=e.roles)||void 0===t||null===(n=t.slice(0,3))||void 0===n||null===(r=n.map(function(e){return e.name}))||void 0===r?void 0:r.join(", "))||"-"))}}]},[]);return n.createElement(n.Fragment,null,n.createElement("div",{style:{marginRight:"-70px"}}," ",n.createElement(o.BackButton,null)," "),n.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",n.createElement(o.Header,null,l("PRIVACY_AUDIT_REPORT"))," "),n.createElement(o.SearchForm,{className:"audit-card",onSubmit:u,handleSubmit:g},n.createElement(bn,{register:f,control:v,reset:h,tenantId:a,t:l,previousPage:w})),n.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",width:"80%"}},null!=c&&c.display?n.createElement("div",{style:{marginTop:"20x",maxWidth:"680%",marginLeft:"60px",backgroundColor:"white",height:"60px"}},l(c.display).split("\\n").map(function(e,t){return n.createElement("p",{key:t,style:{textAlign:"center",paddingTop:"12px"}},e)})):""!==c?n.createElement("div",{style:{backgroundColor:"white",marginRight:"200px",marginLeft:"2.5%",width:"100%"}},n.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},n.createElement(_,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(S)}})),n.createElement(o.Table,{t:l,data:c.sort(function(e,t){return e.timestamp-t.timestamp}),totalRecords:s,columns:A,getCellProps:function(e){return{style:{minWidth:e.column.Header===l("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}},onPageSizeChange:function(e){E("limit",Number(e.target.value)),g(u)()},currentPage:y("offset")/y("limit"),onNextPage:function(){E("offset",y("offset")+y("limit")),g(u)()},onPrevPage:w,pageSizeLimit:y("limit"),onSort:D,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})):n.createElement(o.Loader,null)))},_n=function(e){var r,i,o,u,c,s,m,f,v,p,g=l.useTranslation().t,E=Digit.ULBService.getCitizenCurrentTenant(),y=t.useState({}),h=y[0],C=y[1],b=window.Digit.Utils.browser.isMobile(),O=function(e,t){void 0===t&&(t="dayend");try{var n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),r=new Date(Date.UTC(n[1],n[2]-1,n[3]));return r.setMinutes(r.getMinutes()+r.getTimezoneOffset()),"dayend"===t&&(r.setHours(r.getHours()+24),r.setSeconds(r.getSeconds()-1)),"daystart"===t&&(r.setHours(r.getHours()),r.setSeconds(r.getSeconds()+1)),r.getTime()}catch(t){return e}};t.useEffect(function(){var e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){var t=d({},e);C(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]="object"==typeof t[n]?t[n].code:t[n],r))},{}))}},[]);var S,N,I={enabled:!!(h&&Object.keys(h).length>0)},_=window.location.href.split("/").pop();isNaN(parseInt(_))?S=10:(N=_,S=parseInt(_)+10);var D=b?d({},h,{offset:isNaN(parseInt(_))?0:parseInt(N)}):d({},h),w=Digit.Hooks.useAudit({tenantId:E,filters:d({},D),config:I}),T=w.isLoading,L=w.data;return n.createElement(n.Fragment,null,n.createElement(In,{t:g,tenantId:E,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:10});var t=d({},e,{fromDate:O(null==e?void 0:e.fromDate,(null==e?void 0:e.fromDate)==(null==e?void 0:e.toDate)?"daystart":""),toDate:O(null==e?void 0:e.toDate,(null==e?void 0:e.fromDate)==(null==e?void 0:e.toDate)?"dayend":"")});C(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]=t[n],r))},{}))},data:T?"":(null==L||null===(r=L.ElasticSearchData)||void 0===r||null===(i=r.filter(function(e){return!e.total}))||void 0===i?void 0:i.length)>0?null==L||null===(o=L.ElasticSearchData)||void 0===o?void 0:o.filter(function(e){return!e.total}):{display:"ES_COMMON_NO_DATA"},count:null==L||null===(u=L.ElasticSearchData)||void 0===u||null===(c=u.filter(function(e){return e.total}))||void 0===c||null===(s=c[0])||void 0===s?void 0:s.total,isLoading:T}),b&&(null==L||null===(m=L.ElasticSearchData)||void 0===m||null===(f=m.filter(function(e){return!e.total}))||void 0===f?void 0:f.length)&&0!==(null==L||null===(v=L.ElasticSearchData)||void 0===v||null===(p=v.filter(function(e){return!e.total}))||void 0===p?void 0:p.length)&&n.createElement("div",null,n.createElement("p",{style:{marginLeft:"16px",marginBottom:"40px"}},n.createElement("span",{className:"link"},n.createElement(a.Link,{to:"/digit-ui/citizen/Audit/"+S},g("PT_LOAD_MORE_MSG"))))))},Dn=["digit-ui/citizen/register/name","/digit-ui/citizen/select-language","/digit-ui/citizen/select-location","/digit-ui/citizen/login","/digit-ui/citizen/register/otp"],wn=function(e,t){return t.filter(function(t){return e.map(function(e){return e.code}).includes(t.code)})},Tn=function(e){var t,r,i,u=e.stateInfo,c=e.userDetails,s=e.CITIZEN,d=e.cityDetails,m=e.mobileView,f=e.handleUserDropdownSelection,v=e.logoUrl,p=e.stateCode,E=e.modules,y=e.appTenants,C=e.pathname,b=e.initData,O=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:"[?(@.url == 'digit-ui-card')]"}],{select:function(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(function(e){return!0===e.enabled}).reduce(function(e,t){var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t].concat(e[t.parentModule]):[t],e},{})}}),S=O.isLoading,N=O.data,I=O.isFetched,_=Digit.Hooks.fsm.useRouteSubscription(C),D=l.useTranslation().t,w=a.useRouteMatch().path,T=a.useHistory(),L=Dn.some(function(e){return window.location.href.includes(e)}),A=E.map(function(e,t){var r=e.code,i=e.tenants,l=Digit.ComponentRegistryService.getComponent(r+"Module");return l?n.createElement(a.Route,{key:t,path:w+"/"+r.toLowerCase()},n.createElement(l,{stateCode:p,moduleCode:r,userType:"citizen",tenants:wn(i,y)})):null}),R=E.map(function(e,t){var r=e.code,i=e.bannerImage,l=(Digit.ComponentRegistryService.getComponent(r+"Links"),I?g(N,r,D):void 0);return"ACTION_TEST_WS"===(null==l?void 0:l.header)&&(null==l||l.links.sort(function(e,t){return t.orderNumber-e.orderNumber})),n.createElement(n.Fragment,null,n.createElement(a.Route,{key:t,path:w+"/"+r.toLowerCase()+"-home"},n.createElement("div",{className:"moduleLinkHomePage"},n.createElement("img",{src:i||(null==u?void 0:u.bannerUrl),alt:"noimagefound"}),n.createElement(o.BackButton,{className:"moduleLinkHomePageBackButton"}),n.createElement("h1",null,D("MODULE_"+r.toUpperCase())),n.createElement("div",{className:"moduleLinkHomePageModuleLinks"},l&&n.createElement(o.CitizenHomeCard,{header:D(null==l?void 0:l.header),links:null==l?void 0:l.links,Icon:function(){return n.createElement("span",null)},Info:"OBPS"===r?function(){return n.createElement(o.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:D("CS_FILE_APPLICATION_INFO_LABEL"),text:D("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")})}:null,isInfo:"OBPS"===r})),n.createElement(Ct,{moduleCode:null==r?void 0:r.toUpperCase()}))),n.createElement(a.Route,{key:"faq"+t,path:w+"/"+r.toLowerCase()+"-faq"},n.createElement(yt,{module:null==r?void 0:r.toUpperCase()})),n.createElement(a.Route,{key:"hiw"+t,path:w+"/"+r.toLowerCase()+"-how-it-works"},n.createElement(ht,{module:null==r?void 0:r.toUpperCase()})))});return n.createElement("div",{className:_},n.createElement(ct,{t:D,stateInfo:u,userDetails:c,CITIZEN:s,cityDetails:d,mobileView:m,handleUserDropdownSelection:f,logoUrl:v,showSidebar:!0,linkData:N,islinkDataLoading:S}),n.createElement("div",{className:"main center-container citizen-home-container mb-25"},L?null:n.createElement("div",{className:"SideBarStatic"},n.createElement(nt,{linkData:N,islinkDataLoading:S})),n.createElement(a.Switch,null,n.createElement(a.Route,{exact:!0,path:w},n.createElement(vt,null)),n.createElement(a.Route,{exact:!0,path:w+"/select-language"},n.createElement(pt,null)),n.createElement(a.Route,{exact:!0,path:w+"/select-location"},n.createElement(gt,null)),n.createElement(a.Route,{path:w+"/error"},n.createElement(Ve,{initData:b,goToHome:function(){T.push("/digit-ui/citizen")}})),n.createElement(a.Route,{path:w+"/all-services"},n.createElement(h,{userType:"citizen",modules:E,getCitizenMenu:N,fetchedCitizen:I,isLoading:S})),n.createElement(a.Route,{path:w+"/login"},n.createElement(x,{stateCode:p})),n.createElement(a.Route,{path:w+"/register"},n.createElement(x,{stateCode:p,isUserRegistered:!1})),n.createElement(a.Route,{path:w+"/user/profile"},n.createElement(dt,{stateCode:p,userType:"citizen",cityDetails:d})),n.createElement(a.Route,{path:w+"/Audit"},n.createElement(_n,null)),n.createElement(Ge,{initData:b},A,R))),n.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(r=t.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:function(){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=function(e){var r,i=e.stateCode,l=e.modules,o=e.appTenants,u=e.logoUrl,c=e.initData,s=a.useHistory(),d=a.useLocation().pathname,m=window.innerWidth,f=Digit.ULBService.getCurrentUlb(),v=Digit.UserService.getUser(),p=(Digit.Hooks.useStore.getInitData().data||{}).stateInfo,g=Digit.UserService.hasAccess(["FSM_DSO"]),E="CITIZEN"===(null==v||null===(r=v.info)||void 0===r?void 0:r.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(E=!1),t.useEffect(function(){null!=d&&d.includes("application-details")||(null!=d&&d.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=d&&d.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=d&&d.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),"/digit-ui/employee"===(null==d?void 0:d.toString())&&(Digit.SessionStorage.del("SEARCH_APPLICATION_DETAIL"),Digit.SessionStorage.del("WS_EDIT_APPLICATION_DETAILS")),"/digit-ui/citizen"!==(null==d?void 0:d.toString())&&"/digit-ui/employee"!==(null==d?void 0:d.toString())||Digit.SessionStorage.del("WS_DISCONNECTION")},[d]),s.listen(function(){var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});var y={stateInfo:p,userDetails:v,CITIZEN:E,cityDetails:f,mobileView:m<=640,handleUserDropdownSelection:function(e){e.func()},logoUrl:u,DSO:g,stateCode:i,modules:l,appTenants:o,sourceUrl:window.location.origin+"/citizen",pathname:d,initData:c};return n.createElement(a.Switch,null,n.createElement(a.Route,{path:"/digit-ui/employee"},n.createElement(ft,y)),n.createElement(a.Route,{path:"/digit-ui/citizen"},n.createElement(Tn,y)),n.createElement(a.Route,null,n.createElement(a.Redirect,{to:"/digit-ui/citizen"})))},An=[s],Rn=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):c.compose)(c.applyMiddleware.apply(void 0,An)),Mn=function(e,t){return void 0===t&&(t={}),c.createStore(function(e,t){return c.combineReducers(d({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return d({},e,{selectedLanguage:t.payload});default:return e}})},t));var n}(e,t),Rn)},Pn=function(e){var t,r=e.stateCode,u=e.moduleReducers,c=Digit.Hooks.useInitStore(r,e.enabledModules),s=c.data;return c.isLoading?n.createElement(o.Loader,{page:!0}):(l.getI18n(),n.createElement(i.Provider,{store:Mn(s,u(s))},n.createElement(a.BrowserRouter,null,n.createElement(o.Body,null,n.createElement(Ln,{initData:s,stateCode:r,modules:null==s?void 0:s.modules,appTenants:s.tenants,logoUrl:null==s||null===(t=s.stateInfo)||void 0===t?void 0:t.logoUrl})))))},xn={SelectOtp:w};exports.DigitUI=function(e){var i=e.stateCode,a=e.registry,l=e.enabledModules,o=e.moduleReducers,u=t.useState(Digit.Utils.getPrivacyObject()||{}),c=u[0],s=u[1],m=(Digit.UserService.getType(),new r.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retryDelay:function(e){return Infinity},retry:!1}}})),f=Digit.Contexts.ComponentProvider,v=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),n.createElement("div",null,n.createElement(Ge,null,n.createElement(r.QueryClientProvider,{client:m},n.createElement(f.Provider,{value:a},n.createElement(v.Provider,{value:{privacy:null==c?void 0:c[window.location.pathname],resetPrivacy:function(e){Digit.Utils.setPrivacyObject({}),s({})},getPrivacy:function(){var e=Digit.Utils.getPrivacyObject();return s(e),e},updatePrivacyDescoped:function(e){var t,n=Digit.Utils.getAllPrivacyObject(),r=d({},n,((t={})[window.location.pathname]=e,t));Digit.Utils.setPrivacyObject(d({},r)),s((null==n?void 0:n[window.location.pathname])||{})},updatePrivacy:function(e,t){s(Digit.Utils.updatePrivacy(e,t)||{})}}},n.createElement(Pn,{stateCode:i,enabledModules:l,moduleReducers:o}))))))},exports.initCoreComponents=function(){Object.entries(xn).forEach(function(e){Digit.ComponentRegistryService.setComponent(e[0],e[1])})};
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),n=e(t),r=require("react-query"),i=require("react-redux"),o=require("react-router-dom"),a=require("react-i18next"),l=require("@egovernments/digit-ui-react-components"),u=e(require("react-tooltip")),c=require("redux"),s=e(require("redux-thunk"));function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return m(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g=function(e,t,n){var r=null==e?void 0:e[""+t];r&&r.map(function(e){e.link=e.navigationURL,e.i18nKey=n(e.name)});var i={links:null==r?void 0:r.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:"CITIZEN_"+t+"_ICON"};return"FSM"===t&&[{role:"FSM_DSO",from:"/digit-ui/citizen/fsm/dso-dashboard",dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(function(e){var t,r,o=e.from,a=e.loginLink,l=e.dashoardLink;Digit.UserService.hasAccess(e.role)?null==i||null===(t=i.links)||void 0===t||t.push({link:o,i18nKey:n(l)}):null==i||null===(r=i.links)||void 0===r||r.push({link:"/digit-ui/citizen/login",state:{role:"FSM_DSO",from:o},i18nKey:n(a)})}),i},h=function(e){var t=e.modules,r=e.getCitizenMenu,i=e.fetchedCitizen,o=e.isLoading,u=t.filter(function(e){return"Payment"===e.code})[0],c=t.filter(function(e){return"Payment"!==e.code}),s=[u].concat(c),d=a.useTranslation().t;return o?n.createElement(l.Loader,null):n.createElement(n.Fragment,null,n.createElement("div",{className:"citizen-all-services-wrapper"},n.createElement(l.BackButton,null),n.createElement("div",{className:"citizenAllServiceGrid"},s.filter(function(e){return e}).map(function(e,t){var o,a,u,c,s,f,v,m=e.code;return i&&(u=i?g(r,m,d):void 0),(null===(o=u)||void 0===o||null===(a=o.links)||void 0===a?void 0:a.length)>0?n.createElement(l.CitizenHomeCard,{header:d(null===(c=u)||void 0===c?void 0:c.header),links:null===(s=u)||void 0===s||null===(f=s.links)||void 0===f||null===(v=f.filter(function(e){return null==e?void 0:e.link}))||void 0===v?void 0:v.sort(function(e,t){return(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)}),Icon:function(){return function(e){switch(e){case"PT":return n.createElement(l.PTIcon,{className:"fill-path-primary-main"});case"WS":return n.createElement(l.WSICon,{className:"fill-path-primary-main"});case"FSM":return n.createElement(l.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return n.createElement(l.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return n.createElement(l.PGRIcon,{className:"fill-path-primary-main"});case"TL":return n.createElement(l.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return n.createElement(l.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return n.createElement(l.BillsIcon,{className:"fill-path-primary-main"});default:return n.createElement(l.PTIcon,{className:"fill-path-primary-main"})}}(m)},Info:"OBPS"===m?function(){return n.createElement(l.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:d("CS_FILE_APPLICATION_INFO_LABEL"),text:d("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")})}:null,isInfo:"OBPS"===m}):n.createElement(n.Fragment,null)}))))},E=function(e){var t=e.modules;return window.Digit.SessionStorage.get("PT_CREATE_EMP_TRADE_NEW_FORM")&&window.Digit.SessionStorage.set("PT_CREATE_EMP_TRADE_NEW_FORM",{}),n.createElement("div",{className:"employee-app-container"},n.createElement("div",{className:"ground-container moduleCardWrapper gridModuleWrapper"},t.map(function(e,t){var r=Digit.ComponentRegistryService.getComponent(e.code+"Card")||function(){return n.createElement(n.Fragment,null)};return n.createElement(r,{key:t})})))},y=function(e){var t=e.modules;return"citizen"===e.userType?n.createElement(h,{modules:t,getCitizenMenu:e.getCitizenMenu,fetchedCitizen:e.fetchedCitizen,isLoading:e.isLoading}):n.createElement(E,{modules:t})},_=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var o=1&i?t:n;if(o){try{b(r,1,o(this.v))}catch(e){b(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?b(r,1,t?t(i):i):n?b(r,1,n(i)):b(r,2,i)}catch(e){b(r,2,e)}},r},e}();function b(e,t,n){if(!e.s){if(n instanceof _){if(!n.s)return void(n.o=b.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(b.bind(null,e,t),b.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}function C(e){return e instanceof _&&1&e.s}var S="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function O(e,t,n){if("function"==typeof e[S]){var r,i,o,a=e[S]();if(function e(l){try{for(;!((r=a.next()).done||n&&n());)if((l=t(r.value))&&l.then){if(!C(l))return void l.then(e,o||(o=b.bind(null,i=new _,2)));l=l.v}i?b(i,1,l):i=l}catch(e){b(i||(i=new _),2,e)}}(),a.return){var l=function(e){try{r.done||a.return()}catch(e){}return e};if(i&&i.then)return i.then(l,function(e){throw l(e)});l()}return i}if(!("length"in e))throw new TypeError("Object is not iterable");for(var u=[],c=0;c<e.length;c++)u.push(e[c]);return function(e,t,n){var r,i,o=-1;return function a(l){try{for(;++o<e.length&&(!n||!n());)if((l=t(o))&&l.then){if(!C(l))return void l.then(a,i||(i=b.bind(null,r=new _,2)));l=l.v}r?b(r,1,l):r=l}catch(e){b(r||(r=new _),2,e)}}(),r}(u,function(e){return t(u[e])},n)}function w(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var N=[{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,pattern:/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i}}]}],I=function(e){var r,i=e.t,o=e.onSelect,a=e.mobileNumber,u=e.onMobileChange,c=e.config,s=e.canSubmit,d=t.useState(!1),f=d[0],v=d[1],m=t.useState(!1),p=m[0],g=m[1],h=t.useState(""),E=h[0],y=h[1],_=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"common-masters",[{name:"CitizenConsentForm"}]),b=_.isLoading,C=_.data;function S(e){v(e.target.checked)}return t.useEffect(function(){var e,t,n,r,i;null!=C&&null!==(e=C["common-masters"])&&void 0!==e&&null!==(t=e.CitizenConsentForm)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.isCitizenConsentFormEnabled&&g(null==C||null===(r=C["common-masters"])||void 0===r||null===(i=r.CitizenConsentForm)||void 0===i?void 0:i[0])},[C]),b?n.createElement(l.Loader,null):n.createElement(l.FormStep,{isDisabled:null!=p&&p.isCitizenConsentFormEnabled?!(10===a.length&&s&&f):!(10===a.length&&s),onSelect:o,config:c,t:i,componentInFront:"+91",onChange:u,value:a},(null==p?void 0:p.isCitizenConsentFormEnabled)&&n.createElement("div",null,n.createElement(l.CheckBox,{className:"form-field",label:n.createElement("span",null,null==p||null===(r=p.checkBoxLabels)||void 0===r?void 0:r.map(function(e,t){var r;return n.createElement("span",null,(null==e?void 0:e.linkPrefix)&&n.createElement("span",null,i((null==e?void 0:e.linkPrefix)+"_")),(null==e?void 0:e.link)&&n.createElement("span",{id:null==e?void 0:e.linkId,onClick:function(e){!function(e){y(e.target.id)}(e)},style:{color:"#F47738",cursor:"pointer"}},i((null==e?void 0:e.link)+"_")),(null==e?void 0:e.linkPostfix)&&n.createElement("span",null,i((null==e?void 0:e.linkPostfix)+"_")),t==(null==p||null===(r=p.checkBoxLabels)||void 0===r?void 0:r.length)-1&&i("LABEL"))})),value:f,checked:f,style:{marginTop:"5px",marginLeft:"55px"},styles:{marginBottom:"30px"},onChange:S}),n.createElement(l.CitizenConsentForm,{styles:{},t:i,isCheckBoxChecked:S,labels:null==p?void 0:p.checkBoxLabels,mdmsConfig:E,setMdmsConfig:y})))},T=function(e){var r,i,o,a=e.config,u=e.otp,c=e.onOtpChange,s=e.onResend,d=e.onSelect,f=e.t,v=e.error,m=e.userType,p=void 0===m?"citizen":m,g=e.canSubmit,h=t.useState(30),E=h[0],y=h[1];r=function(){y(E-1)},i=E>0?1e3:null,o=t.useRef(),t.useEffect(function(){o.current=r},[r]),t.useEffect(function(){if(null!==i){var e=setInterval(function(){o.current()},i);return function(){return clearInterval(e)}}},[i]);var _=function(){s(),y(2)};return"employee"===p?n.createElement(t.Fragment,null,n.createElement(l.OTPInput,{length:6,onChange:c,value:u}),E>0?n.createElement(l.CardText,null,f("CS_RESEND_ANOTHER_OTP")+" "+E+" "+f("CS_RESEND_SECONDS")):n.createElement("p",{className:"card-text-button",onClick:_},f("CS_RESEND_OTP")),!v&&n.createElement(l.CardLabelError,null,f("CS_INVALID_OTP"))):n.createElement(l.FormStep,{onSelect:d,config:a,t:f,isDisabled:!(6===(null==u?void 0:u.length)&&g)},n.createElement(l.OTPInput,{length:6,onChange:c,value:u}),E>0?n.createElement(l.CardText,null,f("CS_RESEND_ANOTHER_OTP")+" "+E+" "+f("CS_RESEND_SECONDS")):n.createElement("p",{className:"card-text-button",onClick:_},f("CS_RESEND_OTP")),!v&&n.createElement(l.CardLabelError,null,f("CS_INVALID_OTP")))},D=function(e){return n.createElement(l.FormStep,{config:e.config,onSelect:e.onSelect,t:e.t,isDisabled:e.isDisabled})},A=["ResponseInfo","UserRequest"],L=["ResponseInfo","UserRequest"],R={type:"register"},x={type:"login"},M=function(e,t){return(null==e?void 0:e.from)||(null==t?void 0:t.from)||"/digit-ui/citizen"},P=function(e){var r,i,u=e.stateCode,c=e.isUserRegistered,s=void 0===c||c,f=a.useTranslation().t,m=o.useLocation(),p=o.useRouteMatch().path,g=o.useHistory(),h=t.useState(null),E=h[0],y=h[1],_=t.useState(null),b=_[0],C=_[1],S=t.useState(!0),O=S[0],P=S[1],k=(t.useState(null),t.useState(s?{}:null==m||null===(r=m.state)||void 0===r?void 0:r.data)),U=k[0],B=k[1],j=t.useState(null),F=j[0],z=j[1],V=Digit.Hooks.useQueryParams(),W=t.useState(!1),H=W[0],G=W[1],q=t.useState(!0),X=q[0],Z=q[1],Y=t.useState(!0),K=Y[0],$=Y[1];t.useEffect(function(){var e;return b&&(F&&(clearTimeout(F),z(null)),e=setTimeout(function(){C("")},5e3),z(e)),function(){e&&clearTimeout(e)}},[b]),t.useEffect(function(){var e;if(E){var t,n,r,i,o,a;Digit.SessionStorage.set("citizen.userRequestObject",E),Digit.UserService.setUser(E),t=null==E?void 0:E.info,n=null==E?void 0:E.access_token,r=u,a=null===(i=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===i||null===(o=i.value)||void 0===o?void 0:o.selectedLanguage,localStorage.setItem("Citizen.tenant-id",r),localStorage.setItem("tenant-id",r),localStorage.setItem("citizen.userRequestObject",JSON.stringify(t)),localStorage.setItem("locale",a),localStorage.setItem("Citizen.locale",a),localStorage.setItem("token",n),localStorage.setItem("Citizen.token",n),localStorage.setItem("user-info",JSON.stringify(t)),localStorage.setItem("Citizen.user-info",JSON.stringify(t));var l=(null===(e=m.state)||void 0===e?void 0:e.from)||"/digit-ui/citizen";Digit.ULBService.getCitizenCurrentTenant(!0)?g.replace(l):g.replace("/digit-ui/citizen/select-location",{redirectBackTo:l})}},[E]);var J=t.useMemo(function(){return N.map(function(e){var t={};for(var n in e.texts)t[n]=f(e.texts[n]);return d({},e,{texts:t})},[N])}),Q=function(){return Digit.UserService.getType()},ee=function(e){return Promise.resolve(w(function(){return Promise.resolve(Digit.UserService.sendOtp(e,u)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return n.createElement("div",{className:"citizen-form-wrapper"},n.createElement(o.Switch,null,n.createElement(l.AppContainer,null,n.createElement(l.BackButton,null),n.createElement(o.Route,{path:""+p,exact:!0},n.createElement(I,{onSelect:function(e){try{$(!1),B(d({},U,e));var t=d({},e,{tenantId:u,userType:Q()});return Promise.resolve(s?Promise.resolve(ee({otp:d({},t,x)})).then(function(e){var n,r,i;if(!e[1])return $(!0),void g.replace(p+"/otp",{from:M(m.state,V),role:null===(r=m.state)||void 0===r?void 0:r.role});$(!0),m.state&&"FSM_DSO"===m.state.role||g.push("/digit-ui/citizen/register/name",{from:M(m.state,V),data:t}),null!==(n=m.state)&&void 0!==n&&n.role&&($(!0),C("FSM_DSO"===(null===(i=m.state)||void 0===i?void 0:i.role)?f("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(ee({otp:d({},t,R)})).then(function(e){if(!e[1])return $(!0),void g.replace(p+"/otp",{from:M(m.state,V)});$(!0)}))}catch(e){return Promise.reject(e)}},config:J[0],mobileNumber:U.mobileNumber||"",onMobileChange:function(e){B(d({},U,{mobileNumber:e.target.value}))},canSubmit:K,showRegisterLink:s&&!(null!==(i=m.state)&&void 0!==i&&i.role),t:f})),n.createElement(o.Route,{path:p+"/otp"},n.createElement(T,{config:d({},J[1],{texts:d({},J[1].texts,{cardText:J[1].texts.cardText+" "+(U.mobileNumber||"")})}),onOtpChange:function(e){B(d({},U,{otp:e}))},onResend:function(){try{var e={mobileNumber:U.mobileNumber,tenantId:u,userType:Q()},t=function(){if(!s)return Promise.resolve(ee({otp:d({},e,R)})).then(function(){});var t=function(){if(s)return Promise.resolve(ee({otp:d({},e,x)})).then(function(){})}();return t&&t.then?t.then(function(){}):void 0}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(w(function(){P(!0),Z(!1);var e=U.mobileNumber,t=U.otp,n=U.name;return function(){if(s){var r={username:e,password:t,tenantId:u,userType:Q()};return Promise.resolve(Digit.UserService.authenticate(r)).then(function(e){var t,n,r,i=e.UserRequest,o=v(e,A);if(null!==(t=m.state)&&void 0!==t&&t.role){var a=i.roles.find(function(e){return e.code===m.state.role});if(!a||!a.code)return C(f("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(function(){return g.replace("/digit-ui/citizen")},5e3)}null!==(n=window)&&void 0!==n&&null!==(r=n.globalConfigs)&&void 0!==r&&r.getConfig("ENABLE_SINGLEINSTANCE")&&(i.tenantId=Digit.ULBService.getStateId()),y(d({info:i},o))})}var i=function(){if(!s)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:u},u)).then(function(e){var t,n,r=e.UserRequest,i=v(e,L);null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(r.tenantId=Digit.ULBService.getStateId()),y(d({info:r},i))})}();if(i&&i.then)return i.then(function(){})}()},function(){Z(!0),P(!1)}))}catch(e){return Promise.reject(e)}},otp:U.otp,error:O,canSubmit:X,t:f})),n.createElement(o.Route,{path:p+"/name"},n.createElement(D,{config:J[2],onSelect:function(e){try{var t=d({},U,{tenantId:u,userType:Q()},e);return B(d({},U,e)),G(!0),Promise.resolve(ee({otp:d({},t,R)})).then(function(e){e[0]?(G(!1),g.replace(p+"/otp",{from:M(m.state,V)})):G(!1)})}catch(e){return Promise.reject(e)}},t:f,isDisabled:H})),b&&n.createElement(l.Toast,{error:!0,label:b,onClose:function(){return C(null)}}))))},k=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",name:"username",error:"ERR_HRMS_INVALID_USER_ID"},{label:"CORE_LOGIN_PASSWORD",type:"password",name:"password",error:"ERR_HRMS_WRONG_PASSWORD"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],U="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function B(e,t){return e(t={exports:{}},t.exports),t.exports}var j="function"==typeof Symbol&&Symbol.for,F=j?Symbol.for("react.element"):60103,z=j?Symbol.for("react.portal"):60106,V=j?Symbol.for("react.fragment"):60107,W=j?Symbol.for("react.strict_mode"):60108,H=j?Symbol.for("react.profiler"):60114,G=j?Symbol.for("react.provider"):60109,q=j?Symbol.for("react.context"):60110,X=j?Symbol.for("react.async_mode"):60111,Z=j?Symbol.for("react.concurrent_mode"):60111,Y=j?Symbol.for("react.forward_ref"):60112,K=j?Symbol.for("react.suspense"):60113,$=j?Symbol.for("react.suspense_list"):60120,J=j?Symbol.for("react.memo"):60115,Q=j?Symbol.for("react.lazy"):60116,ee=j?Symbol.for("react.block"):60121,te=j?Symbol.for("react.fundamental"):60117,ne=j?Symbol.for("react.responder"):60118,re=j?Symbol.for("react.scope"):60119;function ie(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case F:switch(e=e.type){case X:case Z:case V:case H:case W:case K:return e;default:switch(e=e&&e.$$typeof){case q:case Y:case Q:case J:case G:return e;default:return t}}case z:return t}}}function oe(e){return ie(e)===Z}var ae={AsyncMode:X,ConcurrentMode:Z,ContextConsumer:q,ContextProvider:G,Element:F,ForwardRef:Y,Fragment:V,Lazy:Q,Memo:J,Portal:z,Profiler:H,StrictMode:W,Suspense:K,isAsyncMode:function(e){return oe(e)||ie(e)===X},isConcurrentMode:oe,isContextConsumer:function(e){return ie(e)===q},isContextProvider:function(e){return ie(e)===G},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===F},isForwardRef:function(e){return ie(e)===Y},isFragment:function(e){return ie(e)===V},isLazy:function(e){return ie(e)===Q},isMemo:function(e){return ie(e)===J},isPortal:function(e){return ie(e)===z},isProfiler:function(e){return ie(e)===H},isStrictMode:function(e){return ie(e)===W},isSuspense:function(e){return ie(e)===K},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===V||e===Z||e===H||e===W||e===K||e===$||"object"==typeof e&&null!==e&&(e.$$typeof===Q||e.$$typeof===J||e.$$typeof===G||e.$$typeof===q||e.$$typeof===Y||e.$$typeof===te||e.$$typeof===ne||e.$$typeof===re||e.$$typeof===ee)},typeOf:ie},le=B(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var v=e.type;switch(v){case c:case s:case i:case a:case o:case f:return v;default:var g=v&&v.$$typeof;switch(g){case u:case d:case p:case m:case l:return g;default:return t}}case r:return t}}}var b=s,C=u,S=l,O=n,w=d,N=i,I=p,T=m,D=r,A=a,L=o,R=f,x=!1;function M(e){return _(e)===s}t.AsyncMode=c,t.ConcurrentMode=b,t.ContextConsumer=C,t.ContextProvider=S,t.Element=O,t.ForwardRef=w,t.Fragment=N,t.Lazy=I,t.Memo=T,t.Portal=D,t.Profiler=A,t.StrictMode=L,t.Suspense=R,t.isAsyncMode=function(e){return x||(x=!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.")),M(e)||_(e)===c},t.isConcurrentMode=M,t.isContextConsumer=function(e){return _(e)===u},t.isContextProvider=function(e){return _(e)===l},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)===i},t.isLazy=function(e){return _(e)===p},t.isMemo=function(e){return _(e)===m},t.isPortal=function(e){return _(e)===r},t.isProfiler=function(e){return _(e)===a},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===o||e===f||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===m||e.$$typeof===l||e.$$typeof===u||e.$$typeof===d||e.$$typeof===h||e.$$typeof===E||e.$$typeof===y||e.$$typeof===g)},t.typeOf=_}()}),ue=B(function(e){e.exports="production"===process.env.NODE_ENV?ae:le}),ce=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;function fe(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var ve=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 r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=fe(e),o=1;o<arguments.length;o++){for(var a in n=Object(arguments[o]))se.call(n,a)&&(i[a]=n[a]);if(ce){r=ce(n);for(var l=0;l<r.length;l++)de.call(n,r[l])&&(i[r[l]]=n[r[l]])}}return i},me="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",pe=Function.call.bind(Object.prototype.hasOwnProperty),ge=function(){};if("production"!==process.env.NODE_ENV){var he=me,Ee={},ye=pe;ge=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function _e(e,t,n,r,i){if("production"!==process.env.NODE_ENV)for(var o in e)if(ye(e,o)){var a;try{if("function"!=typeof e[o]){var l=Error((r||"React class")+": "+n+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[o](t,o,r,n,null,he)}catch(e){a=e}if(!a||a instanceof Error||ge((r||"React class")+": type specification of "+n+" `"+o+"` 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 Ee)){Ee[a.message]=!0;var u=i?i():"";ge("Failed "+n+" type: "+a.message+(null!=u?u:""))}}}_e.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(Ee={})};var be=_e,Ce=function(){};function Se(){return null}function Oe(){}function we(){}"production"!==process.env.NODE_ENV&&(Ce=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),we.resetWarningCache=Oe;var Ne=B(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:a(Se),arrayOf:function(e){return a(function(t,n,r,i,a){if("function"!=typeof e)return new o("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var l=t[n];if(!Array.isArray(l))return new o("Invalid "+i+" `"+a+"` of type `"+s(l)+"` supplied to `"+r+"`, expected an array.");for(var u=0;u<l.length;u++){var c=e(l,u,r,i,a+"["+u+"]",me);if(c instanceof Error)return c}return null})},element:a(function(t,n,r,i,a){var l=t[n];return e(l)?null:new o("Invalid "+i+" `"+a+"` of type `"+s(l)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:a(function(e,t,n,r,i){var a=e[t];return ue.isValidElementType(a)?null:new o("Invalid "+r+" `"+i+"` of type `"+s(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,r,i,a){var l;return t[n]instanceof e?null:new o("Invalid "+i+" `"+a+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,t,n,r,i){return c(e[t])?null:new o("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,n,r,i,a){if("function"!=typeof e)return new o("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var l=t[n],u=s(l);if("object"!==u)return new o("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var c in l)if(pe(l,c)){var d=e(l,c,r,i,a+"."+c,me);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Ce(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."),Se;function t(t,n,r,a,l){for(var u=t[n],c=0;c<e.length;c++)if(i(u,e[c]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new o("Invalid "+a+" `"+l+"` of value `"+String(u)+"` supplied to `"+r+"`, expected one of "+s+".")}return a(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Ce("Invalid argument supplied to oneOfType, expected an instance of array."),Se;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return Ce("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+f(n)+" at index "+t+"."),Se}return a(function(t,n,r,i,a){for(var l=[],u=0;u<e.length;u++){var c=(0,e[u])(t,n,r,i,a,me);if(null==c)return null;c.data&&pe(c.data,"expectedType")&&l.push(c.data.expectedType)}return new o("Invalid "+i+" `"+a+"` supplied to `"+r+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,n,r,i,a){var l=t[n],c=s(l);if("object"!==c)return new o("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var f in e){var v=e[f];if("function"!=typeof v)return u(r,i,a,f,d(v));var m=v(l,f,r,i,a+"."+f,me);if(m)return m}return null})},exact:function(e){return a(function(t,n,r,i,a){var l=t[n],c=s(l);if("object"!==c)return new o("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var f=ve({},t[n],e);for(var v in f){var m=e[v];if(pe(e,v)&&"function"!=typeof m)return u(r,i,a,v,d(m));if(!m)return new o("Invalid "+i+" `"+a+"` key `"+v+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=m(l,v,r,i,a+"."+v,me);if(p)return p}return null})}};function i(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function o(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,r,i,a,l,u){if(i=i||"<<anonymous>>",l=l||r,u!==me){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[r]?t?new o(null===n[r]?"The "+a+" `"+l+"` is marked as required in `"+i+"`, but its value is `null`.":"The "+a+" `"+l+"` is marked as required in `"+i+"`, but its value is `undefined`."):null:e(n,r,i,a,l)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function l(e){return a(function(t,n,r,i,a,l){var u=t[n];return s(u)!==e?new o("Invalid "+i+" `"+a+"` of type `"+d(u)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,r,i){return new o((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}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 r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var i,o=r.call(t);if(r!==t.entries){for(;!(i=o.next()).done;)if(!c(i.value))return!1}else for(;!(i=o.next()).done;){var a=i.value;if(a&&!c(a[1]))return!1}return!0;default:return!1}}function s(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=s(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function f(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 o.prototype=Error.prototype,r.checkPropTypes=be,r.resetWarningCache=be.resetWarningCache,r.PropTypes=r,r}(ue.isElement):function(){function e(e,t,n,r,i,o){if(o!==me){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:we,resetWarningCache:Oe};return n.PropTypes=n,n}()}),Ie=function(e){return n.createElement("div",{className:"banner banner-container"},e.children)},Te=function(){var e=Digit.Hooks.useStore.getInitData(),t=e.isLoading,r=(e.data||{}).stateInfo,i=a.useTranslation().t;return t?n.createElement(l.Loader,null):n.createElement("div",{className:"bannerHeader"},n.createElement("img",{className:"bannerLogo",src:null==r?void 0:r.logoUrl}),n.createElement("p",null,i("TENANT_TENANTS_"+(null==r?void 0:r.code.toUpperCase()))))},De=["UserRequest"],Ae=function(e){var r,i,a,u=e.config,c=e.t,s=e.isDisabled,f=Digit.Hooks.useTenants(),m=f.data,p=f.isLoading,g=Digit.Hooks.useStore.getInitData().isLoading,h=t.useState(null),E=h[0],y=h[1],_=t.useState(null),b=_[0],C=_[1],S=t.useState(!1),O=S[0],N=S[1],I=o.useHistory();t.useEffect(function(){var e,t,n,r,i,o,a,l,u,c,s,d,f,v,m,p,g;if(E){Digit.SessionStorage.set("citizen.userRequestObject",E);var h,y,_,b,C=null==E||null===(e=E.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(function(e){return e.tenantId===Digit.SessionStorage.get("Employee.tenantId")});(null==E||null===(n=E.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.length)>0&&(E.info.roles=C),Digit.UserService.setUser(E),h=null==E?void 0:E.info,y=null==E?void 0:E.access_token,b=(null===(_=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===_?void 0:_.value)||"en_IN",localStorage.setItem("Employee.tenant-id",null==h?void 0:h.tenantId),localStorage.setItem("tenant-id",null==h?void 0:h.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(h)),localStorage.setItem("locale",b),localStorage.setItem("Employee.locale",b),localStorage.setItem("token",y),localStorage.setItem("Employee.token",y),localStorage.setItem("user-info",JSON.stringify(h)),localStorage.setItem("Employee.user-info",JSON.stringify(h));var S,O,w,N,T="/digit-ui/employee";null!==(i=window)&&void 0!==i&&null!==(o=i.location)&&void 0!==o&&null!==(a=o.href)&&void 0!==a&&a.includes("from=")&&(T=decodeURIComponent(null===(S=window)||void 0===S||null===(O=S.location)||void 0===O||null===(w=O.href)||void 0===w||null===(N=w.split("from="))||void 0===N?void 0:N[1])||"/digit-ui/employee"),null!=E&&null!==(l=E.info)&&void 0!==l&&l.roles&&(null==E||null===(u=E.info)||void 0===u||null===(c=u.roles)||void 0===c?void 0:c.length)>0&&null!=E&&null!==(s=E.info)&&void 0!==s&&null!==(d=s.roles)&&void 0!==d&&d.every(function(e){return"NATADMIN"===e.code})&&(T="/digit-ui/employee/dss/landing/NURT_DASHBOARD"),null!=E&&null!==(f=E.info)&&void 0!==f&&f.roles&&(null==E||null===(v=E.info)||void 0===v||null===(m=v.roles)||void 0===m?void 0:m.length)>0&&null!=E&&null!==(p=E.info)&&void 0!==p&&null!==(g=p.roles)&&void 0!==g&&g.every(function(e){return"STADMIN"===e.code})&&(T="/digit-ui/employee/dss/landing/home"),I.replace(T)}},[E]);var T=function(){C(null)},D=u.inputs,A=D[0],L=D[1],R=D[2],x=[{body:[{label:c(A.label),type:A.type,populators:{name:A.name},isMandatory:!0},{label:c(L.label),type:L.type,populators:{name:L.name},isMandatory:!0},{label:c(R.label),type:R.type,populators:{name:R.name,customProps:{},component:function(e,t){return n.createElement(l.Dropdown,d({option:m,className:"login-city-dd",optionKey:"i18nKey",select:function(t){e.onChange(t)},t:c},t))}},isMandatory:!0}]}];return p||g?n.createElement(l.Loader,null):n.createElement(Ie,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(l.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(l.FormComposer,{onSubmit:function(e){try{var t=function(){N(!1)};if(!e.city)return alert("Please Select City!"),Promise.resolve();N(!0);var n=d({},e,{userType:"EMPLOYEE"});n.tenantId=e.city.code,delete n.city;var r=w(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t=e.UserRequest,n=v(e,De);Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),y(d({info:t},n))})},function(e){var t,n;C((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"Invalid login credentials!"),setTimeout(T,5e3)});return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},isDisabled:s||O,noBoxShadow:!0,inline:!0,submitInForm:!0,config:x,label:u.texts.submitButtonLabel,secondaryActionLabel:u.texts.secondaryButtonLabel,onSecondayActionClick:function(){sessionStorage.getItem("User")&&sessionStorage.removeItem("User"),I.push("/digit-ui/employee/user/forgot-password")},heading:u.texts.header,headingStyle:{textAlign:"center"},cardStyle:{margin:"auto",minWidth:"408px"},className:"loginFormStyleEmployee",buttonStyle:{maxWidth:"100%",width:"100%"}},n.createElement(Te,null)),b&&n.createElement(l.Toast,{error:!0,label:c(b),onClose:T}),n.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(a=i.getConfig)||void 0===a?void 0:a.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};Ae.propTypes={loginParams:Ne.any},Ae.defaultProps={loginParams:null};var Le=function(){var e=a.useTranslation().t,r=o.useRouteMatch().path,i=t.useMemo(function(){return k.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[k])});return n.createElement(o.Switch,null,n.createElement(o.Route,{path:""+r,exact:!0},n.createElement(Ae,{config:i[0],t:e})))},Re=[{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"}]}],xe=function(e){var r,i,a,u=e.config,c=e.t,s=t.useState(null)[0],f=Digit.Hooks.useQueryParams(),v=f.mobile_number,m=f.tenantId,p=o.useHistory(),g=t.useState(""),h=g[0],E=g[1],y=t.useState(!0)[0],_=t.useState(null),b=_[0],C=_[1],S=function(){return Digit.UserService.getType()};t.useEffect(function(){var e;if(s){Digit.UserService.setUser(s);var t=(null===(e=location.state)||void 0===e?void 0:e.from)||"/digit-ui/employee";p.replace(t)}else Digit.UserService.setType("employee")},[s]);var O=function(){C(null)},N=u.inputs,I=N[0],D=N[1],A=N[2],L=[{body:[{label:c(I.label),type:I.type,populators:{name:I.name},isMandatory:!0},{label:c(D.label),type:D.type,populators:{name:D.name},isMandatory:!0},{label:c(A.label),type:A.type,populators:{name:A.name},isMandatory:!0}]}];return n.createElement(Ie,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(l.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(l.FormComposer,{onSubmit:function(e){try{return Promise.resolve(w(function(){if(e.newPassword!==e.confirmPassword)return C(c("ERR_PASSWORD_DO_NOT_MATCH"));var t=d({},e,{otpReference:h,tenantId:m,type:S().toUpperCase()});return Promise.resolve(Digit.UserService.changePassword(t,m)).then(function(e){p.replace("/digit-ui/employee/user/login")})},function(e){var t,n,r,i,o;C((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||c("ES_SOMETHING_WRONG")),setTimeout(O,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:L,label:u.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},n.createElement(Te,null),n.createElement(l.CardSubHeader,{style:{textAlign:"center"}}," ",u.texts.header," "),n.createElement(l.CardText,null,c("CS_LOGIN_OTP_TEXT")+" ",n.createElement("b",null," ",""+c("+ 91 - ")," ",v)),n.createElement(T,{t:c,userType:"employee",otp:h,onOtpChange:E,error:y,onResend:function(){try{var e=function(){setTimeout(O,5e3)},t={otp:{mobileNumber:v,userType:S().toUpperCase(),type:"passwordreset",tenantId:m}},n=w(function(){return Promise.resolve(Digit.UserService.sendOtp(t,m)).then(function(){C(c("ES_OTP_RESEND"))})},function(e){var t,n;C((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||c("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),b&&n.createElement(l.Toast,{error:!0,label:c(b),onClose:O}),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(a=i.getConfig)||void 0===a?void 0:a.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};xe.propTypes={loginParams:Ne.any},xe.defaultProps={loginParams:null};var Me=function(){var e=a.useTranslation().t,r=o.useRouteMatch().path,i=t.useMemo(function(){return Re.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[Re])});return n.createElement(o.Switch,null,n.createElement(o.Route,{path:""+r,exact:!0},n.createElement(xe,{config:i[0],t:e})))},Pe=[{texts:{header:"CORE_COMMON_FORGOT_PASSWORD_LABEL",description:"ES_FORGOT_PASSWORD_DESC",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOBILE_NUMBER"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],ke=function(e){var r,i,a,u=e.config,c=e.t,s=Digit.Hooks.useTenants(),f=s.data,v=s.isLoading,m=t.useState(null)[0],p=o.useHistory(),g=t.useState(null),h=g[0],E=g[1];t.useEffect(function(){var e;if(m){Digit.UserService.setUser(m);var t=(null===(e=location.state)||void 0===e?void 0:e.from)||"/digit-ui/employee";p.replace(t)}else Digit.UserService.setType("employee")},[m]);var y=function(){E(null)},_=u.inputs,b=_[0],C=_[1],S=[{body:[{label:c(b.label),type:b.type,populators:{name:b.name,componentInFront:"+91"},isMandatory:!0},{label:c(C.label),type:C.type,populators:{name:C.name,customProps:{},component:function(e,t){return n.createElement(l.Dropdown,d({option:f,optionKey:"name",id:C.name,className:"login-city-dd",select:function(t){e.onChange(t)}},t))}},isMandatory:!0}]}];return v?n.createElement(l.Loader,null):n.createElement(Ie,null,n.createElement("div",{className:"employeeBackbuttonAlign"},n.createElement(l.BackButton,{variant:"white",style:{borderBottom:"none"}})),n.createElement(l.FormComposer,{onSubmit:function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();var t={otp:{mobileNumber:e.mobileNumber,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=w(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){p.push("/digit-ui/employee/user/change-password?mobile_number="+e.mobileNumber+"&tenantId="+e.city.code)})},function(e){var t,n,r,i,o;E((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(i=r.fields)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.message)||"Invalid login credentials!"),setTimeout(y,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:S,label:u.texts.submitButtonLabel,secondaryActionLabel:u.texts.secondaryButtonLabel,onSecondayActionClick:function(){p.replace("/digit-ui/employee/login")},heading:u.texts.header,description:u.texts.description,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},n.createElement(Te,null)),h&&n.createElement(l.Toast,{error:!0,label:c(h),onClose:y}),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(r=window)||void 0===r||null===(i=r.globalConfigs)||void 0===i||null===(a=i.getConfig)||void 0===a?void 0:a.call(i,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))};ke.propTypes={loginParams:Ne.any},ke.defaultProps={loginParams:null};var Ue=function(){var e=a.useTranslation().t,r=o.useRouteMatch().path,i=t.useMemo(function(){return Pe.map(function(t){var n={};for(var r in t.texts)n[r]=e(t.texts[r]);return d({},t,{texts:n})},[Pe])});return n.createElement(o.Switch,null,n.createElement(o.Route,{path:""+r,exact:!0},n.createElement(ke,{config:i[0],t:e})))},Be=function(){var e,r,i,u=Digit.Hooks.useStore.getInitData(),c=u.data,s=u.isLoading,d=a.useTranslation().t,f=o.useHistory(),v=c||{},m=v.languages,p=v.stateInfo,g=Digit.StoreData.getCurrentLanguage(),h=t.useState(g),E=h[0],y=h[1];return s?null:n.createElement(Ie,null,n.createElement(l.Card,{className:"bannerCard removeBottomMargin"},n.createElement("div",{className:"bannerHeader"},n.createElement("img",{className:"bannerLogo",src:null==p?void 0:p.logoUrl,alt:"Digit"}),n.createElement("p",null,d("TENANT_TENANTS_"+(null==p?void 0:p.code.toUpperCase())))),n.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},m.map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(l.CustomButton,{selected:e.value===E,text:e.label,onClick:function(){return function(e){y(e.value),Digit.LocalizationService.changeLanguage(e.value,p.code)}(e)}}))})),n.createElement(l.SubmitBar,{style:{width:"100%"},label:d("CORE_COMMON_CONTINUE"),onSubmit:function(e){f.push("/digit-ui/employee/user/login")}})),n.createElement("div",{className:"EmployeeLoginFooter"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(r=e.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:function(){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()}})," "))},je=function(e,t){return t.filter(function(t){var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,function(e){return e.code}).includes(t.code)})},Fe=function(e){var t=e.stateCode,r=e.userType,i=e.modules,a=e.appTenants,l=(Digit,o.useRouteMatch().path),u=o.useLocation(),c=Digit.UserService.getUser();if(!c||null==c||!c.access_token||null==c||!c.info)return n.createElement(o.Redirect,{to:{pathname:"/digit-ui/employee/user/login",state:{from:u.pathname+u.search}}});var s=i.map(function(e,i){var c=e.code,s=e.tenants,d=Digit.ComponentRegistryService.getComponent(c+"Module");return n.createElement(o.Route,{key:i,path:l+"/"+c.toLowerCase()},d?n.createElement(d,{stateCode:t,moduleCode:c,userType:r,tenants:je(s,a)}):n.createElement(o.Redirect,{to:{pathname:"/digit-ui/employee/user/error?type=notfound",state:{from:u.pathname+u.search}}}))});return n.createElement("div",{className:"ground-container"},n.createElement(o.Switch,null,s,n.createElement(o.Route,{path:l+"/login"},n.createElement(o.Redirect,{to:{pathname:"/digit-ui/employee/user/login",state:{from:u.pathname+u.search}}})),n.createElement(o.Route,{path:l+"/forgot-password"},n.createElement(Ue,null)),n.createElement(o.Route,{path:l+"/change-password"},n.createElement(Me,null)),n.createElement(o.Route,null,n.createElement(y,{userType:r,modules:i}))))},ze={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:"CORE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},Ve=function(e){var t=Digit.Hooks.useQueryParams().type,r=ze[void 0===t?"error":t],i=a.useTranslation().t;return n.createElement("div",{className:"error-boundary"},n.createElement("div",{className:"error-container"},n.createElement("img",{src:r.imgUrl,alt:"error"}),n.createElement("h1",null,i(r.infoMessage)),n.createElement("button",{onClick:function(){e.goToHome()}},i(r.buttonInfo))))},We=function(){var e="employee"===Digit.UserService.getType()?"/digit-ui/employee/user/error":"/digit-ui/citizen/error";return window.location.href.includes("employee/user/error")||window.location.href.includes("citizen/error")||"development"===process.env.NODE_ENV||(window.location.href=e),n.createElement("span",null)},He=function(e){var t,r;function i(t){var n;return(n=e.call(this,t)||this).state={error:null,errorStack:null,hasError:!1},n}r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,f(t,r),i.getDerivedStateFromError=function(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack}};var o=i.prototype;return o.componentDidCatch=function(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})},o.render=function(){return this.state.hasError?n.createElement("div",{className:"error-boundary"},n.createElement(We,null),n.createElement(Ve,{initData:this.props.initData})):this.props.children},i}(n.Component),Ge=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(r=e)&&void 0!==r&&r.includes(t);){var r,i;e=null===(i=e)||void 0===i?void 0:i.replace(t,n)}return e},qe=function(e){var r,i=t.useState(null),a=i[0],u=i[1],c=t.useState([]),s=c[0],d=c[1],f=(t.useState([]),o.useHistory());return t.useEffect(function(){var t,n,r=Digit.SessionStorage.get("citizen.userRequestObject"),i=[],o=[];null==r||null===(t=r.info)||void 0===t||null===(n=t.roles)||void 0===n||n.forEach(function(e){return i.push(e.tenantId)});var a=i.filter(function(e,t,n){return n.indexOf(e)===t});null==a||a.forEach(function(t){var n;o.push({label:null==e?void 0:e.t("TENANT_TENANTS_"+(null===(n=Ge(t,".","_"))||void 0===n?void 0:n.toUpperCase())),value:t})}),null==o||o.filter(function(e){return e.value==Digit.SessionStorage.get("Employee.tenantId")}),d(o)},[a]),n.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},n.createElement(l.Dropdown,{option:s,selected:s.find(function(e){return e.value===(null==a?void 0:a.value)}),optionKey:"label",select:function(e){var t,n,r,i=Digit.SessionStorage.get("citizen.userRequestObject"),o=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.filter(function(t){return t.tenantId===e.value});if((null==o?void 0:o.length)>0&&(i.info.roles=o,i.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(i),u(e),window.location.href.includes("/digit-ui/employee/")){var a,l=(null===(a=location.state)||void 0===a?void 0:a.from)||"/digit-ui/employee";f.replace(l)}window.location.reload()},freeze:!0,customSelector:n.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(r=Ge(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===r?void 0:r.toUpperCase())))}))},Xe=function(e){var r=e.dropdown||!1,i=Digit.Hooks.useStore.getInitData(),o=i.isLoading,a=i.data||{},u=a.languages,c=a.stateInfo,s=Digit.StoreData.getCurrentLanguage(),d=t.useState(s),f=d[0],v=d[1],m=function(e){v(e.value),Digit.LocalizationService.changeLanguage(e.value,c.code)};return o?null:r?n.createElement("div",null,n.createElement(l.Dropdown,{option:u,selected:u.find(function(e){return e.value===s}),optionKey:"label",select:m,freeze:!0,customSelector:n.createElement("label",{className:"cp"},u.find(function(e){return e.value===f}).label)})):n.createElement(n.Fragment,null,n.createElement("div",{style:{marginBottom:"5px"}},"Language"),n.createElement("div",{className:"language-selector"},u.map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(l.CustomButton,{selected:e.value===f,text:e.label,onClick:function(){return m(e)}}))})))},Ze=function(e){var t,r;return n.createElement("span",{className:"user-img-txt",onClick:e.toggleMenu,title:e.name},null==e||null===(t=e.name)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.toUpperCase())},Ye=function(e){var t,r,i,a,u,c,s,d=e.t,f=e.stateInfo,v=e.toggleSidebar,m=e.handleLogout,p=e.userDetails,g=e.CITIZEN,h=e.cityDetails,E=e.mobileView,y=e.userOptions,_=e.handleUserDropdownSelection,b=e.logoUrl,C=e.showLanguageChange,S=void 0===C||C,O=e.setSideBarScrollTop,w=n.useState(null),N=w[0],I=w[1];n.useEffect(function(){try{var e,t=Digit.ULBService.getCurrentTenantId(),n=null==p||null===(e=p.info)||void 0===e?void 0:e.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");I(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==N,null==p||null===(t=p.info)||void 0===t?void 0:t.uuid]);var T,D,A,L,R,x,M=Digit.ULBService.getCitizenCurrentTenant(!0),P=o.useHistory(),k=o.useLocation().pathname,U=Digit.Hooks.useNotificationCount({tenantId:M,config:{enabled:"EMPLOYEE"!==(null===(T=Digit.UserService)||void 0===T||null===(D=T.getUser())||void 0===D||null===(A=D.info)||void 0===A?void 0:A.type)&&"CITIZEN"===(null===(L=Digit.UserService)||void 0===L||null===(R=L.getUser())||void 0===R||null===(x=R.info)||void 0===x?void 0:x.type)&&!!M}}),B=U.data,j=(void 0===B?{}:B).unreadCount;if(g)return n.createElement("div",null,n.createElement(l.TopBar,{img:null==f?void 0:f.logoUrlWhite,isMobile:!0,toggleSidebar:function(){Digit.clikOusideFired?Digit.clikOusideFired=!1:(v(!0),O(!0))},logoUrl:null==f?void 0:f.logoUrlWhite,onLogout:m,userDetails:p,notificationCount:j<99?j:99,notificationCountLoaded:U.isSuccess,cityOfCitizenShownBesideLogo:d(M),onNotificationIconClick:function(){P.push("/digit-ui/citizen/engagement/notifications")},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:function(e){var t,n;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&["/digit-ui/citizen/select-language","/digit-ui/citizen/select-location"].includes(e)}(k),changeLanguage:E?null:n.createElement(Xe,{dropdown:!0})}));var F=!(null==p||!p.access_token);return n.createElement("div",{className:"topbar"},E?n.createElement(l.Hamburger,{handleClick:v,color:"#9E9E9E"}):null,n.createElement("img",{className:"city",src:F?null==h?void 0:h.logoId:null==f?void 0:f.statelogo}),n.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},F&&(null!=h&&null!==(r=h.city)&&void 0!==r&&r.ulbGrade?n.createElement("p",{className:"ulb",style:E?{fontSize:"14px",display:"inline-block"}:{}},d(null==h?void 0:h.i18nKey).toUpperCase()," ",d("ULBGRADE_"+(null==h||null===(i=h.city)||void 0===i?void 0:i.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):n.createElement("img",{className:"state",src:b})),!F&&n.createElement("p",{className:"ulb",style:E?{fontSize:"14px",display:"inline-block"}:{}},d("MYCITY_"+(null==f||null===(a=f.code)||void 0===a?void 0:a.toUpperCase())+"_LABEL")," ",d("MYCITY_STATECODE_LABEL")),!E&&n.createElement("div",{className:E?"right":"flex-right right w-80 column-gap-15",style:F?{}:{width:"80%"}},n.createElement("div",{className:"left"},!window.location.href.includes("employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&n.createElement(qe,{dropdown:!0,t:d})),n.createElement("div",{className:"left"},S&&n.createElement(Xe,{dropdown:!0})),(null==p?void 0:p.access_token)&&n.createElement("div",{className:"left"},n.createElement(l.Dropdown,{option:y,optionKey:"name",select:_,showArrow:!0,freeze:!0,style:E?{right:0}:{},optionCardStyles:{overflow:"revert"},customSelector:null==N?n.createElement(Ze,{name:(null==p||null===(u=p.info)||void 0===u?void 0:u.name)||(null==p||null===(c=p.info)||void 0===c||null===(s=c.userInfo)||void 0===s?void 0:s.name)||"Employee"}):n.createElement("img",{src:N,style:{height:"48px",width:"48px",borderRadius:"50%"}})})),n.createElement("img",{className:"state",src:b}))))},Ke=function(e,t,r,i,o,a){var l,u,c=(null==o||null===(l=o.tenants.filter(function(e){return e.code===a})[0])||void 0===l?void 0:l.contactNumber)||(null==o||null===(u=o.tenants[0])||void 0===u?void 0:u.contactNumber);return[{type:"link",element:"HOME",text:e("COMMON_BOTTOM_NAVIGATION_HOME"),link:i?"/digit-ui/employee":"/digit-ui/citizen",icon:"HomeIcon",populators:{onClick:t}},{type:"component",element:"LANGUAGE",action:n.createElement(Xe,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:"LoginIcon",populators:{onClick:r}},{id:"help-line",text:n.createElement(n.Fragment,null,e("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+c},c)))),element:"Helpline",icon:"Phone"}]},$e=function(e){return n.createElement("h1",{className:"heading-m"},e.label)},Je=function(){return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))},Qe=function(e){return n.createElement("div",{onClick:null==e?void 0:e.onClick,style:null!=e&&e.isMobileView?{padding:5}:null},null!=e&&e.isMobileView?n.createElement(l.CloseSvg,null):n.createElement("div",{className:"icon-bg-secondary",style:{backgroundColor:"#505A5F"}}," ",n.createElement(Je,null)," "))},et=function(e){var t=e.onSelect,r=e.onCancel,i=e.onDismiss,o=a.useTranslation().t,u=n.useState(window.innerWidth<=780),c=u[0],s=u[1],d=function(){window.innerWidth<=780?c||s(!0):c&&s(!1)};return n.useEffect(function(){return window.addEventListener("resize",function(){d()}),function(){window.addEventListener("resize",function(){d()})}}),c?n.createElement(l.Modal,{popupStyles:{height:"174px",maxHeight:"174px",width:"324px",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},popupModuleActionBarStyles:{display:"flex",flex:1,justifyContent:"flex-start",width:"100%",position:"absolute",left:0,bottom:0,padding:"18px"},style:{flex:1},popupModuleMianStyles:{padding:"18px"},headerBarMain:n.createElement($e,{label:o("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:n.createElement(Qe,{onClick:i,isMobileView:c}),actionCancelLabel:o("TL_COMMON_NO"),actionCancelOnSubmit:r,actionSaveLabel:o("TL_COMMON_YES"),actionSaveOnSubmit:t,formId:"modal-action"},n.createElement("div",null,n.createElement(l.CardText,{style:{margin:0}},o("CORE_LOGOUT_MOBILE_CONFIRMATION_MESSAGE")+" "))):n.createElement(l.Modal,{popupModuleMianStyles:{paddingTop:"30px"},headerBarMain:n.createElement($e,{label:o("CORE_LOGOUT_WEB_HEADER")}),headerBarEnd:n.createElement(Qe,{onClick:i,isMobileView:!1}),actionCancelLabel:o("CORE_LOGOUT_CANCEL"),actionCancelOnSubmit:r,actionSaveLabel:o("CORE_LOGOUT_WEB_YES"),actionSaveOnSubmit:t,formId:"modal-action"},n.createElement("div",null,n.createElement(l.CardText,{style:{marginBottom:"54px",marginLeft:"8px",marginRight:"8px"}},o("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",n.createElement("strong",null,o("CORE_LOGOUT_MESSAGE"),"?"))))},tt=function(e){var t=e.info,r=e.t;return n.createElement("div",{className:"profile-section"},n.createElement("div",{className:"imageloader imageloader-loaded"},n.createElement("img",{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC"})),n.createElement("div",{id:"profile-name",className:"label-container name-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),n.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&n.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",t.emailId," ")),n.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")&&n.createElement(qe,{t:r,mobileView:!0}))},nt={CommonPTIcon:n.createElement(l.PTIcon,{className:"icon"}),OBPSIcon:n.createElement(l.OBPSIcon,{className:"icon"}),propertyIcon:n.createElement(l.PropertyHouse,{className:"icon"}),TLIcon:n.createElement(l.CaseIcon,{className:"icon"}),PGRIcon:n.createElement(l.PGRIcon,{className:"icon"}),FSMIcon:n.createElement(l.FSMIcon,{className:"icon"}),WSIcon:n.createElement(l.WSICon,{className:"icon"}),MCollectIcon:n.createElement(l.MCollectIcon,{className:"icon"}),BillsIcon:n.createElement(l.CollectionIcon,{className:"icon"}),BirthIcon:n.createElement(l.BirthIcon,{className:"icon"}),DeathIcon:n.createElement(l.DeathIcon,{className:"icon"}),FirenocIcon:n.createElement(l.FirenocIcon,{className:"icon"}),HomeIcon:n.createElement(l.HomeIcon,{className:"icon"}),EditPencilIcon:n.createElement(l.EditPencilIcon,{className:"icon"}),LogoutIcon:n.createElement(l.LogoutIcon,{className:"icon"}),Phone:n.createElement(l.Phone,{className:"icon"}),LoginIcon:n.createElement(l.LoginIcon,{className:"icon"})},rt=function(e){var r,i,u,c,s,f=e.linkData,v=e.islinkDataLoading,m=a.useTranslation().t,p=o.useHistory(),g=o.useLocation().pathname,h=Digit.Hooks.useStore.getInitData(),E=h.data,y=h.isFetched,_=(E||{}).stateInfo,b=Digit.UserService.getUser(),C=window.Digit.Utils.browser.isMobile(),S=t.useState(!1)[0],O=t.useState(!1)[1],w=t.useState(!1),N=w[0],I=w[1],T=function(){I(!1)};if(v||!y)return n.createElement(l.Loader,null);var D=function(){p.push("/digit-ui/citizen/user/profile")},A=Digit.ULBService.getCitizenCurrentTenant(),L=(null==E||null===(r=E.tenants.filter(function(e){return e.code===A})[0])||void 0===r?void 0:r.contactNumber)||(null==E||null===(i=E.tenants[0])||void 0===i?void 0:i.contactNumber),R=[].concat(Ke(m,D,function(){p.push("/digit-ui/citizen/login")},S,E,A));R=R.filter(function(e){return"LANGUAGE"!==e.element});var x,M=function(e){var t,r,i,a=e.item,l=(null==a?void 0:a.icon)||(null===(t=a.icon)||void 0===t||null===(r=t.type)||void 0===r?void 0:r.name),u=l?nt[l]:nt.BillsIcon;i="component"===a.type?a.action:a.text;var c=function(){return n.createElement("span",d({className:"menu-item"},a.populators),u,n.createElement("div",{className:"menu-label"},i))};return"external-link"===a.type?n.createElement("a",{href:a.link},n.createElement(c,null)):"link"===a.type?n.createElement(o.Link,{to:null==a?void 0:a.link},n.createElement(c,null)):n.createElement(c,null)};return y&&b&&b.access_token&&(x=n.createElement(tt,{info:null==b?void 0:b.info,stateName:null==_?void 0:_.name,t:m}),R=R.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)&&"help-line"!==(null==e?void 0:e.id)}),R=[].concat(R,[{text:m("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:D}},{text:m("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:function(){O(!1),I(!0)}}},{text:n.createElement(n.Fragment,null,m("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+L},L)))),element:"Helpline",icon:"Phone"}])),null===(u=Object.keys(f))||void 0===u||null===(c=u.sort(function(e,t){return t.localeCompare(e)}))||void 0===c||c.map(function(e){var t,n,r,i,o;"digit-ui-links"===(null===(t=f[e][0])||void 0===t?void 0:t.sidebar)&&R.splice(1,0,{type:null!==(n=f[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes("digit-ui")?"link":"external-link",text:m("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:f[e],icon:null===(i=f[e][0])||void 0===i?void 0:i.leftIcon,link:null===(o=f[e][0])||void 0===o?void 0:o.sidebarURL})}),n.createElement(n.Fragment,null,n.createElement("div",null,n.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),n.createElement("div",{style:{display:"flex",flexDirection:"column",height:C?"calc(100vh - 56px)":"auto",zIndex:"99"}},x,n.createElement("div",{className:"drawer-desktop"},null===(s=R)||void 0===s?void 0:s.map(function(e,t){return n.createElement("div",{className:"sidebar-list "+(g===(null==e?void 0:e.link)||g===(null==e?void 0:e.sidebarURL)?"active":""),key:t},n.createElement(M,{item:e}))}))),n.createElement("div",null,N&&n.createElement(et,{onSelect:function(){Digit.UserService.logout(),I(!1)},onCancel:T,onDismiss:T}))))},it=function(e){var t=e.info,r=e.t,i=n.useState(null),o=i[0],a=i[1];return n.useEffect(function(){try{var e=Digit.ULBService.getCurrentTenantId(),n=null==t?void 0:t.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(e,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t,n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");a(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==o]),n.createElement("div",{className:"profile-section"},n.createElement("div",{className:"imageloader imageloader-loaded"},n.createElement("img",{className:"img-responsive img-circle img-Profile",src:o||"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",style:{objectFit:"cover",objectPosition:"center"}})),n.createElement("div",{id:"profile-name",className:"label-container name-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),n.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&n.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},n.createElement("div",{className:"label-text"}," ",t.emailId," ")),n.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")&&n.createElement(qe,{t:r,mobileView:!0}))},ot=function(){var e,t,r;return n.createElement("div",{className:"digit-footer",style:{marginBottom:0}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(r=t.getConfig)||void 0===r?void 0:r.call(t,"DIGIT_FOOTER"),style:{cursor:"pointer"},onClick:function(){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()}})," ")},at=function(e){var r,i,u=e.isOpen,c=e.isMobile,s=void 0!==c&&c,f=e.toggleSidebar,v=e.onLogout,m=e.isEmployee,p=void 0!==m&&m,g=e.linkData,h=e.islinkDataLoading,E=e.isSideBarScroll,y=Digit.Hooks.useStore.getInitData(),_=y.data,b=y.isFetched,C=(_||{}).stateInfo,S=Digit.UserService.getUser(),O=t.useState(""),w=O[0],N=O[1],I=a.useTranslation().t,T=o.useHistory(),D=function(){Digit.clikOusideFired=!0,f(!1)},A=Digit.Hooks.useAccessControl(),L=A.isLoading,R=A.data,x=Digit.ULBService.getCitizenCurrentTenant();if(h||L||!b)return n.createElement(l.Loader,null);var M,P=(null==_||null===(r=_.tenants.filter(function(e){return e.code===x})[0])||void 0===r?void 0:r.contactNumber)||(null==_||null===(i=_.tenants[0])||void 0===i?void 0:i.contactNumber),k=[].concat(Ke(I,D,function(){T.push("/digit-ui/citizen/login"),D()},p,_,x));b&&S&&S.access_token&&(M=n.createElement(it,{info:null==S?void 0:S.info,stateName:null==C?void 0:C.name,t:I}),k=k.filter(function(e){return"login-btn"!==(null==e?void 0:e.id)&&"help-line"!==(null==e?void 0:e.id)}),k=[].concat(k,[{text:I("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:function(){T.push(p?"/digit-ui/employee/user/profile":"/digit-ui/citizen/user/profile"),D()}}},{text:I("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:v}},{text:n.createElement(n.Fragment,null,I("CS_COMMON_HELPLINE"),n.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},n.createElement("div",{className:"link"},n.createElement("a",{href:"tel:"+P},P)))),element:"Helpline",icon:"Phone"}]));var U={};if(p){var B;null==R||R.actions.filter(function(e){return"url"===e.url&&"Home"!==e.displayName}).forEach(function(e){var t;if(""==w&&""!==e.path){var n=e.path.split(".")[0];"TradeLicense"===n&&(n="Trade License"),U[n]?U[n].push(e):U[n]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(w.toLowerCase())){var r=e.path.split(".")[0];"TradeLicense"===r&&(r="Trade License"),U[r]?U[r].push(e):U[r]=[e]}});for(var j=Object.keys(U),F=function(e){var t,n,r,i,o,a,l,u,c,s,f,v=null===(t=U[j[e]][0])||void 0===t||null===(n=t.displayName)||void 0===n||null===(r=n.toUpperCase())||void 0===r?void 0:r.replace(/[ -]/g,"_"),m=null===(i=j[e])||void 0===i||null===(o=i.toUpperCase())||void 0===o?void 0:o.replace(/[ -]/g,"_");-1===U[j[e]][0].path.indexOf(".")?k.splice(1,0,{type:"link",text:I("ACTION_TEST_"+v),link:null===(a=U[j[e]][0])||void 0===a?void 0:a.navigationURL,icon:null===(l=U[j[e]][0])||void 0===l||null===(u=l.leftIcon)||void 0===u||null===(c=u.split)||void 0===c?void 0:c.call(u,":")[1],populators:{onClick:function(){var t;T.push(null===(t=U[j[e]][0])||void 0===t?void 0:t.navigationURL),D()}}}):k.splice(1,0,{type:"dynamic",moduleName:I("ACTION_TEST_"+m),links:null===(s=U[j[e]])||void 0===s?void 0:s.map(function(e){var t,n;return d({},e,{displayName:I("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===(f=U[j[e]][1])||void 0===f?void 0:f.leftIcon})},z=0;z<j.length;z++)F(z);var V=k.findIndex(function(e){return"HOME"===e.element}),W=k.splice(V,1),H=k.findIndex(function(e){return"LANGUAGE"===e.element}),G=k.splice(H,(null===(B=k)||void 0===B?void 0:B.length)-H);k.sort(function(e,t){return("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==W?void 0:W[0])&&k.splice(0,0,W[0]),k=(null==G?void 0:G.length)>0?k.concat(G):k}else{var q,X;null===(q=Object.keys(g))||void 0===q||null===(X=q.sort(function(e,t){return t.localeCompare(e)}))||void 0===X||X.map(function(e){var t,n,r,i,o;"digit-ui-links"===(null===(t=g[e][0])||void 0===t?void 0:t.sidebar)&&k.splice(1,0,{type:null!==(n=g[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes("digit-ui")?"link":"external-link",text:I("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:g[e],icon:null===(i=g[e][0])||void 0===i?void 0:i.leftIcon,link:null===(o=g[e][0])||void 0===o?void 0:o.sidebarURL})})}return T.location.pathname.includes("/openlink")&&(M=n.createElement("span",null),k=k.filter(function(e){return"LANGUAGE"===e.element})),s?n.createElement(l.NavBar,{open:u,toggleSidebar:f,profileItem:M,onClose:D,isSideBarScroll:E,menuItems:k,Footer:n.createElement(ot,null),isEmployee:p,search:w,setSearch:N}):n.createElement(rt,{logout:v})},lt=function(e){var r,i,c,s,d,f,v,m=e.item,p=t.useState(!1),g=p[0],h=p[1],E=o.useLocation().pathname,y=a.useTranslation().t,_={home:n.createElement(l.HomeIcon,null),announcement:n.createElement(l.ComplaintIcon,null),business:n.createElement(l.BPAHomeIcon,null),store:n.createElement(l.PropertyHouse,null),assignment:n.createElement(l.CaseIcon,null),receipt:n.createElement(l.ReceiptIcon,null),"business-center":n.createElement(l.PersonIcon,null),description:n.createElement(l.DocumentIconSolid,null),"water-tap":n.createElement(l.DropIcon,null),"collections-bookmark":n.createElement(l.CollectionsBookmarIcons,null),"insert-chart":n.createElement(l.FinanceChartIcon,null),edcr:n.createElement(l.CollectionIcon,null),collections:n.createElement(l.CollectionIcon,null)},b=_[(null==m||null===(r=m.icon)||void 0===r||null===(i=r.leftIcon)||void 0===i||null===(c=i.split)||void 0===c||null===(s=c.call(i,":"))||void 0===s?void 0:s[1])||(null==m||null===(d=m.leftIcon)||void 0===d||null===(f=d.split)||void 0===f?void 0:f.call(d,":")[1])]||_.collections,C=null==m||null===(v=m.moduleName)||void 0===v?void 0:v.replace(/[ -]/g,"_"),S=y("ACTION_TEST_"+C),O=y((null==S?void 0:S.length)>20?S.substring(0,20)+"...":S);if("single"===m.type){var w,N=window.location.origin;return n.createElement("div",{className:"submenu-container"},n.createElement("div",{className:"sidebar-link "+(E===(null==m?void 0:m.navigationURL)?"active":"")},n.createElement("div",{className:"actions"},b,-1===(null===(w=m.navigationURL)||void 0===w?void 0:w.indexOf("/digit-ui"))?n.createElement("a",{"data-tip":"React-tooltip","data-for":"jk-side-"+C,className:"custom-link",href:N+"/employee/"+m.navigationURL},n.createElement("span",null," ",O," "),(null==O?void 0:O.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+C},y("ACTION_TEST_"+C))):n.createElement(o.Link,{className:"custom-link",to:m.navigationURL},n.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+C},n.createElement("span",null," ",O," "),(null==O?void 0:O.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+C},y("ACTION_TEST_"+C)))))))}return n.createElement(n.Fragment,null,n.createElement("div",{className:"submenu-container"},n.createElement("div",{onClick:m.links&&function(){return h(!g)},className:"sidebar-link"},n.createElement("div",{className:"actions"},b,n.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+C},n.createElement("span",null," ",O," "),(null==O?void 0:O.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+C},y("ACTION_TEST_"+C)))),n.createElement("div",null," ",m.links&&g?n.createElement(l.ArrowVectorDown,null):m.links?n.createElement(l.ArrowForward,null):null," "))),g&&m.links.sort(function(e,t){return e.orderNumber-t.orderNumber}).filter(function(e){return"url"===e.url||""!==e.url}).map(function(e,t){var r,i,a=null==e||null===(r=e.displayName)||void 0===r||null===(i=r.toUpperCase())||void 0===i?void 0:i.replace(/[ -]/g,"_"),l=y("ACTION_TEST_"+a),c=y((null==l?void 0:l.length)>20?l.substring(0,20)+"...":l);if(-1===e.navigationURL.indexOf("/digit-ui")){var s=window.location.origin;return n.createElement("a",{key:t,className:"dropdown-link "+(E===e.link?"active":""),href:s+"/employee/"+e.navigationURL},n.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},n.createElement("span",null," ",c," "),(null==c?void 0:c.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},y("ACTION_TEST_"+a))))}return n.createElement(o.Link,{to:(null==e?void 0:e.link)||e.navigationURL,key:t,className:"dropdown-link "+(E===(null==e?void 0:e.link)||E===(null==e?void 0:e.navigationURL)?"active":"")},n.createElement("div",{className:"actions","data-tip":"React-tooltip","data-for":"jk-side-"+t},n.createElement("span",null," ",c," "),(null==c?void 0:c.includes("..."))&&n.createElement(u,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+t},y("ACTION_TEST_"+a))))}))},ut=B(function(e,t){(function(){var n="Expected a function",r="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",l="[object Boolean]",u="[object Date]",c="[object Error]",s="[object Function]",d="[object GeneratorFunction]",f="[object Map]",v="[object Number]",m="[object Object]",p="[object RegExp]",g="[object Set]",h="[object String]",E="[object Symbol]",y="[object WeakMap]",_="[object ArrayBuffer]",b="[object DataView]",C="[object Float32Array]",S="[object Float64Array]",O="[object Int8Array]",w="[object Int16Array]",N="[object Int32Array]",I="[object Uint8Array]",T="[object Uint16Array]",D="[object Uint32Array]",A=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,P=RegExp(x.source),k=RegExp(M.source),B=/<%-([\s\S]+?)%>/g,j=/<%([\s\S]+?)%>/g,F=/<%=([\s\S]+?)%>/g,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/[\\^$.*+?()[\]{}|]/g,G=RegExp(H.source),q=/^\s+/,X=/\s/,Z=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y=/\{\n\/\* \[wrapped with (.+)\] \*/,K=/,? & /,$=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,re=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,ce=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fe="["+de+"]",ve="["+se+"]",me="\\d+",pe="[a-z\\xdf-\\xf6\\xf8-\\xff]",ge="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",he="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",ye="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ce="(?:"+pe+"|"+ge+")",Se="(?:"+be+"|"+ge+")",Oe="(?:"+ve+"|"+he+")?",we="[\\ufe0e\\ufe0f]?"+Oe+"(?:\\u200d(?:"+[Ee,ye,_e].join("|")+")[\\ufe0e\\ufe0f]?"+Oe+")*",Ne="(?:"+["[\\u2700-\\u27bf]",ye,_e].join("|")+")"+we,Ie="(?:"+[Ee+ve+"?",ve,ye,_e,"[\\ud800-\\udfff]"].join("|")+")",Te=RegExp("['’]","g"),De=RegExp(ve,"g"),Ae=RegExp(he+"(?="+he+")|"+Ie+we,"g"),Le=RegExp([be+"?"+pe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[fe,be,"$"].join("|")+")",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[fe,be+Ce,"$"].join("|")+")",be+"?"+Ce+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Ne].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Me=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Pe=-1,ke={};ke[C]=ke[S]=ke[O]=ke[w]=ke[N]=ke[I]=ke["[object Uint8ClampedArray]"]=ke[T]=ke[D]=!0,ke[o]=ke[a]=ke[_]=ke[l]=ke[b]=ke[u]=ke[c]=ke[s]=ke[f]=ke[v]=ke[m]=ke[p]=ke[g]=ke[h]=ke[y]=!1;var Ue={};Ue[o]=Ue[a]=Ue[_]=Ue[b]=Ue[l]=Ue[u]=Ue[C]=Ue[S]=Ue[O]=Ue[w]=Ue[N]=Ue[f]=Ue[v]=Ue[m]=Ue[p]=Ue[g]=Ue[h]=Ue[E]=Ue[I]=Ue["[object Uint8ClampedArray]"]=Ue[T]=Ue[D]=!0,Ue[c]=Ue[s]=Ue[y]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},je=parseFloat,Fe=parseInt,ze="object"==typeof U&&U&&U.Object===Object&&U,Ve="object"==typeof self&&self&&self.Object===Object&&self,We=ze||Ve||Function("return this")(),He=t&&!t.nodeType&&t,Ge=He&&e&&!e.nodeType&&e,qe=Ge&&Ge.exports===He,Xe=qe&&ze.process,Ze=function(){try{return Ge&&Ge.require&&Ge.require("util").types||Xe&&Xe.binding&&Xe.binding("util")}catch(e){}}(),Ye=Ze&&Ze.isArrayBuffer,Ke=Ze&&Ze.isDate,$e=Ze&&Ze.isMap,Je=Ze&&Ze.isRegExp,Qe=Ze&&Ze.isSet,et=Ze&&Ze.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function lt(e,t){return!(null==e||!e.length)&&ht(e,t,0)>-1}function ut(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function ct(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function st(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function dt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function ft(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function vt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var mt=bt("length");function pt(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function gt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function ht(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):gt(e,yt,n)}function Et(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function yt(e){return e!=e}function _t(e,t){var n=null==e?0:e.length;return n?Ot(e,t)/n:NaN}function bt(e){return function(t){return null==t?void 0:t[e]}}function Ct(e){return function(t){return null==e?void 0:e[t]}}function St(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function Ot(e,t){for(var n,r=-1,i=e.length;++r<i;){var o=t(e[r]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function wt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Nt(e){return e?e.slice(0,Ht(e)+1).replace(q,""):e}function It(e){return function(t){return e(t)}}function Tt(e,t){return ct(t,function(t){return e[t]})}function Dt(e,t){return e.has(t)}function At(e,t){for(var n=-1,r=e.length;++n<r&&ht(t,e[n],0)>-1;);return n}function Lt(e,t){for(var n=e.length;n--&&ht(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var xt=Ct({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Mt=Ct({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Pt(e){return"\\"+Be[e]}function kt(e){return Re.test(e)}function Ut(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Bt(e,t){return function(n){return e(t(n))}}function jt(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var l=e[n];l!==t&&l!==r||(e[n]=r,a[o++]=n)}return a}function Ft(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function zt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Vt(e){return kt(e)?function(e){for(var t=Ae.lastIndex=0;Ae.test(e);)++t;return t}(e):mt(e)}function Wt(e){return kt(e)?function(e){return e.match(Ae)||[]}(e):function(e){return e.split("")}(e)}function Ht(e){for(var t=e.length;t--&&X.test(e.charAt(t)););return t}var Gt=Ct({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),qt=function e(t){var U,X=(t=null==t?We:qt.defaults(We.Object(),t,qt.pick(We,Me))).Array,se=t.Date,de=t.Error,fe=t.Function,ve=t.Math,me=t.Object,pe=t.RegExp,ge=t.String,he=t.TypeError,Ee=X.prototype,ye=me.prototype,_e=t["__core-js_shared__"],be=fe.prototype.toString,Ce=ye.hasOwnProperty,Se=0,Oe=(U=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"",we=ye.toString,Ne=be.call(me),Ie=We._,Ae=pe("^"+be.call(Ce).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=qe?t.Buffer:void 0,Be=t.Symbol,ze=t.Uint8Array,Ve=Re?Re.allocUnsafe:void 0,He=Bt(me.getPrototypeOf,me),Ge=me.create,Xe=ye.propertyIsEnumerable,Ze=Ee.splice,mt=Be?Be.isConcatSpreadable:void 0,Ct=Be?Be.iterator:void 0,Xt=Be?Be.toStringTag:void 0,Zt=function(){try{var e=Ji(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Yt=t.clearTimeout!==We.clearTimeout&&t.clearTimeout,Kt=se&&se.now!==We.Date.now&&se.now,$t=t.setTimeout!==We.setTimeout&&t.setTimeout,Jt=ve.ceil,Qt=ve.floor,en=me.getOwnPropertySymbols,tn=Re?Re.isBuffer:void 0,nn=t.isFinite,rn=Ee.join,on=Bt(me.keys,me),an=ve.max,ln=ve.min,un=se.now,cn=t.parseInt,sn=ve.random,dn=Ee.reverse,fn=Ji(t,"DataView"),vn=Ji(t,"Map"),mn=Ji(t,"Promise"),pn=Ji(t,"Set"),gn=Ji(t,"WeakMap"),hn=Ji(me,"create"),En=gn&&new gn,yn={},_n=To(fn),bn=To(vn),Cn=To(mn),Sn=To(pn),On=To(gn),wn=Be?Be.prototype:void 0,Nn=wn?wn.valueOf:void 0,In=wn?wn.toString:void 0;function Tn(e){if(Ga(e)&&!Ma(e)&&!(e instanceof Rn)){if(e instanceof Ln)return e;if(Ce.call(e,"__wrapped__"))return Do(e)}return new Ln(e)}var Dn=function(){function e(){}return function(t){if(!Ha(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function An(){}function Ln(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Rn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Mn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pn;++t<n;)this.add(e[t])}function Un(e){var t=this.__data__=new Mn(e);this.size=t.size}function Bn(e,t){var n=Ma(e),r=!n&&xa(e),i=!n&&!r&&Ba(e),o=!n&&!r&&!i&&Qa(e),a=n||r||i||o,l=a?wt(e.length,ge):[],u=l.length;for(var c in e)!t&&!Ce.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||oo(c,u))||l.push(c);return l}function jn(e){var t=e.length;return t?e[Pr(0,t-1)]:void 0}function Fn(e,t){return So(gi(e),Yn(t,0,e.length))}function zn(e){return So(gi(e))}function Vn(e,t,n){(void 0!==n&&!Aa(e[t],n)||void 0===n&&!(t in e))&&Xn(e,t,n)}function Wn(e,t,n){var r=e[t];Ce.call(e,t)&&Aa(r,n)&&(void 0!==n||t in e)||Xn(e,t,n)}function Hn(e,t){for(var n=e.length;n--;)if(Aa(e[n][0],t))return n;return-1}function Gn(e,t,n,r){return er(e,function(e,i,o){t(r,e,n(e),o)}),r}function qn(e,t){return e&&hi(t,bl(t),e)}function Xn(e,t,n){"__proto__"==t&&Zt?Zt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Zn(e,t){for(var n=-1,r=t.length,i=X(r),o=null==e;++n<r;)i[n]=o?void 0:gl(e,t[n]);return i}function Yn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Kn(e,t,n,r,i,a){var c,y=1&t,A=2&t,L=4&t;if(n&&(c=i?n(e,r,i,a):n(e)),void 0!==c)return c;if(!Ha(e))return e;var R=Ma(e);if(R){if(c=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ce.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!y)return gi(e,c)}else{var x=to(e),M=x==s||x==d;if(Ba(e))return si(e,y);if(x==m||x==o||M&&!i){if(c=A||M?{}:ro(e),!y)return A?function(e,t){return hi(e,eo(e),t)}(e,function(e,t){return e&&hi(t,Cl(t),e)}(c,e)):function(e,t){return hi(e,Qi(e),t)}(e,qn(c,e))}else{if(!Ue[x])return i?e:{};c=function(e,t,n){var r=e.constructor;switch(t){case _:return di(e);case l:case u:return new r(+e);case b:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case C:case S:case O:case w:case N:case I:case"[object Uint8ClampedArray]":case T:case D:return fi(e,n);case f:return new r;case v:case h:return new r(e);case p:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return new r;case E:return Nn?me(Nn.call(e)):{}}}(e,x,y)}}a||(a=new Un);var P=a.get(e);if(P)return P;a.set(e,c),Ka(e)?e.forEach(function(r){c.add(Kn(r,t,n,r,e,a))}):qa(e)&&e.forEach(function(r,i){c.set(i,Kn(r,t,n,i,e,a))});var k=R?void 0:(L?A?Gi:Hi:A?Cl:bl)(e);return rt(k||e,function(r,i){k&&(r=e[i=r]),Wn(c,i,Kn(r,t,n,i,e,a))}),c}function $n(e,t,n){var r=n.length;if(null==e)return!r;for(e=me(e);r--;){var i=n[r],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Jn(e,t,r){if("function"!=typeof e)throw new he(n);return yo(function(){e.apply(void 0,r)},t)}function Qn(e,t,n,r){var i=-1,o=lt,a=!0,l=e.length,u=[],c=t.length;if(!l)return u;n&&(t=ct(t,It(n))),r?(o=ut,a=!1):t.length>=200&&(o=Dt,a=!1,t=new kn(t));e:for(;++i<l;){var s=e[i],d=null==n?s:n(s);if(s=r||0!==s?s:0,a&&d==d){for(var f=c;f--;)if(t[f]===d)continue e;u.push(s)}else o(t,d,r)||u.push(s)}return u}Tn.templateSettings={escape:B,evaluate:j,interpolate:F,variable:"",imports:{_:Tn}},(Tn.prototype=An.prototype).constructor=Tn,(Ln.prototype=Dn(An.prototype)).constructor=Ln,(Rn.prototype=Dn(An.prototype)).constructor=Rn,xn.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},xn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xn.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ce.call(t,e)?t[e]:void 0},xn.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:Ce.call(t,e)},xn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hn&&void 0===t?"__lodash_hash_undefined__":t,this},Mn.prototype.clear=function(){this.__data__=[],this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=Hn(t,e);return!(n<0||(n==t.length-1?t.pop():Ze.call(t,n,1),--this.size,0))},Mn.prototype.get=function(e){var t=this.__data__,n=Hn(t,e);return n<0?void 0:t[n][1]},Mn.prototype.has=function(e){return Hn(this.__data__,e)>-1},Mn.prototype.set=function(e,t){var n=this.__data__,r=Hn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new xn,map:new(vn||Mn),string:new xn}},Pn.prototype.delete=function(e){var t=Ki(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Ki(this,e).get(e)},Pn.prototype.has=function(e){return Ki(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Ki(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},kn.prototype.add=kn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},kn.prototype.has=function(e){return this.__data__.has(e)},Un.prototype.clear=function(){this.__data__=new Mn,this.size=0},Un.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Un.prototype.get=function(e){return this.__data__.get(e)},Un.prototype.has=function(e){return this.__data__.has(e)},Un.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Mn){var r=n.__data__;if(!vn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(r)}return n.set(e,t),this.size=n.size,this};var er=_i(ur),tr=_i(cr,!0);function nr(e,t){var n=!0;return er(e,function(e,r,i){return n=!!t(e,r,i)}),n}function rr(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],a=t(o);if(null!=a&&(void 0===l?a==a&&!Ja(a):n(a,l)))var l=a,u=o}return u}function ir(e,t){var n=[];return er(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function or(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=io),i||(i=[]);++o<a;){var l=e[o];t>0&&n(l)?t>1?or(l,t-1,n,r,i):st(i,l):r||(i[i.length]=l)}return i}var ar=bi(),lr=bi(!0);function ur(e,t){return e&&ar(e,t,bl)}function cr(e,t){return e&&lr(e,t,bl)}function sr(e,t){return at(t,function(t){return za(e[t])})}function dr(e,t){for(var n=0,r=(t=ai(t,e)).length;null!=e&&n<r;)e=e[Io(t[n++])];return n&&n==r?e:void 0}function fr(e,t,n){var r=t(e);return Ma(e)?r:st(r,n(e))}function vr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Xt&&Xt in me(e)?function(e){var t=Ce.call(e,Xt),n=e[Xt];try{e[Xt]=void 0;var r=!0}catch(e){}var i=we.call(e);return r&&(t?e[Xt]=n:delete e[Xt]),i}(e):function(e){return we.call(e)}(e)}function mr(e,t){return e>t}function pr(e,t){return null!=e&&Ce.call(e,t)}function gr(e,t){return null!=e&&t in me(e)}function hr(e,t,n){for(var r=n?ut:lt,i=e[0].length,o=e.length,a=o,l=X(o),u=Infinity,c=[];a--;){var s=e[a];a&&t&&(s=ct(s,It(t))),u=ln(s.length,u),l[a]=!n&&(t||i>=120&&s.length>=120)?new kn(a&&s):void 0}s=e[0];var d=-1,f=l[0];e:for(;++d<i&&c.length<u;){var v=s[d],m=t?t(v):v;if(v=n||0!==v?v:0,!(f?Dt(f,m):r(c,m,n))){for(a=o;--a;){var p=l[a];if(!(p?Dt(p,m):r(e[a],m,n)))continue e}f&&f.push(m),c.push(v)}}return c}function Er(e,t,n){var r=null==(e=po(e,t=ai(t,e)))?e:e[Io(Fo(t))];return null==r?void 0:tt(r,e,n)}function yr(e){return Ga(e)&&vr(e)==o}function _r(e,t,n,r,i){return e===t||(null==e||null==t||!Ga(e)&&!Ga(t)?e!=e&&t!=t:function(e,t,n,r,i,s){var d=Ma(e),y=Ma(t),C=d?a:to(e),S=y?a:to(t),O=(C=C==o?m:C)==m,w=(S=S==o?m:S)==m,N=C==S;if(N&&Ba(e)){if(!Ba(t))return!1;d=!0,O=!1}if(N&&!O)return s||(s=new Un),d||Qa(e)?Vi(e,t,n,r,i,s):function(e,t,n,r,i,o,a){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!o(new ze(e),new ze(t)));case l:case u:case v:return Aa(+e,+t);case c:return e.name==t.name&&e.message==t.message;case p:case h:return e==t+"";case f:var s=Ut;case g:if(s||(s=Ft),e.size!=t.size&&!(1&r))return!1;var d=a.get(e);if(d)return d==t;r|=2,a.set(e,t);var m=Vi(s(e),s(t),r,i,o,a);return a.delete(e),m;case E:if(Nn)return Nn.call(e)==Nn.call(t)}return!1}(e,t,C,n,r,i,s);if(!(1&n)){var I=O&&Ce.call(e,"__wrapped__"),T=w&&Ce.call(t,"__wrapped__");if(I||T){var D=I?e.value():e,A=T?t.value():t;return s||(s=new Un),i(D,A,n,r,s)}}return!!N&&(s||(s=new Un),function(e,t,n,r,i,o){var a=1&n,l=Hi(e),u=l.length;if(u!=Hi(t).length&&!a)return!1;for(var c=u;c--;){var s=l[c];if(!(a?s in t:Ce.call(t,s)))return!1}var d=o.get(e),f=o.get(t);if(d&&f)return d==t&&f==e;var v=!0;o.set(e,t),o.set(t,e);for(var m=a;++c<u;){var p=e[s=l[c]],g=t[s];if(r)var h=a?r(g,p,s,t,e,o):r(p,g,s,e,t,o);if(!(void 0===h?p===g||i(p,g,n,r,o):h)){v=!1;break}m||(m="constructor"==s)}if(v&&!m){var E=e.constructor,y=t.constructor;E==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof y&&y instanceof y||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,n,r,i,s))}(e,t,n,r,_r,i))}function br(e,t,n,r){var i=n.length,o=i,a=!r;if(null==e)return!o;for(e=me(e);i--;){var l=n[i];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<o;){var u=(l=n[i])[0],c=e[u],s=l[1];if(a&&l[2]){if(void 0===c&&!(u in e))return!1}else{var d=new Un;if(r)var f=r(c,s,u,e,t,d);if(!(void 0===f?_r(s,c,3,r,d):f))return!1}}return!0}function Cr(e){return!(!Ha(e)||(t=e,Oe&&Oe in t))&&(za(e)?Ae:ie).test(To(e));var t}function Sr(e){return"function"==typeof e?e:null==e?Xl:"object"==typeof e?Ma(e)?Tr(e[0],e[1]):Ir(e):nu(e)}function Or(e){if(!so(e))return on(e);var t=[];for(var n in me(e))Ce.call(e,n)&&"constructor"!=n&&t.push(n);return t}function wr(e,t){return e<t}function Nr(e,t){var n=-1,r=ka(e)?X(e.length):[];return er(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function Ir(e){var t=$i(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||br(n,e,t)}}function Tr(e,t){return lo(e)&&fo(t)?vo(Io(e),t):function(n){var r=gl(n,e);return void 0===r&&r===t?hl(n,e):_r(t,r,3)}}function Dr(e,t,n,r,i){e!==t&&ar(t,function(o,a){if(i||(i=new Un),Ha(o))!function(e,t,n,r,i,o,a){var l=ho(e,n),u=ho(t,n),c=a.get(u);if(c)Vn(e,n,c);else{var s=o?o(l,u,n+"",e,t,a):void 0,d=void 0===s;if(d){var f=Ma(u),v=!f&&Ba(u),m=!f&&!v&&Qa(u);s=u,f||v||m?Ma(l)?s=l:Ua(l)?s=gi(l):v?(d=!1,s=si(u,!0)):m?(d=!1,s=fi(u,!0)):s=[]:Za(u)||xa(u)?(s=l,xa(l)?s=ll(l):Ha(l)&&!za(l)||(s=ro(u))):d=!1}d&&(a.set(u,s),i(s,u,r,o,a),a.delete(u)),Vn(e,n,s)}}(e,t,a,n,Dr,r,i);else{var l=r?r(ho(e,a),o,a+"",e,t,i):void 0;void 0===l&&(l=o),Vn(e,a,l)}},Cl)}function Ar(e,t){var n=e.length;if(n)return oo(t+=t<0?n:0,n)?e[t]:void 0}function Lr(e,t,n){t=t.length?ct(t,function(e){return Ma(e)?function(t){return dr(t,1===e.length?e[0]:e)}:e}):[Xl];var r=-1;return t=ct(t,It(Yi())),function(e,t){var r=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,l=n.length;++r<a;){var u=vi(i[r],o[r]);if(u)return r>=l?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(Nr(e,function(e,n,i){return{criteria:ct(t,function(t){return t(e)}),index:++r,value:e}}))}function Rr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],l=dr(e,a);n(l,a)&&Fr(o,ai(a,e),l)}return o}function xr(e,t,n,r){var i=r?Et:ht,o=-1,a=t.length,l=e;for(e===t&&(t=gi(t)),n&&(l=ct(e,It(n)));++o<a;)for(var u=0,c=t[o],s=n?n(c):c;(u=i(l,s,u,r))>-1;)l!==e&&Ze.call(l,u,1),Ze.call(e,u,1);return e}function Mr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;oo(i)?Ze.call(e,i,1):Jr(e,i)}}return e}function Pr(e,t){return e+Qt(sn()*(t-e+1))}function kr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Qt(t/2))&&(e+=e)}while(t);return n}function Ur(e,t){return _o(mo(e,t,Xl),e+"")}function Br(e){return jn(Al(e))}function jr(e,t){var n=Al(e);return So(n,Yn(t,0,n.length))}function Fr(e,t,n,r){if(!Ha(e))return e;for(var i=-1,o=(t=ai(t,e)).length,a=o-1,l=e;null!=l&&++i<o;){var u=Io(t[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=l[u];void 0===(c=r?r(s,u,l):void 0)&&(c=Ha(s)?s:oo(t[i+1])?[]:{})}Wn(l,u,c),l=l[u]}return e}var zr=En?function(e,t){return En.set(e,t),e}:Xl,Vr=Zt?function(e,t){return Zt(e,"toString",{configurable:!0,enumerable:!1,value:Hl(t),writable:!0})}:Xl;function Wr(e){return So(Al(e))}function Hr(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=X(i);++r<i;)o[r]=e[r+t];return o}function Gr(e,t){var n;return er(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function qr(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!Ja(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return Xr(e,t,Xl,n)}function Xr(e,t,n,r){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,l=null===t,u=Ja(t),c=void 0===t;i<o;){var s=Qt((i+o)/2),d=n(e[s]),f=void 0!==d,v=null===d,m=d==d,p=Ja(d);if(a)var g=r||m;else g=c?m&&(r||f):l?m&&f&&(r||!v):u?m&&f&&!v&&(r||!p):!v&&!p&&(r?d<=t:d<t);g?i=s+1:o=s}return ln(o,4294967294)}function Zr(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],l=t?t(a):a;if(!n||!Aa(l,u)){var u=l;o[i++]=0===a?0:a}}return o}function Yr(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function Kr(e){if("string"==typeof e)return e;if(Ma(e))return ct(e,Kr)+"";if(Ja(e))return In?In.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function $r(e,t,n){var r=-1,i=lt,o=e.length,a=!0,l=[],u=l;if(n)a=!1,i=ut;else if(o>=200){var c=t?null:ki(e);if(c)return Ft(c);a=!1,i=Dt,u=new kn}else u=t?[]:l;e:for(;++r<o;){var s=e[r],d=t?t(s):s;if(s=n||0!==s?s:0,a&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;t&&u.push(d),l.push(s)}else i(u,d,n)||(u!==l&&u.push(d),l.push(s))}return l}function Jr(e,t){return null==(e=po(e,t=ai(t,e)))||delete e[Io(Fo(t))]}function Qr(e,t,n,r){return Fr(e,t,n(dr(e,t)),r)}function ei(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Hr(e,r?0:o,r?o+1:i):Hr(e,r?o+1:0,r?i:o)}function ti(e,t){var n=e;return n instanceof Rn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function ni(e,t,n){var r=e.length;if(r<2)return r?$r(e[0]):[];for(var i=-1,o=X(r);++i<r;)for(var a=e[i],l=-1;++l<r;)l!=i&&(o[i]=Qn(o[i]||a,e[l],t,n));return $r(or(o,1),t,n)}function ri(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r<i;)n(a,e[r],r<o?t[r]:void 0);return a}function ii(e){return Ua(e)?e:[]}function oi(e){return"function"==typeof e?e:Xl}function ai(e,t){return Ma(e)?e:lo(e,t)?[e]:No(ul(e))}var li=Ur;function ui(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:Hr(e,t,n)}var ci=Yt||function(e){return We.clearTimeout(e)};function si(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function di(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function fi(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=Ja(e),a=void 0!==t,l=null===t,u=t==t,c=Ja(t);if(!l&&!c&&!o&&e>t||o&&a&&u&&!l&&!c||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!c&&e<t||c&&n&&i&&!r&&!o||l&&n&&i||!a&&i||!u)return-1}return 0}function mi(e,t,n,r){for(var i=-1,o=e.length,a=n.length,l=-1,u=t.length,c=an(o-a,0),s=X(u+c),d=!r;++l<u;)s[l]=t[l];for(;++i<a;)(d||i<o)&&(s[n[i]]=e[i]);for(;c--;)s[l++]=e[i++];return s}function pi(e,t,n,r){for(var i=-1,o=e.length,a=-1,l=n.length,u=-1,c=t.length,s=an(o-l,0),d=X(s+c),f=!r;++i<s;)d[i]=e[i];for(var v=i;++u<c;)d[v+u]=t[u];for(;++a<l;)(f||i<o)&&(d[v+n[a]]=e[i++]);return d}function gi(e,t){var n=-1,r=e.length;for(t||(t=X(r));++n<r;)t[n]=e[n];return t}function hi(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var l=t[o],u=r?r(n[l],e[l],l,n,e):void 0;void 0===u&&(u=e[l]),i?Xn(n,l,u):Wn(n,l,u)}return n}function Ei(e,t){return function(n,r){var i=Ma(n)?nt:Gn,o=t?t():{};return i(n,e,Yi(r,2),o)}}function yi(e){return Ur(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&ao(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++r<i;){var l=n[r];l&&e(t,l,r,o)}return t})}function _i(e,t){return function(n,r){if(null==n)return n;if(!ka(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=me(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function bi(e){return function(t,n,r){for(var i=-1,o=me(t),a=r(t),l=a.length;l--;){var u=a[e?l:++i];if(!1===n(o[u],u,o))break}return t}}function Ci(e){return function(t){var n=kt(t=ul(t))?Wt(t):void 0,r=n?n[0]:t.charAt(0),i=n?ui(n,1).join(""):t.slice(1);return r[e]()+i}}function Si(e){return function(t){return dt(zl(xl(t).replace(Te,"")),e,"")}}function Oi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Dn(e.prototype),r=e.apply(n,t);return Ha(r)?r:n}}function wi(e){return function(t,n,r){var i=me(t);if(!ka(t)){var o=Yi(n,3);t=bl(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,r);return a>-1?i[o?t[a]:a]:void 0}}function Ni(e){return Wi(function(t){var r=t.length,i=r,o=Ln.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new he(n);if(o&&!l&&"wrapper"==Xi(a))var l=new Ln([],!0)}for(i=l?i:r;++i<r;){var u=Xi(a=t[i]),c="wrapper"==u?qi(a):void 0;l=c&&uo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[Xi(c[0])].apply(l,c[3]):1==a.length&&uo(a)?l[u]():l.thru(a)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ma(n))return l.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}})}function Ii(e,t,n,r,i,o,a,l,u,c){var s=128&t,d=1&t,f=2&t,v=24&t,m=512&t,p=f?void 0:Oi(e);return function g(){for(var h=arguments.length,E=X(h),y=h;y--;)E[y]=arguments[y];if(v)var _=Zi(g),b=Rt(E,_);if(r&&(E=mi(E,r,i,v)),o&&(E=pi(E,o,a,v)),h-=b,v&&h<c){var C=jt(E,_);return Mi(e,t,Ii,g.placeholder,n,E,C,l,u,c-h)}var S=d?n:this,O=f?S[e]:e;return h=E.length,l?E=go(E,l):m&&h>1&&E.reverse(),s&&u<h&&(E.length=u),this&&this!==We&&this instanceof g&&(O=p||Oi(O)),O.apply(S,E)}}function Ti(e,t){return function(n,r){return function(e,t,n,r){return ur(e,function(e,i,o){t(r,n(e),i,o)}),r}(n,e,t(r),{})}}function Di(e,t){return function(n,r){var i;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=Kr(n),r=Kr(r)):(n=Yr(n),r=Yr(r)),i=e(n,r)}return i}}function Ai(e){return Wi(function(t){return t=ct(t,It(Yi())),Ur(function(n){var r=this;return e(t,function(e){return tt(e,r,n)})})})}function Li(e,t){var n=(t=void 0===t?" ":Kr(t)).length;if(n<2)return n?kr(t,e):t;var r=kr(t,Jt(e/Vt(t)));return kt(t)?ui(Wt(r),0,e).join(""):r.slice(0,e)}function Ri(e){return function(t,n,r){return r&&"number"!=typeof r&&ao(t,n,r)&&(n=r=void 0),t=rl(t),void 0===n?(n=t,t=0):n=rl(n),function(e,t,n,r){for(var i=-1,o=an(Jt((t-e)/(n||1)),0),a=X(o);o--;)a[r?o:++i]=e,e+=n;return a}(t,n,r=void 0===r?t<n?1:-1:rl(r),e)}}function xi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=al(t),n=al(n)),e(t,n)}}function Mi(e,t,n,r,i,o,a,l,u,c){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var d=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,l,u,c],f=n.apply(void 0,d);return uo(e)&&Eo(f,d),f.placeholder=r,bo(f,e,t)}function Pi(e){var t=ve[e];return function(e,n){if(e=al(e),(n=null==n?0:ln(il(n),292))&&nn(e)){var r=(ul(e)+"e").split("e");return+((r=(ul(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var ki=pn&&1/Ft(new pn([,-0]))[1]==1/0?function(e){return new pn(e)}:Jl;function Ui(e){return function(t){var n=to(t);return n==f?Ut(t):n==g?zt(t):function(e,t){return ct(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bi(e,t,i,o,a,l,u,c){var s=2&t;if(!s&&"function"!=typeof e)throw new he(n);var d=o?o.length:0;if(d||(t&=-97,o=a=void 0),u=void 0===u?u:an(il(u),0),c=void 0===c?c:il(c),d-=a?a.length:0,64&t){var f=o,v=a;o=a=void 0}var m=s?void 0:qi(e),p=[e,t,i,o,a,f,v,l,u,c];if(m&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var l=e[3];e[3]=l?mi(l,a,t[4]):a,e[4]=l?jt(e[3],r):t[4]}(a=t[5])&&(e[5]=(l=e[5])?pi(l,a,t[6]):a,e[6]=l?jt(e[5],r):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:ln(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(p,m),e=p[0],t=p[1],i=p[2],o=p[3],a=p[4],!(c=p[9]=void 0===p[9]?s?0:e.length:an(p[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var r=Oi(e);return function i(){for(var o=arguments.length,a=X(o),l=o,u=Zi(i);l--;)a[l]=arguments[l];var c=o<3&&a[0]!==u&&a[o-1]!==u?[]:jt(a,u);if((o-=c.length)<n)return Mi(e,t,Ii,i.placeholder,void 0,a,c,void 0,void 0,n-o);var s=this&&this!==We&&this instanceof i?r:e;return tt(s,this,a)}}(e,t,c):32!=t&&33!=t||a.length?Ii.apply(void 0,p):function(e,t,n,r){var i=1&t,o=Oi(e);return function t(){for(var a=-1,l=arguments.length,u=-1,c=r.length,s=X(c+l),d=this&&this!==We&&this instanceof t?o:e;++u<c;)s[u]=r[u];for(;l--;)s[u++]=arguments[++a];return tt(d,i?n:this,s)}}(e,t,i,o);else var g=function(e,t,n){var r=1&t,i=Oi(e);return function t(){var o=this&&this!==We&&this instanceof t?i:e;return o.apply(r?n:this,arguments)}}(e,t,i);return bo((m?zr:Eo)(g,p),e,t)}function ji(e,t,n,r){return void 0===e||Aa(e,ye[n])&&!Ce.call(r,n)?t:e}function Fi(e,t,n,r,i,o){return Ha(e)&&Ha(t)&&(o.set(t,e),Dr(e,t,void 0,Fi,o),o.delete(t)),e}function zi(e){return Za(e)?void 0:e}function Vi(e,t,n,r,i,o){var a=1&n,l=e.length,u=t.length;if(l!=u&&!(a&&u>l))return!1;var c=o.get(e),s=o.get(t);if(c&&s)return c==t&&s==e;var d=-1,f=!0,v=2&n?new kn:void 0;for(o.set(e,t),o.set(t,e);++d<l;){var m=e[d],p=t[d];if(r)var g=a?r(p,m,d,t,e,o):r(m,p,d,e,t,o);if(void 0!==g){if(g)continue;f=!1;break}if(v){if(!vt(t,function(e,t){if(!Dt(v,t)&&(m===e||i(m,e,n,r,o)))return v.push(t)})){f=!1;break}}else if(m!==p&&!i(m,p,n,r,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function Wi(e){return _o(mo(e,void 0,Po),e+"")}function Hi(e){return fr(e,bl,Qi)}function Gi(e){return fr(e,Cl,eo)}var qi=En?function(e){return En.get(e)}:Jl;function Xi(e){for(var t=e.name+"",n=yn[t],r=Ce.call(yn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function Zi(e){return(Ce.call(Tn,"placeholder")?Tn:e).placeholder}function Yi(){var e=Tn.iteratee||Zl;return e=e===Zl?Sr:e,arguments.length?e(arguments[0],arguments[1]):e}function Ki(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function $i(e){for(var t=bl(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,fo(i)]}return t}function Ji(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Cr(n)?n:void 0}var Qi=en?function(e){return null==e?[]:(e=me(e),at(en(e),function(t){return Xe.call(e,t)}))}:ou,eo=en?function(e){for(var t=[];e;)st(t,Qi(e)),e=He(e);return t}:ou,to=vr;function no(e,t,n){for(var r=-1,i=(t=ai(t,e)).length,o=!1;++r<i;){var a=Io(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Wa(i)&&oo(a,i)&&(Ma(e)||xa(e))}function ro(e){return"function"!=typeof e.constructor||so(e)?{}:Dn(He(e))}function io(e){return Ma(e)||xa(e)||!!(mt&&e&&e[mt])}function oo(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function ao(e,t,n){if(!Ha(n))return!1;var r=typeof t;return!!("number"==r?ka(n)&&oo(t,n.length):"string"==r&&t in n)&&Aa(n[t],e)}function lo(e,t){if(Ma(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ja(e))||V.test(e)||!z.test(e)||null!=t&&e in me(t)}function uo(e){var t=Xi(e),n=Tn[t];if("function"!=typeof n||!(t in Rn.prototype))return!1;if(e===n)return!0;var r=qi(n);return!!r&&e===r[0]}(fn&&to(new fn(new ArrayBuffer(1)))!=b||vn&&to(new vn)!=f||mn&&"[object Promise]"!=to(mn.resolve())||pn&&to(new pn)!=g||gn&&to(new gn)!=y)&&(to=function(e){var t=vr(e),n=t==m?e.constructor:void 0,r=n?To(n):"";if(r)switch(r){case _n:return b;case bn:return f;case Cn:return"[object Promise]";case Sn:return g;case On:return y}return t});var co=_e?za:au;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ye)}function fo(e){return e==e&&!Ha(e)}function vo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mo(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=an(r.length-t,0),a=X(o);++i<o;)a[i]=r[t+i];i=-1;for(var l=X(t+1);++i<t;)l[i]=r[i];return l[t]=n(a),tt(e,this,l)}}function po(e,t){return t.length<2?e:dr(e,Hr(t,0,-1))}function go(e,t){for(var n=e.length,r=ln(t.length,n),i=gi(e);r--;){var o=t[r];e[r]=oo(o,n)?i[o]:void 0}return e}function ho(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Eo=Co(zr),yo=$t||function(e,t){return We.setTimeout(e,t)},_o=Co(Vr);function bo(e,t,n){var r=t+"";return _o(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Z,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return rt(i,function(n){var r="_."+n[0];t&n[1]&&!lt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(Y);return t?t[1].split(K):[]}(r),n)))}function Co(e){var t=0,n=0;return function(){var r=un(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function So(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n<t;){var o=Pr(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var Oo,wo,No=(Oo=Oa(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(W,function(e,n,r,i){t.push(r?i.replace(Q,"$1"):n||e)}),t},function(e){return 500===wo.size&&wo.clear(),e}),wo=Oo.cache,Oo);function Io(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function To(e){if(null!=e){try{return be.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Do(e){if(e instanceof Rn)return e.clone();var t=new Ln(e.__wrapped__,e.__chain__);return t.__actions__=gi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ao=Ur(function(e,t){return Ua(e)?Qn(e,or(t,1,Ua,!0)):[]}),Lo=Ur(function(e,t){var n=Fo(t);return Ua(n)&&(n=void 0),Ua(e)?Qn(e,or(t,1,Ua,!0),Yi(n,2)):[]}),Ro=Ur(function(e,t){var n=Fo(t);return Ua(n)&&(n=void 0),Ua(e)?Qn(e,or(t,1,Ua,!0),void 0,n):[]});function xo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:il(n);return i<0&&(i=an(r+i,0)),gt(e,Yi(t,3),i)}function Mo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=il(n),i=n<0?an(r+i,0):ln(i,r-1)),gt(e,Yi(t,3),i,!0)}function Po(e){return null!=e&&e.length?or(e,1):[]}function ko(e){return e&&e.length?e[0]:void 0}var Uo=Ur(function(e){var t=ct(e,ii);return t.length&&t[0]===e[0]?hr(t):[]}),Bo=Ur(function(e){var t=Fo(e),n=ct(e,ii);return t===Fo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hr(n,Yi(t,2)):[]}),jo=Ur(function(e){var t=Fo(e),n=ct(e,ii);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?hr(n,void 0,t):[]});function Fo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var zo=Ur(Vo);function Vo(e,t){return e&&e.length&&t&&t.length?xr(e,t):e}var Wo=Wi(function(e,t){var n=null==e?0:e.length,r=Zn(e,t);return Mr(e,ct(t,function(e){return oo(e,n)?+e:e}).sort(vi)),r});function Ho(e){return null==e?e:dn.call(e)}var Go=Ur(function(e){return $r(or(e,1,Ua,!0))}),qo=Ur(function(e){var t=Fo(e);return Ua(t)&&(t=void 0),$r(or(e,1,Ua,!0),Yi(t,2))}),Xo=Ur(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,$r(or(e,1,Ua,!0),void 0,t)});function Zo(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ua(e))return t=an(e.length,t),!0}),wt(t,function(t){return ct(e,bt(t))})}function Yo(e,t){if(!e||!e.length)return[];var n=Zo(e);return null==t?n:ct(n,function(e){return tt(t,void 0,e)})}var Ko=Ur(function(e,t){return Ua(e)?Qn(e,t):[]}),$o=Ur(function(e){return ni(at(e,Ua))}),Jo=Ur(function(e){var t=Fo(e);return Ua(t)&&(t=void 0),ni(at(e,Ua),Yi(t,2))}),Qo=Ur(function(e){var t=Fo(e);return t="function"==typeof t?t:void 0,ni(at(e,Ua),void 0,t)}),ea=Ur(Zo),ta=Ur(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Yo(e,n)});function na(e){var t=Tn(e);return t.__chain__=!0,t}function ra(e,t){return t(e)}var ia=Wi(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Zn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Rn&&oo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ra,args:[i],thisArg:void 0}),new Ln(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),oa=Ei(function(e,t,n){Ce.call(e,n)?++e[n]:Xn(e,n,1)}),aa=wi(xo),la=wi(Mo);function ua(e,t){return(Ma(e)?rt:er)(e,Yi(t,3))}function ca(e,t){return(Ma(e)?it:tr)(e,Yi(t,3))}var sa=Ei(function(e,t,n){Ce.call(e,n)?e[n].push(t):Xn(e,n,[t])}),da=Ur(function(e,t,n){var r=-1,i="function"==typeof t,o=ka(e)?X(e.length):[];return er(e,function(e){o[++r]=i?tt(t,e,n):Er(e,t,n)}),o}),fa=Ei(function(e,t,n){Xn(e,n,t)});function va(e,t){return(Ma(e)?ct:Nr)(e,Yi(t,3))}var ma=Ei(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Ur(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ao(e,t[0],t[1])?t=[]:n>2&&ao(t[0],t[1],t[2])&&(t=[t[0]]),Lr(e,or(t,1),[])}),ga=Kt||function(){return We.Date.now()};function ha(e,t,n){return t=n?void 0:t,Bi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function Ea(e,t){var r;if("function"!=typeof t)throw new he(n);return e=il(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var ya=Ur(function(e,t,n){var r=1;if(n.length){var i=jt(n,Zi(ya));r|=32}return Bi(e,r,t,n,i)}),_a=Ur(function(e,t,n){var r=3;if(n.length){var i=jt(n,Zi(_a));r|=32}return Bi(t,r,e,n,i)});function ba(e,t,r){var i,o,a,l,u,c,s=0,d=!1,f=!1,v=!0;if("function"!=typeof e)throw new he(n);function m(t){var n=i,r=o;return i=o=void 0,s=t,l=e.apply(r,n)}function p(e){return s=e,u=yo(h,t),d?m(e):l}function g(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-s>=a}function h(){var e=ga();if(g(e))return E(e);u=yo(h,function(e){var n=t-(e-c);return f?ln(n,a-(e-s)):n}(e))}function E(e){return u=void 0,v&&i?m(e):(i=o=void 0,l)}function y(){var e=ga(),n=g(e);if(i=arguments,o=this,c=e,n){if(void 0===u)return p(c);if(f)return ci(u),u=yo(h,t),m(c)}return void 0===u&&(u=yo(h,t)),l}return t=al(t)||0,Ha(r)&&(d=!!r.leading,a=(f="maxWait"in r)?an(al(r.maxWait)||0,t):a,v="trailing"in r?!!r.trailing:v),y.cancel=function(){void 0!==u&&ci(u),s=0,i=c=o=u=void 0},y.flush=function(){return void 0===u?l:E(ga())},y}var Ca=Ur(function(e,t){return Jn(e,1,t)}),Sa=Ur(function(e,t,n){return Jn(e,al(t)||0,n)});function Oa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new he(n);var r=function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return r.cache=new(Oa.Cache||Pn),r}function wa(e){if("function"!=typeof e)throw new he(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Oa.Cache=Pn;var Na=li(function(e,t){var n=(t=1==t.length&&Ma(t[0])?ct(t[0],It(Yi())):ct(or(t,1),It(Yi()))).length;return Ur(function(r){for(var i=-1,o=ln(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return tt(e,this,r)})}),Ia=Ur(function(e,t){return Bi(e,32,void 0,t,jt(t,Zi(Ia)))}),Ta=Ur(function(e,t){return Bi(e,64,void 0,t,jt(t,Zi(Ta)))}),Da=Wi(function(e,t){return Bi(e,256,void 0,void 0,void 0,t)});function Aa(e,t){return e===t||e!=e&&t!=t}var La=xi(mr),Ra=xi(function(e,t){return e>=t}),xa=yr(function(){return arguments}())?yr:function(e){return Ga(e)&&Ce.call(e,"callee")&&!Xe.call(e,"callee")},Ma=X.isArray,Pa=Ye?It(Ye):function(e){return Ga(e)&&vr(e)==_};function ka(e){return null!=e&&Wa(e.length)&&!za(e)}function Ua(e){return Ga(e)&&ka(e)}var Ba=tn||au,ja=Ke?It(Ke):function(e){return Ga(e)&&vr(e)==u};function Fa(e){if(!Ga(e))return!1;var t=vr(e);return t==c||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Za(e)}function za(e){if(!Ha(e))return!1;var t=vr(e);return t==s||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Va(e){return"number"==typeof e&&e==il(e)}function Wa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ha(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ga(e){return null!=e&&"object"==typeof e}var qa=$e?It($e):function(e){return Ga(e)&&to(e)==f};function Xa(e){return"number"==typeof e||Ga(e)&&vr(e)==v}function Za(e){if(!Ga(e)||vr(e)!=m)return!1;var t=He(e);if(null===t)return!0;var n=Ce.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&be.call(n)==Ne}var Ya=Je?It(Je):function(e){return Ga(e)&&vr(e)==p},Ka=Qe?It(Qe):function(e){return Ga(e)&&to(e)==g};function $a(e){return"string"==typeof e||!Ma(e)&&Ga(e)&&vr(e)==h}function Ja(e){return"symbol"==typeof e||Ga(e)&&vr(e)==E}var Qa=et?It(et):function(e){return Ga(e)&&Wa(e.length)&&!!ke[vr(e)]},el=xi(wr),tl=xi(function(e,t){return e<=t});function nl(e){if(!e)return[];if(ka(e))return $a(e)?Wt(e):gi(e);if(Ct&&e[Ct])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ct]());var t=to(e);return(t==f?Ut:t==g?Ft:Al)(e)}function rl(e){return e?(e=al(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function il(e){var t=rl(e),n=t%1;return t==t?n?t-n:t:0}function ol(e){return e?Yn(il(e),0,4294967295):0}function al(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(Ha(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ha(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Nt(e);var n=re.test(e);return n||oe.test(e)?Fe(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ll(e){return hi(e,Cl(e))}function ul(e){return null==e?"":Kr(e)}var cl=yi(function(e,t){if(so(t)||ka(t))hi(t,bl(t),e);else for(var n in t)Ce.call(t,n)&&Wn(e,n,t[n])}),sl=yi(function(e,t){hi(t,Cl(t),e)}),dl=yi(function(e,t,n,r){hi(t,Cl(t),e,r)}),fl=yi(function(e,t,n,r){hi(t,bl(t),e,r)}),vl=Wi(Zn),ml=Ur(function(e,t){e=me(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&ao(t[0],t[1],i)&&(r=1);++n<r;)for(var o=t[n],a=Cl(o),l=-1,u=a.length;++l<u;){var c=a[l],s=e[c];(void 0===s||Aa(s,ye[c])&&!Ce.call(e,c))&&(e[c]=o[c])}return e}),pl=Ur(function(e){return e.push(void 0,Fi),tt(Ol,void 0,e)});function gl(e,t,n){var r=null==e?void 0:dr(e,t);return void 0===r?n:r}function hl(e,t){return null!=e&&no(e,t,gr)}var El=Ti(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=we.call(t)),e[t]=n},Hl(Xl)),yl=Ti(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=we.call(t)),Ce.call(e,t)?e[t].push(n):e[t]=[n]},Yi),_l=Ur(Er);function bl(e){return ka(e)?Bn(e):Or(e)}function Cl(e){return ka(e)?Bn(e,!0):function(e){if(!Ha(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=so(e),n=[];for(var r in e)("constructor"!=r||!t&&Ce.call(e,r))&&n.push(r);return n}(e)}var Sl=yi(function(e,t,n){Dr(e,t,n)}),Ol=yi(function(e,t,n,r){Dr(e,t,n,r)}),wl=Wi(function(e,t){var n={};if(null==e)return n;var r=!1;t=ct(t,function(t){return t=ai(t,e),r||(r=t.length>1),t}),hi(e,Gi(e),n),r&&(n=Kn(n,7,zi));for(var i=t.length;i--;)Jr(n,t[i]);return n}),Nl=Wi(function(e,t){return null==e?{}:function(e,t){return Rr(e,t,function(t,n){return hl(e,n)})}(e,t)});function Il(e,t){if(null==e)return{};var n=ct(Gi(e),function(e){return[e]});return t=Yi(t),Rr(e,n,function(e,n){return t(e,n[0])})}var Tl=Ui(bl),Dl=Ui(Cl);function Al(e){return null==e?[]:Tt(e,bl(e))}var Ll=Si(function(e,t,n){return t=t.toLowerCase(),e+(n?Rl(t):t)});function Rl(e){return Fl(ul(e).toLowerCase())}function xl(e){return(e=ul(e))&&e.replace(le,xt).replace(De,"")}var Ml=Si(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Pl=Si(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),kl=Ci("toLowerCase"),Ul=Si(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Bl=Si(function(e,t,n){return e+(n?" ":"")+Fl(t)}),jl=Si(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Fl=Ci("toUpperCase");function zl(e,t,n){return e=ul(e),void 0===(t=n?void 0:t)?function(e){return xe.test(e)}(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.match($)||[]}(e):e.match(t)||[]}var Vl=Ur(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fa(e)?e:new de(e)}}),Wl=Wi(function(e,t){return rt(t,function(t){t=Io(t),Xn(e,t,ya(e[t],e))}),e});function Hl(e){return function(){return e}}var Gl=Ni(),ql=Ni(!0);function Xl(e){return e}function Zl(e){return Sr("function"==typeof e?e:Kn(e,1))}var Yl=Ur(function(e,t){return function(n){return Er(n,e,t)}}),Kl=Ur(function(e,t){return function(n){return Er(e,n,t)}});function $l(e,t,n){var r=bl(t),i=sr(t,r);null!=n||Ha(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=sr(t,bl(t)));var o=!(Ha(n)&&"chain"in n&&!n.chain),a=za(e);return rt(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=gi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,st([this.value()],arguments))})}),e}function Jl(){}var Ql=Ai(ct),eu=Ai(ot),tu=Ai(vt);function nu(e){return lo(e)?bt(Io(e)):function(e){return function(t){return dr(t,e)}}(e)}var ru=Ri(),iu=Ri(!0);function ou(){return[]}function au(){return!1}var lu,uu=Di(function(e,t){return e+t},0),cu=Pi("ceil"),su=Di(function(e,t){return e/t},1),du=Pi("floor"),fu=Di(function(e,t){return e*t},1),vu=Pi("round"),mu=Di(function(e,t){return e-t},0);return Tn.after=function(e,t){if("function"!=typeof t)throw new he(n);return e=il(e),function(){if(--e<1)return t.apply(this,arguments)}},Tn.ary=ha,Tn.assign=cl,Tn.assignIn=sl,Tn.assignInWith=dl,Tn.assignWith=fl,Tn.at=vl,Tn.before=Ea,Tn.bind=ya,Tn.bindAll=Wl,Tn.bindKey=_a,Tn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ma(e)?e:[e]},Tn.chain=na,Tn.chunk=function(e,t,n){t=(n?ao(e,t,n):void 0===t)?1:an(il(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var i=0,o=0,a=X(Jt(r/t));i<r;)a[o++]=Hr(e,i,i+=t);return a},Tn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Tn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=X(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return st(Ma(n)?gi(n):[n],or(t,1))},Tn.cond=function(e){var t=null==e?0:e.length,r=Yi();return e=t?ct(e,function(e){if("function"!=typeof e[1])throw new he(n);return[r(e[0]),e[1]]}):[],Ur(function(n){for(var r=-1;++r<t;){var i=e[r];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Tn.conforms=function(e){return function(e){var t=bl(e);return function(n){return $n(n,e,t)}}(Kn(e,1))},Tn.constant=Hl,Tn.countBy=oa,Tn.create=function(e,t){var n=Dn(e);return null==t?n:qn(n,t)},Tn.curry=function e(t,n,r){var i=Bi(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=e.placeholder,i},Tn.curryRight=function e(t,n,r){var i=Bi(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=e.placeholder,i},Tn.debounce=ba,Tn.defaults=ml,Tn.defaultsDeep=pl,Tn.defer=Ca,Tn.delay=Sa,Tn.difference=Ao,Tn.differenceBy=Lo,Tn.differenceWith=Ro,Tn.drop=function(e,t,n){var r=null==e?0:e.length;return r?Hr(e,(t=n||void 0===t?1:il(t))<0?0:t,r):[]},Tn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?Hr(e,0,(t=r-(t=n||void 0===t?1:il(t)))<0?0:t):[]},Tn.dropRightWhile=function(e,t){return e&&e.length?ei(e,Yi(t,3),!0,!0):[]},Tn.dropWhile=function(e,t){return e&&e.length?ei(e,Yi(t,3),!0):[]},Tn.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ao(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=il(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:il(r))<0&&(r+=i),r=n>r?0:ol(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Tn.filter=function(e,t){return(Ma(e)?at:ir)(e,Yi(t,3))},Tn.flatMap=function(e,t){return or(va(e,t),1)},Tn.flatMapDeep=function(e,t){return or(va(e,t),1/0)},Tn.flatMapDepth=function(e,t,n){return n=void 0===n?1:il(n),or(va(e,t),n)},Tn.flatten=Po,Tn.flattenDeep=function(e){return null!=e&&e.length?or(e,1/0):[]},Tn.flattenDepth=function(e,t){return null!=e&&e.length?or(e,t=void 0===t?1:il(t)):[]},Tn.flip=function(e){return Bi(e,512)},Tn.flow=Gl,Tn.flowRight=ql,Tn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Tn.functions=function(e){return null==e?[]:sr(e,bl(e))},Tn.functionsIn=function(e){return null==e?[]:sr(e,Cl(e))},Tn.groupBy=sa,Tn.initial=function(e){return null!=e&&e.length?Hr(e,0,-1):[]},Tn.intersection=Uo,Tn.intersectionBy=Bo,Tn.intersectionWith=jo,Tn.invert=El,Tn.invertBy=yl,Tn.invokeMap=da,Tn.iteratee=Zl,Tn.keyBy=fa,Tn.keys=bl,Tn.keysIn=Cl,Tn.map=va,Tn.mapKeys=function(e,t){var n={};return t=Yi(t,3),ur(e,function(e,r,i){Xn(n,t(e,r,i),e)}),n},Tn.mapValues=function(e,t){var n={};return t=Yi(t,3),ur(e,function(e,r,i){Xn(n,r,t(e,r,i))}),n},Tn.matches=function(e){return Ir(Kn(e,1))},Tn.matchesProperty=function(e,t){return Tr(e,Kn(t,1))},Tn.memoize=Oa,Tn.merge=Sl,Tn.mergeWith=Ol,Tn.method=Yl,Tn.methodOf=Kl,Tn.mixin=$l,Tn.negate=wa,Tn.nthArg=function(e){return e=il(e),Ur(function(t){return Ar(t,e)})},Tn.omit=wl,Tn.omitBy=function(e,t){return Il(e,wa(Yi(t)))},Tn.once=function(e){return Ea(2,e)},Tn.orderBy=function(e,t,n,r){return null==e?[]:(Ma(t)||(t=null==t?[]:[t]),Ma(n=r?void 0:n)||(n=null==n?[]:[n]),Lr(e,t,n))},Tn.over=Ql,Tn.overArgs=Na,Tn.overEvery=eu,Tn.overSome=tu,Tn.partial=Ia,Tn.partialRight=Ta,Tn.partition=ma,Tn.pick=Nl,Tn.pickBy=Il,Tn.property=nu,Tn.propertyOf=function(e){return function(t){return null==e?void 0:dr(e,t)}},Tn.pull=zo,Tn.pullAll=Vo,Tn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?xr(e,t,Yi(n,2)):e},Tn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?xr(e,t,void 0,n):e},Tn.pullAt=Wo,Tn.range=ru,Tn.rangeRight=iu,Tn.rearg=Da,Tn.reject=function(e,t){return(Ma(e)?at:ir)(e,wa(Yi(t,3)))},Tn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=Yi(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return Mr(e,i),n},Tn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return Ur(e,t=void 0===t?t:il(t))},Tn.reverse=Ho,Tn.sampleSize=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:il(t),(Ma(e)?Fn:jr)(e,t)},Tn.set=function(e,t,n){return null==e?e:Fr(e,t,n)},Tn.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Fr(e,t,n,r)},Tn.shuffle=function(e){return(Ma(e)?zn:Wr)(e)},Tn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ao(e,t,n)?(t=0,n=r):(t=null==t?0:il(t),n=void 0===n?r:il(n)),Hr(e,t,n)):[]},Tn.sortBy=pa,Tn.sortedUniq=function(e){return e&&e.length?Zr(e):[]},Tn.sortedUniqBy=function(e,t){return e&&e.length?Zr(e,Yi(t,2)):[]},Tn.split=function(e,t,n){return n&&"number"!=typeof n&&ao(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ul(e))&&("string"==typeof t||null!=t&&!Ya(t))&&!(t=Kr(t))&&kt(e)?ui(Wt(e),0,n):e.split(t,n):[]},Tn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:an(il(t),0),Ur(function(n){var r=n[t],i=ui(n,0,t);return r&&st(i,r),tt(e,this,i)})},Tn.tail=function(e){var t=null==e?0:e.length;return t?Hr(e,1,t):[]},Tn.take=function(e,t,n){return e&&e.length?Hr(e,0,(t=n||void 0===t?1:il(t))<0?0:t):[]},Tn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Hr(e,(t=r-(t=n||void 0===t?1:il(t)))<0?0:t,r):[]},Tn.takeRightWhile=function(e,t){return e&&e.length?ei(e,Yi(t,3),!1,!0):[]},Tn.takeWhile=function(e,t){return e&&e.length?ei(e,Yi(t,3)):[]},Tn.tap=function(e,t){return t(e),e},Tn.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new he(n);return Ha(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),ba(e,t,{leading:i,maxWait:t,trailing:o})},Tn.thru=ra,Tn.toArray=nl,Tn.toPairs=Tl,Tn.toPairsIn=Dl,Tn.toPath=function(e){return Ma(e)?ct(e,Io):Ja(e)?[e]:gi(No(ul(e)))},Tn.toPlainObject=ll,Tn.transform=function(e,t,n){var r=Ma(e),i=r||Ba(e)||Qa(e);if(t=Yi(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Ha(e)&&za(o)?Dn(He(e)):{}}return(i?rt:ur)(e,function(e,r,i){return t(n,e,r,i)}),n},Tn.unary=function(e){return ha(e,1)},Tn.union=Go,Tn.unionBy=qo,Tn.unionWith=Xo,Tn.uniq=function(e){return e&&e.length?$r(e):[]},Tn.uniqBy=function(e,t){return e&&e.length?$r(e,Yi(t,2)):[]},Tn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?$r(e,void 0,t):[]},Tn.unset=function(e,t){return null==e||Jr(e,t)},Tn.unzip=Zo,Tn.unzipWith=Yo,Tn.update=function(e,t,n){return null==e?e:Qr(e,t,oi(n))},Tn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Qr(e,t,oi(n),r)},Tn.values=Al,Tn.valuesIn=function(e){return null==e?[]:Tt(e,Cl(e))},Tn.without=Ko,Tn.words=zl,Tn.wrap=function(e,t){return Ia(oi(t),e)},Tn.xor=$o,Tn.xorBy=Jo,Tn.xorWith=Qo,Tn.zip=ea,Tn.zipObject=function(e,t){return ri(e||[],t||[],Wn)},Tn.zipObjectDeep=function(e,t){return ri(e||[],t||[],Fr)},Tn.zipWith=ta,Tn.entries=Tl,Tn.entriesIn=Dl,Tn.extend=sl,Tn.extendWith=dl,$l(Tn,Tn),Tn.add=uu,Tn.attempt=Vl,Tn.camelCase=Ll,Tn.capitalize=Rl,Tn.ceil=cu,Tn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=al(n))==n?n:0),void 0!==t&&(t=(t=al(t))==t?t:0),Yn(al(e),t,n)},Tn.clone=function(e){return Kn(e,4)},Tn.cloneDeep=function(e){return Kn(e,5)},Tn.cloneDeepWith=function(e,t){return Kn(e,5,t="function"==typeof t?t:void 0)},Tn.cloneWith=function(e,t){return Kn(e,4,t="function"==typeof t?t:void 0)},Tn.conformsTo=function(e,t){return null==t||$n(e,t,bl(t))},Tn.deburr=xl,Tn.defaultTo=function(e,t){return null==e||e!=e?t:e},Tn.divide=su,Tn.endsWith=function(e,t,n){e=ul(e),t=Kr(t);var r=e.length,i=n=void 0===n?r:Yn(il(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Tn.eq=Aa,Tn.escape=function(e){return(e=ul(e))&&k.test(e)?e.replace(M,Mt):e},Tn.escapeRegExp=function(e){return(e=ul(e))&&G.test(e)?e.replace(H,"\\$&"):e},Tn.every=function(e,t,n){var r=Ma(e)?ot:nr;return n&&ao(e,t,n)&&(t=void 0),r(e,Yi(t,3))},Tn.find=aa,Tn.findIndex=xo,Tn.findKey=function(e,t){return pt(e,Yi(t,3),ur)},Tn.findLast=la,Tn.findLastIndex=Mo,Tn.findLastKey=function(e,t){return pt(e,Yi(t,3),cr)},Tn.floor=du,Tn.forEach=ua,Tn.forEachRight=ca,Tn.forIn=function(e,t){return null==e?e:ar(e,Yi(t,3),Cl)},Tn.forInRight=function(e,t){return null==e?e:lr(e,Yi(t,3),Cl)},Tn.forOwn=function(e,t){return e&&ur(e,Yi(t,3))},Tn.forOwnRight=function(e,t){return e&&cr(e,Yi(t,3))},Tn.get=gl,Tn.gt=La,Tn.gte=Ra,Tn.has=function(e,t){return null!=e&&no(e,t,pr)},Tn.hasIn=hl,Tn.head=ko,Tn.identity=Xl,Tn.includes=function(e,t,n,r){e=ka(e)?e:Al(e),n=n&&!r?il(n):0;var i=e.length;return n<0&&(n=an(i+n,0)),$a(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&ht(e,t,n)>-1},Tn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:il(n);return i<0&&(i=an(r+i,0)),ht(e,t,i)},Tn.inRange=function(e,t,n){return t=rl(t),void 0===n?(n=t,t=0):n=rl(n),function(e,t,n){return e>=ln(t,n)&&e<an(t,n)}(e=al(e),t,n)},Tn.invoke=_l,Tn.isArguments=xa,Tn.isArray=Ma,Tn.isArrayBuffer=Pa,Tn.isArrayLike=ka,Tn.isArrayLikeObject=Ua,Tn.isBoolean=function(e){return!0===e||!1===e||Ga(e)&&vr(e)==l},Tn.isBuffer=Ba,Tn.isDate=ja,Tn.isElement=function(e){return Ga(e)&&1===e.nodeType&&!Za(e)},Tn.isEmpty=function(e){if(null==e)return!0;if(ka(e)&&(Ma(e)||"string"==typeof e||"function"==typeof e.splice||Ba(e)||Qa(e)||xa(e)))return!e.length;var t=to(e);if(t==f||t==g)return!e.size;if(so(e))return!Or(e).length;for(var n in e)if(Ce.call(e,n))return!1;return!0},Tn.isEqual=function(e,t){return _r(e,t)},Tn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?_r(e,t,void 0,n):!!r},Tn.isError=Fa,Tn.isFinite=function(e){return"number"==typeof e&&nn(e)},Tn.isFunction=za,Tn.isInteger=Va,Tn.isLength=Wa,Tn.isMap=qa,Tn.isMatch=function(e,t){return e===t||br(e,t,$i(t))},Tn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,br(e,t,$i(t),n)},Tn.isNaN=function(e){return Xa(e)&&e!=+e},Tn.isNative=function(e){if(co(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Cr(e)},Tn.isNil=function(e){return null==e},Tn.isNull=function(e){return null===e},Tn.isNumber=Xa,Tn.isObject=Ha,Tn.isObjectLike=Ga,Tn.isPlainObject=Za,Tn.isRegExp=Ya,Tn.isSafeInteger=function(e){return Va(e)&&e>=-9007199254740991&&e<=9007199254740991},Tn.isSet=Ka,Tn.isString=$a,Tn.isSymbol=Ja,Tn.isTypedArray=Qa,Tn.isUndefined=function(e){return void 0===e},Tn.isWeakMap=function(e){return Ga(e)&&to(e)==y},Tn.isWeakSet=function(e){return Ga(e)&&"[object WeakSet]"==vr(e)},Tn.join=function(e,t){return null==e?"":rn.call(e,t)},Tn.kebabCase=Ml,Tn.last=Fo,Tn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=il(n))<0?an(r+i,0):ln(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):gt(e,yt,i,!0)},Tn.lowerCase=Pl,Tn.lowerFirst=kl,Tn.lt=el,Tn.lte=tl,Tn.max=function(e){return e&&e.length?rr(e,Xl,mr):void 0},Tn.maxBy=function(e,t){return e&&e.length?rr(e,Yi(t,2),mr):void 0},Tn.mean=function(e){return _t(e,Xl)},Tn.meanBy=function(e,t){return _t(e,Yi(t,2))},Tn.min=function(e){return e&&e.length?rr(e,Xl,wr):void 0},Tn.minBy=function(e,t){return e&&e.length?rr(e,Yi(t,2),wr):void 0},Tn.stubArray=ou,Tn.stubFalse=au,Tn.stubObject=function(){return{}},Tn.stubString=function(){return""},Tn.stubTrue=function(){return!0},Tn.multiply=fu,Tn.nth=function(e,t){return e&&e.length?Ar(e,il(t)):void 0},Tn.noConflict=function(){return We._===this&&(We._=Ie),this},Tn.noop=Jl,Tn.now=ga,Tn.pad=function(e,t,n){e=ul(e);var r=(t=il(t))?Vt(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Li(Qt(i),n)+e+Li(Jt(i),n)},Tn.padEnd=function(e,t,n){e=ul(e);var r=(t=il(t))?Vt(e):0;return t&&r<t?e+Li(t-r,n):e},Tn.padStart=function(e,t,n){e=ul(e);var r=(t=il(t))?Vt(e):0;return t&&r<t?Li(t-r,n)+e:e},Tn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),cn(ul(e).replace(q,""),t||0)},Tn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ao(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=rl(e),void 0===t?(t=e,e=0):t=rl(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=sn();return ln(e+i*(t-e+je("1e-"+((i+"").length-1))),t)}return Pr(e,t)},Tn.reduce=function(e,t,n){var r=Ma(e)?dt:St,i=arguments.length<3;return r(e,Yi(t,4),n,i,er)},Tn.reduceRight=function(e,t,n){var r=Ma(e)?ft:St,i=arguments.length<3;return r(e,Yi(t,4),n,i,tr)},Tn.repeat=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:il(t),kr(ul(e),t)},Tn.replace=function(){var e=arguments,t=ul(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Tn.result=function(e,t,n){var r=-1,i=(t=ai(t,e)).length;for(i||(i=1,e=void 0);++r<i;){var o=null==e?void 0:e[Io(t[r])];void 0===o&&(r=i,o=n),e=za(o)?o.call(e):o}return e},Tn.round=vu,Tn.runInContext=e,Tn.sample=function(e){return(Ma(e)?jn:Br)(e)},Tn.size=function(e){if(null==e)return 0;if(ka(e))return $a(e)?Vt(e):e.length;var t=to(e);return t==f||t==g?e.size:Or(e).length},Tn.snakeCase=Ul,Tn.some=function(e,t,n){var r=Ma(e)?vt:Gr;return n&&ao(e,t,n)&&(t=void 0),r(e,Yi(t,3))},Tn.sortedIndex=function(e,t){return qr(e,t)},Tn.sortedIndexBy=function(e,t,n){return Xr(e,t,Yi(n,2))},Tn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=qr(e,t);if(r<n&&Aa(e[r],t))return r}return-1},Tn.sortedLastIndex=function(e,t){return qr(e,t,!0)},Tn.sortedLastIndexBy=function(e,t,n){return Xr(e,t,Yi(n,2),!0)},Tn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=qr(e,t,!0)-1;if(Aa(e[n],t))return n}return-1},Tn.startCase=Bl,Tn.startsWith=function(e,t,n){return e=ul(e),n=null==n?0:Yn(il(n),0,e.length),t=Kr(t),e.slice(n,n+t.length)==t},Tn.subtract=mu,Tn.sum=function(e){return e&&e.length?Ot(e,Xl):0},Tn.sumBy=function(e,t){return e&&e.length?Ot(e,Yi(t,2)):0},Tn.template=function(e,t,n){var r=Tn.templateSettings;n&&ao(e,t,n)&&(t=void 0),e=ul(e),t=dl({},t,r,ji);var i,o,a=dl({},t.imports,r.imports,ji),l=bl(a),u=Tt(a,l),c=0,s=t.interpolate||ue,d="__p += '",f=pe((t.escape||ue).source+"|"+s.source+"|"+(s===F?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(Ce.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Pe+"]")+"\n";e.replace(f,function(t,n,r,a,l,u){return r||(r=a),d+=e.slice(c,u).replace(ce,Pt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),l&&(o=!0,d+="';\n"+l+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),d+="';\n";var m=Ce.call(t,"variable")&&t.variable;if(m){if(J.test(m))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(A,""):d).replace(L,"$1").replace(R,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var p=Vl(function(){return fe(l,v+"return "+d).apply(void 0,u)});if(p.source=d,Fa(p))throw p;return p},Tn.times=function(e,t){if((e=il(e))<1||e>9007199254740991)return[];var n=4294967295,r=ln(e,4294967295);e-=4294967295;for(var i=wt(r,t=Yi(t));++n<e;)t(n);return i},Tn.toFinite=rl,Tn.toInteger=il,Tn.toLength=ol,Tn.toLower=function(e){return ul(e).toLowerCase()},Tn.toNumber=al,Tn.toSafeInteger=function(e){return e?Yn(il(e),-9007199254740991,9007199254740991):0===e?e:0},Tn.toString=ul,Tn.toUpper=function(e){return ul(e).toUpperCase()},Tn.trim=function(e,t,n){if((e=ul(e))&&(n||void 0===t))return Nt(e);if(!e||!(t=Kr(t)))return e;var r=Wt(e),i=Wt(t);return ui(r,At(r,i),Lt(r,i)+1).join("")},Tn.trimEnd=function(e,t,n){if((e=ul(e))&&(n||void 0===t))return e.slice(0,Ht(e)+1);if(!e||!(t=Kr(t)))return e;var r=Wt(e);return ui(r,0,Lt(r,Wt(t))+1).join("")},Tn.trimStart=function(e,t,n){if((e=ul(e))&&(n||void 0===t))return e.replace(q,"");if(!e||!(t=Kr(t)))return e;var r=Wt(e);return ui(r,At(r,Wt(t))).join("")},Tn.truncate=function(e,t){var n=30,r="...";if(Ha(t)){var i="separator"in t?t.separator:i;n="length"in t?il(t.length):n,r="omission"in t?Kr(t.omission):r}var o=(e=ul(e)).length;if(kt(e)){var a=Wt(e);o=a.length}if(n>=o)return e;var l=n-Vt(r);if(l<1)return r;var u=a?ui(a,0,l).join(""):e.slice(0,l);if(void 0===i)return u+r;if(a&&(l+=u.length-l),Ya(i)){if(e.slice(l).search(i)){var c,s=u;for(i.global||(i=pe(i.source,ul(te.exec(i))+"g")),i.lastIndex=0;c=i.exec(s);)var d=c.index;u=u.slice(0,void 0===d?l:d)}}else if(e.indexOf(Kr(i),l)!=l){var f=u.lastIndexOf(i);f>-1&&(u=u.slice(0,f))}return u+r},Tn.unescape=function(e){return(e=ul(e))&&P.test(e)?e.replace(x,Gt):e},Tn.uniqueId=function(e){var t=++Se;return ul(e)+t},Tn.upperCase=jl,Tn.upperFirst=Fl,Tn.each=ua,Tn.eachRight=ca,Tn.first=ko,$l(Tn,(lu={},ur(Tn,function(e,t){Ce.call(Tn.prototype,t)||(lu[t]=e)}),lu),{chain:!1}),Tn.VERSION="4.17.21",rt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Tn[e].placeholder=Tn}),rt(["drop","take"],function(e,t){Rn.prototype[e]=function(n){n=void 0===n?1:an(il(n),0);var r=this.__filtered__&&!t?new Rn(this):this.clone();return r.__filtered__?r.__takeCount__=ln(n,r.__takeCount__):r.__views__.push({size:ln(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},Rn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),rt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Rn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Yi(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),rt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Rn.prototype[e]=function(){return this[n](1).value()[0]}}),rt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Rn.prototype[e]=function(){return this.__filtered__?new Rn(this):this[n](1)}}),Rn.prototype.compact=function(){return this.filter(Xl)},Rn.prototype.find=function(e){return this.filter(e).head()},Rn.prototype.findLast=function(e){return this.reverse().find(e)},Rn.prototype.invokeMap=Ur(function(e,t){return"function"==typeof e?new Rn(this):this.map(function(n){return Er(n,e,t)})}),Rn.prototype.reject=function(e){return this.filter(wa(Yi(e)))},Rn.prototype.slice=function(e,t){e=il(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Rn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=il(t))<0?n.dropRight(-t):n.take(t-e)),n)},Rn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Rn.prototype.toArray=function(){return this.take(4294967295)},ur(Rn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Tn[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);i&&(Tn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof Rn,u=a[0],c=l||Ma(t),s=function(e){var t=i.apply(Tn,st([e],a));return r&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,f=!!this.__actions__.length,v=o&&!d,m=l&&!f;if(!o&&c){t=m?t:new Rn(this);var p=e.apply(t,a);return p.__actions__.push({func:ra,args:[s],thisArg:void 0}),new Ln(p,d)}return v&&m?e.apply(this,a):(p=this.thru(s),v?r?p.value()[0]:p.value():p)})}),rt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ee[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Tn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ma(i)?i:[],e)}return this[n](function(n){return t.apply(Ma(n)?n:[],e)})}}),ur(Rn.prototype,function(e,t){var n=Tn[t];if(n){var r=n.name+"";Ce.call(yn,r)||(yn[r]=[]),yn[r].push({name:t,func:n})}}),yn[Ii(void 0,2).name]=[{name:"wrapper",func:void 0}],Rn.prototype.clone=function(){var e=new Rn(this.__wrapped__);return e.__actions__=gi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=gi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=gi(this.__views__),e},Rn.prototype.reverse=function(){if(this.__filtered__){var e=new Rn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Rn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ma(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ln(t,e+a);break;case"takeRight":e=an(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,l=o.end,u=l-a,c=r?l:a-1,s=this.__iteratees__,d=s.length,f=0,v=ln(u,this.__takeCount__);if(!n||!r&&i==u&&v==u)return ti(e,this.__actions__);var m=[];e:for(;u--&&f<v;){for(var p=-1,g=e[c+=t];++p<d;){var h=s[p],E=h.type,y=(0,h.iteratee)(g);if(2==E)g=y;else if(!y){if(1==E)continue e;break e}}m[f++]=g}return m},Tn.prototype.at=ia,Tn.prototype.chain=function(){return na(this)},Tn.prototype.commit=function(){return new Ln(this.value(),this.__chain__)},Tn.prototype.next=function(){void 0===this.__values__&&(this.__values__=nl(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Tn.prototype.plant=function(e){for(var t,n=this;n instanceof An;){var r=Do(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Tn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Rn){var t=e;return this.__actions__.length&&(t=new Rn(this)),(t=t.reverse()).__actions__.push({func:ra,args:[Ho],thisArg:void 0}),new Ln(t,this.__chain__)}return this.thru(Ho)},Tn.prototype.toJSON=Tn.prototype.valueOf=Tn.prototype.value=function(){return ti(this.__wrapped__,this.__actions__)},Tn.prototype.first=Tn.prototype.head,Ct&&(Tn.prototype[Ct]=function(){return this}),Tn}();Ge?((Ge.exports=qt)._=qt,He._=qt):We._=qt}).call(U)}),ct=function(){var e,r,i=t.useRef(null),o=Digit.Hooks.useAccessControl(),u=o.isLoading,c=o.data,s=t.useState(""),f=s[0],v=s[1],m=a.useTranslation().t;t.useEffect(function(){if(u)return n.createElement(l.Loader,null);i.current.style.cursor="pointer",p()},[u]);var p=function(){i.current.style.width="55px",i.current.style.overflow="hidden",i.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="none"}),i.current.querySelectorAll(".actions").forEach(function(e){e.style.padding="0"})},g={},h={};null==c||null===(e=c.actions)||void 0===e||null===(r=e.filter(function(e){return"url"===e.url}))||void 0===r||r.forEach(function(e){ut.set(h,e.path,d({},e))}),null==c||c.actions.filter(function(e){return"url"===e.url}).forEach(function(e){var t,n,r,i=e.path.split(".")[0];(""==f&&""!==e.path||""!==e.path&&null!==(t=m("ACTION_TEST_"+(null===(n=i)||void 0===n||null===(r=n.toUpperCase())||void 0===r?void 0:r.replace(/[ -]/g,"_"))))&&void 0!==t&&t.toLowerCase().includes(f.toLowerCase()))&&("TradeLicense"===(i=e.path.split(".")[0])&&(i="Trade License"),g[i]?g[i].push(e):g[i]=[e])});var E=[];return u?n.createElement(l.Loader,null):E?n.createElement("div",{className:"sidebar",ref:i,onMouseOver:function(){i.current.style.width="260px",i.current.style.overflow="auto",i.current.querySelectorAll(".dropdown-link").forEach(function(e){e.style.display="flex"})},onMouseLeave:p},n.createElement("div",{className:"submenu-container"},n.createElement("div",{className:"sidebar-link"},n.createElement("div",{className:"actions search-icon-wrapper"},n.createElement(l.SearchIcon,{className:"search-icon"}),n.createElement("input",{className:"employee-search-input",type:"text",placeholder:m("ACTION_TEST_SEARCH"),name:"search",value:f,onChange:function(e){return v(e.target.value)}})))),function(){var e,t=Object.keys(g);t.sort(function(e,t){return e.orderNumber-t.orderNumber});for(var r=0;r<t.length;r++)if(-1===g[t[r]][0].path.indexOf("."))if("Home"===g[t[r]][0].displayName)E.unshift({moduleName:t[r].toUpperCase(),icon:g[t[r]][0],navigationURL:"/digit-ui/employee",type:"single"});else{var i;E.push({moduleName:null===(i=g[t[r]][0])||void 0===i?void 0:i.displayName.toUpperCase(),type:"single",icon:g[t[r]][0],navigationURL:g[t[r]][0].navigationURL})}else E.push({moduleName:t[r].toUpperCase(),links:g[t[r]],icon:g[t[r]][0],orderNumber:g[t[r]][0].orderNumber});if(E.find(function(e){return"HOME"===e.moduleName})){E.findIndex(function(e){return"HOME"===e.moduleName});var o,a,l=null===(o=E)||void 0===o?void 0:o.filter(function(e){return"HOME"===(null==e?void 0:e.moduleName)}),u=null===(a=E)||void 0===a?void 0:a.filter(function(e){return"HOME"!==(null==e?void 0:e.moduleName)});E=u.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)}),(null==l?void 0:l[0])&&E.unshift(l[0])}else E.sort(function(e,t){return e.moduleName.localeCompare(t.moduleName)});return null===(e=E)||void 0===e?void 0:e.map(function(e,t){return n.createElement(lt,{item:e,key:t+1})})}()):""},st=function(e){var t=e.isSidebarOpen,r=e.toggleSidebar,i=e.handleLogout,o=e.mobileView,a=e.userDetails,l=e.modules;return e.CITIZEN?n.createElement(at,{isOpen:t,isSideBarScroll:e.isSideBarScroll,setSideBarScrollTop:e.setSideBarScrollTop,isMobile:!0,toggleSidebar:r,onLogout:i,linkData:e.linkData,islinkDataLoading:e.islinkDataLoading}):!o&&null!=a&&a.access_token?n.createElement(ct,{mobileView:o,userDetails:a,modules:l}):n.createElement(at,{isOpen:t,isMobile:!0,toggleSidebar:r,onLogout:i,isEmployee:!0})},dt=function(e){var r=e.t,i=e.stateInfo,a=e.userDetails,u=e.CITIZEN,c=e.cityDetails,s=e.mobileView,d=e.handleUserDropdownSelection,f=e.logoUrl,v=e.showSidebar,m=void 0===v||v,p=e.showLanguageChange,g=e.linkData,h=e.islinkDataLoading,E=t.useState(!1),y=E[0],_=E[1],b=t.useState(!1),C=b[0],S=b[1],O=o.useHistory(),w=t.useState(!1),N=w[0],I=w[1],T=function(){_(!1),I(!0)},D=function(){I(!1)},A=[{name:r("EDIT_PROFILE"),icon:n.createElement(l.EditPencilIcon,{className:"icon"}),func:function(){O.push("/digit-ui/employee/user/profile")}},{name:r("CORE_COMMON_LOGOUT"),icon:n.createElement(l.LogoutIcon,{className:"icon"}),func:T}];return n.createElement(n.Fragment,null,n.createElement(Ye,{t:r,stateInfo:i,toggleSidebar:_,setSideBarScrollTop:S,isSidebarOpen:y,isSideBarScroll:C,handleLogout:T,userDetails:a,CITIZEN:u,cityDetails:c,mobileView:s,userOptions:A,handleUserDropdownSelection:d,logoUrl:f,showLanguageChange:p}),N&&n.createElement(et,{onSelect:function(){Digit.UserService.logout(),I(!1)},onCancel:D,onDismiss:D}),m&&n.createElement(st,{t:r,CITIZEN:u,isSidebarOpen:y,toggleSidebar:_,isSideBarScroll:C,setSideBarScrollTop:S,handleLogout:T,mobileView:s,userDetails:a,linkData:g,islinkDataLoading:h}))};function ft(e){var r=e.setProfilePic,i=e.closeDrawer,o=e.userType,u=e.removeProfilePic,c=e.showToast,s=t.useState(null)[1],d=t.useState(""),f=d[0],v=d[1],m=t.useState(null)[1],p=a.useTranslation().t;return t.useEffect(function(){!function(){try{m(null);var e=function(){if(f){var e=function(){if(f.size>=1e6)c("error",p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),m(p("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{var e=w(function(){return Promise.resolve(Digit.UploadServices.Filestorage(o+"-profile",f,Digit.ULBService.getStateId())).then(function(e){var t,n;if((null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){var i,o,a=null==e||null===(i=e.data)||void 0===i||null===(o=i.files[0])||void 0===o?void 0:o.fileStoreId;s(a),r(a)}else c("error",p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),m(p("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",p("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)}}()},[f]),n.createElement(n.Fragment,null,n.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:function(){return i()}}),n.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===o?"2.5rem":"0",zIndex:"2"}},n.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},n.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",n.createElement(l.GalleryIcon,null)),n.createElement("label",{style:{cursor:"pointer"}}," Gallery"),n.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:function(e){return v(e.target.files[0])},style:{display:"none"}})),n.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},n.createElement("button",{onClick:function(){u(),i()}},n.createElement(l.RemoveIcon,null)),n.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}var vt=function(e){var r,i,u,c,s,f,v,m,p,g,h=e.stateCode,E=e.userType,y=e.cityDetails,_=(o.useHistory(),a.useTranslation().t),b=window.location.href,C=Digit.ULBService.getStateId(),S=Digit.ULBService.getCurrentTenantId(),O=(null===(r=Digit.UserService.getUser())||void 0===r?void 0:r.info)||{},N=t.useState(null),I=N[0],T=N[1],D=t.useState(null!=O&&O.name?O.name:""),A=D[0],L=D[1],R=t.useState(null!=O&&O.emailId?O.emailId:""),x=R[0],M=R[1],P=t.useState(null==I?void 0:I.gender),k=P[0],U=P[1],B=t.useState(null!=O&&O.permanentCity?O.permanentCity:y.name),j=B[0],F=B[1],z=t.useState(null!=O&&O.mobileNumber?O.mobileNumber:""),V=z[0],W=z[1],H=t.useState(null),G=H[0],q=H[1],X=t.useState(""),Z=X[0],Y=X[1],K=t.useState(!1),$=K[0],J=K[1],Q=t.useState(!1),ee=Q[0],te=Q[1],ne=t.useState(""),re=ne[0],ie=ne[1],oe=t.useState(""),ae=oe[0],le=oe[1],ue=t.useState(""),ce=ue[0],se=ue[1],de=t.useState(null),fe=de[0],ve=de[1],me=t.useState(!1),pe=me[0],ge=me[1],he=n.useState(window.innerWidth),Ee=he[0],ye=he[1],_e=n.useState({}),be=_e[0],Ce=_e[1],Se=window.Digit.Utils.browser.isMobile();n.useEffect(function(){return window.addEventListener("resize",function(){return ye(window.innerWidth)}),function(){window.removeEventListener("resize",function(){return ye(window.innerWidth)})}}),t.useEffect(function(){var e;ge(!0),function(){try{var e=null==O?void 0:O.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(S,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&T(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),U({i18nKey:void 0,code:null==I?void 0:I.gender,value:null==I?void 0:I.gender});var t=null==I||null===(e=I.photo)||void 0===e?void 0:e.split(",");Y(null==t?void 0:t.at(0)),ge(!1)},[null!==I]);var Oe=function(e){return U(e)},we=function(){return J(!1)},Ne=function(e){L(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?Ce(d({},be,{userName:{type:"pattern",message:_("CORE_COMMON_PROFILE_NAME_INVALID")}})):Ce(d({},be,{userName:null}))},Ie=function(e){M(e),e.length&&!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e)?Ce(d({},be,{emailAddress:{type:"pattern",message:_("CORE_COMMON_PROFILE_EMAIL_INVALID")}})):Ce(d({},be,{emailAddress:null}))},Te=function(e,t,n){void 0===n&&(n=5e3),ve({key:e,action:t}),setTimeout(function(){ve(null)},n)},De=function(){try{var e=function(e){if(t)return e;ge(!1)},t=!1;ge(!0);var n=w(function(){var e=d({},O,{name:A,gender:null==k?void 0:k.value,emailId:x,photo:G});if(!new RegExp(/^([a-zA-Z ])*$/).test(A)||""===A||A.length>50||A.length<1)throw JSON.stringify({type:"error",message:_("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===E&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(V))throw JSON.stringify({type:"error",message:_("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(x.length&&!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x))throw JSON.stringify({type:"error",message:_("CORE_COMMON_PROFILE_EMAIL_INVALID")});if(re.length||ae.length||ce.length){if(ae!==ce)throw JSON.stringify({type:"error",message:_("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(re.length&&ae.length&&ce.length))throw JSON.stringify({type:"error",message:_("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(ae)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(ce))throw JSON.stringify({type:"error",message:_("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}return e.locale=Digit.StoreData.getCurrentLanguage(),Promise.resolve(Digit.UserService.updateUser(e,h)).then(function(e){var t=e.responseInfo;if(t&&"200"===t.status){var n=Digit.UserService.getUser();n&&Digit.UserService.setUser(d({},n,{info:d({},n.info,{name:A,mobileNumber:V,emailId:x,permanentCity:j})}))}return function(){if(re.length&&ae.length&&ce.length){var e={existingPassword:re,newPassword:ae,tenantId:S,type:"EMPLOYEE",username:null==O?void 0:O.userName,confirmPassword:ce};return function(){if(ae===ce)return w(function(){return Promise.resolve(Digit.UserService.changePassword(e,S)).then(function(e){var t=e.responseInfo;if(null==t||!t.status||"200"!==t.status)throw"";Te("success",_("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3)})},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&&Te("success",_("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){var t=JSON.parse(e);Te(t.type,_(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}},Ae=[],Le=Digit.Hooks.pt.useGenderMDMS(C,"common-masters","GenderType").data;return Le&&Le.map(function(e){Ae.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),pe?n.createElement(l.Loader,null):n.createElement("div",{className:"user-profile"},n.createElement("section",{style:{margin:"citizen"===E?"8px":"24px"}},"citizen"===E?n.createElement(l.BackButton,null):n.createElement(l.BreadCrumb,{crumbs:[{path:"/digit-ui/employee",content:_("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/user/profile",content:_("ES_COMMON_PAGE_1"),show:b.includes("/user/profile")}]})),n.createElement("div",{style:{display:"flex",flex:1,flexDirection:Ee<768||"citizen"===E?"column":"row",margin:"citizen"===E?"8px":"16px",gap:"citizen"===E?"":"0 24px",boxShadow:"citizen"===E?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===E?"white":"",borderRadius:"citizen"===E?"4px":"",maxWidth:"citizen"===E?"960px":""}},n.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===E?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",height:"376px",borderRadius:"4px",boxShadow:"citizen"===E?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===E?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===E?"8px":"16px"}},n.createElement("div",{style:{position:"relative",height:"citizen"===E?"114px":"150px",width:"citizen"===E?"114px":"150px",margin:"16px"}},n.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:Z&&""!==Z?Z:"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"}),n.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:function(){return J(!$)}},n.createElement(l.CameraIcon,null)))),n.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===E?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===E?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===E?"8px":"24px",paddingBottom:"20px"}},"citizen"===E?n.createElement(n.Fragment,null,n.createElement(l.LabelFieldPair,null,n.createElement(l.CardLabel,{style:{}},""+_("CORE_COMMON_PROFILE_NAME"),"*"),n.createElement("div",{style:{width:"100%",maxWidth:"960px"}},n.createElement(l.TextInput,d({t:_,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:A,onChange:function(e){return Ne(e.target.value)}},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:_("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==be?void 0:be.userName)&&n.createElement(l.CardLabelError,null," ",null==be||null===(i=be.userName)||void 0===i?void 0:i.message," "))),n.createElement(l.LabelFieldPair,null,n.createElement(l.CardLabel,{style:{}},""+_("CORE_COMMON_PROFILE_GENDER")),n.createElement(l.Dropdown,{style:{width:"100%"},className:"form-field",selected:1===(null==k?void 0:k.length)?k[0]:k,disable:1===(null==k?void 0:k.length)||!1,option:Ae,select:Oe,value:k,optionKey:"code",t:_,name:"gender"})),n.createElement(l.LabelFieldPair,null,n.createElement(l.CardLabel,{style:{}},""+_("CORE_COMMON_PROFILE_EMAIL")),n.createElement("div",{style:{width:"100%"}},n.createElement(l.TextInput,{t:_,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:x,onChange:function(e){return Ie(e.target.value)},disable:!1}),(null==be?void 0:be.emailAddress)&&n.createElement(l.CardLabelError,null," ",null==be||null===(u=be.emailAddress)||void 0===u?void 0:u.message," "))),n.createElement("button",{onClick:De,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:Se?"100%":"240px",borderBottom:"1px solid black"}},_("CORE_COMMON_SAVE"))):n.createElement(n.Fragment,null,n.createElement(l.LabelFieldPair,{style:{display:"flex"}},n.createElement(l.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_NAME"),"*"),n.createElement("div",{style:{width:"100%"}},n.createElement(l.TextInput,d({t:_,type:"text",isMandatory:!1,name:"name",value:A,onChange:function(e){return Ne(e.target.value)},placeholder:"Enter Your Name"},{isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:_("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==be?void 0:be.userName)&&n.createElement(l.CardLabelError,{style:{margin:0,padding:0}}," ",null==be||null===(c=be.userName)||void 0===c?void 0:c.message," "))),n.createElement(l.LabelFieldPair,{style:{display:"flex"}},n.createElement(l.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_GENDER")),n.createElement(l.Dropdown,{style:{width:"100%"},selected:1===(null==k?void 0:k.length)?k[0]:k,disable:1===(null==k?void 0:k.length)||!1,option:Ae,select:Oe,value:k,optionKey:"code",t:_,name:"gender"})),n.createElement(l.LabelFieldPair,{style:{display:"flex"}},n.createElement(l.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_CITY")),n.createElement("div",{style:{width:"100%"}},n.createElement(l.TextInput,d({t:_,type:"text",isMandatory:!1,name:"city",value:_(j),onChange:function(e){return F(e.target.value)},placeholder:"Enter Your City Name"},{isRequired:!0,type:"text",title:_("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disable:!0})),n.createElement(l.CardLabelError,null))),n.createElement(l.LabelFieldPair,{style:{display:"flex"}},n.createElement(l.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},_("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),n.createElement("div",{style:{width:"100%"}},n.createElement(l.MobileNumber,{value:V,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:function(e){return function(e){W(e),"employee"!==E||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?Ce(d({},be,{mobileNumber:null})):Ce(d({},be,{mobileNumber:{type:"pattern",message:_("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}}))}(e)},disable:!0,required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:_("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==be?void 0:be.mobileNumber)&&n.createElement(l.CardLabelError,{style:{margin:0,padding:0}}," ",null==be||null===(s=be.mobileNumber)||void 0===s?void 0:s.message," "))),n.createElement(l.LabelFieldPair,{style:{display:"flex"}},n.createElement(l.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_EMAIL")),n.createElement("div",{style:{width:"100%"}},n.createElement(l.TextInput,{t:_,type:"email",isMandatory:!1,placeholder:"Enter a valid Email",optionKey:"i18nKey",name:"email",value:x,onChange:function(e){return Ie(e.target.value)},disable:!1}),(null==be?void 0:be.emailAddress)&&n.createElement(l.CardLabelError,null," ",null==be||null===(f=be.emailAddress)||void 0===f?void 0:f.message," "))),n.createElement(l.LabelFieldPair,null,n.createElement("div",null,n.createElement("a",{style:(v={color:"orange",cursor:"default",marginBottom:"5"},v.cursor="pointer",v),onClick:function(){return te(!ee)}},_("CORE_COMMON_CHANGE_PASSWORD")),ee?n.createElement("div",{style:{marginTop:"10px"}},n.createElement(l.LabelFieldPair,{style:{display:"flex"}},n.createElement(l.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(l.TextInput,{t:_,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return ie(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Ce(d({},be,{currentPassword:null})):Ce(d({},be,{currentPassword:{type:"pattern",message:_("CORE_COMMON_PROFILE_PASSWORD_INVALID")}})));var t},disable:!1}),(null==be?void 0:be.currentPassword)&&n.createElement(l.CardLabelError,null,null==be||null===(m=be.currentPassword)||void 0===m?void 0:m.message))),n.createElement(l.LabelFieldPair,{style:{display:"flex"}},n.createElement(l.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_NEW_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(l.TextInput,{t:_,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return le(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Ce(d({},be,{newPassword:null})):Ce(d({},be,{newPassword:{type:"pattern",message:_("CORE_COMMON_PROFILE_PASSWORD_INVALID")}})));var t},disable:!1}),(null==be?void 0:be.newPassword)&&n.createElement(l.CardLabelError,null,null==be||null===(p=be.newPassword)||void 0===p?void 0:p.message))),n.createElement(l.LabelFieldPair,{style:{display:"flex"}},n.createElement(l.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),n.createElement("div",{style:{width:"100%"}},n.createElement(l.TextInput,{t:_,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:function(e){return se(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?Ce(d({},be,{confirmPassword:null})):Ce(d({},be,{confirmPassword:{type:"pattern",message:_("CORE_COMMON_PROFILE_PASSWORD_INVALID")}})));var t},disable:!1}),(null==be?void 0:be.confirmPassword)&&n.createElement(l.CardLabelError,null,null==be||null===(g=be.confirmPassword)||void 0===g?void 0:g.message)))):""))))),"employee"===E?n.createElement("div",{style:{height:"88px",backgroundColor:"#FFFFFF",display:"flex",justifyContent:"flex-end",marginTop:"64px",alignItems:"center"}},n.createElement("button",{onClick:De,style:{marginTop:"24px",backgroundColor:"#F47738",width:Ee<768?"100%":"248px",height:"40px",float:"right",margin:Ee<768?"0 16px":"",marginRight:Ee<768?"16px":"31px",color:"white",borderBottom:"1px solid black"}},_("CORE_COMMON_SAVE"))):"",fe&&n.createElement(l.Toast,{error:"error"===fe.key,label:_("success"===fe.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":fe.action),onClose:function(){return ve(null)},style:{maxWidth:"670px"}}),1==$?n.createElement(ft,{setProfilePic:function(e){try{var t=function(e){Y(null==e?void 0:e.thumbs[0]),we()};return q(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(function(e){return e.url.split(",")[3]}),images:e.data.fileStoreIds.map(function(e){return Digit.Utils.getFileUrl(e.url)})}:null})}catch(e){return Promise.reject(e)}}([e],C)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:we,userType:E,removeProfilePic:function(){q(null),Y(null)},showToast:Te}):"")},mt=["user/profile","user/error"],pt=function(e){var r,i,l,u,c=e.stateInfo,s=e.userDetails,d=e.CITIZEN,f=e.cityDetails,v=e.mobileView,m=e.handleUserDropdownSelection,p=e.logoUrl,g=e.DSO,h=e.stateCode,E=e.modules,y=e.appTenants,_=e.initData,b=o.useHistory(),C=a.useTranslation().t,S=o.useRouteMatch().path,O=o.useLocation(),w=null==O||null===(r=O.pathname)||void 0===r?void 0:r.includes("language-selection"),N=mt.some(function(e){var t;return null==O||null===(t=O.pathname)||void 0===t?void 0:t.includes(e)});return t.useEffect(function(){Digit.UserService.setType("employee")},[]),n.createElement("div",{className:"employee"},n.createElement(o.Switch,null,n.createElement(o.Route,{path:S+"/user"},N&&n.createElement(dt,{t:C,stateInfo:c,userDetails:s,CITIZEN:d,cityDetails:f,mobileView:v,handleUserDropdownSelection:m,logoUrl:p,showSidebar:!!N,showLanguageChange:!w}),n.createElement("div",{className:N?"grounded-container":"loginContainer",style:N?{padding:0,paddingTop:"80px",marginLeft:v?"":"64px"}:{"--banner-url":"url("+(null==c?void 0:c.bannerUrl)+")",padding:"0px"}},n.createElement(o.Switch,null,n.createElement(o.Route,{path:S+"/user/login"},n.createElement(Le,null)),n.createElement(o.Route,{path:S+"/user/forgot-password"},n.createElement(Ue,null)),n.createElement(o.Route,{path:S+"/user/change-password"},n.createElement(Me,null)),n.createElement(o.Route,{path:S+"/user/profile"},n.createElement(vt,{stateCode:h,userType:"employee",cityDetails:f})),n.createElement(o.Route,{path:S+"/user/error"},n.createElement(Ve,{initData:_,goToHome:function(){b.push("/digit-ui/employee")}})),n.createElement(o.Route,{path:S+"/user/language-selection"},n.createElement(Be,null)),n.createElement(o.Route,null,n.createElement(o.Redirect,{to:S+"/user/language-selection"}))))),n.createElement(o.Route,null,n.createElement(dt,{t:C,stateInfo:c,userDetails:s,CITIZEN:d,cityDetails:f,mobileView:v,handleUserDropdownSelection:m,logoUrl:p,modules:E}),n.createElement("div",{className:"main "+(g?"m-auto":"")},n.createElement("div",{className:"employee-app-wrapper"},n.createElement(He,{initData:_},n.createElement(Fe,{stateCode:h,userType:"employee",modules:E,appTenants:y}))),n.createElement("div",{className:"employee-home-footer"},n.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(l=i.globalConfigs)||void 0===l||null===(u=l.getConfig)||void 0===u?void 0:u.call(l,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:function(){var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))),n.createElement(o.Route,null,n.createElement(o.Redirect,{to:S+"/user/language-selection"}))))},gt=function(){var e,t,r,i,u,c,s,f,v,m,p,g,h,E,y,_,b,C,S,O=a.useTranslation().t,w=o.useHistory(),N=Digit.ULBService.getCitizenCurrentTenant(!0),I=Digit.Hooks.useStore.getInitData(),T=I.data,D=(void 0===T?{}:T).uiHomePage,A=I.isLoading,L=window.Digit.Utils.browser.isMobile();window.Digit.SessionStorage.get("TL_CREATE_TRADE")&&window.Digit.SessionStorage.set("TL_CREATE_TRADE",{});var R=function(){var e,t,n,r,i;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===(r=Digit.UserService)||void 0===r||null===(i=r.getUser())||void 0===i||!i.access_token)},x=Digit.Hooks.useEvents({tenantId:N,variant:"whats-new",config:{enabled:R()}}),M=x.data,P=x.isLoading;N||(null===Digit.SessionStorage.get("locale")?w.push("/digit-ui/citizen/select-language"):w.push("/digit-ui/citizen/select-location"));var k=null==D?void 0:D.appBannerDesktop,U=null==D?void 0:D.appBannerMobile,B=null==D?void 0:D.citizenServicesCard,j=null==D?void 0:D.informationAndUpdatesCard,F=null==D?void 0:D.whatsAppBannerDesktop,z=null==D?void 0:D.whatsAppBannerMobile,V=null==D?void 0:D.whatsNewSection,W=function(e){window.open(null==e?void 0:e.navigationUrl)},H={header:O(null==B?void 0:B.headerLabel),sideOption:{name:O(null==B||null===(e=B.sideOption)||void 0===e?void 0:e.name),onClick:function(){var e;return w.push(null==B||null===(e=B.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:O(null==B||null===(t=B.props)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.label),Icon:n.createElement(l.ComplaintIcon,null),onClick:function(){var e,t;return w.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:O(null==B||null===(i=B.props)||void 0===i||null===(u=i[1])||void 0===u?void 0:u.label),Icon:n.createElement(l.PTIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return w.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:O(null==B||null===(c=B.props)||void 0===c||null===(s=c[2])||void 0===s?void 0:s.label),Icon:n.createElement(l.CaseIcon,{className:"fill-path-primary-main"}),onClick:function(){var e,t;return w.push(null==B||null===(e=B.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:O(null==B||null===(f=B.props)||void 0===f||null===(v=f[3])||void 0===v?void 0:v.label),Icon:n.createElement(l.WSICon,null),onClick:function(){var e,t;return w.push(null==B||null===(e=B.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%"}},G={header:O(null==j?void 0:j.headerLabel),sideOption:{name:O(null==j||null===(m=j.sideOption)||void 0===m?void 0:m.name),onClick:function(){var e;return w.push(null==j||null===(e=j.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:O(null==j||null===(p=j.props)||void 0===p||null===(g=p[0])||void 0===g?void 0:g.label),Icon:n.createElement(l.HomeIcon,null),onClick:function(){var e,t;return w.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:O(null==j||null===(h=j.props)||void 0===h||null===(E=h[1])||void 0===E?void 0:E.label),Icon:n.createElement(l.Calender,null),onClick:function(){var e,t;return w.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:O(null==j||null===(y=j.props)||void 0===y||null===(_=y[2])||void 0===_?void 0:_.label),Icon:n.createElement(l.DocumentIcon,null),onClick:function(){var e,t;return w.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:O(null==j||null===(b=j.props)||void 0===b||null===(C=b[3])||void 0===C?void 0:C.label),Icon:n.createElement(l.DocumentIcon,null),onClick:function(){var e,t;return w.push(null==j||null===(e=j.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 A?n.createElement(l.Loader,null):n.createElement("div",{className:"HomePageContainer"},n.createElement("div",{className:"HomePageWrapper"},n.createElement("div",{className:"BannerWithSearch"},n.createElement("img",L?{src:null==U?void 0:U.bannerUrl}:{src:null==k?void 0:k.bannerUrl}),n.createElement("div",{className:"ServicesSection"},n.createElement(l.CardBasedOptions,d({style:{marginTop:"-30px"}},H)),n.createElement(l.CardBasedOptions,d({style:L?{}:{marginTop:"-30px"}},G)))),(z||F)&&n.createElement("div",{className:"WhatsAppBanner"},n.createElement("img",L?{src:null==z?void 0:z.bannerUrl,onClick:function(){return W(z)}}:{src:null==F?void 0:F.bannerUrl,onClick:function(){return W(F)}})),R()?P?n.createElement(l.Loader,null):n.createElement("div",{className:"WhatsNewSection"},n.createElement("div",{className:"headSection"},n.createElement("h2",null,O(null==V?void 0:V.headerLabel)),n.createElement("p",{onClick:function(){var e;return w.push(null==V||null===(e=V.sideOption)||void 0===e?void 0:e.navigationUrl)}},O(null==V||null===(S=V.sideOption)||void 0===S?void 0:S.name))),n.createElement(l.WhatsNewCard,null==M?void 0:M[0])):null))},ht=function(){var e=a.useTranslation().t,r=o.useHistory(),i=Digit.Hooks.useStore.getInitData(),u=i.data,c=void 0===u?{}:u,s=c.languages,d=c.stateInfo,f=i.isLoading,v=Digit.StoreData.getCurrentLanguage(),m=t.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]),p=t.useMemo(function(){return{options:s,optionsKey:"label",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:function(e){return Digit.LocalizationService.changeLanguage(e.value,d.code)},selectedOption:null==s?void 0:s.filter(function(e){return e.value===v})[0]}},[v,s]);return f?n.createElement(l.Loader,null):n.createElement("div",{className:"selection-card-wrapper"},n.createElement(l.PageBasedInput,{texts:m,onSubmit:function(){r.push("/digit-ui/citizen/select-location")}},n.createElement(l.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),n.createElement(l.RadioButtons,p)))},Et=function(){var e=a.useTranslation().t,r=o.useHistory(),i=o.useLocation(),u=Digit.Hooks.useTenants(),c=u.data,s=u.isLoading,f=t.useState(function(){return{code:Digit.ULBService.getCitizenCurrentTenant(!0)}}),v=f[0],m=f[1],p=t.useState(!1),g=p[0],h=p[1],E=t.useMemo(function(){return{header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}},[e]);function y(e){m(e),h(!1)}var _=t.useMemo(function(){return{options:c,optionsKey:"i18nKey",additionalWrapperClass:"reverse-radio-selection-wrapper",onSelect:y,selectedOption:v}},[c,e,v]);return s?n.createElement("loader",null):n.createElement("div",{className:"selection-card-wrapper"},n.createElement(l.BackButton,null),n.createElement(l.PageBasedInput,{texts:E,onSubmit:function(){if(v){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",v);var t=null===(e=i.state)||void 0===e?void 0:e.redirectBackTo;t?r.replace(t):r.push("/digit-ui/citizen")}else h(!0)},className:"location-selection-container"},n.createElement(l.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),n.createElement(l.SearchOnRadioButtons,d({},_,{placeholder:e("COMMON_TABLE_SEARCH")})),g?n.createElement(l.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},yt=function(e){var r=e.question,i=e.answer,o=e.subAnswer,u=e.lastIndex,c=t.useState(!1),s=c[0],d=c[1],f=a.useTranslation().t;return window.Digit.Utils.browser.isMobile(),n.createElement("div",{className:"faqs border-none",onClick:function(){return d(!s)}},n.createElement("div",{className:"faq-question",style:{justifyContent:f(r).length>30&&s?"revert":"space-between",display:Digit.Utils.browser.isMobile()&&f(r).length>30&&s?"block":"flex"}},n.createElement("span",null,f(r)),n.createElement("span",{className:s?"faqicon rotate":"faqicon",style:{float:"right"}},n.createElement(l.ArrowForward,null))),n.createElement("div",{className:"faq-answer",style:s?{display:"block"}:{display:"none"}},n.createElement("span",null,f(i)+f(o))),u?null:n.createElement("div",{className:"cs-box-border"}))},_t=function(e){var r,i,o,u=e.module,c=Digit.UserService.getUser(),s=((null==c||null===(r=c.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),a.useTranslation().t),d=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),f=d.data,v=null==f||null===(i=f.MdmsRes["common-masters"])||void 0===i||null===(o=i.faqs[0])||void 0===o?void 0:o[""+u].faqs;return d.isLoading?n.createElement(l.Loader,null):n.createElement(t.Fragment,null,n.createElement("div",{className:"faq-page"},n.createElement(l.BackButton,{style:{marginLeft:"unset"}}),n.createElement("div",{style:{marginBottom:"15px"}},n.createElement(l.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},s("FAQ_S"))),n.createElement("div",{className:"faq-list"},v.map(function(e,t){return n.createElement(yt,{key:"faq_"+t,question:e.question,answer:e.answer,subAnswer:e.subAnswer?e.subAnswer:"",lastIndex:t===(null==v?void 0:v.length)-1})}))))},bt=function(e){var r,i,o,u=e.module,c=window.Digit.Utils.browser.isMobile(),s=Digit.UserService.getUser(),d=((null==s||null===(r=s.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),a.useTranslation().t),f=Digit.SessionStorage.get("initData").stateInfo,v=Digit.StoreData.getCurrentLanguage(),m=t.useState(v),p=m[0],g=m[1],h=t.useState(!1),E=h[0],y=h[1],_=t.useState(""),b=_[0],C=_[1],S=function(){return n.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.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"}))};function O(e){return n.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:e.onClick},n.createElement("path",{d:"M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z",fill:"white"}))}var w=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),N=w.data,I=null==N||null===(i=N.MdmsRes["common-masters"])||void 0===i||null===(o=i.howItWorks[0])||void 0===o?void 0:o[""+u];return w.isLoading?n.createElement(l.Loader,null):n.createElement(t.Fragment,null,n.createElement("div",{className:"how-it-works-page"},n.createElement("div",{style:{marginLeft:"-10px"}},n.createElement(l.BackButton,null)),n.createElement("div",{className:"how-it-works-page-header"},n.createElement("div",{style:{marginLeft:c?"-15px":""}},n.createElement(l.Header,null,d("HOW_IT_WORKS")))),n.createElement("div",{className:"language-selector",style:{marginBottom:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map(function(e,t){return n.createElement("div",{className:"language-button-container",key:t},n.createElement(l.CustomButton,{selected:e.value===p,text:e.label,onClick:function(){return function(e){g(e.value),Digit.LocalizationService.changeLanguage(e.value,f.code)}(e)}}))})),I.videosJson.map(function(e,t){return n.createElement("div",null,n.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},n.createElement("div",{className:"video-icon",onClick:function(){return t=e,C("hi_IN"===p?t.hi_IN:t.en_IN),void y(!0);var t}},n.createElement("div",{className:"vid-svg"},n.createElement(S,null))),n.createElement("div",{className:"how-it-works-header-description"},n.createElement("h2",null,d(e.headerLabel)),n.createElement("p",null,d(e.description)))))}),n.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},n.createElement("div",{className:"how-it-works-pdf-section"},n.createElement("div",{className:"pdf-icon-header-desc"},n.createElement("div",{className:"pdf-icon"},n.createElement(l.PDFSvg,null)),n.createElement("div",{className:"pdf-header-desc"},n.createElement("h2",null,d(I.pdfHeader)),n.createElement("p",null,d(I.pdfDesc)))),n.createElement("div",{className:"download-icon"},n.createElement(l.DownloadImgIcon,null)))),E&&n.createElement("div",{className:"how-it-works-video-play"},n.createElement("div",{className:"close-button",style:{position:"absolute",right:"15px",top:"10%",zIndex:"1"}},n.createElement(O,{onClick:function(){y(!1)}})),n.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0,muted:!0,style:{position:"fixed",top:"0",left:"0",minWidth:"100%",minHeight:"100%",backgroundColor:"rgba(0,0,0,0.5)"}},n.createElement("source",{src:b,type:"video/mp4"})))))},Ct=function(e){var t,r,i,o,u,c,s,d,f,v,m,p,g,h,E,y,_=e.moduleCode,b=a.useTranslation().t,C=Digit.ULBService.getCitizenCurrentTenant(),S=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),O=S.isLoading,w=S.data,N=Digit.Hooks.useDynamicData({moduleCode:_,tenantId:C,filters:{},t:b}),I=N.isLoading,T=N.error,D=N.data,A=window.Digit.Utils.browser.isMobile();window.location.href.includes("tl")&&window.Digit.SessionStorage.get("TL_CREATE_TRADE")&&window.Digit.SessionStorage.set("TL_CREATE_TRADE",{});var L=function(e){var t=e.styles;switch(e.module){case"TL":return n.createElement(l.CaseIcon,{className:"fill-path-primary-main",styles:t});case"PT":return n.createElement(l.PTIcon,{className:"fill-path-primary-main",styles:t});case"MCOLLECT":return n.createElement(l.MCollectIcon,{className:"fill-path-primary-main",styles:t});case"PGR":return n.createElement(l.PTIcon,{className:"fill-path-primary-main",styles:t});case"WS":return n.createElement(l.WSICon,{className:"fill-path-primary-main",styles:t});case"OBPS":return n.createElement(l.BPAHomeIcon,{className:"fill-path-primary-main",styles:t});default:return n.createElement(l.CaseIcon,{className:"fill-path-primary-main",styles:t})}},R=null==w||null===(t=w.MdmsRes["common-masters"])||void 0===t||null===(r=t.StaticData[0])||void 0===r?void 0:r[""+_],x=function(e){switch(e.module){case"PT":case"WS":return n.createElement("span",{className:"timerIcon"},n.createElement(l.TimerIcon,null));default:return null}},M=function(e){switch(e.module){case"PT":return n.createElement("span",{className:"rupeeSymbol"},n.createElement(l.RupeeSymbol,null));case"WS":return n.createElement("span",{className:"timerIcon"},n.createElement(l.TimerIcon,null));default:return null}},P=function(e){switch(e){case"TL":return{staticCommonContent:b("TL_VALIDITY")};case"MCOLLECT":return{staticCommonContent:b("CHALLAN_VALIDITY")};case"PGR":return{staticCommonContent:b("CATEGORIES_OF_COMPLAINT_TYPES_CAN_BE_SUBMITTED_ON_GRIEVANCE_PORTAL")};case"OBPS":return{staticCommonContent:b("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==R?void 0:R.validity)+" "+b("1"===(null==R?void 0:R.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},k=function(e){switch(e){case"PT":return{staticDataOne:(null==R?void 0:R.staticDataOne)+" "+b("COMMON_DAYS"),staticDataOneHeader:b("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==R?void 0:R.staticDataTwo,staticDataTwoHeader:b("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:b("PAY_WATER_CHARGES_BY")+" "+(null==R?void 0:R.staticDataOne)+" "+b("COMMON_DAYS")+" "+b("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==R?void 0:R.staticDataTwo)+" "+b("COMMON_DAYS"),staticDataTwoHeader:b("APPLICATION_PROCESSING_TIME")};default:return{}}};return O||I?n.createElement(l.Loader,null):R?n.createElement(n.Fragment,null,R&&null!=R&&R.payViaWhatsApp?n.createElement(l.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"pay-whatsapp-card",onClick:function(){window.open(null==R?void 0:R.payViaWhatsApp)}},n.createElement("div",{className:"pay-whatsapp-text"},b("PAY_VIA_WHATSAPP")),n.createElement("div",{className:"whatsAppIconG"},n.createElement(l.WhatsappIconGreen,null)))):null,R&&null!=R&&R.helpline?n.createElement(l.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"static-home-Card"},n.createElement("div",{className:"static-home-Card-header"},b("CALL_CENTER_HELPLINE")),n.createElement("div",{className:"helplineIcon"},n.createElement(l.HelpLineIcon,null))),n.createElement("div",{className:"call-center-card-text"},null!=R&&null!==(i=R.helpline)&&void 0!==i&&i.contactOne?n.createElement("div",{className:"call-center-card-content"},n.createElement("a",{href:"tel:"+(null==R||null===(o=R.helpline)||void 0===o?void 0:o.contactOne)},null==R||null===(u=R.helpline)||void 0===u?void 0:u.contactOne)):null,null!=R&&null!==(c=R.helpline)&&void 0!==c&&c.contactTwo?n.createElement("div",{className:"call-center-card-content"},n.createElement("a",{href:"tel:"+(null==R||null===(s=R.helpline)||void 0===s?void 0:s.contactTwo)},null==R||null===(d=R.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,R&&null!=R&&R.serviceCenter?n.createElement(l.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},n.createElement("div",{className:"static-home-Card"},n.createElement("div",{className:"static-home-Card-header"},b("CITIZEN_SERVICE_CENTER")),n.createElement("div",{className:"serviceCentrIcon"},n.createElement(l.ServiceCenterIcon,null))),n.createElement("div",{className:"service-center-details-card"},n.createElement("div",{className:"service-center-details-text"},null==R?void 0:R.serviceCenter)),null!=R&&R.viewMapLocation?n.createElement("div",{className:"link"},n.createElement("a",{href:null==R?void 0:R.viewMapLocation},b("VIEW_ON_MAP"))):null):n.createElement("div",null),n.createElement(l.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},T||null==D||null===(null==D?void 0:D.dynamicDataOne)?n.createElement("div",null):n.createElement("div",{className:"dynamicDataCard",style:A?{maxHeight:"fit-content"}:{}},n.createElement("div",{className:"dynamicData"},n.createElement("span",{style:{paddingTop:"2px"}},n.createElement(L,{module:_,styles:{width:"18px",height:"24px"}})),n.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataOne))),T||null==D||null===(null==D?void 0:D.dynamicDataTwo)?n.createElement("div",null):n.createElement("div",{className:"dynamicDataCard",style:A?{maxHeight:"fit-content"}:{}},n.createElement("div",{className:"dynamicData"},n.createElement("span",{style:{paddingTop:"2px"}},n.createElement(L,{module:_,styles:{width:"18px",height:"24px"}})),n.createElement("span",{className:"dynamicData-content"},null==D?void 0:D.dynamicDataTwo))),R&&null!=R&&R.staticDataOne?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement(x,{module:_}),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(f=k(_))||void 0===f?void 0:f.staticDataOne)?"8px":"unset"}},null===(v=k(_))||void 0===v?void 0:v.staticDataOneHeader),n.createElement("span",{className:"static-data-content-second"},""+(null===(m=k(_))||void 0===m?void 0:m.staticDataOne))))):n.createElement("div",null),R&&null!=R&&R.staticDataTwo?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement(M,{module:_}),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(p=k(_))||void 0===p?void 0:p.staticDataTwoHeader),n.createElement("span",{className:"static-data-content-second"},null===(g=k(_))||void 0===g?void 0:g.staticDataTwo)))):n.createElement("div",null),R&&null!=R&&R.validity?n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},n.createElement("span",{className:"validityIcon"},n.createElement(l.ValidityTimeIcon,null)),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(h=P(_))||void 0===h?void 0:h.staticCommonContent),n.createElement("span",{className:"static-data-content-second"},null===(E=P(_))||void 0===E?void 0:E.validity)))):n.createElement("div",null),T||null==D||null==D||!D.staticData||null===(null==D?void 0:D.staticData)?n.createElement("div",null):n.createElement("div",{className:"staticDataCard"},n.createElement("div",{className:"staticData"},"PGR"===_?n.createElement("span",{style:{paddingTop:"15px"}},n.createElement(l.TimerIcon,{module:_,styles:{width:"18px",height:"24px",marginLeft:"13px"}})):n.createElement("span",{className:"validityIcon"},n.createElement(l.ValidityTimeIcon,null)),n.createElement("span",{className:"static-data-content"},n.createElement("span",{className:"static-data-content-first"},null===(y=P(_))||void 0===y?void 0:y.staticCommonContent),n.createElement("span",{className:"static-data-content-second"},null==D?void 0:D.staticData)))))):n.createElement(n.Fragment,null)},St=function(e){return(0,a.useTranslation().t)(null!=e&&e.isSuccess?"CS_PROPERTY_FEEDBACK_SUCCESS":"CS_PROPERTY_FEEDBACK_FAILED")},Ot=function(e){return n.createElement(l.Banner,{message:St(e),applicationNumber:"",style:e.isMobile?{}:{width:"740px"},successful:null==e?void 0:e.isSuccess})},wt=function(e){var t,r,i,u,c,s,d,f,v,m=a.useTranslation().t,p=(Digit.ULBService.getCurrentTenantId(),o.useLocation()),g=(Digit.Hooks.useStore.getInitData(),window.Digit.Utils.browser.isMobile());return n.createElement("form",null,n.createElement(l.Card,null,n.createElement(Ot,{t:m,data:p.state,isSuccess:!(null===(t=p.state)||void 0===t||null===(r=t.result)||void 0===r||null===(i=r.Service)||void 0===i||!i[0]),isMobile:g,isLoading:!1}),(null===(u=p.state)||void 0===u||null===(c=u.result)||void 0===c||null===(s=c.Service)||void 0===s?void 0:s[0])&&n.createElement(l.CardText,null,m("CS_CF_FEEDBACK_RESPONSE")),!(null!==(d=p.state)&&void 0!==d&&null!==(f=d.result)&&void 0!==f&&null!==(v=f.Service)&&void 0!==v&&v[0])&&n.createElement(l.CardText,null,m("CS_FILE_PROPERTY_FAILED_RESPONSE")),n.createElement(o.Link,{to:"/digit-ui/citizen"},n.createElement(l.SubmitBar,{label:m("CS_COMMON_GO_BACK_TO_HOME")}))))},Nt=function(e){return e instanceof HTMLElement},It=function(e){return null==e},Tt=function(e){return"object"==typeof e},Dt=function(e){return!It(e)&&!Array.isArray(e)&&Tt(e)&&!(e instanceof Date)},At=function(e){return/^\w*$/.test(e)},Lt=function(e){return e.filter(Boolean)},Rt=function(e){return Lt(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."))};function xt(e,t,n){for(var r=-1,i=At(t)?[t]:Rt(t),o=i.length,a=o-1;++r<o;){var l=i[r],u=n;if(r!==a){var c=e[l];u=Dt(c)||Array.isArray(c)?c:isNaN(+i[r+1])?{}:[]}e[l]=u,e=e[l]}return e}var Mt=function(e,t){for(var n in void 0===t&&(t={}),e)At(n)?t[n]=e[n]:xt(t,n,e[n]);return t},Pt=function(e){return void 0===e},kt=function(e,t,n){void 0===e&&(e={});var r=Lt(t.split(/[,[\].]+?/)).reduce(function(e,t){return It(e)?e:e[t]},e);return Pt(r)||r===e?Pt(e[t])?n:e[t]:r},Ut=function(e,t){Nt(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))},Bt={isValid:!1,value:null},jt=function(e){return Array.isArray(e)?e.reduce(function(e,t){return t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e},Bt):Bt},Ft=function(e){return"radio"===e.type},zt=function(e){return"file"===e.type},Vt=function(e){return"checkbox"===e.type},Wt=function(e){return"select-multiple"===e.type},Ht={value:!1,isValid:!1},Gt={value:!0,isValid:!0},qt=function(e){if(Array.isArray(e)){if(e.length>1){var t=e.filter(function(e){return e&&e.ref.checked}).map(function(e){return e.ref.value});return{value:t,isValid:!!t.length}}var n=e[0].ref,r=n.value,i=n.attributes;return n.checked?i&&!Pt(i.value)?Pt(r)||""===r?Gt:{value:r,isValid:!0}:Gt:Ht}return Ht};function Xt(e,t,n,r,i){var o=e.current[t];if(o){var a=o.ref,l=a.value,u=o.ref,c=o.valueAsNumber,s=o.valueAsDate,d=o.setValueAs;if(a.disabled&&r)return;return zt(u)?u.files:Ft(u)?jt(o.options).value:Wt(u)?[].concat(u.options).filter(function(e){return e.selected}).map(function(e){return e.value}):Vt(u)?qt(o.options).value:i?l:c?""===l?NaN:+l:s?u.valueAsDate:d?d(l):l}if(n)return kt(n.current,t)}function Zt(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&Zt(e.parentNode)}var Yt=function(e){return Dt(e)&&!Object.keys(e).length},Kt=function(e){return"boolean"==typeof e};function $t(e,t){var n,r=At(t)?[t]:Rt(t),i=1==r.length?e:function(e,t){for(var n=t.slice(0,-1).length,r=0;r<n;)e=Pt(e)?r++:e[t[r++]];return e}(e,r);i&&delete i[r[r.length-1]];for(var o=0;o<r.slice(0,-1).length;o++){var a=-1,l=void 0,u=r.slice(0,-(o+1)),c=u.length-1;for(o>0&&(n=e);++a<u.length;){var s=u[a];l=l?l[s]:e[s],c===a&&(Dt(l)&&Yt(l)||Array.isArray(l)&&!l.filter(function(e){return Dt(e)&&!Yt(e)||Kt(e)}).length)&&(n?delete n[s]:delete e[s]),n=l}}return e}var Jt=function(e,t){return e&&e.ref===t},Qt=function(e){return It(e)||!Tt(e)};function en(e,t){if(Qt(e)||Qt(t))return t;for(var n in t){var r=e[n],i=t[n];try{e[n]=Dt(r)&&Dt(i)||Array.isArray(r)&&Array.isArray(i)?en(r,i):i}catch(e){}}return e}function tn(e,n,r){if(Qt(e)||Qt(n)||e instanceof Date||n instanceof Date)return e===n;if(!t.isValidElement(e)){var i=Object.keys(e),o=Object.keys(n);if(i.length!==o.length)return!1;for(var a=0,l=i;a<l.length;a++){var u=l[a],c=e[u];if(!r||"ref"!==u){var s=n[u];if((Dt(c)||Array.isArray(c))&&(Dt(s)||Array.isArray(s))?!tn(c,s,r):c!==s)return!1}}}return!0}function nn(e,t,n,r,i){for(var o=-1;++o<e.length;){for(var a in e[o]){var l;Array.isArray(e[o][a])?(!n[o]&&(n[o]={}),n[o][a]=[],nn(e[o][a],kt(t[o]||{},a,[]),n[o][a],n[o],a)):tn(kt(t[o]||{},a),e[o][a])?xt(n[o]||{},a):n[o]=Object.assign(Object.assign({},n[o]),((l={})[a]=!0,l))}r&&!n.length&&delete r[i]}return n}var rn=function(e){return"string"==typeof e},on=function(e,t,n,r,i){var o={},a=function(t){(Pt(i)||(rn(i)?t.startsWith(i):Array.isArray(i)&&i.find(function(e){return t.startsWith(e)})))&&(o[t]=Xt(e,t,void 0,r))};for(var l in e.current)a(l);return n?Mt(o):en(t,Mt(o))},an=function(e){return e instanceof RegExp},ln=function(e){return Dt(e)&&!an(e)?e:{value:e,message:""}},un=function(e){return"function"==typeof e},cn=function(e){return rn(e)||t.isValidElement(e)};function sn(e,t,n){if(void 0===n&&(n="validate"),cn(e)||Kt(e)&&!e)return{type:n,message:cn(e)?e:"",ref:t}}var dn=function(e,t,n,r,i){var o;return t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),(o={},o[r]=i||!0,o))}):{}},fn=function(e,t,n,r){var i=n.ref,o=n.ref.value,a=n.options,l=n.required,u=n.maxLength,c=n.minLength,s=n.min,d=n.max,f=n.pattern,v=n.validate;try{var m=!1,p=i.name,g={},h=Ft(i),E=Vt(i),y=h||E,_=""===o,b=dn.bind(null,p,t,g),C=function(e,t,n,r,o){void 0===r&&(r="maxLength"),void 0===o&&(o="minLength");var a=e?t:n;g[p]=Object.assign({type:e?r:o,message:a,ref:i},b(e?r:o,a))};if(l&&(!h&&!E&&(_||It(o))||Kt(o)&&!o||E&&!qt(a).isValid||h&&!jt(a).isValid)){var S=cn(l)?{value:!!l,message:l}:ln(l),w=S.message;if(S.value&&(g[p]=Object.assign({type:"required",message:w,ref:y?((e.current[p].options||[])[0]||{}).ref:i},b("required",w)),!t))return Promise.resolve(g)}if(!(It(s)&&It(d)||""===o)){var N,I,T=ln(d),D=ln(s);if(isNaN(o)){var A=i.valueAsDate||new Date(o);rn(T.value)&&(N=A>new Date(T.value)),rn(D.value)&&(I=A<new Date(D.value))}else{var L=i.valueAsNumber||parseFloat(o);It(T.value)||(N=L>T.value),It(D.value)||(I=L<D.value)}if((N||I)&&(C(!!N,T.message,D.message,"max","min"),!t))return Promise.resolve(g)}if(rn(o)&&!_&&(u||c)){var R=ln(u),x=ln(c),M=!It(R.value)&&o.length>R.value,P=!It(x.value)&&o.length<x.value;if((M||P)&&(C(M,R.message,x.message),!t))return Promise.resolve(g)}if(rn(o)&&f&&!_){var k=ln(f),U=k.value,B=k.message;if(an(U)&&!U.test(o)&&(g[p]=Object.assign({type:"pattern",message:B,ref:i},b("pattern",B)),!t))return Promise.resolve(g)}var j=function(){if(v){var n=Xt(e,p,r,!1,!0),o=y&&a?a[0].ref:i;return un(v)?Promise.resolve(v(n)).then(function(e){var n=sn(e,o);if(n&&(g[p]=Object.assign(Object.assign({},n),b("validate",n.message)),!t))return m=!0,g}):function(){if(Dt(v)){var e=function(){if(!Yt(i)&&(g[p]=Object.assign({ref:o},i),!t))return m=!0,g},r=!1,i={},a=O(Object.entries(v),function(e){var a=e[0],l=e[1];if(Yt(i)||t)return Promise.resolve(l(n)).then(function(e){var n=sn(e,o,a);n&&(i=Object.assign(Object.assign({},n),b(a,n.message)),t&&(g[p]=i))});r=!0},function(){return r});return a&&a.then?a.then(e):e()}}()}}();return Promise.resolve(j&&j.then?j.then(function(e){return m?e:g}):m?j:g)}catch(e){return Promise.reject(e)}},vn=function e(t,n,r){for(var i in void 0===r&&(r=[]),n){var o=t+(Dt(n)?"."+i:"["+i+"]");Qt(n[i])?r.push(o):e(o,n[i],r)}return r},mn=function(e,t,n,r,i){var o=void 0;return n.add(t),Yt(e)||(o=kt(e,t),(Dt(o)||Array.isArray(o))&&vn(t,o).forEach(function(e){return n.add(e)})),Pt(o)?i?r:kt(r,t):o},pn=function(e){var t=e.isBlurEvent,n=e.isSubmitted;return!e.isOnAll&&(!n&&e.isOnTouch?!(e.isTouched||t):(n?e.isReValidateOnBlur:e.isOnBlur)?!t:!(n?e.isReValidateOnChange:e.isOnChange)||t)},gn=function(e){return e.substring(0,e.indexOf("["))},hn=function(e,t){return[].concat(e).some(function(e){return function(e,t){return RegExp(("^"+t+"([|.)\\d+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e)}(t,e)})},En="undefined"!=typeof window&&"undefined"!=typeof document;function yn(e){var t,n;if(Qt(e)||En&&(e instanceof File||Nt(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 new Date(e.getTime());if(e instanceof Set){n=new Set;for(var r,i=p(e);!(r=i()).done;)n.add(r.value);return n}if(e instanceof Map){n=new Map;for(var o,a=p(e.keys());!(o=a()).done;){var l=o.value;n.set(l,yn(e.get(l)))}return n}for(var u in n=Array.isArray(e)?[]:{},e)n[u]=yn(e[u]);return n}var _n=function(e){return{isOnSubmit:!e||"onSubmit"===e,isOnBlur:"onBlur"===e,isOnChange:"onChange"===e,isOnAll:"all"===e,isOnTouch:"onTouched"===e}},bn=function(e){return Ft(e)||Vt(e)},Cn="undefined"==typeof window,Sn=En?"Proxy"in window:"undefined"!=typeof Proxy,On=t.createContext(null);On.displayName="RHFContext";var wn=function(e){var n=e.as,r=e.render,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),o=function(e){var n=e.name,r=e.rules,i=e.defaultValue,o=e.control,a=e.onFocus,l=t.useContext(On);if("production"!==process.env.NODE_ENV&&!o&&!l)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");var u=o||l.control,c=u.defaultValuesRef,s=u.setValue,d=u.register,f=u.unregister,v=u.trigger,m=u.mode,p=u.reValidateMode,g=p.isReValidateOnBlur,h=p.isReValidateOnChange,E=u.formState,y=u.formStateRef.current,_=y.isSubmitted,b=y.touched,C=y.errors,S=u.updateFormState,O=u.readFormStateRef,w=u.fieldsRef,N=u.shallowFieldsStateRef,I=!hn(u.fieldArrayNamesRef.current,n),T=function(){return!Pt(kt(N.current,n))&&I?kt(N.current,n):Pt(i)?kt(c.current,n):i},D=t.useState(T()),A=D[0],L=D[1],R=t.useRef(A),x=t.useRef({focus:function(){return null}}),M=t.useRef(a||function(){un(x.current.focus)&&x.current.focus(),"production"!==process.env.NODE_ENV&&(un(x.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"))}),P=t.useCallback(function(e){return!pn(Object.assign({isBlurEvent:e,isReValidateOnBlur:g,isReValidateOnChange:h,isSubmitted:_,isTouched:!!kt(b,n)},m))},[g,h,_,b,n,m]),k=t.useCallback(function(e){var t,n=Qt(t=e[0])||!Dt(t.target)||Dt(t.target)&&!t.type?t:Pt(t.target.value)?t.target.checked:t.target.value;return L(n),R.current=n,n},[]),U=t.useCallback(function(e){if("production"!==process.env.NODE_ENV&&!n)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");w.current[n]?w.current[n]=Object.assign({ref:w.current[n].ref},r):(d(Object.defineProperties({name:n,focus:M.current},{value:{set:function(e){L(e),R.current=e},get:function(){return R.current}}}),r),e=Pt(kt(c.current,n))),e&&I&&L(T())},[r,n,d]);t.useEffect(function(){return function(){return f(n)}},[n]),t.useEffect(function(){"production"!==process.env.NODE_ENV&&(Pt(A)&&console.warn("📋 "+n+" 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)"),!I&&Pt(i)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),U()},[U]),t.useEffect(function(){!w.current[n]&&U(!0)});var B=t.useCallback(function(){O.current.touched&&!kt(b,n)&&(xt(b,n,!0),S({touched:b})),P(!0)&&v(n)},[n,S,P,v,O]);return{field:{onChange:t.useCallback(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s(n,k(t),{shouldValidate:P(),shouldDirty:!0})},[s,n,P]),onBlur:B,name:n,value:A,ref:x},meta:Object.defineProperties({invalid:!!kt(C,n)},{isDirty:{get:function(){return!!kt(E.dirtyFields,n)}},isTouched:{get:function(){return!!kt(E.touched,n)}}})}}(e),a=o.field,l=o.meta,u=Object.assign(Object.assign({},i),a);return n?t.isValidElement(n)?t.cloneElement(n,u):t.createElement(n,u):r?r(a,l):null},Nn=function(e){var r,i,u,c,s=e.popup,f=void 0!==s&&s,v=e.onClose,m=e.setShowToast,p=e.data,g=a.useTranslation().t,h=o.useHistory(),E=Digit.UserService.getUser(),y=Digit.Hooks.useQueryParams(),_=y.redirectedFrom,b=y.propertyId,C=y.acknowldgementNumber,S=y.creationReason,O=y.tenantId,w=y.locality,N=window.Digit.Utils.browser.isMobile();O=O||Digit.ULBService.getCurrentTenantId();var I=Digit.ULBService.getStateId(),T=Digit.Hooks.pt.useRatingAndFeedbackMDMS.RatingAndFeedBack(I),D=T.data,A=T.isLoading,L=t.useState(""),R=L[0],x=L[1],M=t.useState(0),P=M[0],k=M[1];if(A)return n.createElement(l.Loader,null);var U,B,j,F=function(e){var t,n,r=null==D||null===(t=D.enabledScreensList)||void 0===t||null===(n=t.filter(function(e){var t,n,r;return"PT"===(null==e?void 0:e.module)&&((null==_?void 0:_.includes(null==e?void 0:e.screenfrom))||(null==e||null===(t=e.bussinessService)||void 0===t?void 0:t.includes(null==p||null===(n=p.Properties)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.creationReason)))}))||void 0===n?void 0:n[0];return"Header"===e?null==r?void 0:r.cardHeader:"Text"===e?null==r?void 0:r.cardText:void 0};return n.createElement(n.Fragment,null,n.createElement("form",null,n.createElement(l.Card,null,n.createElement("div",{style:f?{display:"flex",justifyContent:"space-between"}:{}},n.createElement(l.CardHeader,null,g(F("Header"))||g("PT_RATE_HELP_TEXT")),f&&n.createElement("span",{style:{marginTop:"8px"},onClick:function(){return v(!1)}},n.createElement(l.CloseSvg,null))),n.createElement(l.CardText,null,g(F("Text"),{acknowldgementNumber:C||(null==p||null===(r=p.Properties)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.acknowldgementNumber),propertyId:b||(null==p||null===(u=p.Properties)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.propertyId)})||g("PT_RATE_TEXT")),n.createElement(l.Rating,{styles:{justifyContent:"center"},currentRating:P,maxRating:5,onFeedback:function(e,t,n){k(n)}}),0!==P&&n.createElement("div",null,n.createElement(l.CardLabel,null,g((null==D||null===(U=D.headerByRating)||void 0===U||null===(B=U.filter(function(e){return P>=(null==e?void 0:e.minvalue)&&P<=(null==e?void 0:e.maxvalue)}))||void 0===B||null===(j=B[0])||void 0===j?void 0:j.code)||g("CS_WHAT_WENT_WRONG"))),n.createElement(l.TextArea,{name:"",minLength:"50",onChange:function(e){x(e.target.value)}}),R&&(null==R?void 0:R.length)<50&&n.createElement(l.CardLabelError,null,g("CS_MIN_LENGTH_50"))),n.createElement(l.SubmitBar,{label:g("PT_SUBMIT"),onSubmit:function(){var e,t,n,r,i={},o={tenantId:(null==p||null===(e=p.Properties)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.tenantId)||O,code:["PT_"+(null!=_&&_.includes("payment")?"PAYMENT":S||(null==p||null===(n=p.Properties)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.creationReason))],module:["PT"]};Digit.PTService.cfdefinitionsearch({filters:{ServiceDefinitionCriteria:o}}).then(function(e,t){var n,r,o,a,l,u,c,s,g,y,_,S,N,I;(null==e||null===(n=e.ServiceDefinition)||void 0===n?void 0:n.length)>0&&(i=d({},i={tenantId:(null==p||null===(r=p.Properties)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.tenantId)||O,serviceDefId:null==e||null===(a=e.ServiceDefinition)||void 0===a||null===(l=a[0])||void 0===l?void 0:l.id,isActive:!0,attributes:[{attributeCode:"consumerCode",value:b||(null==p||null===(u=p.Properties)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.propertyId),additionalDetails:{}},{attributeCode:"rating",value:P,additionalDetails:{}},{attributeCode:"comments",value:R,additionalDetails:{}},{attributeCode:"channel",value:"Online",additionalDetails:{}}],additionalDetails:{locality:w||(null==p||null===(s=p.Properties)||void 0===s||null===(g=s[0])||void 0===g||null===(y=g.address)||void 0===y||null===(_=y.locality)||void 0===_?void 0:_.code)||""},accountId:null==E||null===(S=E.info)||void 0===S?void 0:S.uuid},{referenceId:C||(null==p||null===(N=p.Properties)||void 0===N||null===(I=N[0])||void 0===I?void 0:I.acknowldgementNumber)}),Digit.PTService.cfcreate({Service:d({},i)},O).then(function(e,t){var n;(null==e||null===(n=e.Service)||void 0===n?void 0:n.length)>0&&(f?(v(!1),m({key:!1,label:"PT_FEEDBACK_SUBMITTED_SUCCESSFULLY"})):h.push({pathname:"/digit-ui/citizen/feedback-acknowledgement",state:{rating:P,comment:R,result:e}}))}).catch(function(e){var t,n,r;m({key:"error",label:""+(null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.Errors[0])||void 0===r?void 0:r.message)})}))})},disabled:!!(R&&(null==R?void 0:R.length)<50)||!P}),!f&&n.createElement("div",{className:"link",style:N?{marginTop:"8px",width:"100%",textAlign:"center"}:{marginTop:"8px"}},n.createElement(o.Link,{to:"/digit-ui/citizen"},g("CS_GO_BACK_HOME"))))))},In=function(e){var r=e.control,i=e.t,o=window.Digit.Utils.browser.isMobile();return n.createElement(t.Fragment,null,n.createElement(l.SearchField,{className:"pt-form-field"},n.createElement("label",null,i("AUDIT_FROM_DATE_LABEL")),n.createElement(wn,{render:function(e){return n.createElement(l.DatePicker,{date:e.value,onChange:e.onChange})},name:"fromDate",control:r})),n.createElement(l.SearchField,{className:"pt-form-field"},n.createElement("label",null,i("AUDIT_TO_DATE_LABEL")),n.createElement(wn,{render:function(e){return n.createElement(l.DatePicker,{date:e.value,onChange:e.onChange})},name:"toDate",control:r})),n.createElement(l.SearchField,{className:"pt-search-action-submit"},n.createElement(l.SubmitBar,{style:{marginTop:o?"510px":"25px",marginLeft:o?"0":"-30px",maxWidth:o?"100%":"240px"},label:i("ES_COMMON_APPLY"),submit:!0})))},Tn=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],Dn=["currentlyActiveMobileModal","searchFormFieldsComponentProps","tenantId"],An=function(e){var r,i=e.Controller,o=e.register,a=e.control,u=e.t,c=e.reset,s=e.previousPage,f=e.handleSubmit,m=e.tenantId,p=e.data,g=e.onSubmit,h=e.isLoading,E=t.useState([]),y=E[0],_=E[1],b=function(e){return n.createElement("div",{onClick:e.onClick},n.createElement(l.DownloadBtnCommon,null))};t.useEffect(function(){(null==p?void 0:p.length)>0&&_([null==p?void 0:p.map(function(e){var t,n,r={};return r[u("AUDIT_DATE_LABEL")]=C(null==e?void 0:e.timestamp)||"-",r[u("AUDIT_TIME_LABEL")]=S(null==e?void 0:e.timestamp)||"-",r[u("AUDIT_DATAVIEWED_LABEL")]=(null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",r[u("AUDIT_DATAVIEWED_BY_LABEL")]=(null==e?void 0:e.dataViewedBy)||"-",r[u("AUDIT_ROLE_LABEL")]=(null==e||null===(n=e.roles)||void 0===n?void 0:n.map(function(e){return e.name}).join(", "))||"-",d({},r)})])},[p]);var C=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},S=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},O=t.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),w=O[0],N=O[1],I=function(){N({type:"remove"})},T=function(){return n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:I},n.createElement(l.CloseSvg,null))},D={Controller:i,register:o,control:a,t:u,reset:c,previousPage:s},A=t.useCallback(function(e){return function(e){var t=e.currentlyActiveMobileModal,r=e.searchFormFieldsComponentProps,i=e.tenantId,o=v(e,Tn),a=o.closeMobilePopupModal;switch(t){case"SearchFormComponent":return n.createElement(l.SearchForm,o,n.createElement(T,null),n.createElement("div",{className:"MobilePopupHeadingWrapper"},n.createElement("h2",null,u("PRIVACY_AUDIT_REPORT"),":")),n.createElement(In,d({},r,{closeMobilePopupModal:a,tenantId:i,t:u})));default:return n.createElement("span",null)}}(d({currentlyActiveMobileModal:e.currentlyActiveMobileModal,searchFormFieldsComponentProps:e.searchFormFieldsComponentProps,tenantId:e.tenantId},v(e,Dn)))},[w]);null==p||null===(r=p.roles)||void 0===r||r.forEach(function(e){});var L=t.useMemo(function(){return null!=p&&p.display||""===p?[]:null==p?void 0:p.map(function(e){var t,n,r,i;return(i={})[u("AUDIT_DATE_LABEL")]=C(e.timestamp)||"-",i[u("AUDIT_TIME_LABEL")]=S(e.timestamp)||"-",i[u("AUDIT_DATAVIEWED_LABEL")]=(null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",i[u("AUDIT_DATAVIEWED_BY_LABEL")]=e.dataViewedBy||"-",i[u("AUDIT_ROLE_LABEL")]=(null===(n=e.roles)||void 0===n||null===(r=n.slice(0,3))||void 0===r?void 0:r.map(function(e){return e.name}).join(", "))||"-",i})},[p]);return n.createElement(n.Fragment,null,n.createElement(l.BackButton,null),n.createElement("div",{className:"sideContent",style:{marginLeft:"65%",marginTop:"-12%"}},n.createElement(b,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(y)}})),n.createElement(l.Header,null,u("PRIVACY_AUDIT_REPORT"),":"),n.createElement("div",{className:"searchBox"},n.createElement(l.SearchAction,{text:u("ES_COMMON_SEARCH"),handleActionClick:function(){return N({type:"set",payload:"SearchFormComponent"})},tenantId:m,t:u})),w?n.createElement(l.PopUp,null,n.createElement(A,{onSubmit:function(e){N({type:"remove"}),g(e)},handleSubmit:f,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:D,currentlyActiveMobileModal:w,closeMobilePopupModal:I,tenantId:m})):null,h&&n.createElement(l.Loader,null),n.createElement(l.DetailsCard,{data:L}))},Ln=function(e){var r=e.showLoader,i=e.isLoading,o=e.tenantId,a=e.t,u=e.onSubmit,c=e.data,s=e.count,f=function(e){var n=void 0===e?{}:e,r=n.mode,i=void 0===r?"onSubmit":r,o=n.reValidateMode,a=void 0===o?"onChange":o,l=n.resolver,u=n.context,c=n.defaultValues,s=void 0===c?{}:c,d=n.shouldFocusError,f=void 0===d||d,v=n.shouldUnregister,m=void 0===v||v,g=n.criteriaMode,h=t.useRef({}),E=t.useRef({}),y=t.useRef({}),_=t.useRef(new Set),b=t.useRef({}),C=t.useRef({}),S=t.useRef({}),w=t.useRef({}),N=t.useRef(s),I=t.useRef(!1),T=t.useRef(!1),D=t.useRef(),A=t.useRef({}),L=t.useRef({}),R=t.useRef(u),x=t.useRef(l),M=t.useRef(new Set),P=t.useRef(_n(i)),k=P.current,U=k.isOnSubmit,B=k.isOnTouch,j="all"===g,F=t.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!U,errors:{}}),z=F[0],V=F[1],W=t.useRef({isDirty:!Sn,dirtyFields:!Sn,touched:!Sn||B,isValidating:!Sn,isSubmitting:!Sn,isValid:!Sn}),H=t.useRef(z),G=t.useRef(),q=t.useRef(_n(a)).current,X=q.isOnBlur,Z=q.isOnChange;R.current=u,x.current=l,H.current=z,A.current=m?{}:Yt(A.current)?yn(s):A.current;var Y=t.useCallback(function(e){void 0===e&&(e={}),I.current||(H.current=Object.assign(Object.assign({},H.current),e),V(H.current))},[]),K=function(){return W.current.isValidating&&Y({isValidating:!0})},$=t.useCallback(function(e,t,n,r,i){void 0===n&&(n=!1),void 0===r&&(r={});var o=n||function(e){var t=e.errors,n=e.name,r=e.error,i=e.validFields,o=e.fieldsWithValidation,a=Pt(r),l=kt(t,n);return a&&!!l||!a&&!tn(l,r,!0)||a&&kt(o,n)&&!kt(i,n)}({errors:H.current.errors,error:t,name:e,validFields:w.current,fieldsWithValidation:S.current}),a=kt(H.current.errors,e);t?($t(w.current,e),o=o||!a||!tn(a,t,!0),xt(H.current.errors,e,t)):((kt(S.current,e)||x.current)&&(xt(w.current,e,!0),o=o||a),$t(H.current.errors,e)),(o&&!It(n)||!Yt(r)||W.current.isValidating)&&Y(Object.assign(Object.assign(Object.assign({},r),x.current?{isValid:!!i}:{}),{isValidating:!1}))},[]),J=t.useCallback(function(e,t){var n=h.current[e],r=n.ref,i=n.options,o=En&&Nt(r)&&It(t)?"":t;Ft(r)?(i||[]).forEach(function(e){var t=e.ref;return t.checked=t.value===o}):zt(r)&&!rn(o)?r.files=o:Wt(r)?[].concat(r.options).forEach(function(e){return e.selected=o.includes(e.value)}):Vt(r)&&i?i.length>1?i.forEach(function(e){var t=e.ref;return t.checked=Array.isArray(o)?!!o.find(function(e){return e===t.value}):o===t.value}):i[0].ref.checked=!!o:r.value=o},[]),Q=t.useCallback(function(e,t){if(W.current.isDirty){var n=ce();return e&&t&&xt(n,e,t),!tn(n,N.current)}return!1},[]),ee=t.useCallback(function(e,t){if(void 0===t&&(t=!0),W.current.isDirty||W.current.dirtyFields){var n=!tn(kt(N.current,e),Xt(h,e,A)),r=kt(H.current.dirtyFields,e),i=H.current.isDirty;n?xt(H.current.dirtyFields,e,!0):$t(H.current.dirtyFields,e);var o={isDirty:Q(),dirtyFields:H.current.dirtyFields},a=W.current.isDirty&&i!==o.isDirty||W.current.dirtyFields&&r!==kt(H.current.dirtyFields,e);return a&&t&&Y(o),a?o:{}}return{}},[]),te=t.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||h.current[e]?Promise.resolve(fn(h,j,h.current[e],A)).then(function(n){var r=n[e];return $(e,r,t),Pt(r)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[$,j]),ne=t.useCallback(function(e){try{return Promise.resolve(x.current(ce(),R.current,j)).then(function(t){var n=t.errors,r=H.current.isValid;if(Array.isArray(e)){var i=e.map(function(e){var t=kt(n,e);return t?xt(H.current.errors,e,t):$t(H.current.errors,e),!t}).every(Boolean);return Y({isValid:Yt(n),isValidating:!1}),i}var o=kt(n,e);return $(e,o,r!==Yt(n),{},Yt(n)),!o})}catch(e){return Promise.reject(e)}},[$,j]),re=t.useCallback(function(e){try{var t=function(e){return n?e:Promise.resolve(te(r))},n=!1,r=e||Object.keys(h.current);if(K(),x.current)return Promise.resolve(ne(r));var i=function(){if(Array.isArray(r))return!e&&(H.current.errors={}),Promise.resolve(Promise.all(r.map(function(e){try{return Promise.resolve(te(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){Y({isValidating:!1});var t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(i&&i.then?i.then(t):t(i))}catch(e){return Promise.reject(e)}},[ne,te]),ie=t.useCallback(function(e,t,n){var r=n.shouldDirty,i=n.shouldValidate,o={};xt(o,e,t);for(var a,l=p(vn(e,t));!(a=l()).done;){var u=a.value;h.current[u]&&(J(u,kt(o,u)),r&&ee(u),i&&re(u))}},[re,J,ee]),oe=t.useCallback(function(e,t,n){if(!m&&!Qt(t)&&xt(A.current,e,Array.isArray(t)?[].concat(t):Object.assign({},t)),h.current[e])J(e,t),n.shouldDirty&&ee(e),n.shouldValidate&&re(e);else if(!Qt(t)&&(ie(e,t,n),M.current.has(e))){var r,i,o=gn(e)||e;xt(E.current,e,t),L.current[o](((r={})[o]=kt(E.current,o),r)),(W.current.isDirty||W.current.dirtyFields)&&n.shouldDirty&&(xt(H.current.dirtyFields,e,function(e,t,n){return en(nn(e,t,n.slice(0,e.length)),nn(t,e,n.slice(0,e.length)))}(t,kt(N.current,e,[]),kt(H.current.dirtyFields,e,[]))),Y({isDirty:!tn(Object.assign(Object.assign({},ce()),(i={},i[e]=t,i)),N.current)}))}!m&&xt(A.current,e,t)},[ee,J,ie]),ae=function(e){return T.current||_.current.has(e)||_.current.has((e.match(/\w+/)||[])[0])},le=function(e){var t=!0;if(!Yt(b.current))for(var n in b.current)e&&b.current[n].size&&!b.current[n].has(e)&&!b.current[n].has(gn(e))||(C.current[n](),t=!1);return t};function ue(e){if(!m){for(var t,n=yn(e),r=p(M.current);!(t=r()).done;){var i,o=t.value;At(o)&&!n[o]&&(n=Object.assign(Object.assign({},n),((i={})[o]=[],i)))}return n}return e}function ce(e){if(rn(e))return Xt(h,e,A);if(Array.isArray(e)){for(var t,n={},r=p(e);!(t=r()).done;){var i=t.value;xt(n,i,Xt(h,i,A))}return n}return ue(on(h,yn(A.current),m))}D.current=D.current?D.current:function(e){var t=e.type,n=e.target;try{var r,i,o=n.name,a=h.current[o];return Promise.resolve(function(){if(a){var e=function(){!l&&le(o),$(o,r,s,c,i)},l="blur"===t,u=pn(Object.assign({isBlurEvent:l,isReValidateOnChange:Z,isReValidateOnBlur:X,isTouched:!!kt(H.current.touched,o),isSubmitted:H.current.isSubmitted},P.current)),c=ee(o,!1),s=!Yt(c)||!l&&ae(o);if(l&&!kt(H.current.touched,o)&&W.current.touched&&(xt(H.current.touched,o,!0),c=Object.assign(Object.assign({},c),{touched:H.current.touched})),!m&&Vt(n)&&xt(A.current,o,Xt(h,o)),u)return!l&&le(o),(!Yt(c)||s&&Yt(c))&&Y(c);K();var d=x.current?Promise.resolve(x.current(ce(),R.current,j)).then(function(e){var t=e.errors,a=H.current.isValid;if(r=kt(t,o),Vt(n)&&!r&&x.current){var l=gn(o),u=kt(t,l,{});u.type&&u.message&&(r=u),l&&(u||kt(H.current.errors,l))&&(o=l)}a!==(i=Yt(t))&&(s=!0)}):Promise.resolve(fn(h,j,a,A)).then(function(e){r=e[o]});return d&&d.then?d.then(e):e()}}())}catch(e){return Promise.reject(e)}};var se=t.useCallback(function(e){void 0===e&&(e={});try{var t=Yt(h.current)?N.current:{};return Promise.resolve(x.current(Object.assign(Object.assign(Object.assign({},t),ce()),e),R.current,j)).then(function(e){var t=Yt(e.errors);H.current.isValid!==t&&Y({isValid:t})})}catch(e){return Promise.reject(e)}},[j]),de=t.useCallback(function(e,t){!function(e,t,n,r,i,o){var a=n.ref,l=n.ref.name,u=e.current[l];if(!i){var c=Xt(e,l,r);!Pt(c)&&xt(r.current,l,c)}a.type&&u?Ft(a)||Vt(a)?Array.isArray(u.options)&&u.options.length?(Lt(u.options).forEach(function(e,n){void 0===e&&(e={}),(Zt(e.ref)&&Jt(e,e.ref)||o)&&(Ut(e.ref,t),$t(u.options,"["+n+"]"))}),u.options&&!Lt(u.options).length&&delete e.current[l]):delete e.current[l]:(Zt(a)&&Jt(u,a)||o)&&(Ut(a,t),delete e.current[l]):delete e.current[l]}(h,D.current,e,A,m,t),m&&($t(w.current,e.ref.name),$t(S.current,e.ref.name))},[m]),fe=t.useCallback(function(e){if(T.current)Y();else{for(var t,n=p(_.current);!(t=n()).done;)if(t.value.startsWith(e)){Y();break}le(e)}},[]),ve=t.useCallback(function(e,t){e&&(de(e,t),m&&!Lt(e.options||[]).length&&($t(H.current.errors,e.ref.name),xt(H.current.dirtyFields,e.ref.name,!0),Y({isDirty:Q()}),W.current.isValid&&x.current&&se(),fe(e.ref.name)))},[se,de]),me=t.useCallback(function(e,t,n){var r=n?b.current[n]:_.current,i=on(h,yn(A.current),m,!1,e);if(rn(e)){var o=gn(e)||e;return M.current.has(o)&&(i=Object.assign(Object.assign({},y.current),i)),mn(i,e,r,Pt(kt(N.current,e))?t:kt(N.current,e),!0)}var a=Pt(t)?N.current:t;return Array.isArray(e)?e.reduce(function(e,t){var n;return Object.assign(Object.assign({},e),((n={})[t]=mn(i,t,r,a),n))},{}):(T.current=Pt(n),Mt(!Yt(i)&&i||a))},[]);function pe(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(M.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")}var n,r=e.name,i=e.type,o=e.value,a=Object.assign({ref:e},t),l=h.current,u=bn(e),c=hn(M.current,r),s=function(t){return En&&(!Nt(e)||t===e)},d=l[r],f=!0;if(d&&(u?Array.isArray(d.options)&&Lt(d.options).find(function(e){return o===e.ref.value&&s(e.ref)}):s(d.ref)))l[r]=Object.assign(Object.assign({},d),t);else{d=i?u?Object.assign({options:[].concat(Lt(d&&d.options||[]),[{ref:e}]),ref:{type:i,name:r}},t):Object.assign({},a):a,l[r]=d;var v=Pt(kt(A.current,r));Yt(N.current)&&v||(n=kt(v?N.current:A.current,r),(f=Pt(n))||c||J(r,n)),Yt(t)||(xt(S.current,r,!0),!U&&W.current.isValid&&fn(h,j,d,A).then(function(e){var t=H.current.isValid;Yt(e)?xt(w.current,r,!0):$t(w.current,r),t!==Yt(e)&&Y()})),!m||c&&f||!c&&$t(H.current.dirtyFields,r),i&&function(e,t,n){var r=e.ref;Nt(r)&&n&&(r.addEventListener(t?"change":"input",n),r.addEventListener("blur",n))}(u&&d.options?d.options[d.options.length-1]:d,u||"select-one"===e.type,D.current)}}var ge=t.useCallback(function(e,t){return function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());var r={},i=ue(on(h,yn(A.current),m,!0));return W.current.isSubmitting&&Y({isSubmitting:!0}),Promise.resolve(function(o,a){try{var l=function(){function o(){var o=function(){if(Yt(r)&&Object.keys(H.current.errors).every(function(e){return e in h.current}))return Y({errors:{},isSubmitting:!0}),Promise.resolve(e(i,n)).then(function(){});var o=function(e){f&&function(e,t){for(var n in e)if(kt(t,n)){var r=e[n];if(r){if(r.ref.focus&&Pt(r.ref.focus()))break;if(r.options){r.options[0].ref.focus();break}}}}(h.current,H.current.errors)};return H.current.errors=Object.assign(Object.assign({},H.current.errors),r),t?Promise.resolve(t(H.current.errors,n)).then(o):o()}();if(o&&o.then)return o.then(function(){})}var a=x.current?Promise.resolve(x.current(i,R.current,j)).then(function(e){var t=e.values;H.current.errors=r=e.errors,i=t}):O(Object.values(h.current),function(e){var t=function(){if(e){var t=e.ref.name;return Promise.resolve(fn(h,j,e,A)).then(function(e){e[t]?(xt(r,t,e[t]),$t(w.current,t)):kt(S.current,t)&&($t(H.current.errors,t),xt(w.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return a&&a.then?a.then(o):o()}()}catch(e){return a(!0,e)}return l&&l.then?l.then(a.bind(null,!1),a.bind(null,!0)):a(!1,l)}(0,function(e,t){if(H.current.isSubmitting=!1,Y({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Yt(H.current.errors),submitCount:H.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}}},[f,j]);t.useEffect(function(){l&&W.current.isValid&&se(),G.current=G.current||!En?G.current:function(e,t){var n=new MutationObserver(function(){for(var n=0,r=Object.values(e.current);n<r.length;n++){var i=r[n];if(i&&i.options)for(var o,a=p(i.options);!(o=a()).done;){var l=o.value;l&&l.ref&&Zt(l.ref)&&t(i)}else i&&Zt(i.ref)&&t(i)}});return n.observe(window.document,{childList:!0,subtree:!0}),n}(h,ve)},[ve,N.current]),t.useEffect(function(){return function(){G.current&&G.current.disconnect(),I.current=!0,"production"===process.env.NODE_ENV&&Object.values(h.current).forEach(function(e){return ve(e,!0)})}},[]),!l&&W.current.isValid&&(z.isValid=tn(w.current,S.current)&&Yt(H.current.errors));var he={trigger:re,setValue:t.useCallback(function(e,t,n){oe(e,t,n||{}),ae(e)&&Y(),le(e)},[oe,re]),getValues:t.useCallback(ce,[]),register:t.useCallback(function(e,t){if(!Cn)if(rn(e))pe({name:e},t);else{if(!Dt(e)||!("name"in e))return function(t){return t&&pe(t,e)};pe(e,t)}},[N.current]),unregister:t.useCallback(function(e){for(var t,n=p(Array.isArray(e)?e:[e]);!(t=n()).done;)ve(h.current[t.value],!0)},[]),formState:Sn?new Proxy(z,{get:function(e,t){if("production"!==process.env.NODE_ENV&&"isValid"===t&&U&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return W.current[t]=!0,e[t]}}):z},Ee=t.useMemo(function(){return Object.assign({isFormDirty:Q,updateWatchedValue:fe,shouldUnregister:m,updateFormState:Y,removeFieldEventListener:de,watchInternal:me,mode:P.current,reValidateMode:{isReValidateOnBlur:X,isReValidateOnChange:Z},validateResolver:l?se:void 0,fieldsRef:h,resetFieldArrayFunctionRef:L,useWatchFieldsRef:b,useWatchRenderFunctionsRef:C,fieldArrayDefaultValuesRef:E,validFieldsRef:w,fieldsWithValidationRef:S,fieldArrayNamesRef:M,readFormStateRef:W,formStateRef:H,defaultValuesRef:N,shallowFieldsStateRef:A,fieldArrayValuesRef:y},he)},[N.current,fe,m,de,me]);return Object.assign({watch:function(e,t){return me(e,t)},control:Ee,handleSubmit:ge,reset:t.useCallback(function(e,t){if(void 0===t&&(t={}),En)for(var n=0,r=Object.values(h.current);n<r.length;n++){var i=r[n];if(i){var o=i.ref,a=i.options,l=bn(o)&&Array.isArray(a)?a[0].ref:o;if(Nt(l))try{l.closest("form").reset();break}catch(e){}}}var u,c,s,d,f,v,p,g;h.current={},N.current=Object.assign({},e||N.current),e&&le(""),Object.values(L.current).forEach(function(e){return un(e)&&e()}),A.current=m?{}:yn(e||N.current),c=(u=t).errors,s=u.isDirty,d=u.isSubmitted,f=u.touched,p=u.submitCount,g=u.dirtyFields,(v=u.isValid)||(w.current={},S.current={}),E.current={},_.current=new Set,T.current=!1,Y({submitCount:p?H.current.submitCount:0,isDirty:!!s&&H.current.isDirty,isSubmitted:!!d&&H.current.isSubmitted,isValid:!!v&&H.current.isValid,dirtyFields:g?H.current.dirtyFields:{},touched:f?H.current.touched:{},errors:c?H.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},[]),clearErrors:t.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(function(e){return h.current[e]&&At(e)?delete H.current.errors[e]:$t(H.current.errors,e)}),Y({errors:e?H.current.errors:{}})},[]),setError:t.useCallback(function(e,t){var n=(h.current[e]||{}).ref;xt(H.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),Y({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:z.errors},he)}({defaultValues:Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:10,sortOrder:"ASC"}}),v=f.register,m=f.control,g=f.handleSubmit,h=f.setValue,E=f.getValues,y=f.reset,_=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getMonth()+1,r=t.getDate();return(r=(r>9?"":"0")+r)+"/"+(n=(n>9?"":"0")+n)+"/"+t.getFullYear()},b=function(e){if(null==e||null==e||""==e)return"NA";var t=new Date(e),n=t.getHours(),r=t.getMinutes(),i=n>12?"PM":"AM";return(n=((n=n>12?n-12:n)>9?"":"0")+n)+":"+(r=(r>9?"":"0")+r)+" "+i},C=t.useState([]),S=C[0],w=C[1],N=function(e){return n.createElement("div",{onClick:e.onClick},n.createElement(l.DownloadBtnCommon,null))};t.useEffect(function(){v("offset",0),v("limit",10)},[v]),t.useEffect(function(){(null==c?void 0:c.length)>0&&w([null==c?void 0:c.map(function(e){var t,n,r={};return r[a("AUDIT_DATE_LABEL")]=_(null==e?void 0:e.timestamp)||"-",r[a("AUDIT_TIME_LABEL")]=b(null==e?void 0:e.timestamp)||"-",r[a("AUDIT_DATAVIEWED_LABEL")]=(null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-",r[a("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,r[a("AUDIT_ROLE_LABEL")]=(null==e||null===(n=e.roles)||void 0===n?void 0:n.map(function(e){return e.name}).join(", "))||"-",d({},r)})])},[c]);var I=t.useCallback(function(e){0!==e.length&&(h("sortBy",e.id),h("sortOrder",e.desc?"DESC":"ASC"))},[]);function T(){h("offset",E("offset")-E("limit")),g(u)()}var D=window.Digit.Utils.browser.isMobile();if(D)return n.createElement(An,{Controller:wn,isLoading:i,showLoader:r,register:v,control:m,t:a,reset:y,previousPage:T,handleSubmit:g,tenantId:o,data:c,onSubmit:u});var A=function(e){return n.createElement("span",{className:"cell-text"},e)},L=t.useMemo(function(){return[{Header:a("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?a("WS_NA"):_(e.timestamp);return A(""+(t||"-"))}},{Header:a("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:function(e){var t="NA"===e.timestamp?a("WS_NA"):b(e.timestamp);return A(""+(t||"-"))}},{Header:a(D?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:function(e){var t;return A(""+((null==e||null===(t=e.dataView)||void 0===t?void 0:t.join(", "))||"-"))}},{Header:a(D?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:function(e){return A(""+((null==e?void 0:e.dataViewedBy)||"-"))}},{Header:a("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:function(e){var t,n,r;return A(""+((null==e||null===(t=e.roles)||void 0===t||null===(n=t.slice(0,3))||void 0===n||null===(r=n.map(function(e){return e.name}))||void 0===r?void 0:r.join(", "))||"-"))}}]},[]);return n.createElement(n.Fragment,null,n.createElement("div",{style:{marginRight:"-70px"}}," ",n.createElement(l.BackButton,null)," "),n.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",n.createElement(l.Header,null,a("PRIVACY_AUDIT_REPORT"))," "),n.createElement(l.SearchForm,{className:"audit-card",onSubmit:u,handleSubmit:g},n.createElement(In,{register:v,control:m,reset:y,tenantId:o,t:a,previousPage:T})),n.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",width:"80%"}},null!=c&&c.display?n.createElement("div",{style:{marginTop:"20x",maxWidth:"680%",marginLeft:"60px",backgroundColor:"white",height:"60px"}},a(c.display).split("\\n").map(function(e,t){return n.createElement("p",{key:t,style:{textAlign:"center",paddingTop:"12px"}},e)})):""!==c?n.createElement("div",{style:{backgroundColor:"white",marginRight:"200px",marginLeft:"2.5%",width:"100%"}},n.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},n.createElement(N,{className:"mrlg cursorPointer",onClick:function(){return function(e){if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")}(S)}})),n.createElement(l.Table,{t:a,data:c.sort(function(e,t){return e.timestamp-t.timestamp}),totalRecords:s,columns:L,getCellProps:function(e){return{style:{minWidth:e.column.Header===a("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}},onPageSizeChange:function(e){h("limit",Number(e.target.value)),g(u)()},currentPage:E("offset")/E("limit"),onNextPage:function(){h("offset",E("offset")+E("limit")),g(u)()},onPrevPage:T,pageSizeLimit:E("limit"),onSort:I,disableSort:!1,sortParams:[{id:E("sortBy"),desc:"DESC"===E("sortOrder")}]})):n.createElement(l.Loader,null)))},Rn=function(e){var r,i,l,u,c,s,f,v,m,p,g=a.useTranslation().t,h=Digit.ULBService.getCitizenCurrentTenant(),E=t.useState({}),y=E[0],_=E[1],b=window.Digit.Utils.browser.isMobile(),C=function(e,t){void 0===t&&(t="dayend");try{var n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),r=new Date(Date.UTC(n[1],n[2]-1,n[3]));return r.setMinutes(r.getMinutes()+r.getTimezoneOffset()),"dayend"===t&&(r.setHours(r.getHours()+24),r.setSeconds(r.getSeconds()-1)),"daystart"===t&&(r.setHours(r.getHours()),r.setSeconds(r.getSeconds()+1)),r.getTime()}catch(t){return e}};t.useEffect(function(){var e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){var t=d({},e);_(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]="object"==typeof t[n]?t[n].code:t[n],r))},{}))}},[]);var S,O,w={enabled:!!(y&&Object.keys(y).length>0)},N=window.location.href.split("/").pop();isNaN(parseInt(N))?S=10:(O=N,S=parseInt(N)+10);var I=b?d({},y,{offset:isNaN(parseInt(N))?0:parseInt(O)}):d({},y),T=Digit.Hooks.useAudit({tenantId:h,filters:d({},I),config:w}),D=T.isLoading,A=T.data;return n.createElement(n.Fragment,null,n.createElement(Ln,{t:g,tenantId:h,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:10});var t=d({},e,{fromDate:C(null==e?void 0:e.fromDate,(null==e?void 0:e.fromDate)==(null==e?void 0:e.toDate)?"daystart":""),toDate:C(null==e?void 0:e.toDate,(null==e?void 0:e.fromDate)==(null==e?void 0:e.toDate)?"dayend":"")});_(Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){var r;return d({},e,((r={})[n]=t[n],r))},{}))},data:D?"":(null==A||null===(r=A.ElasticSearchData)||void 0===r||null===(i=r.filter(function(e){return!e.total}))||void 0===i?void 0:i.length)>0?null==A||null===(l=A.ElasticSearchData)||void 0===l?void 0:l.filter(function(e){return!e.total}):{display:"ES_COMMON_NO_DATA"},count:null==A||null===(u=A.ElasticSearchData)||void 0===u||null===(c=u.filter(function(e){return e.total}))||void 0===c||null===(s=c[0])||void 0===s?void 0:s.total,isLoading:D}),b&&(null==A||null===(f=A.ElasticSearchData)||void 0===f||null===(v=f.filter(function(e){return!e.total}))||void 0===v?void 0:v.length)&&0!==(null==A||null===(m=A.ElasticSearchData)||void 0===m||null===(p=m.filter(function(e){return!e.total}))||void 0===p?void 0:p.length)&&n.createElement("div",null,n.createElement("p",{style:{marginLeft:"16px",marginBottom:"40px"}},n.createElement("span",{className:"link"},n.createElement(o.Link,{to:"/digit-ui/citizen/Audit/"+S},g("PT_LOAD_MORE_MSG"))))))},xn=["digit-ui/citizen/register/name","/digit-ui/citizen/select-language","/digit-ui/citizen/select-location","/digit-ui/citizen/login","/digit-ui/citizen/register/otp"],Mn=function(e,t){return t.filter(function(t){return e.map(function(e){return e.code}).includes(t.code)})},Pn=function(e){var t,r,i,u=e.stateInfo,c=e.userDetails,s=e.CITIZEN,d=e.cityDetails,f=e.mobileView,v=e.handleUserDropdownSelection,m=e.logoUrl,p=e.stateCode,h=e.modules,E=e.appTenants,_=e.pathname,b=e.initData,C=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:"[?(@.url == 'digit-ui-card')]"}],{select:function(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(function(e){return!0===e.enabled}).reduce(function(e,t){var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t].concat(e[t.parentModule]):[t],e},{})}}),S=C.isLoading,O=C.data,w=C.isFetched,N=Digit.Hooks.fsm.useRouteSubscription(_),I=a.useTranslation().t,T=o.useRouteMatch().path,D=o.useHistory(),A=xn.some(function(e){return window.location.href.includes(e)}),L=h.map(function(e,t){var r=e.code,i=e.tenants,a=Digit.ComponentRegistryService.getComponent(r+"Module");return a?n.createElement(o.Route,{key:t,path:T+"/"+r.toLowerCase()},n.createElement(a,{stateCode:p,moduleCode:r,userType:"citizen",tenants:Mn(i,E)})):null}),R=h.map(function(e,t){var r=e.code,i=e.bannerImage,a=(Digit.ComponentRegistryService.getComponent(r+"Links"),w?g(O,r,I):void 0);return(null==a?void 0:a.links)&&(null==a||a.links.sort(function(e,t){return e.orderNumber-t.orderNumber})),n.createElement(n.Fragment,null,n.createElement(o.Route,{key:t,path:T+"/"+r.toLowerCase()+"-home"},n.createElement("div",{className:"moduleLinkHomePage"},n.createElement("img",{src:i||(null==u?void 0:u.bannerUrl),alt:"noimagefound"}),n.createElement(l.BackButton,{className:"moduleLinkHomePageBackButton"}),n.createElement("h1",null,I("MODULE_"+r.toUpperCase())),n.createElement("div",{className:"moduleLinkHomePageModuleLinks"},a&&n.createElement(l.CitizenHomeCard,{header:I(null==a?void 0:a.header),links:null==a?void 0:a.links,Icon:function(){return n.createElement("span",null)},Info:"OBPS"===r?function(){return n.createElement(l.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"===r})),n.createElement(Ct,{moduleCode:null==r?void 0:r.toUpperCase()}))),n.createElement(o.Route,{key:"faq"+t,path:T+"/"+r.toLowerCase()+"-faq"},n.createElement(_t,{module:null==r?void 0:r.toUpperCase()})),n.createElement(o.Route,{key:"hiw"+t,path:T+"/"+r.toLowerCase()+"-how-it-works"},n.createElement(bt,{module:null==r?void 0:r.toUpperCase()})))});return n.createElement("div",{className:N},n.createElement(dt,{t:I,stateInfo:u,userDetails:c,CITIZEN:s,cityDetails:d,mobileView:f,handleUserDropdownSelection:v,logoUrl:m,showSidebar:!0,linkData:O,islinkDataLoading:S}),n.createElement("div",{className:"main center-container citizen-home-container mb-25"},A?null:n.createElement("div",{className:"SideBarStatic"},n.createElement(rt,{linkData:O,islinkDataLoading:S})),n.createElement(o.Switch,null,n.createElement(o.Route,{exact:!0,path:T},n.createElement(gt,null)),n.createElement(l.PrivateRoute,{path:T+"/feedback",component:Nn}),n.createElement(l.PrivateRoute,{path:T+"/feedback-acknowledgement",component:wt}),n.createElement(o.Route,{exact:!0,path:T+"/select-language"},n.createElement(ht,null)),n.createElement(o.Route,{exact:!0,path:T+"/select-location"},n.createElement(Et,null)),n.createElement(o.Route,{path:T+"/error"},n.createElement(Ve,{initData:b,goToHome:function(){D.push("/digit-ui/citizen")}})),n.createElement(o.Route,{path:T+"/all-services"},n.createElement(y,{userType:"citizen",modules:h,getCitizenMenu:O,fetchedCitizen:w,isLoading:S})),n.createElement(o.Route,{path:T+"/login"},n.createElement(P,{stateCode:p})),n.createElement(o.Route,{path:T+"/register"},n.createElement(P,{stateCode:p,isUserRegistered:!1})),n.createElement(o.Route,{path:T+"/user/profile"},n.createElement(vt,{stateCode:p,userType:"citizen",cityDetails:d})),n.createElement(o.Route,{path:T+"/Audit"},n.createElement(Rn,null)),n.createElement(He,{initData:b},L,R))),n.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},n.createElement("img",{alt:"Powered by DIGIT",src:null===(t=window)||void 0===t||null===(r=t.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:function(){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()}})))},kn=function(e){var r,i=e.stateCode,a=e.modules,l=e.appTenants,u=e.logoUrl,c=e.initData,s=o.useHistory(),d=o.useLocation().pathname,f=window.innerWidth,v=Digit.ULBService.getCurrentUlb(),m=Digit.UserService.getUser(),p=(Digit.Hooks.useStore.getInitData().data||{}).stateInfo,g=Digit.UserService.hasAccess(["FSM_DSO"]),h="CITIZEN"===(null==m||null===(r=m.info)||void 0===r?void 0:r.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(h=!1),t.useEffect(function(){null!=d&&d.includes("application-details")||(null!=d&&d.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=d&&d.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=d&&d.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),"/digit-ui/employee"===(null==d?void 0:d.toString())&&(Digit.SessionStorage.del("SEARCH_APPLICATION_DETAIL"),Digit.SessionStorage.del("WS_EDIT_APPLICATION_DETAILS")),"/digit-ui/citizen"!==(null==d?void 0:d.toString())&&"/digit-ui/employee"!==(null==d?void 0:d.toString())||Digit.SessionStorage.del("WS_DISCONNECTION")},[d]),s.listen(function(){var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});var E={stateInfo:p,userDetails:m,CITIZEN:h,cityDetails:v,mobileView:f<=640,handleUserDropdownSelection:function(e){e.func()},logoUrl:u,DSO:g,stateCode:i,modules:a,appTenants:l,sourceUrl:window.location.origin+"/citizen",pathname:d,initData:c};return n.createElement(o.Switch,null,n.createElement(o.Route,{path:"/digit-ui/employee"},n.createElement(pt,E)),n.createElement(o.Route,{path:"/digit-ui/citizen"},n.createElement(Pn,E)),n.createElement(o.Route,null,n.createElement(o.Redirect,{to:"/digit-ui/citizen"})))},Un=[s],Bn=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):c.compose)(c.applyMiddleware.apply(void 0,Un)),jn=function(e,t){return void 0===t&&(t={}),c.createStore(function(e,t){return c.combineReducers(d({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return d({},e,{selectedLanguage:t.payload});default:return e}})},t));var n}(e,t),Bn)},Fn=function(e){var t,r=e.stateCode,u=e.moduleReducers,c=Digit.Hooks.useInitStore(r,e.enabledModules),s=c.data;return c.isLoading?n.createElement(l.Loader,{page:!0}):(a.getI18n(),n.createElement(i.Provider,{store:jn(s,u(s))},n.createElement(o.BrowserRouter,null,n.createElement(l.Body,null,n.createElement(kn,{initData:s,stateCode:r,modules:null==s?void 0:s.modules,appTenants:s.tenants,logoUrl:null==s||null===(t=s.stateInfo)||void 0===t?void 0:t.logoUrl})))))},zn={SelectOtp:T,AcknowledgementCF:wt,CitizenFeedback:Nn};exports.DigitUI=function(e){var i=e.stateCode,o=e.registry,a=e.enabledModules,l=e.moduleReducers,u=t.useState(Digit.Utils.getPrivacyObject()||{}),c=u[0],s=u[1],f=(Digit.UserService.getType(),new r.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retryDelay:function(e){return Infinity},retry:!1}}})),v=Digit.Contexts.ComponentProvider,m=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),n.createElement("div",null,n.createElement(He,null,n.createElement(r.QueryClientProvider,{client:f},n.createElement(v.Provider,{value:o},n.createElement(m.Provider,{value:{privacy:null==c?void 0:c[window.location.pathname],resetPrivacy:function(e){Digit.Utils.setPrivacyObject({}),s({})},getPrivacy:function(){var e=Digit.Utils.getPrivacyObject();return s(e),e},updatePrivacyDescoped:function(e){var t,n=Digit.Utils.getAllPrivacyObject(),r=d({},n,((t={})[window.location.pathname]=e,t));Digit.Utils.setPrivacyObject(d({},r)),s((null==n?void 0:n[window.location.pathname])||{})},updatePrivacy:function(e,t){s(Digit.Utils.updatePrivacy(e,t)||{})}}},n.createElement(Fn,{stateCode:i,enabledModules:a,moduleReducers:l}))))))},exports.initCoreComponents=function(){Object.entries(zn).forEach(function(e){Digit.ComponentRegistryService.setComponent(e[0],e[1])})};
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@egovernments/digit-ui-module-core",
3
- "version": "1.6.0-alpha.4",
3
+ "version": "1.7.0-beta.1",
4
4
  "license": "MIT",
5
+ "description": "Digit App Core Module contains all core components",
5
6
  "main": "dist/index.js",
6
7
  "module": "dist/index.modern.js",
7
8
  "source": "src/Module.js",
@@ -14,7 +15,7 @@
14
15
  "prepublish": "yarn build"
15
16
  },
16
17
  "dependencies": {
17
- "@egovernments/digit-ui-react-components": "1.6.0-alpha.4",
18
+ "@egovernments/digit-ui-react-components": "^1.7.0-beta.1",
18
19
  "react": "17.0.2",
19
20
  "react-dom": "17.0.2",
20
21
  "react-i18next": "11.16.2",