@mseva/digit-ui-module-ndc 1.0.70 → 1.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +13 -6
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,t=require("@mseva/digit-ui-react-components"),n=require("react"),o=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-router-dom"),l=require("react-i18next"),i=require("react-redux"),a=require("react-hook-form");require("react-query");var u=require("redux");function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(null,arguments)}function c(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}const d=function(e){void 0===e&&(e=!1);let t=window.location.href.includes("/search");const n=[{code:t?"FIRE_NOC":"FIRE_NOC_SRV",active:!0,roles:["FIRE_NOC_APPROVER"],i18nKey:"WF_FIRE_NOC_FIRE_NOC_SRV"},{code:t?"AIRPORT_AUTHORITY":"AIRPORT_NOC_SRV",active:!0,roles:["AIRPORT_AUTHORITY_APPROVER"],i18nKey:"WF_FIRE_NOC_AIRPORT_NOC_SRV"}],o=[],r=Digit.UserService.getUser().info.roles;return n.map((t,l)=>{let{roles:i}=t;i.map(t=>{r.map(r=>{var i;r.code===t&&o.push(e?null==n||null===(i=n[l])||void 0===i?void 0:i.code:null==n?void 0:n[l])})})}),o},m=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let o=e[t]||"",r=(null==o?void 0:o.split(","))||[],l="";return r.length>0&&r.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(l=e)}),l},v=(e,t)=>{var n,o,r,l;const i=Digit.Hooks.useEmployeeSearch(e,{codes:t,isActive:!0},{enabled:!!t});console.log("employeeData",i);const a=null==i||null===(n=i.data)||void 0===n||null===(o=n.Employees)||void 0===o?void 0:o[0],u=null==a||null===(r=a.assignments)||void 0===r?void 0:r[0];return{officer:a?{code:null==a?void 0:a.code,id:null==a?void 0:a.id,name:null==a||null===(l=a.user)||void 0===l?void 0:l.name,department:null==u?void 0:u.department,designation:null==u?void 0:u.designation}:null}};var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var h,g,y="object"==typeof f&&f&&f.Object===Object&&f,E="object"==typeof self&&self&&self.Object===Object&&self,b=y||E||Function("return this")(),N=b.Symbol,S=Object.prototype,D=S.hasOwnProperty,C=S.toString,w=N?N.toStringTag:void 0,A=Object.prototype.toString,T=N?N.toStringTag:void 0,O=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?function(e){var t=D.call(e,w),n=e[w];try{e[w]=void 0;var o=!0}catch(e){}var r=C.call(e);return o&&(t?e[w]=n:delete e[w]),r}(e):function(e){return A.call(e)}(e)},P=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},I=b["__core-js_shared__"],x=(h=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+h:"",R=Function.prototype.toString,L=function(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""},F=/^\[object .+?Constructor\]$/,M=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!P(e)||(t=e,x&&x in t))&&(function(e){if(!P(e))return!1;var t=O(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?M:F).test(L(e));var t}(n)?n:void 0},B=k(b,"Map");k(Object,"create"),function(){try{k(Object,"defineProperty")({},"",{})}catch(e){}}(),function(e){return null!=e&&"object"==typeof e}(g=function(){return arguments}())&&O(g);var U=function(){return!1},j=(p(function(e,t){var n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,r=o&&o.exports===n?b.Buffer:void 0;e.exports=(r?r.isBuffer:void 0)||U}),p(function(e,t){var n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,r=o&&o.exports===n&&y.process,l=function(){try{return o&&o.require&&o.require("util").types||r&&r.binding&&r.binding("util")}catch(e){}}();e.exports=l}),p(function(e,t){var n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,r=o&&o.exports===n?b.Buffer:void 0,l=r?r.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,o=l?l(n):new e.constructor(n);return e.copy(o),o}}),k(b,"DataView")),W=k(b,"Promise"),z=k(b,"Set"),H=k(b,"WeakMap"),V=L(j),q=L(B),Y=L(W),G=L(z),$=L(H),K=O;(j&&"[object DataView]"!=K(new j(new ArrayBuffer(1)))||B&&"[object Map]"!=K(new B)||W&&"[object Promise]"!=K(W.resolve())||z&&"[object Set]"!=K(new z)||H&&"[object WeakMap]"!=K(new H))&&(K=function(e){var t=O(e),n="[object Object]"==t?e.constructor:void 0,o=n?L(n):"";if(o)switch(o){case V:return"[object DataView]";case q:return"[object Map]";case Y:return"[object Promise]";case G:return"[object Set]";case $:return"[object WeakMap]"}return t});const X=e=>{let{children:t,currentStep:n=1,stepsList:r=[]}=e;const{t:i}=l.useTranslation(),a=e=>{const t=e<=n;return{width:"56px",height:"56px",borderRadius:"50%",background:t?"linear-gradient(135deg,#2563eb,#7c3aed)":"#ffffff",color:t?"#ffffff":"#0f172a",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"8px",fontWeight:600,fontSize:"18px",border:t?"none":"1px solid rgba(15,23,42,0.08)",boxShadow:t?"0 6px 18px rgba(37,99,235,0.18)":"0 2px 6px rgba(2,6,23,0.04)",position:"relative"}},u={fontSize:"16px",color:"#0f172a",fontWeight:600,fontFamily:"Noto Sans, sans-serif",marginRight:"8px",textAlign:"right"},c={fontSize:"14px",color:"#6b7280",fontWeight:500,fontFamily:"Noto Sans, sans-serif",margin:"0 6px 0 0"},d={position:"absolute",width:"3px",height:"56px",backgroundColor:"rgba(15,23,42,0.06)",left:"50%",top:"100%",transform:"translateX(-50%)",borderRadius:"2px"},m=window.Digit.Utils.browser.isMobile(),v=r.length,f=m?{width:"32px",height:"32px",fontSize:"12px"}:{},p=m?{fontSize:"10px"}:{},h=m?{width:"auto",padding:"6px",marginBottom:"0",flexDirection:"column",alignItems:"center"}:{};return o.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:m?"column":"row",gap:"24px"}},o.createElement("div",{className:"stepper-navigation-bar",style:s({display:"flex",flexDirection:"column",alignItems:"center",padding:"18px",minWidth:"120px",maxWidth:"320px",marginBottom:"20px",marginTop:m?"20px":"0",height:m?"106px":""},m?{flexDirection:"row",overflowX:"auto",whiteSpace:"nowrap",minWidth:"100%",maxWidth:"100%",gap:"8px",padding:"10px"}:{})},[...Array(v)].map((e,t)=>{return o.createElement("div",{className:"step-content",key:t,style:s({},(l=t+1<=n,g=t===v-1,{display:"flex",alignItems:"center",justifyContent:"flex-start",flex:"0 0 auto",color:l?"#0D43A7":"#9CA3AF",padding:"14px 12px",width:"260px",marginBottom:g?"6px":"18px"}),h)},o.createElement("div",{className:"step-circle",style:s({},a(t+1),f)},t+1,t<v-1&&!m&&o.createElement("div",{style:d})),o.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:m?"center":"flex-end",margin:m?"4px":"10px"}},t+1===v?null:o.createElement("div",{className:"step-number",style:c}),o.createElement("div",{className:"step-label",style:s({},u,p,{textAlign:m?"center":"right"})},i(r[t].stepLabel))));var l,g})),o.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px",background:"transparent"}},t))},Z=e=>{let{stepsList:t=[],onSubmit:n,step:r,setStep:i}=e;const a=t.filter(e=>e.isStepEnabled),{t:u}=l.useTranslation();function s(){r<a.length?d():r===a.length&&n()}function c(){r>1&&m()}const d=()=>i(r+1),m=()=>i(r-1);return o.createElement(X,{currentStep:r,nextStep:d,prevStep:m,stepsList:a},(()=>{var e,t;const n=a[r-1],{component:l,key:i,texts:d,currStepConfig:m}=n,v=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(l);return o.createElement(o.Fragment,null,o.createElement(v,{config:{key:i,texts:d,component:l,currStepNumber:r,currStepConfig:m},onGoNext:s,onBackClick:c,t:u}))})())},Q=[{head:"Applicant Details",stepNumber:1,body:[{type:"component",component:"PropertyDetailsForm",key:"PropertyDetailsForm",withoutLabel:!0}]},{head:"Property Details",stepNumber:2,body:[{type:"component",component:"PropertyDetailsFormUser",key:"PropertyDetailsFormUser",withoutLabel:!0}]}],J=(e,t)=>({type:"UPDATE_NDC_FORM",payload:{key:e,value:t}}),ee=e=>({type:"SET_NDC_STEP",payload:e}),te=([{head:"APPLICANT_DETAILS",stepLabel:"Applicant Details",stepNumber:1,isStepEnabled:!0,type:"component",component:"PropertyDetailsStep1",key:"PropertyDetailsStep1",withoutLabel:!0,texts:{submitBarLabel:"Next Step"}},{head:"PROPERTY_DETAILS",stepLabel:"Property Details",stepNumber:2,isStepEnabled:!0,type:"component",component:"PropertyDetailsStep2",key:"PropertyDetailsStep2",withoutLabel:!0,texts:{submitBarLabel:"Submit"}}].map(e=>s({},e,{currStepConfig:Q.filter(t=>t.stepNumber===e.stepNumber)})),e=>{var n,i,a;const{state:u}=e.location,{t:s}=l.useTranslation(),c=r.useHistory(),d=null==u||null===(n=u.data)||void 0===n||null===(i=n.Noc)||void 0===i?void 0:i[0],m=window.localStorage.getItem("Employee.tenant-id"),v=((null==c||null===(a=c.location)||void 0===a?void 0:a.pathname)||"").split("/").pop();return o.createElement("div",null,o.createElement(t.Card,null,o.createElement(t.Banner,{message:"NDC Application Submitted Successfully",applicationNumber:v,info:"REJECTED"==(null==d?void 0:d.applicationStatus)?"":s("NDC_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==d?void 0:d.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),o.createElement(t.ActionBar,{classname:"challan-emp-acknowledgement"},o.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{c.push("/digit-ui/employee")}}),o.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_NDC"),onSubmit:()=>{c.push("/digit-ui/employee/ndc/inbox")}}),o.createElement(t.SubmitBar,{label:s("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:()=>{c.push("/digit-ui/employee/payment/collect/NDC/"+v+"/"+m+"?tenantId="+m)}}))))}),ne=e=>{let{location:n}=e;const{t:r}=l.useTranslation(),i=[{path:"/digit-ui/employee",content:r("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/ndc/inbox",content:r("ES_COMMON_INBOX"),show:!!n.pathname.includes("ndc/inbox")},{path:"/digit-ui/employee/ndc/create",content:"NDC Application Create Page",show:!!n.pathname.includes("ndc/create")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:r("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:r("ES_COMMON_APPLICATION_SEARCH"),show:!!n.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:r("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return o.createElement(t.BreadCrumb,{crumbs:i})},oe=e=>{var i,a,u,c;let{path:d}=e;const m=r.useLocation(),v=(l.useTranslation(),null===(i=Digit)||void 0===i||null===(a=i.ComponentRegistryService)||void 0===a?void 0:a.getComponent("NDCApplicationOverview")),f=null===(u=Digit)||void 0===u||null===(c=u.ComponentRegistryService)||void 0===c?void 0:c.getComponent("NDCInbox"),p=Digit.ComponentRegistryService.getComponent("NewNDCStepFormEmployee"),h=window.location.href.includes("/response");return window.Digit.Utils.browser.isMobile(),o.createElement(n.Fragment,null,o.createElement("div",{className:"ground-container"},h?null:o.createElement(ne,{location:m}),o.createElement(r.Switch,null,o.createElement(t.PrivateRoute,{path:d+"/inbox/application-overview/:id",component:v}),o.createElement(t.PrivateRoute,{path:d+"/search/application-overview/:id",component:v}),o.createElement(r.Route,{path:d+"/inbox",component:e=>o.createElement(f,s({},e,{parentRoute:d}))}),o.createElement(t.PrivateRoute,{path:d+"/create",component:e=>o.createElement(p,s({},e,{parentRoute:d}))}),o.createElement(t.PrivateRoute,{path:d+"/response/:id",component:te}))))},re=["path","url"],le=e=>{let{location:n}=e;const{t:r}=l.useTranslation(),i=[{path:"/digit-ui/citizen",content:r("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/citizen/ndc-home",content:r("NDC")+" Home",show:!!n.pathname.includes("ndc/")},{path:"/digit-ui/citizen/ptr-home",content:r("PET_NDCSERVICE"),show:!!n.pathname.includes("ptr/petservice/test")}];return o.createElement(t.BreadCrumb,{crumbs:i})},ie=()=>{var e,n;const i=r.useRouteMatch(),{path:a}=i,u=(c(i,re),l.useTranslation(),r.useLocation()),s=Digit.ComponentRegistryService.getComponent("NewNDCStepFormCitizen"),d=Digit.ComponentRegistryService.getComponent("MyApplications"),m=Digit.ComponentRegistryService.getComponent("NDCResponseCitizen"),v=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("CitizenApplicationOverview"),f=window.location.href.includes("/response"),p=window.Digit.Utils.browser.isMobile();return o.createElement("span",{className:"chb-citizen",style:{width:"100%",paddingRight:"25px",paddingLeft:"25px"}},o.createElement(r.Switch,null,o.createElement(t.AppContainer,null,f?null:o.createElement("div",{style:window.location.href.includes("application-overview")||p?{marginLeft:"10px"}:{}},o.createElement(le,{location:u})),o.createElement(t.PrivateRoute,{path:a+"/new-application",component:s}),o.createElement(t.PrivateRoute,{path:a+"/my-application",component:d}),o.createElement(t.PrivateRoute,{path:a+"/response/:id",component:m}),o.createElement(t.PrivateRoute,{path:a+"/search/application-overview/:id",component:v}))))};function ae(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.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const ue=e=>{let{width:t=20,height:n=20,style:r}=e;return o.createElement("svg",{style:r,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},o.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))};function se(e){var t;let{value:n={}}=e;const{t:r}=l.useTranslation(),i=window.Digit.Utils.browser.isMobile(),{data:a}=Digit.Hooks.ndc.useNDCDocumentSearch({value:n},{value:n});let u=[];return null!=n&&n.workflowDocs&&(u=null==n?void 0:n.workflowDocs),o.createElement("div",{className:"document-container"},o.createElement(o.Fragment,null,o.createElement("div",{className:"document-grid"},null===(t=u)||void 0===t?void 0:t.map((e,t)=>{let n=m(a.pdfFiles,null==e?void 0:e.uuid);return o.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:n,className:"document-link",key:t},o.createElement("div",{className:"document-card"},o.createElement("div",{className:"document-icon-wrapper"},o.createElement(ue,{width:i?50:80,height:i?60:100})),o.createElement("p",{className:"document-name",title:r(null==e?void 0:e.documentType)},(()=>{const t=r(null==e?void 0:e.documentType),n=i?8:12;return(null==t?void 0:t.length)>n?t.substring(0,n)+"...":t})()),o.createElement("div",{className:"document-action-label"},"View")))}))))}var ce="function"==typeof Symbol&&Symbol.for,de=ce?Symbol.for("react.element"):60103,me=ce?Symbol.for("react.portal"):60106,ve=ce?Symbol.for("react.fragment"):60107,fe=ce?Symbol.for("react.strict_mode"):60108,pe=ce?Symbol.for("react.profiler"):60114,he=ce?Symbol.for("react.provider"):60109,ge=ce?Symbol.for("react.context"):60110,ye=ce?Symbol.for("react.async_mode"):60111,Ee=ce?Symbol.for("react.concurrent_mode"):60111,be=ce?Symbol.for("react.forward_ref"):60112,_e=ce?Symbol.for("react.suspense"):60113,Ne=ce?Symbol.for("react.suspense_list"):60120,Se=ce?Symbol.for("react.memo"):60115,De=ce?Symbol.for("react.lazy"):60116,Ce=ce?Symbol.for("react.block"):60121,we=ce?Symbol.for("react.fundamental"):60117,Ae=ce?Symbol.for("react.responder"):60118,Te=ce?Symbol.for("react.scope"):60119;function Oe(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case de:switch(e=e.type){case ye:case Ee:case ve:case pe:case fe:case _e:return e;default:switch(e=e&&e.$$typeof){case ge:case be:case De:case Se:case he:return e;default:return t}}case me:return t}}}function Pe(e){return Oe(e)===Ee}var Ie={AsyncMode:ye,ConcurrentMode:Ee,ContextConsumer:ge,ContextProvider:he,Element:de,ForwardRef:be,Fragment:ve,Lazy:De,Memo:Se,Portal:me,Profiler:pe,StrictMode:fe,Suspense:_e,isAsyncMode:function(e){return Pe(e)||Oe(e)===ye},isConcurrentMode:Pe,isContextConsumer:function(e){return Oe(e)===ge},isContextProvider:function(e){return Oe(e)===he},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===de},isForwardRef:function(e){return Oe(e)===be},isFragment:function(e){return Oe(e)===ve},isLazy:function(e){return Oe(e)===De},isMemo:function(e){return Oe(e)===Se},isPortal:function(e){return Oe(e)===me},isProfiler:function(e){return Oe(e)===pe},isStrictMode:function(e){return Oe(e)===fe},isSuspense:function(e){return Oe(e)===_e},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===ve||e===Ee||e===pe||e===fe||e===_e||e===Ne||"object"==typeof e&&null!==e&&(e.$$typeof===De||e.$$typeof===Se||e.$$typeof===he||e.$$typeof===ge||e.$$typeof===be||e.$$typeof===we||e.$$typeof===Ae||e.$$typeof===Te||e.$$typeof===Ce)},typeOf:Oe},xe=p(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,l=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var v=e.type;switch(v){case s:case c:case r:case i:case l:case m:return v;default:var h=v&&v.$$typeof;switch(h){case u:case d:case p:case f:case a:return h;default:return t}}case o:return t}}}var _=c,N=u,S=a,D=n,C=d,w=r,A=p,T=f,O=o,P=i,I=l,x=m,R=!1;function L(e){return b(e)===c}t.AsyncMode=s,t.ConcurrentMode=_,t.ContextConsumer=N,t.ContextProvider=S,t.Element=D,t.ForwardRef=C,t.Fragment=w,t.Lazy=A,t.Memo=T,t.Portal=O,t.Profiler=P,t.StrictMode=I,t.Suspense=x,t.isAsyncMode=function(e){return R||(R=!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.")),L(e)||b(e)===s},t.isConcurrentMode=L,t.isContextConsumer=function(e){return b(e)===u},t.isContextProvider=function(e){return b(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===r},t.isLazy=function(e){return b(e)===p},t.isMemo=function(e){return b(e)===f},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===i},t.isStrictMode=function(e){return b(e)===l},t.isSuspense=function(e){return b(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===l||e===m||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===a||e.$$typeof===u||e.$$typeof===d||e.$$typeof===g||e.$$typeof===y||e.$$typeof===E||e.$$typeof===h)},t.typeOf=b}()}),Re=p(function(e){e.exports="production"===process.env.NODE_ENV?Ie:xe}),Le=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable;function ke(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var Be=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,o,r=ke(e),l=1;l<arguments.length;l++){for(var i in n=Object(arguments[l]))Fe.call(n,i)&&(r[i]=n[i]);if(Le){o=Le(n);for(var a=0;a<o.length;a++)Me.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r},Ue="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",je=Function.call.bind(Object.prototype.hasOwnProperty),We=function(){};if("production"!==process.env.NODE_ENV){var ze=Ue,He={},Ve=je;We=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function qe(e,t,n,o,r){if("production"!==process.env.NODE_ENV)for(var l in e)if(Ve(e,l)){var i;try{if("function"!=typeof e[l]){var a=Error((o||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}i=e[l](t,l,o,n,null,ze)}catch(e){i=e}if(!i||i instanceof Error||We((o||"React class")+": type specification of "+n+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in He)){He[i.message]=!0;var u=r?r():"";We("Failed "+n+" type: "+i.message+(null!=u?u:""))}}}qe.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(He={})};var Ye=qe,Ge=function(){};function $e(){return null}function Ke(){}function Xe(){}"production"!==process.env.NODE_ENV&&(Ge=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Xe.resetWarningCache=Ke;var Ze=p(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,o={array:a("array"),bigint:a("bigint"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:i($e),arrayOf:function(e){return i(function(t,n,o,r,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new l("Invalid "+r+" `"+i+"` of type `"+c(a)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<a.length;u++){var s=e(a,u,o,r,i+"["+u+"]",Ue);if(s instanceof Error)return s}return null})},element:i(function(t,n,o,r,i){var a=t[n];return e(a)?null:new l("Invalid "+r+" `"+i+"` of type `"+c(a)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:i(function(e,t,n,o,r){var i=e[t];return Re.isValidElementType(i)?null:new l("Invalid "+o+" `"+r+"` of type `"+c(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return i(function(t,n,o,r,i){var a;return t[n]instanceof e?null:new l("Invalid "+r+" `"+i+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+o+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:i(function(e,t,n,o,r){return s(e[t])?null:new l("Invalid "+o+" `"+r+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return i(function(t,n,o,r,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var a=t[n],u=c(a);if("object"!==u)return new l("Invalid "+r+" `"+i+"` of type `"+u+"` supplied to `"+o+"`, expected an object.");for(var s in a)if(je(a,s)){var d=e(a,s,o,r,i+"."+s,Ue);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Ge(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."),$e;function t(t,n,o,i,a){for(var u=t[n],s=0;s<e.length;s++)if(r(u,e[s]))return null;var c=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new l("Invalid "+i+" `"+a+"` of value `"+String(u)+"` supplied to `"+o+"`, expected one of "+c+".")}return i(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Ge("Invalid argument supplied to oneOfType, expected an instance of array."),$e;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return Ge("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),$e}return i(function(t,n,o,r,i){for(var a=[],u=0;u<e.length;u++){var s=(0,e[u])(t,n,o,r,i,Ue);if(null==s)return null;s.data&&je(s.data,"expectedType")&&a.push(s.data.expectedType)}return new l("Invalid "+r+" `"+i+"` supplied to `"+o+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return i(function(t,n,o,r,i){var a=t[n],s=c(a);if("object"!==s)return new l("Invalid "+r+" `"+i+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var m in e){var v=e[m];if("function"!=typeof v)return u(o,r,i,m,d(v));var f=v(a,m,o,r,i+"."+m,Ue);if(f)return f}return null})},exact:function(e){return i(function(t,n,o,r,i){var a=t[n],s=c(a);if("object"!==s)return new l("Invalid "+r+" `"+i+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");var m=Be({},t[n],e);for(var v in m){var f=e[v];if(je(e,v)&&"function"!=typeof f)return u(o,r,i,v,d(f));if(!f)return new l("Invalid "+r+" `"+i+"` key `"+v+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=f(a,v,o,r,i+"."+v,Ue);if(p)return p}return null})}};function r(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function l(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function i(e){function t(t,n,o,r,i,a,u){if(r=r||"<<anonymous>>",a=a||o,u!==Ue){var s=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 s.name="Invariant Violation",s}return null==n[o]?t?new l(null===n[o]?"The "+i+" `"+a+"` is marked as required in `"+r+"`, but its value is `null`.":"The "+i+" `"+a+"` is marked as required in `"+r+"`, but its value is `undefined`."):null:e(n,o,r,i,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return i(function(t,n,o,r,i,a){var u=t[n];return c(u)!==e?new l("Invalid "+r+" `"+i+"` of type `"+d(u)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,o,r){return new l((e||"React class")+": "+t+" type `"+n+"."+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+r+"`.")}function s(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(s);if(null===t||e(t))return!0;var o=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!o)return!1;var r,l=o.call(t);if(o!==t.entries){for(;!(r=l.next()).done;)if(!s(r.value))return!1}else for(;!(r=l.next()).done;){var i=r.value;if(i&&!s(i[1]))return!1}return!0;default:return!1}}function c(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=c(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 l.prototype=Error.prototype,o.checkPropTypes=Ye,o.resetWarningCache=Ye.resetWarningCache,o.PropTypes=o,o}(Re.isElement):function(){function e(e,t,n,o,r,l){if(l!==Ue){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Xe,resetWarningCache:Ke};return n.PropTypes=n,n}()});const Qe=e=>{let{page:t=!1}=e;const n={display:"flex",justifyContent:"center",alignItems:"center"},r=s({},n,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(255,255,255,0.6)",backdropFilter:"blur(4px)",zIndex:9999}),l=s({},n,{minHeight:"100px",width:"100%",position:"relative"});return o.createElement("div",{style:t?r:l},o.createElement("div",{style:{width:"64px",height:"64px",border:"8px solid #1976d2",borderTop:"8px solid transparent",borderRadius:"50%",animation:"spin 1.2s linear infinite"}}),o.createElement("style",null,"\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "))};Qe.propTypes={page:Ze.bool},Qe.defaultProps={page:!1};const Je=e=>o.createElement("h1",{className:"heading-m"},e.label),et=()=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},o.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o.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"})),tt=e=>o.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},o.createElement(et,null)),nt=e=>{var r;let{t:l,action:i,tenantId:a,closeModal:u,submitAction:c,applicationData:d,businessService:m,showToast:v,closeToast:f,errors:p,showErrorToast:h,errorOne:g,closeToastOne:y,getEmployees:E}=e;const[b,_]=n.useState({}),[N,S]=n.useState({}),[D,C]=n.useState([]),[w,A]=n.useState({}),[T,O]=n.useState(null),[P,I]=n.useState(null),[x,R]=n.useState(null),[L,F]=n.useState([]),[M,k]=n.useState(null),B=null==i||null===(r=i.state)||void 0===r?void 0:r.actions,U=[...new Set(null==B?void 0:B.flatMap(e=>e.roles))],j=[...new Set(null==E?void 0:E.flatMap(e=>e.roles))];console.log("getEmployees",E),console.log("allRoles",U),console.log("allRolesNew",j);const{data:W,isLoading:z}=Digit.Hooks.useEmployeeSearch(a,{roles:null==j?void 0:j.map(e=>({code:e})),isActive:!0},{enabled:!(null!=i&&i.isTerminateState)}),{data:H}=Digit.Hooks.pt.useMDMS(a,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}});n.useEffect(()=>{var e;H&&H["egf-master"]&&F(null===(e=H["egf-master"])||void 0===e?void 0:e.FinancialYear)},[H]);const{data:V}=Digit.Hooks.useCustomMDMS(a,"common-masters",[{name:"Department"}]);function q(e){O(e.target.files[0])}return n.useEffect(()=>{if(W&&V){var e;const t=V["common-masters"].Department;C(null==W||null===(e=W.Employees)||void 0===e?void 0:e.map(e=>{var n,o,r;const l=null==e||null===(n=e.assignments)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.department,i=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===l);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(r=e.user)||void 0===r?void 0:r.name)+" - "+(null==i?void 0:i.name)}}))}},[W,V]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)R(l("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=ae(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",T,Digit.ULBService.getStateId())).then(function(e){var t,n,o,r;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(o=e.data)||void 0===o||null===(r=o.files[0])||void 0===r?void 0:r.fileStoreId):R(l("CS_FILE_UPLOAD_ERROR"))})},function(){R(l("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{i&&_((e=>{let{t:n,action:r,approvers:l,selectedApprover:i,setSelectedApprover:a,selectFile:u,uploadedFile:s,setUploadedFile:c}=e,d=!0;return"SENDBACKTOCITIZEN"!=(null==r?void 0:r.action)&&"APPROVE"!=(null==r?void 0:r.action)&&"REJECT"!=(null==r?void 0:r.action)&&"SENDBACK"!=(null==r?void 0:r.action)||(d=!1),r.isTerminateState&&(d=!1),console.log("action=====",r.action),{label:{heading:"",submit:""+(null==r?void 0:r.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:d?n("WF_ASSIGNEE_NAME_LABEL")+" *":null,placeholder:d?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:d?o.createElement(t.Dropdown,{option:l,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:i}):null},{label:n("CS_COMMON_COMMENTS")+" *",type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:o.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:l,action:i,approvers:D,selectedApprover:w,setSelectedApprover:A,selectFile:q,uploadedFile:P,setUploadedFile:I,businessService:m}))},[i,D,L,M,P]),i&&b.form?o.createElement(t.Modal,{headerBarMain:o.createElement(Je,{label:l(b.label.heading)}),headerBarEnd:o.createElement(tt,{onClick:u}),actionCancelLabel:l(b.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:l(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},o.createElement(t.FormComposer,{config:b.form,className:"BPAemployeeCard bpa-workflow-modal-form",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){d=s({},d,{action:null==i?void 0:i.action,comment:null==e?void 0:e.comments,assignee:null!=w&&w.uuid?[null==w?void 0:w.uuid]:null,wfDocuments:P?[{documentType:null==T?void 0:T.type,documentUid:null==T?void 0:T.name,fileStoreId:P}]:null}),c({Licenses:[d]})},defaultValues:N,formId:"modal-action"}),v&&o.createElement(t.Toast,{error:"error"===v.key,label:p,onClose:f}),h&&o.createElement(t.Toast,{error:!0,label:g,isDleteBtn:!0,onClose:y}),z&&o.createElement(Qe,{page:!0})):null},ot=o.memo(e=>{let{width:t=20,height:n=20,style:r}=e;return o.createElement("svg",{style:r,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},o.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))}),rt=o.memo(e=>{let{value:r,Code:l,index:i}=e;const{isLoading:a,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:r},{value:r},l,i),s=n.useMemo(()=>{var e;const t=null!=r&&r.documents?null==r||null===(e=r.documents)||void 0===e?void 0:e.documents:r;return(null==t?void 0:t.filter(e=>(null==e?void 0:e.documentType)===l))||[]},[r,l]);return a?o.createElement(t.Loader,null):o.createElement("div",{className:"custom-doc-container"},null==s?void 0:s.map((e,t)=>{const n=((e,t)=>{var n;const o=(null==e?void 0:e[t])||"",r=(null==o||null===(n=o.split(","))||void 0===n?void 0:n.filter(Boolean))||[];return(null==r?void 0:r.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==r?void 0:r[0])||""})(null==u?void 0:u.pdfFiles,(null==e?void 0:e.fileStoreId)||(null==e?void 0:e.documentUid));return n?o.createElement("a",{key:t,target:"_blank",rel:"noopener noreferrer",href:n,className:"custom-doc-link"},o.createElement(ot,null),o.createElement("span",null,(null==e?void 0:e.fileName)||"Document")):null}))});function lt(e){var r,l,i,a,u,c;let{workflowDetails:d,t:m,tenantId:v=Digit.ULBService.getCurrentTenantId(),timeObj:f}=e;const{isLoading:p,data:h}=Digit.Hooks.ads.useADSDocumentSearch({value:(null==d||null===(r=d.data)||void 0===r||null===(l=r.timeline)||void 0===l?void 0:l.flatMap(e=>null==e?void 0:e.wfDocuments))||[]},{value:(null==d||null===(i=d.data)||void 0===i||null===(a=i.timeline)||void 0===a?void 0:a.flatMap(e=>null==e?void 0:e.wfDocuments))||[]},null,0),g=o.useCallback(()=>{if(!p){const e=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")||{},t=function(e,t,n,o){var r,l,i,a,u,s,c,d,m;void 0===n&&(n={}),console.log("pdfFiles",n);const v=(null==e||null===(r=e.data)||void 0===r?void 0:r.timeline)||(null==e?void 0:e.timeline)||[],f=(null==e||null===(l=e.data)||void 0===l?void 0:l.processInstances)||(null==e?void 0:e.processInstances)||[],p=(null==f||null===(i=f[0])||void 0===i?void 0:i.businessId)||"N/A",h=(null==f||null===(a=f[0])||void 0===a?void 0:a.businessService)||"N/A",g=(null==f||null===(u=f[0])||void 0===u?void 0:u.moduleName)||"N/A",y=(e,t)=>{var n;const o=(null==e?void 0:e[t])||"",r=(null==o||null===(n=o.split(","))||void 0===n?void 0:n.filter(Boolean))||[];return(null==r?void 0:r.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==r?void 0:r[0])||""},E=v.map((e,t)=>{var r,l,i,a,u,s;const c=(null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.created)||"N/A",d=(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.timing)||"N/A",m=(null==e||null===(i=e.assigner)||void 0===i?void 0:i.name)||"N/A",v=(null==e||null===(a=e.assigner)||void 0===a?void 0:a.type)||"N/A",f=(null==e||null===(u=e.assigner)||void 0===u?void 0:u.mobileNumber)||"N/A",p=(null==e?void 0:e.performedAction)||"N/A",h=(null==e?void 0:e.status)||(null==e?void 0:e.state)||"N/A",g=(null==e||null===(s=e.wfComment)||void 0===s?void 0:s[0])||"-",E=(null==e?void 0:e.wfDocuments)||[],b=(null==e?void 0:e.sla)||"N/A",_=Array.isArray(null==e?void 0:e.assignes)?e.assignes.map(e=>null==e?void 0:e.name).filter(Boolean).join(", "):"";return{sNo:t+1,action:o?o(p):p,status:o?o(h):h,assignerName:m,assignerType:v,mobileNumber:f,designation:v,date:c,time:d,dateTime:(c+" "+("N/A"!==d?d:"")).trim(),comment:g,documents:E.map(e=>({name:(null==e?void 0:e.fileName)||(null==e?void 0:e.documentType)||"Document",type:(null==e?void 0:e.documentType)||"Document",fileStoreId:null==e?void 0:e.fileStoreId,link:y(n,null==e?void 0:e.fileStoreId)})),hasDocuments:E.length>0,sla:b,assignedTo:_}});return{t:o,tenantId:(null==t?void 0:t.code)||"",tenantName:(null==t?void 0:t.name)||(null==t?void 0:t.i18nKey)||"Government Department",name:o?o("TIMELINE_PDF_TITLE"):"Application Timeline",heading:o?o("TIMELINE_PDF_HEADING"):"File Movement Report",businessId:p,businessService:o?o("CS_COMMON_"+(null==h?void 0:h.toUpperCase())):h,moduleName:g,currentStatus:o?o((null==v||null===(s=v[0])||void 0===s?void 0:s.status)||(null==v||null===(c=v[0])||void 0===c?void 0:c.state)||"N/A"):(null==v||null===(d=v[0])||void 0===d?void 0:d.status)||(null==v||null===(m=v[0])||void 0===m?void 0:m.state)||"N/A",generatedDate:(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"}),generatedDateTime:(new Date).toLocaleString("en-IN",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}),timelineRows:E,totalSteps:E.length}}(d,e,(null==h?void 0:h.pdfFiles)||{},m);Digit.Utils.pdf.generateTimelinePDF(t)}},[d,h,m,p]),y=e=>{if(null==e||!e.created||null==e||!e.timing)return null;const[t,n,o]=e.created.split("/");return new Date(o+"-"+n+"-"+t+" "+e.timing)},E=(e,t)=>{if(!e||!t)return null;const n=Math.floor((e-t)/6e4),o=Math.floor(n/60),r=Math.floor(o/24);return r>0?r+" day(s)":o>0?o+" hour(s)":n+" minute(s)"},b=n.useMemo(()=>(e=>{const t=(null==e?void 0:e.data)||e,n=null==t?void 0:t.timeline;if(!Array.isArray(n))return[];const o=[...n].reverse();return o.map((e,t)=>{var n;const r=y(e.auditDetails),l=t>0?y(null===(n=o[t-1])||void 0===n?void 0:n.auditDetails):null;return s({},e,{status:(null==e?void 0:e.state)||(null==e?void 0:e.status),assigner:(null==e?void 0:e.assigner)||null,assignes:Array.isArray(null==e?void 0:e.assignes)?e.assignes:[],wfComment:Array.isArray(null==e?void 0:e.wfComment)?e.wfComment:null!=e&&e.comment?[e.comment]:[],wfDocuments:Array.isArray(null==e?void 0:e.wfDocuments)?e.wfDocuments:[],actionDateTime:r,sla:E(r,l)})}).reverse()})(d),[d]),_=(null==b?void 0:b.filter(e=>!("SAVE_AS_DRAFT"===(null==e?void 0:e.performedAction))))||[],N=_.map(e=>{var t;return null==e||null===(t=e.assigner)||void 0===t?void 0:t.userName}).filter(Boolean),S=[...new Set(N)].join(","),D=Digit.Hooks.useEmployeeSearch(v,{codes:S,isActive:!0},{enabled:!!S}),C={};return null==D||null===(u=D.data)||void 0===u||null===(c=u.Employees)||void 0===c||c.forEach(e=>{var t;const n=null==e||null===(t=e.assignments)||void 0===t?void 0:t[0];C[null==e?void 0:e.code]="COMMON_MASTERS_DESIGNATION_"+(null==n?void 0:n.designation)}),p?o.createElement(t.Loader,null):o.createElement(o.Fragment,null,o.createElement("div",{className:"custom-timeline-container"},f&&o.createElement("div",{style:{marginBottom:"8px",fontStyle:"italic"}},m("TOTAL_TIME_TAKEN"),": ",null==f?void 0:f.days," ",m("DAYS")," ",null==f?void 0:f.hours," ",m("HOURS")," ",null==f?void 0:f.minutes," ",m("MINUTES")," ",null==f?void 0:f.seconds," ",m("SECONDS")),o.createElement("div",{className:"custom-timeline-header"},o.createElement("div",{className:"custom-tracking-status-header"},o.createElement("div",{className:"custom-tracking-line"}),o.createElement("span",{className:"custom-tracking-status-text"},m("TRACKING STATUS")),o.createElement("div",{className:"custom-tracking-line"})),o.createElement("div",{className:"custom-title-bar-row"},o.createElement("h2",{className:"custom-timeline-title"},m("Application History")),o.createElement("span",{onClick:g,className:"download-button"},m("CS_COMMON_DOWNLOAD")),o.createElement("div",{className:"custom-blue-bar"}))),o.createElement("div",{className:"custom-timeline-entries"},null==_?void 0:_.map((e,t)=>{var n,r,l,i,a,u,s,c,d,v,f,p,h,g,y,E;return o.createElement("div",{key:t,className:"custom-timeline-entry"},o.createElement("div",{className:"custom-vertical-line"}),o.createElement("div",{className:"custom-date-badge"},null==e||null===(n=e.auditDetails)||void 0===n?void 0:n.created," ",null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.timing),o.createElement("div",{className:"custom-entry-content"},o.createElement("div",{className:"custom-icon-container"},o.createElement("div",{className:"custom-circular-icon"},o.createElement("svg",{className:"custom-mail-icon",viewBox:"0 0 24 24"},o.createElement("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),o.createElement("path",{d:"M3 7l9 6 9-6"})))),o.createElement("div",{className:"custom-content-card"},o.createElement("div",{className:"custom-card-top"},o.createElement("div",{className:"custom-card-column"},o.createElement("h3",{className:"custom-action-title"},m("Action taken by")),(null==e?void 0:e.assigner)&&o.createElement("div",{className:"custom-officer-info"},o.createElement("div",{className:"custom-officer-name"},(null==e||null===(l=e.assigner)||void 0===l?void 0:l.name)||m("CS_COMMON_NA"),C[null==e||null===(i=e.assigner)||void 0===i?void 0:i.userName]&&o.createElement("span",{className:"custom-officer-name"},"- ",m(C[null==e||null===(a=e.assigner)||void 0===a?void 0:a.userName]))),(null==e||null===(u=e.assigner)||void 0===u?void 0:u.emailId)&&o.createElement("div",{className:"custom-officer-email"},o.createElement("span",{className:"custom-email-label"},m("Email"))," ",null==e||null===(s=e.assigner)||void 0===s?void 0:s.emailId))),o.createElement("div",{className:"custom-card-column custom-card-column-mid"},(null==e?void 0:e.sla)&&o.createElement(o.Fragment,null,o.createElement("h3",{className:"custom-action-title"},m("Time Taken")),o.createElement("div",{className:"custom-officer-email"},o.createElement("span",{className:"custom-email-label"},null==e?void 0:e.sla)))),o.createElement("div",{className:"custom-card-column custom-card-column-right"},o.createElement("h3",{className:"custom-action-title"},m("Action")),o.createElement("div",{className:"custom-status-text"},m((null==e?void 0:e.performedAction)||"CS_COMMON_NA")))),(null==e?void 0:e.wfComment)&&(null==e||null===(c=e.wfComment)||void 0===c?void 0:c.length)>0&&(null==e||null===(d=e.wfComment)||void 0===d?void 0:d.some(e=>null==e?void 0:e.trim()))&&o.createElement("div",{className:"custom-comments-section container-full-width"},o.createElement("div",{className:"custom-comments-content"},o.createElement("h4",{className:"custom-comments-title"},m("Officer Comments")),o.createElement("div",{className:"custom-comment-text"},null==e||null===(v=e.wfComment)||void 0===v?void 0:v.map((e,t)=>{const n="string"==typeof e?null==e?void 0:e.split(/\[#\?.*?\*\*\]/)[0]:e;return o.createElement("p",{key:t},n)}))),(null==e||null===(f=e.assignes)||void 0===f?void 0:f.length)>0&&o.createElement("div",{className:"custom-assigned-to-footer"},o.createElement("h3",{className:"custom-comments-title"},m("Assigned To")),o.createElement("div",{className:"custom-officer-info"},o.createElement("div",{className:"custom-officer-name"},null===(p=e.assignes[0])||void 0===p?void 0:p.name,C[null===(h=e.assignes[0])||void 0===h?void 0:h.userName]&&o.createElement("span",{className:"custom-officer-email"},"- ",m(C[null===(g=e.assignes[0])||void 0===g?void 0:g.userName])))))),(null==e?void 0:e.wfDocuments)&&(null==e||null===(y=e.wfDocuments)||void 0===y?void 0:y.length)>0&&o.createElement("div",{className:"custom-comments-section-no-border"},o.createElement("h4",{className:"custom-comments-title"},"Document Attached:"),o.createElement("div",{className:"custom-comment-text"},null==e||null===(E=e.wfDocuments)||void 0===E?void 0:E.map((t,n)=>o.createElement(rt,{key:(null==t?void 0:t.documentType)+"-"+n,value:null==e?void 0:e.wfDocuments,Code:null==t?void 0:t.documentType,index:n})))))))}))))}const it=function(e,t,n,o,r,l,i){try{var a,u,s,c,d,m,v,f,p,h,g,y,E,b,_;const N=(null==e||null===(a=e.Applications)||void 0===a?void 0:a[0])||{},S=(null==N||null===(u=N.owners)||void 0===u?void 0:u[0])||{},D=(null==N||null===(s=N.NdcDetails)||void 0===s?void 0:s[0])||{},C=(null==D?void 0:D.additionalDetails)||{},w=null!=N&&null!==(c=N.auditDetails)&&void 0!==c&&c.lastModifiedTime?new Date(null===(d=N.auditDetails)||void 0===d?void 0:d.lastModifiedTime).toLocaleDateString("en-GB"):"N/A",A=null==i||null===(m=i.officer)||void 0===m?void 0:m.designation,T=A?"COMMON_MASTERS_DESIGNATION_"+A:null,O=T?o(T,{defaultValue:A}):"NA",P=(null==N?void 0:N.applicationNo)||"NA",I=null==N||null===(v=N.NdcDetails)||void 0===v?void 0:v.find(e=>"PT"===e.businessService),x=null==I?void 0:I.consumerCode;console.log("ptObj",I);const R=null!=C&&C.propertyType?o(C.propertyType):"NA",L=(null==S?void 0:S.name)||"NA",F=(null==N||null===(f=N.NdcDetails)||void 0===f||null===(p=f[0])||void 0===p||null===(h=p.additionalDetails)||void 0===h?void 0:h.propertyAddress)||(null==S?void 0:S.permanentAddress)||(null==S?void 0:S.correspondenceAddress)||"NA",M=(null==N||null===(g=N.NdcDetails)||void 0===g||null===(y=g[0])||void 0===y||null===(E=y.additionalDetails)||void 0===E?void 0:E.remarks)||null,k=(null==n?void 0:n.name)||(null==N?void 0:N.tenantId)||"NA",B=((null==e?void 0:e.propertyOwnerNames)||[]).join(", ")||"NA";console.log(N,"APPDATA"),function(e){if(void 0===e&&(e=""),!e)return"NA";const t=e.split(".");if(t.length<2)return e;const n=t[1].toLowerCase();var o;({testing:"Testing",amritsar:"Amritsar",punjab:"Punjab",chandigarh:"Chandigarh",ludhiana:"Ludhiana"})[n]||(null==(o=n)||o.charAt(0).toUpperCase(),null==o||o.slice(1))}(null==N?void 0:N.tenantId),console.log(n,"TENANT INFO IN ACKNOWLEDGEMENT");const U=[{text:"NDC No: ",bold:!1,fontSize:9},{text:""+(null==N?void 0:N.applicationNo),bold:!0,fontSize:9},{text:", Property ID: ",bold:!1,fontSize:9},{text:""+x,bold:!0,fontSize:9},{text:", Property Type: ",bold:!1,fontSize:9},{text:R+"\n",bold:!0,fontSize:9},{text:"Property Address: ",bold:!1,fontSize:9},{text:""+t,bold:!0,fontSize:9},{text:" Owned by: ",bold:!1,fontSize:9},{text:B+"\n",bold:!0,fontSize:9},{text:"Applicant Name: ",bold:!1,fontSize:9},{text:""+L,bold:!0,fontSize:9},{text:" (s/o, d/o) ",bold:!1,fontSize:9},{text:""+((null==N||null===(b=N.owners)||void 0===b||null===(_=b[0])||void 0===_?void 0:_.fatherOrHusbandName)||"NA"),bold:!0,fontSize:9},{text:" resident of ",bold:!1,fontSize:9},{text:F+".\n",bold:!0,fontSize:9},{text:[{text:"• This is to certify that, as per the records and data with "+k+", all applicable municipal dues related to the above mentioned property have been duly recovered/deposited. ",bold:!0,fontSize:9},{text:o("NDC_CERTIFY_NOTE_ONE_PB")+" "+k+" "+o("NDC_CERTIFY_NOTE_TWO_PB")+"\n",bold:!1,fontSize:9}]},{text:[{text:"• This No Dues Certificate is valid for one month from the date of issuance.",bold:!0,fontSize:9},{text:o("NDC_VALIDITY_NOTE_PB")+"\n",bold:!1,fontSize:9}]},{text:[{text:"• This is only a No Dues Certificate for municipal dues as on date and it does not regulate the compliance of building regulations, change of land use, any fire safety regulations or any other compliance under any act/rules. ",bold:!0,fontSize:9},{text:o("NDC_BUILDING_NOTE_PB")+"\n",bold:!1,fontSize:9}]},{text:[{text:"• This No Dues Certificate does not bar any competent authority to take action under their prevailing act/rules. ",bold:!0,fontSize:9},{text:o("NDC_AUTHORITY_NOTE_PB")+"\n",bold:!1,fontSize:9}]},{text:[{text:"• In case any discrepancies in the amount deposited are discovered by the Municipal Corporation/Council at any stage, it shall be the responsibility of the owner to deposit the differential amount as notified by the Municipal Corporation/Council, which will have the full right to recover the same. ",bold:!0,fontSize:9},{text:o("NDC_DISCREPANCY_NOTE_PB")+"\n",bold:!1,fontSize:9}]},{text:[{text:"• This certificate is only for the purpose of municipal dues and this certificate is not a proof of ownership. ",bold:!0,fontSize:9},{text:o("NDC_OWNERSHIP_NOTE_PB")+"\n",bold:!1,fontSize:9}]},M&&""!==M.trim()&&{text:[{text:"• Remarks: "+M+"\n",bold:!0,fontSize:9}]}];return Promise.resolve({t:o,approvalDate:w,approver:r,designation:O,ulbType:l,tenantId:null==N?void 0:N.tenantId,name:" No Dues Certificate ",email:null==n?void 0:n.emailId,phoneNumber:null==n?void 0:n.contactNumber,heading:"Local Government, Punjab",applicationNumber:P,details:[{value:U}]})}catch(e){return Promise.reject(e)}},at=[{code:"yes",name:"Yes"},{code:"no",name:"No"}];function ut(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function st(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function ct(e){st(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function dt(e,t){st(2,arguments);var n=ct(e).getTime(),o=ut(t);return new Date(n+o)}function mt(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function vt(e){return st(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function ft(e){if(st(1,arguments),!vt(e)&&"number"!=typeof e)return!1;var t=ct(e);return!isNaN(Number(t))}var pt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function ht(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,o=e.formats[n]||e.formats[e.defaultWidth];return o}}var gt={date:ht({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ht({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ht({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},yt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Et(e){return function(t,n){var o,r=n||{};if("formatting"===(r.context?String(r.context):"standalone")&&e.formattingValues){var l=e.defaultFormattingWidth||e.defaultWidth,i=r.width?String(r.width):l;o=e.formattingValues[i]||e.formattingValues[l]}else{var a=e.defaultWidth,u=r.width?String(r.width):e.defaultWidth;o=e.values[u]||e.values[a]}return o[e.argumentCallback?e.argumentCallback(t):t]}}function bt(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.width,r=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],l=t.match(r);if(!l)return null;var i,a=l[0],u=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(u)?Nt(u,function(e){return e.test(a)}):_t(u,function(e){return e.test(a)});i=e.valueCallback?e.valueCallback(s):s,i=n.valueCallback?n.valueCallback(i):i;var c=t.slice(a.length);return{value:i,rest:c}}}function _t(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function Nt(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}var St,Dt={code:"en-US",formatDistance:function(e,t,n){var o,r=pt[e];return o="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o},formatLong:gt,formatRelative:function(e,t,n,o){return yt[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Et({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Et({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Et({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Et({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Et({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(St={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(St.matchPattern);if(!n)return null;var o=n[0],r=e.match(St.parsePattern);if(!r)return null;var l=St.valueCallback?St.valueCallback(r[0]):r[0];l=t.valueCallback?t.valueCallback(l):l;var i=e.slice(o.length);return{value:l,rest:i}}),era:bt({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:bt({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:bt({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:bt({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:bt({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ct(e,t){st(2,arguments);var n=ut(t);return dt(e,-n)}function wt(e){st(1,arguments);var t=1,n=ct(e),o=n.getUTCDay(),r=(o<t?7:0)+o-t;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function At(e){st(1,arguments);var t=ct(e),n=t.getUTCFullYear(),o=new Date(0);o.setUTCFullYear(n+1,0,4),o.setUTCHours(0,0,0,0);var r=wt(o),l=new Date(0);l.setUTCFullYear(n,0,4),l.setUTCHours(0,0,0,0);var i=wt(l);return t.getTime()>=r.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Tt(e){st(1,arguments);var t=At(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var o=wt(n);return o}function Ot(e,t){st(1,arguments);var n=t||{},o=n.locale,r=o&&o.options&&o.options.weekStartsOn,l=null==r?0:ut(r),i=null==n.weekStartsOn?l:ut(n.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=ct(e),u=a.getUTCDay(),s=(u<i?7:0)+u-i;return a.setUTCDate(a.getUTCDate()-s),a.setUTCHours(0,0,0,0),a}function Pt(e,t){st(1,arguments);var n=ct(e),o=n.getUTCFullYear(),r=t||{},l=r.locale,i=l&&l.options&&l.options.firstWeekContainsDate,a=null==i?1:ut(i),u=null==r.firstWeekContainsDate?a:ut(r.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=new Date(0);s.setUTCFullYear(o+1,0,u),s.setUTCHours(0,0,0,0);var c=Ot(s,t),d=new Date(0);d.setUTCFullYear(o,0,u),d.setUTCHours(0,0,0,0);var m=Ot(d,t);return n.getTime()>=c.getTime()?o+1:n.getTime()>=m.getTime()?o:o-1}function It(e,t){st(1,arguments);var n=t||{},o=n.locale,r=o&&o.options&&o.options.firstWeekContainsDate,l=null==r?1:ut(r),i=null==n.firstWeekContainsDate?l:ut(n.firstWeekContainsDate),a=Pt(e,t),u=new Date(0);u.setUTCFullYear(a,0,i),u.setUTCHours(0,0,0,0);var s=Ot(u,t);return s}function xt(e,t){for(var n=e<0?"-":"",o=Math.abs(e).toString();o.length<t;)o="0"+o;return n+o}var Rt={G:function(e,t,n){var o=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});case"GGGG":default:return n.era(o,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var o=e.getUTCFullYear();return n.ordinalNumber(o>0?o:1-o,{unit:"year"})}return function(e,t){var n=e.getUTCFullYear(),o=n>0?n:1-n;return xt("yy"===t?o%100:o,t.length)}(e,t)},Y:function(e,t,n,o){var r=Pt(e,o),l=r>0?r:1-r;return"YY"===t?xt(l%100,2):"Yo"===t?n.ordinalNumber(l,{unit:"year"}):xt(l,t.length)},R:function(e,t){return xt(At(e),t.length)},u:function(e,t){return xt(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var o=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return xt(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,t,n){var o=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return xt(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,t,n){var o=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):xt(n+1,2)}(e,t);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(e,t,n){var o=e.getUTCMonth();switch(t){case"L":return String(o+1);case"LL":return xt(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(e,t,n,o){var r=function(e,t){st(1,arguments);var n=ct(e),o=Ot(n,t).getTime()-It(n,t).getTime();return Math.round(o/6048e5)+1}(e,o);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):xt(r,t.length)},I:function(e,t,n){var o=function(e){st(1,arguments);var t=ct(e),n=wt(t).getTime()-Tt(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(o,{unit:"week"}):xt(o,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return xt(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,n){var o=function(e){st(1,arguments);var t=ct(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var o=t.getTime(),r=n-o;return Math.floor(r/864e5)+1}(e);return"Do"===t?n.ordinalNumber(o,{unit:"dayOfYear"}):xt(o,t.length)},E:function(e,t,n){var o=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});case"EEEE":default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(e,t,n,o){var r=e.getUTCDay(),l=(r-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return xt(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,o){var r=e.getUTCDay(),l=(r-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return xt(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){var o=e.getUTCDay(),r=0===o?7:o;switch(t){case"i":return String(r);case"ii":return xt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});case"iiii":default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(e,t,n){var o=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){var o,r=e.getUTCHours();switch(o=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){var o,r=e.getUTCHours();switch(o=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var o=e.getUTCHours()%12;return 0===o&&(o=12),n.ordinalNumber(o,{unit:"hour"})}return function(e,t){return xt(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return xt(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,n){var o=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(o,{unit:"hour"}):xt(o,t.length)},k:function(e,t,n){var o=e.getUTCHours();return 0===o&&(o=24),"ko"===t?n.ordinalNumber(o,{unit:"hour"}):xt(o,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return xt(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return xt(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var n=t.length,o=e.getUTCMilliseconds();return xt(Math.floor(o*Math.pow(10,n-3)),t.length)}(e,t)},X:function(e,t,n,o){var r=(o._originalDate||e).getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return Ft(r);case"XXXX":case"XX":return Mt(r);case"XXXXX":case"XXX":default:return Mt(r,":")}},x:function(e,t,n,o){var r=(o._originalDate||e).getTimezoneOffset();switch(t){case"x":return Ft(r);case"xxxx":case"xx":return Mt(r);case"xxxxx":case"xxx":default:return Mt(r,":")}},O:function(e,t,n,o){var r=(o._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Lt(r,":");case"OOOO":default:return"GMT"+Mt(r,":")}},z:function(e,t,n,o){var r=(o._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Lt(r,":");case"zzzz":default:return"GMT"+Mt(r,":")}},t:function(e,t,n,o){return xt(Math.floor((o._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,o){return xt((o._originalDate||e).getTime(),t.length)}};function Lt(e,t){var n=e>0?"-":"+",o=Math.abs(e),r=Math.floor(o/60),l=o%60;if(0===l)return n+String(r);var i=t||"";return n+String(r)+i+xt(l,2)}function Ft(e,t){return e%60==0?(e>0?"-":"+")+xt(Math.abs(e)/60,2):Mt(e,t)}function Mt(e,t){var n=t||"",o=e>0?"-":"+",r=Math.abs(e);return o+xt(Math.floor(r/60),2)+n+xt(r%60,2)}function kt(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Bt(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var Ut={p:Bt,P:function(e,t){var n,o=e.match(/(P+)(p+)?/)||[],r=o[1],l=o[2];if(!l)return kt(e,t);switch(r){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",kt(r,t)).replace("{{time}}",Bt(l,t))}},jt=["D","DD"],Wt=["YY","YYYY"];function zt(e){return-1!==jt.indexOf(e)}function Ht(e){return-1!==Wt.indexOf(e)}function Vt(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var qt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Gt=/^'([^]*?)'?$/,$t=/''/g,Kt=/[a-zA-Z]/;function Xt(e,t,n){st(2,arguments);var o=String(t),r=n||{},l=r.locale||Dt,i=l.options&&l.options.firstWeekContainsDate,a=null==i?1:ut(i),u=null==r.firstWeekContainsDate?a:ut(r.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=l.options&&l.options.weekStartsOn,c=null==s?0:ut(s),d=null==r.weekStartsOn?c:ut(r.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!l.localize)throw new RangeError("locale must contain localize property");if(!l.formatLong)throw new RangeError("locale must contain formatLong property");var m=ct(e);if(!ft(m))throw new RangeError("Invalid time value");var v=mt(m),f=Ct(m,v),p={firstWeekContainsDate:u,weekStartsOn:d,locale:l,_originalDate:m},h=o.match(Yt).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,Ut[t])(e,l.formatLong,p):e}).join("").match(qt).map(function(n){if("''"===n)return"'";var o=n[0];if("'"===o)return Zt(n);var i=Rt[o];if(i)return!r.useAdditionalWeekYearTokens&&Ht(n)&&Vt(n,t,e),!r.useAdditionalDayOfYearTokens&&zt(n)&&Vt(n,t,e),i(f,n,l.localize,p);if(o.match(Kt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return n}).join("");return h}function Zt(e){return e.match(Gt)[1].replace($t,"'")}p(function(e,t){(function(){var n="Expected a function",o="__lodash_placeholder__",r=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],l="[object Arguments]",i="[object Array]",a="[object Boolean]",u="[object Date]",s="[object Error]",c="[object Function]",d="[object GeneratorFunction]",m="[object Map]",v="[object Number]",p="[object Object]",h="[object RegExp]",g="[object Set]",y="[object String]",E="[object Symbol]",b="[object WeakMap]",_="[object ArrayBuffer]",N="[object DataView]",S="[object Float32Array]",D="[object Float64Array]",C="[object Int8Array]",w="[object Int16Array]",A="[object Int32Array]",T="[object Uint8Array]",O="[object Uint16Array]",P="[object Uint32Array]",I=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,M=RegExp(L.source),k=RegExp(F.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,q=RegExp(V.source),Y=/^\s+/,G=/\s/,$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,K=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Q=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,oe=/^0b[01]+$/i,re=/^\[object .+?Constructor\]$/,le=/^0o[0-7]+$/i,ie=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\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",me="["+de+"]",ve="["+ce+"]",fe="\\d+",pe="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+fe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",ye="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",be="[\\ud800-\\udbff][\\udc00-\\udfff]",_e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ne="(?:"+pe+"|"+he+")",Se="(?:"+_e+"|"+he+")",De="(?:"+ve+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+De+"(?:\\u200d(?:"+[ye,Ee,be].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*",we="(?:"+["[\\u2700-\\u27bf]",Ee,be].join("|")+")"+Ce,Ae="(?:"+[ye+ve+"?",ve,Ee,be,"[\\ud800-\\udfff]"].join("|")+")",Te=RegExp("['’]","g"),Oe=RegExp(ve,"g"),Pe=RegExp(ge+"(?="+ge+")|"+Ae+Ce,"g"),Ie=RegExp([_e+"?"+pe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[me,_e,"$"].join("|")+")",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[me,_e+Ne,"$"].join("|")+")",_e+"?"+Ne+"+(?:['’](?:d|ll|m|re|s|t|ve))?",_e+"+(?:['’](?: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_])",fe,we].join("|"),"g"),xe=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Le=["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"],Fe=-1,Me={};Me[S]=Me[D]=Me[C]=Me[w]=Me[A]=Me[T]=Me["[object Uint8ClampedArray]"]=Me[O]=Me[P]=!0,Me[l]=Me[i]=Me[_]=Me[a]=Me[N]=Me[u]=Me[s]=Me[c]=Me[m]=Me[v]=Me[p]=Me[h]=Me[g]=Me[y]=Me[b]=!1;var ke={};ke[l]=ke[i]=ke[_]=ke[N]=ke[a]=ke[u]=ke[S]=ke[D]=ke[C]=ke[w]=ke[A]=ke[m]=ke[v]=ke[p]=ke[h]=ke[g]=ke[y]=ke[E]=ke[T]=ke["[object Uint8ClampedArray]"]=ke[O]=ke[P]=!0,ke[s]=ke[c]=ke[b]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,je=parseInt,We="object"==typeof f&&f&&f.Object===Object&&f,ze="object"==typeof self&&self&&self.Object===Object&&self,He=We||ze||Function("return this")(),Ve=t&&!t.nodeType&&t,qe=Ve&&e&&!e.nodeType&&e,Ye=qe&&qe.exports===Ve,Ge=Ye&&We.process,$e=function(){try{return qe&&qe.require&&qe.require("util").types||Ge&&Ge.binding&&Ge.binding("util")}catch(e){}}(),Ke=$e&&$e.isArrayBuffer,Xe=$e&&$e.isDate,Ze=$e&&$e.isMap,Qe=$e&&$e.isRegExp,Je=$e&&$e.isSet,et=$e&&$e.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,o){for(var r=-1,l=null==e?0:e.length;++r<l;){var i=e[r];t(o,i,n(i),e)}return o}function ot(e,t){for(var n=-1,o=null==e?0:e.length;++n<o&&!1!==t(e[n],n,e););return e}function rt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function lt(e,t){for(var n=-1,o=null==e?0:e.length;++n<o;)if(!t(e[n],n,e))return!1;return!0}function it(e,t){for(var n=-1,o=null==e?0:e.length,r=0,l=[];++n<o;){var i=e[n];t(i,n,e)&&(l[r++]=i)}return l}function at(e,t){return!(null==e||!e.length)&>(e,t,0)>-1}function ut(e,t,n){for(var o=-1,r=null==e?0:e.length;++o<r;)if(n(t,e[o]))return!0;return!1}function st(e,t){for(var n=-1,o=null==e?0:e.length,r=Array(o);++n<o;)r[n]=t(e[n],n,e);return r}function ct(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}function dt(e,t,n,o){var r=-1,l=null==e?0:e.length;for(o&&l&&(n=e[++r]);++r<l;)n=t(n,e[r],r,e);return n}function mt(e,t,n,o){var r=null==e?0:e.length;for(o&&r&&(n=e[--r]);r--;)n=t(n,e[r],r,e);return n}function vt(e,t){for(var n=-1,o=null==e?0:e.length;++n<o;)if(t(e[n],n,e))return!0;return!1}var ft=_t("length");function pt(e,t,n){var o;return n(e,function(e,n,r){if(t(e,n,r))return o=n,!1}),o}function ht(e,t,n,o){for(var r=e.length,l=n+(o?1:-1);o?l--:++l<r;)if(t(e[l],l,e))return l;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var o=n-1,r=e.length;++o<r;)if(e[o]===t)return o;return-1}(e,t,n):ht(e,Et,n)}function yt(e,t,n,o){for(var r=n-1,l=e.length;++r<l;)if(o(e[r],t))return r;return-1}function Et(e){return e!=e}function bt(e,t){var n=null==e?0:e.length;return n?Dt(e,t)/n:NaN}function _t(e){return function(t){return null==t?void 0:t[e]}}function Nt(e){return function(t){return null==e?void 0:e[t]}}function St(e,t,n,o,r){return r(e,function(e,r,l){n=o?(o=!1,e):t(n,e,r,l)}),n}function Dt(e,t){for(var n,o=-1,r=e.length;++o<r;){var l=t(e[o]);void 0!==l&&(n=void 0===n?l:n+l)}return n}function Ct(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}function wt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function At(e){return function(t){return e(t)}}function Tt(e,t){return st(t,function(t){return e[t]})}function Ot(e,t){return e.has(t)}function Pt(e,t){for(var n=-1,o=e.length;++n<o&>(t,e[n],0)>-1;);return n}function It(e,t){for(var n=e.length;n--&>(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length,o=0;n--;)e[n]===t&&++o;return o}var Rt=Nt({"À":"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"}),Lt=Nt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ft(e){return"\\"+Be[e]}function Mt(e){return xe.test(e)}function kt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,o){n[++t]=[o,e]}),n}function Bt(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,r=e.length,l=0,i=[];++n<r;){var a=e[n];a!==t&&a!==o||(e[n]=o,i[l++]=n)}return i}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function zt(e){return Mt(e)?function(e){for(var t=Pe.lastIndex=0;Pe.test(e);)++t;return t}(e):ft(e)}function Ht(e){return Mt(e)?function(e){return e.match(Pe)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var qt=Nt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var f=(t=null==t?He:Yt.defaults(He.Object(),t,Yt.pick(He,Le))).Array,G=t.Date,ce=t.Error,de=t.Function,me=t.Math,ve=t.Object,fe=t.RegExp,pe=t.String,he=t.TypeError,ge=f.prototype,ye=ve.prototype,Ee=t["__core-js_shared__"],be=de.prototype.toString,_e=ye.hasOwnProperty,Ne=0,Se=function(){var e=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),De=ye.toString,Ce=be.call(ve),we=He._,Ae=fe("^"+be.call(_e).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pe=Ye?t.Buffer:void 0,xe=t.Symbol,Be=t.Uint8Array,We=Pe?Pe.allocUnsafe:void 0,ze=Bt(ve.getPrototypeOf,ve),Ve=ve.create,qe=ye.propertyIsEnumerable,Ge=ge.splice,$e=xe?xe.isConcatSpreadable:void 0,ft=xe?xe.iterator:void 0,Nt=xe?xe.toStringTag:void 0,Gt=function(){try{var e=Qr(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==He.clearTimeout&&t.clearTimeout,Kt=G&&G.now!==He.Date.now&&G.now,Xt=t.setTimeout!==He.setTimeout&&t.setTimeout,Zt=me.ceil,Qt=me.floor,Jt=ve.getOwnPropertySymbols,en=Pe?Pe.isBuffer:void 0,tn=t.isFinite,nn=ge.join,on=Bt(ve.keys,ve),rn=me.max,ln=me.min,an=G.now,un=t.parseInt,sn=me.random,cn=ge.reverse,dn=Qr(t,"DataView"),mn=Qr(t,"Map"),vn=Qr(t,"Promise"),fn=Qr(t,"Set"),pn=Qr(t,"WeakMap"),hn=Qr(ve,"create"),gn=pn&&new pn,yn={},En=Al(dn),bn=Al(mn),_n=Al(vn),Nn=Al(fn),Sn=Al(pn),Dn=xe?xe.prototype:void 0,Cn=Dn?Dn.valueOf:void 0,wn=Dn?Dn.toString:void 0;function An(e){if(Vi(e)&&!Ri(e)&&!(e instanceof In)){if(e instanceof Pn)return e;if(_e.call(e,"__wrapped__"))return Tl(e)}return new Pn(e)}var Tn=function(){function e(){}return function(t){if(!Hi(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function On(){}function Pn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function In(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 o=e[t];this.set(o[0],o[1])}}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ln;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new Rn(e);this.size=t.size}function kn(e,t){var n=Ri(e),o=!n&&xi(e),r=!n&&!o&&ki(e),l=!n&&!o&&!r&&Qi(e),i=n||o||r||l,a=i?Ct(e.length,pe):[],u=a.length;for(var s in e)!t&&!_e.call(e,s)||i&&("length"==s||r&&("offset"==s||"parent"==s)||l&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ll(s,u))||a.push(s);return a}function Bn(e){var t=e.length;return t?e[Fo(0,t-1)]:void 0}function Un(e,t){return Nl(hr(e),$n(t,0,e.length))}function jn(e){return Nl(hr(e))}function Wn(e,t,n){(void 0!==n&&!Oi(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function zn(e,t,n){var o=e[t];_e.call(e,t)&&Oi(o,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function Hn(e,t){for(var n=e.length;n--;)if(Oi(e[n][0],t))return n;return-1}function Vn(e,t,n,o){return Jn(e,function(e,r,l){t(o,e,n(e),l)}),o}function qn(e,t){return e&&gr(t,ba(t),e)}function Yn(e,t,n){"__proto__"==t&&Gt?Gt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Gn(e,t){for(var n=-1,o=t.length,r=f(o),l=null==e;++n<o;)r[n]=l?void 0:pa(e,t[n]);return r}function $n(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,o,r,i){var s,f=1&t,b=2&t,I=4&t;if(n&&(s=r?n(e,o,r,i):n(e)),void 0!==s)return s;if(!Hi(e))return e;var x=Ri(e);if(x){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_e.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!f)return hr(e,s)}else{var R=tl(e),L=R==c||R==d;if(ki(e))return cr(e,f);if(R==p||R==l||L&&!r){if(s=b||L?{}:ol(e),!f)return b?function(e,t){return gr(e,el(e),t)}(e,function(e,t){return e&&gr(t,_a(t),e)}(s,e)):function(e,t){return gr(e,Jr(e),t)}(e,qn(s,e))}else{if(!ke[R])return r?e:{};s=function(e,t,n){var o=e.constructor;switch(t){case _:return dr(e);case a:case u:return new o(+e);case N:return function(e,t){var n=t?dr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case S:case D:case C:case w:case A:case T:case"[object Uint8ClampedArray]":case O:case P:return mr(e,n);case m:return new o;case v:case y:return new o(e);case h:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return new o;case E:return Cn?ve(Cn.call(e)):{}}}(e,R,f)}}i||(i=new Mn);var F=i.get(e);if(F)return F;i.set(e,s),Ki(e)?e.forEach(function(o){s.add(Kn(o,t,n,o,e,i))}):qi(e)&&e.forEach(function(o,r){s.set(r,Kn(o,t,n,r,e,i))});var M=x?void 0:(I?b?qr:Vr:b?_a:ba)(e);return ot(M||e,function(o,r){M&&(o=e[r=o]),zn(s,r,Kn(o,t,n,r,e,i))}),s}function Xn(e,t,n){var o=n.length;if(null==e)return!o;for(e=ve(e);o--;){var r=n[o],l=e[r];if(void 0===l&&!(r in e)||!(0,t[r])(l))return!1}return!0}function Zn(e,t,o){if("function"!=typeof e)throw new he(n);return yl(function(){e.apply(void 0,o)},t)}function Qn(e,t,n,o){var r=-1,l=at,i=!0,a=e.length,u=[],s=t.length;if(!a)return u;n&&(t=st(t,At(n))),o?(l=ut,i=!1):t.length>=200&&(l=Ot,i=!1,t=new Fn(t));e:for(;++r<a;){var c=e[r],d=null==n?c:n(c);if(c=o||0!==c?c:0,i&&d==d){for(var m=s;m--;)if(t[m]===d)continue e;u.push(c)}else l(t,d,o)||u.push(c)}return u}An.templateSettings={escape:B,evaluate:U,interpolate:j,variable:"",imports:{_:An}},(An.prototype=On.prototype).constructor=An,(Pn.prototype=Tn(On.prototype)).constructor=Pn,(In.prototype=Tn(On.prototype)).constructor=In,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 _e.call(t,e)?t[e]:void 0},xn.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:_e.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},Rn.prototype.clear=function(){this.__data__=[],this.size=0},Rn.prototype.delete=function(e){var t=this.__data__,n=Hn(t,e);return!(n<0||(n==t.length-1?t.pop():Ge.call(t,n,1),--this.size,0))},Rn.prototype.get=function(e){var t=this.__data__,n=Hn(t,e);return n<0?void 0:t[n][1]},Rn.prototype.has=function(e){return Hn(this.__data__,e)>-1},Rn.prototype.set=function(e,t){var n=this.__data__,o=Hn(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this},Ln.prototype.clear=function(){this.size=0,this.__data__={hash:new xn,map:new(mn||Rn),string:new xn}},Ln.prototype.delete=function(e){var t=Xr(this,e).delete(e);return this.size-=t?1:0,t},Ln.prototype.get=function(e){return Xr(this,e).get(e)},Ln.prototype.has=function(e){return Xr(this,e).has(e)},Ln.prototype.set=function(e,t){var n=Xr(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new Rn,this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mn.prototype.get=function(e){return this.__data__.get(e)},Mn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Rn){var o=n.__data__;if(!mn||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ln(o)}return n.set(e,t),this.size=n.size,this};var Jn=br(ao),eo=br(uo,!0);function to(e,t){var n=!0;return Jn(e,function(e,o,r){return n=!!t(e,o,r)}),n}function no(e,t,n){for(var o=-1,r=e.length;++o<r;){var l=e[o],i=t(l);if(null!=i&&(void 0===a?i==i&&!Zi(i):n(i,a)))var a=i,u=l}return u}function oo(e,t){var n=[];return Jn(e,function(e,o,r){t(e,o,r)&&n.push(e)}),n}function ro(e,t,n,o,r){var l=-1,i=e.length;for(n||(n=rl),r||(r=[]);++l<i;){var a=e[l];t>0&&n(a)?t>1?ro(a,t-1,n,o,r):ct(r,a):o||(r[r.length]=a)}return r}var lo=_r(),io=_r(!0);function ao(e,t){return e&&lo(e,t,ba)}function uo(e,t){return e&&io(e,t,ba)}function so(e,t){return it(t,function(t){return ji(e[t])})}function co(e,t){for(var n=0,o=(t=ir(t,e)).length;null!=e&&n<o;)e=e[wl(t[n++])];return n&&n==o?e:void 0}function mo(e,t,n){var o=t(e);return Ri(e)?o:ct(o,n(e))}function vo(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Nt&&Nt in ve(e)?function(e){var t=_e.call(e,Nt),n=e[Nt];try{e[Nt]=void 0;var o=!0}catch(e){}var r=De.call(e);return o&&(t?e[Nt]=n:delete e[Nt]),r}(e):function(e){return De.call(e)}(e)}function fo(e,t){return e>t}function po(e,t){return null!=e&&_e.call(e,t)}function ho(e,t){return null!=e&&t in ve(e)}function go(e,t,n){for(var o=n?ut:at,r=e[0].length,l=e.length,i=l,a=f(l),u=Infinity,s=[];i--;){var c=e[i];i&&t&&(c=st(c,At(t))),u=ln(c.length,u),a[i]=!n&&(t||r>=120&&c.length>=120)?new Fn(i&&c):void 0}c=e[0];var d=-1,m=a[0];e:for(;++d<r&&s.length<u;){var v=c[d],p=t?t(v):v;if(v=n||0!==v?v:0,!(m?Ot(m,p):o(s,p,n))){for(i=l;--i;){var h=a[i];if(!(h?Ot(h,p):o(e[i],p,n)))continue e}m&&m.push(p),s.push(v)}}return s}function yo(e,t,n){var o=null==(e=fl(e,t=ir(t,e)))?e:e[wl(Ul(t))];return null==o?void 0:tt(o,e,n)}function Eo(e){return Vi(e)&&vo(e)==l}function bo(e,t,n,o,r){return e===t||(null==e||null==t||!Vi(e)&&!Vi(t)?e!=e&&t!=t:function(e,t,n,o,r,c){var d=Ri(e),f=Ri(t),b=d?i:tl(e),S=f?i:tl(t),D=(b=b==l?p:b)==p,C=(S=S==l?p:S)==p,w=b==S;if(w&&ki(e)){if(!ki(t))return!1;d=!0,D=!1}if(w&&!D)return c||(c=new Mn),d||Qi(e)?zr(e,t,n,o,r,c):function(e,t,n,o,r,l,i){switch(n){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!l(new Be(e),new Be(t)));case a:case u:case v:return Oi(+e,+t);case s:return e.name==t.name&&e.message==t.message;case h:case y:return e==t+"";case m:var c=kt;case g:if(c||(c=jt),e.size!=t.size&&!(1&o))return!1;var d=i.get(e);if(d)return d==t;o|=2,i.set(e,t);var f=zr(c(e),c(t),o,r,l,i);return i.delete(e),f;case E:if(Cn)return Cn.call(e)==Cn.call(t)}return!1}(e,t,b,n,o,r,c);if(!(1&n)){var A=D&&_e.call(e,"__wrapped__"),T=C&&_e.call(t,"__wrapped__");if(A||T){var O=A?e.value():e,P=T?t.value():t;return c||(c=new Mn),r(O,P,n,o,c)}}return!!w&&(c||(c=new Mn),function(e,t,n,o,r,l){var i=1&n,a=Vr(e),u=a.length;if(u!=Vr(t).length&&!i)return!1;for(var s=u;s--;){var c=a[s];if(!(i?c in t:_e.call(t,c)))return!1}var d=l.get(e),m=l.get(t);if(d&&m)return d==t&&m==e;var v=!0;l.set(e,t),l.set(t,e);for(var f=i;++s<u;){var p=e[c=a[s]],h=t[c];if(o)var g=i?o(h,p,c,t,e,l):o(p,h,c,e,t,l);if(!(void 0===g?p===h||r(p,h,n,o,l):g)){v=!1;break}f||(f="constructor"==c)}if(v&&!f){var y=e.constructor,E=t.constructor;y==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof E&&E instanceof E||(v=!1)}return l.delete(e),l.delete(t),v}(e,t,n,o,r,c))}(e,t,n,o,bo,r))}function _o(e,t,n,o){var r=n.length,l=r,i=!o;if(null==e)return!l;for(e=ve(e);r--;){var a=n[r];if(i&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<l;){var u=(a=n[r])[0],s=e[u],c=a[1];if(i&&a[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Mn;if(o)var m=o(s,c,u,e,t,d);if(!(void 0===m?bo(c,s,3,o,d):m))return!1}}return!0}function No(e){return!(!Hi(e)||(t=e,Se&&Se in t))&&(ji(e)?Ae:re).test(Al(e));var t}function So(e){return"function"==typeof e?e:null==e?Ya:"object"==typeof e?Ri(e)?To(e[0],e[1]):Ao(e):tu(e)}function Do(e){if(!cl(e))return on(e);var t=[];for(var n in ve(e))_e.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Co(e,t){return e<t}function wo(e,t){var n=-1,o=Fi(e)?f(e.length):[];return Jn(e,function(e,r,l){o[++n]=t(e,r,l)}),o}function Ao(e){var t=Zr(e);return 1==t.length&&t[0][2]?ml(t[0][0],t[0][1]):function(n){return n===e||_o(n,e,t)}}function To(e,t){return al(e)&&dl(t)?ml(wl(e),t):function(n){var o=pa(n,e);return void 0===o&&o===t?ha(n,e):bo(t,o,3)}}function Oo(e,t,n,o,r){e!==t&&lo(t,function(l,i){if(r||(r=new Mn),Hi(l))!function(e,t,n,o,r,l,i){var a=hl(e,n),u=hl(t,n),s=i.get(u);if(s)Wn(e,n,s);else{var c=l?l(a,u,n+"",e,t,i):void 0,d=void 0===c;if(d){var m=Ri(u),v=!m&&ki(u),f=!m&&!v&&Qi(u);c=u,m||v||f?Ri(a)?c=a:Mi(a)?c=hr(a):v?(d=!1,c=cr(u,!0)):f?(d=!1,c=mr(u,!0)):c=[]:Gi(u)||xi(u)?(c=a,xi(a)?c=ia(a):Hi(a)&&!ji(a)||(c=ol(u))):d=!1}d&&(i.set(u,c),r(c,u,o,l,i),i.delete(u)),Wn(e,n,c)}}(e,t,i,n,Oo,o,r);else{var a=o?o(hl(e,i),l,i+"",e,t,r):void 0;void 0===a&&(a=l),Wn(e,i,a)}},_a)}function Po(e,t){var n=e.length;if(n)return ll(t+=t<0?n:0,n)?e[t]:void 0}function Io(e,t,n){t=t.length?st(t,function(e){return Ri(e)?function(t){return co(t,1===e.length?e[0]:e)}:e}):[Ya];var o=-1;return t=st(t,At(Kr())),function(e,t){var o=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var o=-1,r=e.criteria,l=t.criteria,i=r.length,a=n.length;++o<i;){var u=vr(r[o],l[o]);if(u)return o>=a?u:u*("desc"==n[o]?-1:1)}return e.index-t.index}(e,t,n)});o--;)e[o]=e[o].value;return e}(wo(e,function(e,n,r){return{criteria:st(t,function(t){return t(e)}),index:++o,value:e}}))}function xo(e,t,n){for(var o=-1,r=t.length,l={};++o<r;){var i=t[o],a=co(e,i);n(a,i)&&jo(l,ir(i,e),a)}return l}function Ro(e,t,n,o){var r=o?yt:gt,l=-1,i=t.length,a=e;for(e===t&&(t=hr(t)),n&&(a=st(e,At(n)));++l<i;)for(var u=0,s=t[l],c=n?n(s):s;(u=r(a,c,u,o))>-1;)a!==e&&Ge.call(a,u,1),Ge.call(e,u,1);return e}function Lo(e,t){for(var n=e?t.length:0,o=n-1;n--;){var r=t[n];if(n==o||r!==l){var l=r;ll(r)?Ge.call(e,r,1):Qo(e,r)}}return e}function Fo(e,t){return e+Qt(sn()*(t-e+1))}function Mo(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 ko(e,t){return El(vl(e,t,Ya),e+"")}function Bo(e){return Bn(Oa(e))}function Uo(e,t){var n=Oa(e);return Nl(n,$n(t,0,n.length))}function jo(e,t,n,o){if(!Hi(e))return e;for(var r=-1,l=(t=ir(t,e)).length,i=l-1,a=e;null!=a&&++r<l;){var u=wl(t[r]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(r!=i){var c=a[u];void 0===(s=o?o(c,u,a):void 0)&&(s=Hi(c)?c:ll(t[r+1])?[]:{})}zn(a,u,s),a=a[u]}return e}var Wo=gn?function(e,t){return gn.set(e,t),e}:Ya,zo=Gt?function(e,t){return Gt(e,"toString",{configurable:!0,enumerable:!1,value:Ha(t),writable:!0})}:Ya;function Ho(e){return Nl(Oa(e))}function Vo(e,t,n){var o=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var l=f(r);++o<r;)l[o]=e[o+t];return l}function qo(e,t){var n;return Jn(e,function(e,o,r){return!(n=t(e,o,r))}),!!n}function Yo(e,t,n){var o=0,r=null==e?o:e.length;if("number"==typeof t&&t==t&&r<=2147483647){for(;o<r;){var l=o+r>>>1,i=e[l];null!==i&&!Zi(i)&&(n?i<=t:i<t)?o=l+1:r=l}return r}return Go(e,t,Ya,n)}function Go(e,t,n,o){var r=0,l=null==e?0:e.length;if(0===l)return 0;for(var i=(t=n(t))!=t,a=null===t,u=Zi(t),s=void 0===t;r<l;){var c=Qt((r+l)/2),d=n(e[c]),m=void 0!==d,v=null===d,f=d==d,p=Zi(d);if(i)var h=o||f;else h=s?f&&(o||m):a?f&&m&&(o||!v):u?f&&m&&!v&&(o||!p):!v&&!p&&(o?d<=t:d<t);h?r=c+1:l=c}return ln(l,4294967294)}function $o(e,t){for(var n=-1,o=e.length,r=0,l=[];++n<o;){var i=e[n],a=t?t(i):i;if(!n||!Oi(a,u)){var u=a;l[r++]=0===i?0:i}}return l}function Ko(e){return"number"==typeof e?e:Zi(e)?NaN:+e}function Xo(e){if("string"==typeof e)return e;if(Ri(e))return st(e,Xo)+"";if(Zi(e))return wn?wn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Zo(e,t,n){var o=-1,r=at,l=e.length,i=!0,a=[],u=a;if(n)i=!1,r=ut;else if(l>=200){var s=t?null:Mr(e);if(s)return jt(s);i=!1,r=Ot,u=new Fn}else u=t?[]:a;e:for(;++o<l;){var c=e[o],d=t?t(c):c;if(c=n||0!==c?c:0,i&&d==d){for(var m=u.length;m--;)if(u[m]===d)continue e;t&&u.push(d),a.push(c)}else r(u,d,n)||(u!==a&&u.push(d),a.push(c))}return a}function Qo(e,t){return null==(e=fl(e,t=ir(t,e)))||delete e[wl(Ul(t))]}function Jo(e,t,n,o){return jo(e,t,n(co(e,t)),o)}function er(e,t,n,o){for(var r=e.length,l=o?r:-1;(o?l--:++l<r)&&t(e[l],l,e););return n?Vo(e,o?0:l,o?l+1:r):Vo(e,o?l+1:0,o?r:l)}function tr(e,t){var n=e;return n instanceof In&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function nr(e,t,n){var o=e.length;if(o<2)return o?Zo(e[0]):[];for(var r=-1,l=f(o);++r<o;)for(var i=e[r],a=-1;++a<o;)a!=r&&(l[r]=Qn(l[r]||i,e[a],t,n));return Zo(ro(l,1),t,n)}function or(e,t,n){for(var o=-1,r=e.length,l=t.length,i={};++o<r;)n(i,e[o],o<l?t[o]:void 0);return i}function rr(e){return Mi(e)?e:[]}function lr(e){return"function"==typeof e?e:Ya}function ir(e,t){return Ri(e)?e:al(e,t)?[e]:Cl(aa(e))}var ar=ko;function ur(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:Vo(e,t,n)}var sr=$t||function(e){return He.clearTimeout(e)};function cr(e,t){if(t)return e.slice();var n=e.length,o=We?We(n):new e.constructor(n);return e.copy(o),o}function dr(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function mr(e,t){var n=t?dr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vr(e,t){if(e!==t){var n=void 0!==e,o=null===e,r=e==e,l=Zi(e),i=void 0!==t,a=null===t,u=t==t,s=Zi(t);if(!a&&!s&&!l&&e>t||l&&i&&u&&!a&&!s||o&&i&&u||!n&&u||!r)return 1;if(!o&&!l&&!s&&e<t||s&&n&&r&&!o&&!l||a&&n&&r||!i&&r||!u)return-1}return 0}function fr(e,t,n,o){for(var r=-1,l=e.length,i=n.length,a=-1,u=t.length,s=rn(l-i,0),c=f(u+s),d=!o;++a<u;)c[a]=t[a];for(;++r<i;)(d||r<l)&&(c[n[r]]=e[r]);for(;s--;)c[a++]=e[r++];return c}function pr(e,t,n,o){for(var r=-1,l=e.length,i=-1,a=n.length,u=-1,s=t.length,c=rn(l-a,0),d=f(c+s),m=!o;++r<c;)d[r]=e[r];for(var v=r;++u<s;)d[v+u]=t[u];for(;++i<a;)(m||r<l)&&(d[v+n[i]]=e[r++]);return d}function hr(e,t){var n=-1,o=e.length;for(t||(t=f(o));++n<o;)t[n]=e[n];return t}function gr(e,t,n,o){var r=!n;n||(n={});for(var l=-1,i=t.length;++l<i;){var a=t[l],u=o?o(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),r?Yn(n,a,u):zn(n,a,u)}return n}function yr(e,t){return function(n,o){var r=Ri(n)?nt:Vn,l=t?t():{};return r(n,e,Kr(o,2),l)}}function Er(e){return ko(function(t,n){var o=-1,r=n.length,l=r>1?n[r-1]:void 0,i=r>2?n[2]:void 0;for(l=e.length>3&&"function"==typeof l?(r--,l):void 0,i&&il(n[0],n[1],i)&&(l=r<3?void 0:l,r=1),t=ve(t);++o<r;){var a=n[o];a&&e(t,a,o,l)}return t})}function br(e,t){return function(n,o){if(null==n)return n;if(!Fi(n))return e(n,o);for(var r=n.length,l=t?r:-1,i=ve(n);(t?l--:++l<r)&&!1!==o(i[l],l,i););return n}}function _r(e){return function(t,n,o){for(var r=-1,l=ve(t),i=o(t),a=i.length;a--;){var u=i[e?a:++r];if(!1===n(l[u],u,l))break}return t}}function Nr(e){return function(t){var n=Mt(t=aa(t))?Ht(t):void 0,o=n?n[0]:t.charAt(0),r=n?ur(n,1).join(""):t.slice(1);return o[e]()+r}}function Sr(e){return function(t){return dt(ja(xa(t).replace(Te,"")),e,"")}}function Dr(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=Tn(e.prototype),o=e.apply(n,t);return Hi(o)?o:n}}function Cr(e){return function(t,n,o){var r=ve(t);if(!Fi(t)){var l=Kr(n,3);t=ba(t),n=function(e){return l(r[e],e,r)}}var i=e(t,n,o);return i>-1?r[l?t[i]:i]:void 0}}function wr(e){return Hr(function(t){var o=t.length,r=o,l=Pn.prototype.thru;for(e&&t.reverse();r--;){var i=t[r];if("function"!=typeof i)throw new he(n);if(l&&!a&&"wrapper"==Gr(i))var a=new Pn([],!0)}for(r=a?r:o;++r<o;){var u=Gr(i=t[r]),s="wrapper"==u?Yr(i):void 0;a=s&&ul(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?a[Gr(s[0])].apply(a,s[3]):1==i.length&&ul(i)?a[u]():a.thru(i)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Ri(n))return a.plant(n).value();for(var r=0,l=o?t[r].apply(this,e):n;++r<o;)l=t[r].call(this,l);return l}})}function Ar(e,t,n,o,r,l,i,a,u,s){var c=128&t,d=1&t,m=2&t,v=24&t,p=512&t,h=m?void 0:Dr(e);return function g(){for(var y=arguments.length,E=f(y),b=y;b--;)E[b]=arguments[b];if(v)var _=$r(g),N=xt(E,_);if(o&&(E=fr(E,o,r,v)),l&&(E=pr(E,l,i,v)),y-=N,v&&y<s){var S=Ut(E,_);return Lr(e,t,Ar,g.placeholder,n,E,S,a,u,s-y)}var D=d?n:this,C=m?D[e]:e;return y=E.length,a?E=pl(E,a):p&&y>1&&E.reverse(),c&&u<y&&(E.length=u),this&&this!==He&&this instanceof g&&(C=h||Dr(C)),C.apply(D,E)}}function Tr(e,t){return function(n,o){return function(e,t,n,o){return ao(e,function(e,r,l){t(o,n(e),r,l)}),o}(n,e,t(o),{})}}function Or(e,t){return function(n,o){var r;if(void 0===n&&void 0===o)return t;if(void 0!==n&&(r=n),void 0!==o){if(void 0===r)return o;"string"==typeof n||"string"==typeof o?(n=Xo(n),o=Xo(o)):(n=Ko(n),o=Ko(o)),r=e(n,o)}return r}}function Pr(e){return Hr(function(t){return t=st(t,At(Kr())),ko(function(n){var o=this;return e(t,function(e){return tt(e,o,n)})})})}function Ir(e,t){var n=(t=void 0===t?" ":Xo(t)).length;if(n<2)return n?Mo(t,e):t;var o=Mo(t,Zt(e/zt(t)));return Mt(t)?ur(Ht(o),0,e).join(""):o.slice(0,e)}function xr(e){return function(t,n,o){return o&&"number"!=typeof o&&il(t,n,o)&&(n=o=void 0),t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n,o){for(var r=-1,l=rn(Zt((t-e)/(n||1)),0),i=f(l);l--;)i[o?l:++r]=e,e+=n;return i}(t,n,o=void 0===o?t<n?1:-1:na(o),e)}}function Rr(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=la(t),n=la(n)),e(t,n)}}function Lr(e,t,n,o,r,l,i,a,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,r,c?l:void 0,c?i:void 0,c?void 0:l,c?void 0:i,a,u,s],m=n.apply(void 0,d);return ul(e)&&gl(m,d),m.placeholder=o,bl(m,e,t)}function Fr(e){var t=me[e];return function(e,n){if(e=la(e),(n=null==n?0:ln(oa(n),292))&&tn(e)){var o=(aa(e)+"e").split("e");return+((o=(aa(t(o[0]+"e"+(+o[1]+n)))+"e").split("e"))[0]+"e"+(+o[1]-n))}return t(e)}}var Mr=fn&&1/jt(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Za;function kr(e){return function(t){var n=tl(t);return n==m?kt(t):n==g?Wt(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Br(e,t,r,l,i,a,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new he(n);var d=l?l.length:0;if(d||(t&=-97,l=i=void 0),u=void 0===u?u:rn(oa(u),0),s=void 0===s?s:oa(s),d-=i?i.length:0,64&t){var m=l,v=i;l=i=void 0}var p=c?void 0:Yr(e),h=[e,t,r,l,i,m,v,a,u,s];if(p&&function(e,t){var n=e[1],r=t[1],l=n|r;if(!(l<131||128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n))return e;1&r&&(e[2]=t[2],l|=1&n?0:4);var i=t[3];if(i){var a=e[3];e[3]=a?fr(a,i,t[4]):i,e[4]=a?Ut(e[3],o):t[4]}(i=t[5])&&(e[5]=(a=e[5])?pr(a,i,t[6]):i,e[6]=a?Ut(e[5],o):t[6]),(i=t[7])&&(e[7]=i),128&r&&(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]=l}(h,p),e=h[0],t=h[1],r=h[2],l=h[3],i=h[4],!(s=h[9]=void 0===h[9]?c?0:e.length:rn(h[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var o=Dr(e);return function r(){for(var l=arguments.length,i=f(l),a=l,u=$r(r);a--;)i[a]=arguments[a];var s=l<3&&i[0]!==u&&i[l-1]!==u?[]:Ut(i,u);if((l-=s.length)<n)return Lr(e,t,Ar,r.placeholder,void 0,i,s,void 0,void 0,n-l);var c=this&&this!==He&&this instanceof r?o:e;return tt(c,this,i)}}(e,t,s):32!=t&&33!=t||i.length?Ar.apply(void 0,h):function(e,t,n,o){var r=1&t,l=Dr(e);return function t(){for(var i=-1,a=arguments.length,u=-1,s=o.length,c=f(s+a),d=this&&this!==He&&this instanceof t?l:e;++u<s;)c[u]=o[u];for(;a--;)c[u++]=arguments[++i];return tt(d,r?n:this,c)}}(e,t,r,l);else var g=function(e,t,n){var o=1&t,r=Dr(e);return function t(){var l=this&&this!==He&&this instanceof t?r:e;return l.apply(o?n:this,arguments)}}(e,t,r);return bl((p?Wo:gl)(g,h),e,t)}function Ur(e,t,n,o){return void 0===e||Oi(e,ye[n])&&!_e.call(o,n)?t:e}function jr(e,t,n,o,r,l){return Hi(e)&&Hi(t)&&(l.set(t,e),Oo(e,t,void 0,jr,l),l.delete(t)),e}function Wr(e){return Gi(e)?void 0:e}function zr(e,t,n,o,r,l){var i=1&n,a=e.length,u=t.length;if(a!=u&&!(i&&u>a))return!1;var s=l.get(e),c=l.get(t);if(s&&c)return s==t&&c==e;var d=-1,m=!0,v=2&n?new Fn:void 0;for(l.set(e,t),l.set(t,e);++d<a;){var f=e[d],p=t[d];if(o)var h=i?o(p,f,d,t,e,l):o(f,p,d,e,t,l);if(void 0!==h){if(h)continue;m=!1;break}if(v){if(!vt(t,function(e,t){if(!Ot(v,t)&&(f===e||r(f,e,n,o,l)))return v.push(t)})){m=!1;break}}else if(f!==p&&!r(f,p,n,o,l)){m=!1;break}}return l.delete(e),l.delete(t),m}function Hr(e){return El(vl(e,void 0,Ll),e+"")}function Vr(e){return mo(e,ba,Jr)}function qr(e){return mo(e,_a,el)}var Yr=gn?function(e){return gn.get(e)}:Za;function Gr(e){for(var t=e.name+"",n=yn[t],o=_e.call(yn,t)?n.length:0;o--;){var r=n[o],l=r.func;if(null==l||l==e)return r.name}return t}function $r(e){return(_e.call(An,"placeholder")?An:e).placeholder}function Kr(){var e=An.iteratee||Ga;return e=e===Ga?So:e,arguments.length?e(arguments[0],arguments[1]):e}function Xr(e,t){var n,o,r=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Zr(e){for(var t=ba(e),n=t.length;n--;){var o=t[n],r=e[o];t[n]=[o,r,dl(r)]}return t}function Qr(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return No(n)?n:void 0}var Jr=Jt?function(e){return null==e?[]:(e=ve(e),it(Jt(e),function(t){return qe.call(e,t)}))}:ru,el=Jt?function(e){for(var t=[];e;)ct(t,Jr(e)),e=ze(e);return t}:ru,tl=vo;function nl(e,t,n){for(var o=-1,r=(t=ir(t,e)).length,l=!1;++o<r;){var i=wl(t[o]);if(!(l=null!=e&&n(e,i)))break;e=e[i]}return l||++o!=r?l:!!(r=null==e?0:e.length)&&zi(r)&&ll(i,r)&&(Ri(e)||xi(e))}function ol(e){return"function"!=typeof e.constructor||cl(e)?{}:Tn(ze(e))}function rl(e){return Ri(e)||xi(e)||!!($e&&e&&e[$e])}function ll(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ie.test(e))&&e>-1&&e%1==0&&e<t}function il(e,t,n){if(!Hi(n))return!1;var o=typeof t;return!!("number"==o?Fi(n)&&ll(t,n.length):"string"==o&&t in n)&&Oi(n[t],e)}function al(e,t){if(Ri(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Zi(e))||z.test(e)||!W.test(e)||null!=t&&e in ve(t)}function ul(e){var t=Gr(e),n=An[t];if("function"!=typeof n||!(t in In.prototype))return!1;if(e===n)return!0;var o=Yr(n);return!!o&&e===o[0]}(dn&&tl(new dn(new ArrayBuffer(1)))!=N||mn&&tl(new mn)!=m||vn&&"[object Promise]"!=tl(vn.resolve())||fn&&tl(new fn)!=g||pn&&tl(new pn)!=b)&&(tl=function(e){var t=vo(e),n=t==p?e.constructor:void 0,o=n?Al(n):"";if(o)switch(o){case En:return N;case bn:return m;case _n:return"[object Promise]";case Nn:return g;case Sn:return b}return t});var sl=Ee?ji:lu;function cl(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ye)}function dl(e){return e==e&&!Hi(e)}function ml(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in ve(n))}}function vl(e,t,n){return t=rn(void 0===t?e.length-1:t,0),function(){for(var o=arguments,r=-1,l=rn(o.length-t,0),i=f(l);++r<l;)i[r]=o[t+r];r=-1;for(var a=f(t+1);++r<t;)a[r]=o[r];return a[t]=n(i),tt(e,this,a)}}function fl(e,t){return t.length<2?e:co(e,Vo(t,0,-1))}function pl(e,t){for(var n=e.length,o=ln(t.length,n),r=hr(e);o--;){var l=t[o];e[o]=ll(l,n)?r[l]:void 0}return e}function hl(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var gl=_l(Wo),yl=Xt||function(e,t){return He.setTimeout(e,t)},El=_l(zo);function bl(e,t,n){var o=t+"";return El(e,function(e,t){var n=t.length;if(!n)return e;var o=n-1;return t[o]=(n>1?"& ":"")+t[o],t=t.join(n>2?", ":" "),e.replace($,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return ot(r,function(n){var o="_."+n[0];t&n[1]&&!at(e,o)&&e.push(o)}),e.sort()}(function(e){var t=e.match(K);return t?t[1].split(X):[]}(o),n)))}function _l(e){var t=0,n=0;return function(){var o=an(),r=16-(o-n);if(n=o,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Nl(e,t){var n=-1,o=e.length,r=o-1;for(t=void 0===t?o:t;++n<t;){var l=Fo(n,r),i=e[l];e[l]=e[n],e[n]=i}return e.length=t,e}var Sl,Dl,Cl=(Sl=Si(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(H,function(e,n,o,r){t.push(o?r.replace(J,"$1"):n||e)}),t},function(e){return 500===Dl.size&&Dl.clear(),e}),Dl=Sl.cache,Sl);function wl(e){if("string"==typeof e||Zi(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Al(e){if(null!=e){try{return be.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Tl(e){if(e instanceof In)return e.clone();var t=new Pn(e.__wrapped__,e.__chain__);return t.__actions__=hr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ol=ko(function(e,t){return Mi(e)?Qn(e,ro(t,1,Mi,!0)):[]}),Pl=ko(function(e,t){var n=Ul(t);return Mi(n)&&(n=void 0),Mi(e)?Qn(e,ro(t,1,Mi,!0),Kr(n,2)):[]}),Il=ko(function(e,t){var n=Ul(t);return Mi(n)&&(n=void 0),Mi(e)?Qn(e,ro(t,1,Mi,!0),void 0,n):[]});function xl(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=null==n?0:oa(n);return r<0&&(r=rn(o+r,0)),ht(e,Kr(t,3),r)}function Rl(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=o-1;return void 0!==n&&(r=oa(n),r=n<0?rn(o+r,0):ln(r,o-1)),ht(e,Kr(t,3),r,!0)}function Ll(e){return null!=e&&e.length?ro(e,1):[]}function Fl(e){return e&&e.length?e[0]:void 0}var Ml=ko(function(e){var t=st(e,rr);return t.length&&t[0]===e[0]?go(t):[]}),kl=ko(function(e){var t=Ul(e),n=st(e,rr);return t===Ul(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?go(n,Kr(t,2)):[]}),Bl=ko(function(e){var t=Ul(e),n=st(e,rr);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?go(n,void 0,t):[]});function Ul(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var jl=ko(Wl);function Wl(e,t){return e&&e.length&&t&&t.length?Ro(e,t):e}var zl=Hr(function(e,t){var n=null==e?0:e.length,o=Gn(e,t);return Lo(e,st(t,function(e){return ll(e,n)?+e:e}).sort(vr)),o});function Hl(e){return null==e?e:cn.call(e)}var Vl=ko(function(e){return Zo(ro(e,1,Mi,!0))}),ql=ko(function(e){var t=Ul(e);return Mi(t)&&(t=void 0),Zo(ro(e,1,Mi,!0),Kr(t,2))}),Yl=ko(function(e){var t=Ul(e);return t="function"==typeof t?t:void 0,Zo(ro(e,1,Mi,!0),void 0,t)});function Gl(e){if(!e||!e.length)return[];var t=0;return e=it(e,function(e){if(Mi(e))return t=rn(e.length,t),!0}),Ct(t,function(t){return st(e,_t(t))})}function $l(e,t){if(!e||!e.length)return[];var n=Gl(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Kl=ko(function(e,t){return Mi(e)?Qn(e,t):[]}),Xl=ko(function(e){return nr(it(e,Mi))}),Zl=ko(function(e){var t=Ul(e);return Mi(t)&&(t=void 0),nr(it(e,Mi),Kr(t,2))}),Ql=ko(function(e){var t=Ul(e);return t="function"==typeof t?t:void 0,nr(it(e,Mi),void 0,t)}),Jl=ko(Gl),ei=ko(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,$l(e,n)});function ti(e){var t=An(e);return t.__chain__=!0,t}function ni(e,t){return t(e)}var oi=Hr(function(e){var t=e.length,n=t?e[0]:0,o=this.__wrapped__,r=function(t){return Gn(t,e)};return!(t>1||this.__actions__.length)&&o instanceof In&&ll(n)?((o=o.slice(n,+n+(t?1:0))).__actions__.push({func:ni,args:[r],thisArg:void 0}),new Pn(o,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(r)}),ri=yr(function(e,t,n){_e.call(e,n)?++e[n]:Yn(e,n,1)}),li=Cr(xl),ii=Cr(Rl);function ai(e,t){return(Ri(e)?ot:Jn)(e,Kr(t,3))}function ui(e,t){return(Ri(e)?rt:eo)(e,Kr(t,3))}var si=yr(function(e,t,n){_e.call(e,n)?e[n].push(t):Yn(e,n,[t])}),ci=ko(function(e,t,n){var o=-1,r="function"==typeof t,l=Fi(e)?f(e.length):[];return Jn(e,function(e){l[++o]=r?tt(t,e,n):yo(e,t,n)}),l}),di=yr(function(e,t,n){Yn(e,n,t)});function mi(e,t){return(Ri(e)?st:wo)(e,Kr(t,3))}var vi=yr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fi=ko(function(e,t){if(null==e)return[];var n=t.length;return n>1&&il(e,t[0],t[1])?t=[]:n>2&&il(t[0],t[1],t[2])&&(t=[t[0]]),Io(e,ro(t,1),[])}),pi=Kt||function(){return He.Date.now()};function hi(e,t,n){return t=n?void 0:t,Br(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function gi(e,t){var o;if("function"!=typeof t)throw new he(n);return e=oa(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=void 0),o}}var yi=ko(function(e,t,n){var o=1;if(n.length){var r=Ut(n,$r(yi));o|=32}return Br(e,o,t,n,r)}),Ei=ko(function(e,t,n){var o=3;if(n.length){var r=Ut(n,$r(Ei));o|=32}return Br(t,o,e,n,r)});function bi(e,t,o){var r,l,i,a,u,s,c=0,d=!1,m=!1,v=!0;if("function"!=typeof e)throw new he(n);function f(t){var n=r,o=l;return r=l=void 0,c=t,a=e.apply(o,n)}function p(e){return c=e,u=yl(g,t),d?f(e):a}function h(e){var n=e-s;return void 0===s||n>=t||n<0||m&&e-c>=i}function g(){var e=pi();if(h(e))return y(e);u=yl(g,function(e){var n=t-(e-s);return m?ln(n,i-(e-c)):n}(e))}function y(e){return u=void 0,v&&r?f(e):(r=l=void 0,a)}function E(){var e=pi(),n=h(e);if(r=arguments,l=this,s=e,n){if(void 0===u)return p(s);if(m)return sr(u),u=yl(g,t),f(s)}return void 0===u&&(u=yl(g,t)),a}return t=la(t)||0,Hi(o)&&(d=!!o.leading,i=(m="maxWait"in o)?rn(la(o.maxWait)||0,t):i,v="trailing"in o?!!o.trailing:v),E.cancel=function(){void 0!==u&&sr(u),c=0,r=s=l=u=void 0},E.flush=function(){return void 0===u?a:y(pi())},E}var _i=ko(function(e,t){return Zn(e,1,t)}),Ni=ko(function(e,t,n){return Zn(e,la(t)||0,n)});function Si(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new he(n);var o=function(){var n=arguments,r=t?t.apply(this,n):n[0],l=o.cache;if(l.has(r))return l.get(r);var i=e.apply(this,n);return o.cache=l.set(r,i)||l,i};return o.cache=new(Si.Cache||Ln),o}function Di(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)}}Si.Cache=Ln;var Ci=ar(function(e,t){var n=(t=1==t.length&&Ri(t[0])?st(t[0],At(Kr())):st(ro(t,1),At(Kr()))).length;return ko(function(o){for(var r=-1,l=ln(o.length,n);++r<l;)o[r]=t[r].call(this,o[r]);return tt(e,this,o)})}),wi=ko(function(e,t){return Br(e,32,void 0,t,Ut(t,$r(wi)))}),Ai=ko(function(e,t){return Br(e,64,void 0,t,Ut(t,$r(Ai)))}),Ti=Hr(function(e,t){return Br(e,256,void 0,void 0,void 0,t)});function Oi(e,t){return e===t||e!=e&&t!=t}var Pi=Rr(fo),Ii=Rr(function(e,t){return e>=t}),xi=Eo(function(){return arguments}())?Eo:function(e){return Vi(e)&&_e.call(e,"callee")&&!qe.call(e,"callee")},Ri=f.isArray,Li=Ke?At(Ke):function(e){return Vi(e)&&vo(e)==_};function Fi(e){return null!=e&&zi(e.length)&&!ji(e)}function Mi(e){return Vi(e)&&Fi(e)}var ki=en||lu,Bi=Xe?At(Xe):function(e){return Vi(e)&&vo(e)==u};function Ui(e){if(!Vi(e))return!1;var t=vo(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Gi(e)}function ji(e){if(!Hi(e))return!1;var t=vo(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wi(e){return"number"==typeof e&&e==oa(e)}function zi(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Hi(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Vi(e){return null!=e&&"object"==typeof e}var qi=Ze?At(Ze):function(e){return Vi(e)&&tl(e)==m};function Yi(e){return"number"==typeof e||Vi(e)&&vo(e)==v}function Gi(e){if(!Vi(e)||vo(e)!=p)return!1;var t=ze(e);if(null===t)return!0;var n=_e.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&be.call(n)==Ce}var $i=Qe?At(Qe):function(e){return Vi(e)&&vo(e)==h},Ki=Je?At(Je):function(e){return Vi(e)&&tl(e)==g};function Xi(e){return"string"==typeof e||!Ri(e)&&Vi(e)&&vo(e)==y}function Zi(e){return"symbol"==typeof e||Vi(e)&&vo(e)==E}var Qi=et?At(et):function(e){return Vi(e)&&zi(e.length)&&!!Me[vo(e)]},Ji=Rr(Co),ea=Rr(function(e,t){return e<=t});function ta(e){if(!e)return[];if(Fi(e))return Xi(e)?Ht(e):hr(e);if(ft&&e[ft])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[ft]());var t=tl(e);return(t==m?kt:t==g?jt:Oa)(e)}function na(e){return e?(e=la(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function oa(e){var t=na(e),n=t%1;return t==t?n?t-n:t:0}function ra(e){return e?$n(oa(e),0,4294967295):0}function la(e){if("number"==typeof e)return e;if(Zi(e))return NaN;if(Hi(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Hi(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=wt(e);var n=oe.test(e);return n||le.test(e)?je(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ia(e){return gr(e,_a(e))}function aa(e){return null==e?"":Xo(e)}var ua=Er(function(e,t){if(cl(t)||Fi(t))gr(t,ba(t),e);else for(var n in t)_e.call(t,n)&&zn(e,n,t[n])}),sa=Er(function(e,t){gr(t,_a(t),e)}),ca=Er(function(e,t,n,o){gr(t,_a(t),e,o)}),da=Er(function(e,t,n,o){gr(t,ba(t),e,o)}),ma=Hr(Gn),va=ko(function(e,t){e=ve(e);var n=-1,o=t.length,r=o>2?t[2]:void 0;for(r&&il(t[0],t[1],r)&&(o=1);++n<o;)for(var l=t[n],i=_a(l),a=-1,u=i.length;++a<u;){var s=i[a],c=e[s];(void 0===c||Oi(c,ye[s])&&!_e.call(e,s))&&(e[s]=l[s])}return e}),fa=ko(function(e){return e.push(void 0,jr),tt(Sa,void 0,e)});function pa(e,t,n){var o=null==e?void 0:co(e,t);return void 0===o?n:o}function ha(e,t){return null!=e&&nl(e,t,ho)}var ga=Tr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),e[t]=n},Ha(Ya)),ya=Tr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),_e.call(e,t)?e[t].push(n):e[t]=[n]},Kr),Ea=ko(yo);function ba(e){return Fi(e)?kn(e):Do(e)}function _a(e){return Fi(e)?kn(e,!0):function(e){if(!Hi(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=cl(e),n=[];for(var o in e)("constructor"!=o||!t&&_e.call(e,o))&&n.push(o);return n}(e)}var Na=Er(function(e,t,n){Oo(e,t,n)}),Sa=Er(function(e,t,n,o){Oo(e,t,n,o)}),Da=Hr(function(e,t){var n={};if(null==e)return n;var o=!1;t=st(t,function(t){return t=ir(t,e),o||(o=t.length>1),t}),gr(e,qr(e),n),o&&(n=Kn(n,7,Wr));for(var r=t.length;r--;)Qo(n,t[r]);return n}),Ca=Hr(function(e,t){return null==e?{}:function(e,t){return xo(e,t,function(t,n){return ha(e,n)})}(e,t)});function wa(e,t){if(null==e)return{};var n=st(qr(e),function(e){return[e]});return t=Kr(t),xo(e,n,function(e,n){return t(e,n[0])})}var Aa=kr(ba),Ta=kr(_a);function Oa(e){return null==e?[]:Tt(e,ba(e))}var Pa=Sr(function(e,t,n){return t=t.toLowerCase(),e+(n?Ia(t):t)});function Ia(e){return Ua(aa(e).toLowerCase())}function xa(e){return(e=aa(e))&&e.replace(ae,Rt).replace(Oe,"")}var Ra=Sr(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),La=Sr(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fa=Nr("toLowerCase"),Ma=Sr(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),ka=Sr(function(e,t,n){return e+(n?" ":"")+Ua(t)}),Ba=Sr(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ua=Nr("toUpperCase");function ja(e,t,n){return e=aa(e),void 0===(t=n?void 0:t)?function(e){return Re.test(e)}(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Wa=ko(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ui(e)?e:new ce(e)}}),za=Hr(function(e,t){return ot(t,function(t){t=wl(t),Yn(e,t,yi(e[t],e))}),e});function Ha(e){return function(){return e}}var Va=wr(),qa=wr(!0);function Ya(e){return e}function Ga(e){return So("function"==typeof e?e:Kn(e,1))}var $a=ko(function(e,t){return function(n){return yo(n,e,t)}}),Ka=ko(function(e,t){return function(n){return yo(e,n,t)}});function Xa(e,t,n){var o=ba(t),r=so(t,o);null!=n||Hi(t)&&(r.length||!o.length)||(n=t,t=e,e=this,r=so(t,ba(t)));var l=!(Hi(n)&&"chain"in n&&!n.chain),i=ji(e);return ot(r,function(n){var o=t[n];e[n]=o,i&&(e.prototype[n]=function(){var t=this.__chain__;if(l||t){var n=e(this.__wrapped__),r=n.__actions__=hr(this.__actions__);return r.push({func:o,args:arguments,thisArg:e}),n.__chain__=t,n}return o.apply(e,ct([this.value()],arguments))})}),e}function Za(){}var Qa=Pr(st),Ja=Pr(lt),eu=Pr(vt);function tu(e){return al(e)?_t(wl(e)):function(e){return function(t){return co(t,e)}}(e)}var nu=xr(),ou=xr(!0);function ru(){return[]}function lu(){return!1}var iu,au=Or(function(e,t){return e+t},0),uu=Fr("ceil"),su=Or(function(e,t){return e/t},1),cu=Fr("floor"),du=Or(function(e,t){return e*t},1),mu=Fr("round"),vu=Or(function(e,t){return e-t},0);return An.after=function(e,t){if("function"!=typeof t)throw new he(n);return e=oa(e),function(){if(--e<1)return t.apply(this,arguments)}},An.ary=hi,An.assign=ua,An.assignIn=sa,An.assignInWith=ca,An.assignWith=da,An.at=ma,An.before=gi,An.bind=yi,An.bindAll=za,An.bindKey=Ei,An.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ri(e)?e:[e]},An.chain=ti,An.chunk=function(e,t,n){t=(n?il(e,t,n):void 0===t)?1:rn(oa(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var r=0,l=0,i=f(Zt(o/t));r<o;)i[l++]=Vo(e,r,r+=t);return i},An.compact=function(e){for(var t=-1,n=null==e?0:e.length,o=0,r=[];++t<n;){var l=e[t];l&&(r[o++]=l)}return r},An.concat=function(){var e=arguments.length;if(!e)return[];for(var t=f(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return ct(Ri(n)?hr(n):[n],ro(t,1))},An.cond=function(e){var t=null==e?0:e.length,o=Kr();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new he(n);return[o(e[0]),e[1]]}):[],ko(function(n){for(var o=-1;++o<t;){var r=e[o];if(tt(r[0],this,n))return tt(r[1],this,n)}})},An.conforms=function(e){return function(e){var t=ba(e);return function(n){return Xn(n,e,t)}}(Kn(e,1))},An.constant=Ha,An.countBy=ri,An.create=function(e,t){var n=Tn(e);return null==t?n:qn(n,t)},An.curry=function e(t,n,o){var r=Br(t,8,void 0,void 0,void 0,void 0,void 0,n=o?void 0:n);return r.placeholder=e.placeholder,r},An.curryRight=function e(t,n,o){var r=Br(t,16,void 0,void 0,void 0,void 0,void 0,n=o?void 0:n);return r.placeholder=e.placeholder,r},An.debounce=bi,An.defaults=va,An.defaultsDeep=fa,An.defer=_i,An.delay=Ni,An.difference=Ol,An.differenceBy=Pl,An.differenceWith=Il,An.drop=function(e,t,n){var o=null==e?0:e.length;return o?Vo(e,(t=n||void 0===t?1:oa(t))<0?0:t,o):[]},An.dropRight=function(e,t,n){var o=null==e?0:e.length;return o?Vo(e,0,(t=o-(t=n||void 0===t?1:oa(t)))<0?0:t):[]},An.dropRightWhile=function(e,t){return e&&e.length?er(e,Kr(t,3),!0,!0):[]},An.dropWhile=function(e,t){return e&&e.length?er(e,Kr(t,3),!0):[]},An.fill=function(e,t,n,o){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&il(e,t,n)&&(n=0,o=r),function(e,t,n,o){var r=e.length;for((n=oa(n))<0&&(n=-n>r?0:r+n),(o=void 0===o||o>r?r:oa(o))<0&&(o+=r),o=n>o?0:ra(o);n<o;)e[n++]=t;return e}(e,t,n,o)):[]},An.filter=function(e,t){return(Ri(e)?it:oo)(e,Kr(t,3))},An.flatMap=function(e,t){return ro(mi(e,t),1)},An.flatMapDeep=function(e,t){return ro(mi(e,t),1/0)},An.flatMapDepth=function(e,t,n){return n=void 0===n?1:oa(n),ro(mi(e,t),n)},An.flatten=Ll,An.flattenDeep=function(e){return null!=e&&e.length?ro(e,1/0):[]},An.flattenDepth=function(e,t){return null!=e&&e.length?ro(e,t=void 0===t?1:oa(t)):[]},An.flip=function(e){return Br(e,512)},An.flow=Va,An.flowRight=qa,An.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,o={};++t<n;){var r=e[t];o[r[0]]=r[1]}return o},An.functions=function(e){return null==e?[]:so(e,ba(e))},An.functionsIn=function(e){return null==e?[]:so(e,_a(e))},An.groupBy=si,An.initial=function(e){return null!=e&&e.length?Vo(e,0,-1):[]},An.intersection=Ml,An.intersectionBy=kl,An.intersectionWith=Bl,An.invert=ga,An.invertBy=ya,An.invokeMap=ci,An.iteratee=Ga,An.keyBy=di,An.keys=ba,An.keysIn=_a,An.map=mi,An.mapKeys=function(e,t){var n={};return t=Kr(t,3),ao(e,function(e,o,r){Yn(n,t(e,o,r),e)}),n},An.mapValues=function(e,t){var n={};return t=Kr(t,3),ao(e,function(e,o,r){Yn(n,o,t(e,o,r))}),n},An.matches=function(e){return Ao(Kn(e,1))},An.matchesProperty=function(e,t){return To(e,Kn(t,1))},An.memoize=Si,An.merge=Na,An.mergeWith=Sa,An.method=$a,An.methodOf=Ka,An.mixin=Xa,An.negate=Di,An.nthArg=function(e){return e=oa(e),ko(function(t){return Po(t,e)})},An.omit=Da,An.omitBy=function(e,t){return wa(e,Di(Kr(t)))},An.once=function(e){return gi(2,e)},An.orderBy=function(e,t,n,o){return null==e?[]:(Ri(t)||(t=null==t?[]:[t]),Ri(n=o?void 0:n)||(n=null==n?[]:[n]),Io(e,t,n))},An.over=Qa,An.overArgs=Ci,An.overEvery=Ja,An.overSome=eu,An.partial=wi,An.partialRight=Ai,An.partition=vi,An.pick=Ca,An.pickBy=wa,An.property=tu,An.propertyOf=function(e){return function(t){return null==e?void 0:co(e,t)}},An.pull=jl,An.pullAll=Wl,An.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ro(e,t,Kr(n,2)):e},An.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ro(e,t,void 0,n):e},An.pullAt=zl,An.range=nu,An.rangeRight=ou,An.rearg=Ti,An.reject=function(e,t){return(Ri(e)?it:oo)(e,Di(Kr(t,3)))},An.remove=function(e,t){var n=[];if(!e||!e.length)return n;var o=-1,r=[],l=e.length;for(t=Kr(t,3);++o<l;){var i=e[o];t(i,o,e)&&(n.push(i),r.push(o))}return Lo(e,r),n},An.rest=function(e,t){if("function"!=typeof e)throw new he(n);return ko(e,t=void 0===t?t:oa(t))},An.reverse=Hl,An.sampleSize=function(e,t,n){return t=(n?il(e,t,n):void 0===t)?1:oa(t),(Ri(e)?Un:Uo)(e,t)},An.set=function(e,t,n){return null==e?e:jo(e,t,n)},An.setWith=function(e,t,n,o){return o="function"==typeof o?o:void 0,null==e?e:jo(e,t,n,o)},An.shuffle=function(e){return(Ri(e)?jn:Ho)(e)},An.slice=function(e,t,n){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&il(e,t,n)?(t=0,n=o):(t=null==t?0:oa(t),n=void 0===n?o:oa(n)),Vo(e,t,n)):[]},An.sortBy=fi,An.sortedUniq=function(e){return e&&e.length?$o(e):[]},An.sortedUniqBy=function(e,t){return e&&e.length?$o(e,Kr(t,2)):[]},An.split=function(e,t,n){return n&&"number"!=typeof n&&il(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=aa(e))&&("string"==typeof t||null!=t&&!$i(t))&&!(t=Xo(t))&&Mt(e)?ur(Ht(e),0,n):e.split(t,n):[]},An.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:rn(oa(t),0),ko(function(n){var o=n[t],r=ur(n,0,t);return o&&ct(r,o),tt(e,this,r)})},An.tail=function(e){var t=null==e?0:e.length;return t?Vo(e,1,t):[]},An.take=function(e,t,n){return e&&e.length?Vo(e,0,(t=n||void 0===t?1:oa(t))<0?0:t):[]},An.takeRight=function(e,t,n){var o=null==e?0:e.length;return o?Vo(e,(t=o-(t=n||void 0===t?1:oa(t)))<0?0:t,o):[]},An.takeRightWhile=function(e,t){return e&&e.length?er(e,Kr(t,3),!1,!0):[]},An.takeWhile=function(e,t){return e&&e.length?er(e,Kr(t,3)):[]},An.tap=function(e,t){return t(e),e},An.throttle=function(e,t,o){var r=!0,l=!0;if("function"!=typeof e)throw new he(n);return Hi(o)&&(r="leading"in o?!!o.leading:r,l="trailing"in o?!!o.trailing:l),bi(e,t,{leading:r,maxWait:t,trailing:l})},An.thru=ni,An.toArray=ta,An.toPairs=Aa,An.toPairsIn=Ta,An.toPath=function(e){return Ri(e)?st(e,wl):Zi(e)?[e]:hr(Cl(aa(e)))},An.toPlainObject=ia,An.transform=function(e,t,n){var o=Ri(e),r=o||ki(e)||Qi(e);if(t=Kr(t,4),null==n){var l=e&&e.constructor;n=r?o?new l:[]:Hi(e)&&ji(l)?Tn(ze(e)):{}}return(r?ot:ao)(e,function(e,o,r){return t(n,e,o,r)}),n},An.unary=function(e){return hi(e,1)},An.union=Vl,An.unionBy=ql,An.unionWith=Yl,An.uniq=function(e){return e&&e.length?Zo(e):[]},An.uniqBy=function(e,t){return e&&e.length?Zo(e,Kr(t,2)):[]},An.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zo(e,void 0,t):[]},An.unset=function(e,t){return null==e||Qo(e,t)},An.unzip=Gl,An.unzipWith=$l,An.update=function(e,t,n){return null==e?e:Jo(e,t,lr(n))},An.updateWith=function(e,t,n,o){return o="function"==typeof o?o:void 0,null==e?e:Jo(e,t,lr(n),o)},An.values=Oa,An.valuesIn=function(e){return null==e?[]:Tt(e,_a(e))},An.without=Kl,An.words=ja,An.wrap=function(e,t){return wi(lr(t),e)},An.xor=Xl,An.xorBy=Zl,An.xorWith=Ql,An.zip=Jl,An.zipObject=function(e,t){return or(e||[],t||[],zn)},An.zipObjectDeep=function(e,t){return or(e||[],t||[],jo)},An.zipWith=ei,An.entries=Aa,An.entriesIn=Ta,An.extend=sa,An.extendWith=ca,Xa(An,An),An.add=au,An.attempt=Wa,An.camelCase=Pa,An.capitalize=Ia,An.ceil=uu,An.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=la(n))==n?n:0),void 0!==t&&(t=(t=la(t))==t?t:0),$n(la(e),t,n)},An.clone=function(e){return Kn(e,4)},An.cloneDeep=function(e){return Kn(e,5)},An.cloneDeepWith=function(e,t){return Kn(e,5,t="function"==typeof t?t:void 0)},An.cloneWith=function(e,t){return Kn(e,4,t="function"==typeof t?t:void 0)},An.conformsTo=function(e,t){return null==t||Xn(e,t,ba(t))},An.deburr=xa,An.defaultTo=function(e,t){return null==e||e!=e?t:e},An.divide=su,An.endsWith=function(e,t,n){e=aa(e),t=Xo(t);var o=e.length,r=n=void 0===n?o:$n(oa(n),0,o);return(n-=t.length)>=0&&e.slice(n,r)==t},An.eq=Oi,An.escape=function(e){return(e=aa(e))&&k.test(e)?e.replace(F,Lt):e},An.escapeRegExp=function(e){return(e=aa(e))&&q.test(e)?e.replace(V,"\\$&"):e},An.every=function(e,t,n){var o=Ri(e)?lt:to;return n&&il(e,t,n)&&(t=void 0),o(e,Kr(t,3))},An.find=li,An.findIndex=xl,An.findKey=function(e,t){return pt(e,Kr(t,3),ao)},An.findLast=ii,An.findLastIndex=Rl,An.findLastKey=function(e,t){return pt(e,Kr(t,3),uo)},An.floor=cu,An.forEach=ai,An.forEachRight=ui,An.forIn=function(e,t){return null==e?e:lo(e,Kr(t,3),_a)},An.forInRight=function(e,t){return null==e?e:io(e,Kr(t,3),_a)},An.forOwn=function(e,t){return e&&ao(e,Kr(t,3))},An.forOwnRight=function(e,t){return e&&uo(e,Kr(t,3))},An.get=pa,An.gt=Pi,An.gte=Ii,An.has=function(e,t){return null!=e&&nl(e,t,po)},An.hasIn=ha,An.head=Fl,An.identity=Ya,An.includes=function(e,t,n,o){e=Fi(e)?e:Oa(e),n=n&&!o?oa(n):0;var r=e.length;return n<0&&(n=rn(r+n,0)),Xi(e)?n<=r&&e.indexOf(t,n)>-1:!!r&>(e,t,n)>-1},An.indexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=null==n?0:oa(n);return r<0&&(r=rn(o+r,0)),gt(e,t,r)},An.inRange=function(e,t,n){return t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n){return e>=ln(t,n)&&e<rn(t,n)}(e=la(e),t,n)},An.invoke=Ea,An.isArguments=xi,An.isArray=Ri,An.isArrayBuffer=Li,An.isArrayLike=Fi,An.isArrayLikeObject=Mi,An.isBoolean=function(e){return!0===e||!1===e||Vi(e)&&vo(e)==a},An.isBuffer=ki,An.isDate=Bi,An.isElement=function(e){return Vi(e)&&1===e.nodeType&&!Gi(e)},An.isEmpty=function(e){if(null==e)return!0;if(Fi(e)&&(Ri(e)||"string"==typeof e||"function"==typeof e.splice||ki(e)||Qi(e)||xi(e)))return!e.length;var t=tl(e);if(t==m||t==g)return!e.size;if(cl(e))return!Do(e).length;for(var n in e)if(_e.call(e,n))return!1;return!0},An.isEqual=function(e,t){return bo(e,t)},An.isEqualWith=function(e,t,n){var o=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===o?bo(e,t,void 0,n):!!o},An.isError=Ui,An.isFinite=function(e){return"number"==typeof e&&tn(e)},An.isFunction=ji,An.isInteger=Wi,An.isLength=zi,An.isMap=qi,An.isMatch=function(e,t){return e===t||_o(e,t,Zr(t))},An.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,_o(e,t,Zr(t),n)},An.isNaN=function(e){return Yi(e)&&e!=+e},An.isNative=function(e){if(sl(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return No(e)},An.isNil=function(e){return null==e},An.isNull=function(e){return null===e},An.isNumber=Yi,An.isObject=Hi,An.isObjectLike=Vi,An.isPlainObject=Gi,An.isRegExp=$i,An.isSafeInteger=function(e){return Wi(e)&&e>=-9007199254740991&&e<=9007199254740991},An.isSet=Ki,An.isString=Xi,An.isSymbol=Zi,An.isTypedArray=Qi,An.isUndefined=function(e){return void 0===e},An.isWeakMap=function(e){return Vi(e)&&tl(e)==b},An.isWeakSet=function(e){return Vi(e)&&"[object WeakSet]"==vo(e)},An.join=function(e,t){return null==e?"":nn.call(e,t)},An.kebabCase=Ra,An.last=Ul,An.lastIndexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=o;return void 0!==n&&(r=(r=oa(n))<0?rn(o+r,0):ln(r,o-1)),t==t?function(e,t,n){for(var o=n+1;o--;)if(e[o]===t)return o;return o}(e,t,r):ht(e,Et,r,!0)},An.lowerCase=La,An.lowerFirst=Fa,An.lt=Ji,An.lte=ea,An.max=function(e){return e&&e.length?no(e,Ya,fo):void 0},An.maxBy=function(e,t){return e&&e.length?no(e,Kr(t,2),fo):void 0},An.mean=function(e){return bt(e,Ya)},An.meanBy=function(e,t){return bt(e,Kr(t,2))},An.min=function(e){return e&&e.length?no(e,Ya,Co):void 0},An.minBy=function(e,t){return e&&e.length?no(e,Kr(t,2),Co):void 0},An.stubArray=ru,An.stubFalse=lu,An.stubObject=function(){return{}},An.stubString=function(){return""},An.stubTrue=function(){return!0},An.multiply=du,An.nth=function(e,t){return e&&e.length?Po(e,oa(t)):void 0},An.noConflict=function(){return He._===this&&(He._=we),this},An.noop=Za,An.now=pi,An.pad=function(e,t,n){e=aa(e);var o=(t=oa(t))?zt(e):0;if(!t||o>=t)return e;var r=(t-o)/2;return Ir(Qt(r),n)+e+Ir(Zt(r),n)},An.padEnd=function(e,t,n){e=aa(e);var o=(t=oa(t))?zt(e):0;return t&&o<t?e+Ir(t-o,n):e},An.padStart=function(e,t,n){e=aa(e);var o=(t=oa(t))?zt(e):0;return t&&o<t?Ir(t-o,n)+e:e},An.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(aa(e).replace(Y,""),t||0)},An.random=function(e,t,n){if(n&&"boolean"!=typeof n&&il(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=na(e),void 0===t?(t=e,e=0):t=na(t)),e>t){var o=e;e=t,t=o}if(n||e%1||t%1){var r=sn();return ln(e+r*(t-e+Ue("1e-"+((r+"").length-1))),t)}return Fo(e,t)},An.reduce=function(e,t,n){var o=Ri(e)?dt:St,r=arguments.length<3;return o(e,Kr(t,4),n,r,Jn)},An.reduceRight=function(e,t,n){var o=Ri(e)?mt:St,r=arguments.length<3;return o(e,Kr(t,4),n,r,eo)},An.repeat=function(e,t,n){return t=(n?il(e,t,n):void 0===t)?1:oa(t),Mo(aa(e),t)},An.replace=function(){var e=arguments,t=aa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},An.result=function(e,t,n){var o=-1,r=(t=ir(t,e)).length;for(r||(r=1,e=void 0);++o<r;){var l=null==e?void 0:e[wl(t[o])];void 0===l&&(o=r,l=n),e=ji(l)?l.call(e):l}return e},An.round=mu,An.runInContext=e,An.sample=function(e){return(Ri(e)?Bn:Bo)(e)},An.size=function(e){if(null==e)return 0;if(Fi(e))return Xi(e)?zt(e):e.length;var t=tl(e);return t==m||t==g?e.size:Do(e).length},An.snakeCase=Ma,An.some=function(e,t,n){var o=Ri(e)?vt:qo;return n&&il(e,t,n)&&(t=void 0),o(e,Kr(t,3))},An.sortedIndex=function(e,t){return Yo(e,t)},An.sortedIndexBy=function(e,t,n){return Go(e,t,Kr(n,2))},An.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var o=Yo(e,t);if(o<n&&Oi(e[o],t))return o}return-1},An.sortedLastIndex=function(e,t){return Yo(e,t,!0)},An.sortedLastIndexBy=function(e,t,n){return Go(e,t,Kr(n,2),!0)},An.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Yo(e,t,!0)-1;if(Oi(e[n],t))return n}return-1},An.startCase=ka,An.startsWith=function(e,t,n){return e=aa(e),n=null==n?0:$n(oa(n),0,e.length),t=Xo(t),e.slice(n,n+t.length)==t},An.subtract=vu,An.sum=function(e){return e&&e.length?Dt(e,Ya):0},An.sumBy=function(e,t){return e&&e.length?Dt(e,Kr(t,2)):0},An.template=function(e,t,n){var o=An.templateSettings;n&&il(e,t,n)&&(t=void 0),e=aa(e),t=ca({},t,o,Ur);var r,l,i=ca({},t.imports,o.imports,Ur),a=ba(i),u=Tt(i,a),s=0,c=t.interpolate||ue,d="__p += '",m=fe((t.escape||ue).source+"|"+c.source+"|"+(c===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(_e.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fe+"]")+"\n";e.replace(m,function(t,n,o,i,a,u){return o||(o=i),d+=e.slice(s,u).replace(se,Ft),n&&(r=!0,d+="' +\n__e("+n+") +\n'"),a&&(l=!0,d+="';\n"+a+";\n__p += '"),o&&(d+="' +\n((__t = ("+o+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var f=_e.call(t,"variable")&&t.variable;if(f){if(Q.test(f))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(l?d.replace(I,""):d).replace(x,"$1").replace(R,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(l?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var p=Wa(function(){return de(a,v+"return "+d).apply(void 0,u)});if(p.source=d,Ui(p))throw p;return p},An.times=function(e,t){if((e=oa(e))<1||e>9007199254740991)return[];var n=4294967295,o=ln(e,4294967295);e-=4294967295;for(var r=Ct(o,t=Kr(t));++n<e;)t(n);return r},An.toFinite=na,An.toInteger=oa,An.toLength=ra,An.toLower=function(e){return aa(e).toLowerCase()},An.toNumber=la,An.toSafeInteger=function(e){return e?$n(oa(e),-9007199254740991,9007199254740991):0===e?e:0},An.toString=aa,An.toUpper=function(e){return aa(e).toUpperCase()},An.trim=function(e,t,n){if((e=aa(e))&&(n||void 0===t))return wt(e);if(!e||!(t=Xo(t)))return e;var o=Ht(e),r=Ht(t);return ur(o,Pt(o,r),It(o,r)+1).join("")},An.trimEnd=function(e,t,n){if((e=aa(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xo(t)))return e;var o=Ht(e);return ur(o,0,It(o,Ht(t))+1).join("")},An.trimStart=function(e,t,n){if((e=aa(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Xo(t)))return e;var o=Ht(e);return ur(o,Pt(o,Ht(t))).join("")},An.truncate=function(e,t){var n=30,o="...";if(Hi(t)){var r="separator"in t?t.separator:r;n="length"in t?oa(t.length):n,o="omission"in t?Xo(t.omission):o}var l=(e=aa(e)).length;if(Mt(e)){var i=Ht(e);l=i.length}if(n>=l)return e;var a=n-zt(o);if(a<1)return o;var u=i?ur(i,0,a).join(""):e.slice(0,a);if(void 0===r)return u+o;if(i&&(a+=u.length-a),$i(r)){if(e.slice(a).search(r)){var s,c=u;for(r.global||(r=fe(r.source,aa(te.exec(r))+"g")),r.lastIndex=0;s=r.exec(c);)var d=s.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Xo(r),a)!=a){var m=u.lastIndexOf(r);m>-1&&(u=u.slice(0,m))}return u+o},An.unescape=function(e){return(e=aa(e))&&M.test(e)?e.replace(L,qt):e},An.uniqueId=function(e){var t=++Ne;return aa(e)+t},An.upperCase=Ba,An.upperFirst=Ua,An.each=ai,An.eachRight=ui,An.first=Fl,Xa(An,(iu={},ao(An,function(e,t){_e.call(An.prototype,t)||(iu[t]=e)}),iu),{chain:!1}),An.VERSION="4.17.21",ot(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){An[e].placeholder=An}),ot(["drop","take"],function(e,t){In.prototype[e]=function(n){n=void 0===n?1:rn(oa(n),0);var o=this.__filtered__&&!t?new In(this):this.clone();return o.__filtered__?o.__takeCount__=ln(n,o.__takeCount__):o.__views__.push({size:ln(n,4294967295),type:e+(o.__dir__<0?"Right":"")}),o},In.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),ot(["filter","map","takeWhile"],function(e,t){var n=t+1,o=1==n||3==n;In.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Kr(e,3),type:n}),t.__filtered__=t.__filtered__||o,t}}),ot(["head","last"],function(e,t){var n="take"+(t?"Right":"");In.prototype[e]=function(){return this[n](1).value()[0]}}),ot(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");In.prototype[e]=function(){return this.__filtered__?new In(this):this[n](1)}}),In.prototype.compact=function(){return this.filter(Ya)},In.prototype.find=function(e){return this.filter(e).head()},In.prototype.findLast=function(e){return this.reverse().find(e)},In.prototype.invokeMap=ko(function(e,t){return"function"==typeof e?new In(this):this.map(function(n){return yo(n,e,t)})}),In.prototype.reject=function(e){return this.filter(Di(Kr(e)))},In.prototype.slice=function(e,t){e=oa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new In(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=oa(t))<0?n.dropRight(-t):n.take(t-e)),n)},In.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},In.prototype.toArray=function(){return this.take(4294967295)},ao(In.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),r=An[o?"take"+("last"==t?"Right":""):t],l=o||/^find/.test(t);r&&(An.prototype[t]=function(){var t=this.__wrapped__,i=o?[1]:arguments,a=t instanceof In,u=i[0],s=a||Ri(t),c=function(e){var t=r.apply(An,ct([e],i));return o&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(a=s=!1);var d=this.__chain__,m=!!this.__actions__.length,v=l&&!d,f=a&&!m;if(!l&&s){t=f?t:new In(this);var p=e.apply(t,i);return p.__actions__.push({func:ni,args:[c],thisArg:void 0}),new Pn(p,d)}return v&&f?e.apply(this,i):(p=this.thru(c),v?o?p.value()[0]:p.value():p)})}),ot(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);An.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var r=this.value();return t.apply(Ri(r)?r:[],e)}return this[n](function(n){return t.apply(Ri(n)?n:[],e)})}}),ao(In.prototype,function(e,t){var n=An[t];if(n){var o=n.name+"";_e.call(yn,o)||(yn[o]=[]),yn[o].push({name:t,func:n})}}),yn[Ar(void 0,2).name]=[{name:"wrapper",func:void 0}],In.prototype.clone=function(){var e=new In(this.__wrapped__);return e.__actions__=hr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=hr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=hr(this.__views__),e},In.prototype.reverse=function(){if(this.__filtered__){var e=new In(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},In.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ri(e),o=t<0,r=n?e.length:0,l=function(e,t,n){for(var o=-1,r=n.length;++o<r;){var l=n[o],i=l.size;switch(l.type){case"drop":e+=i;break;case"dropRight":t-=i;break;case"take":t=ln(t,e+i);break;case"takeRight":e=rn(e,t-i)}}return{start:e,end:t}}(0,r,this.__views__),i=l.start,a=l.end,u=a-i,s=o?a:i-1,c=this.__iteratees__,d=c.length,m=0,v=ln(u,this.__takeCount__);if(!n||!o&&r==u&&v==u)return tr(e,this.__actions__);var f=[];e:for(;u--&&m<v;){for(var p=-1,h=e[s+=t];++p<d;){var g=c[p],y=g.type,E=(0,g.iteratee)(h);if(2==y)h=E;else if(!E){if(1==y)continue e;break e}}f[m++]=h}return f},An.prototype.at=oi,An.prototype.chain=function(){return ti(this)},An.prototype.commit=function(){return new Pn(this.value(),this.__chain__)},An.prototype.next=function(){void 0===this.__values__&&(this.__values__=ta(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},An.prototype.plant=function(e){for(var t,n=this;n instanceof On;){var o=Tl(n);o.__index__=0,o.__values__=void 0,t?r.__wrapped__=o:t=o;var r=o;n=n.__wrapped__}return r.__wrapped__=e,t},An.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof In){var t=e;return this.__actions__.length&&(t=new In(this)),(t=t.reverse()).__actions__.push({func:ni,args:[Hl],thisArg:void 0}),new Pn(t,this.__chain__)}return this.thru(Hl)},An.prototype.toJSON=An.prototype.valueOf=An.prototype.value=function(){return tr(this.__wrapped__,this.__actions__)},An.prototype.first=An.prototype.head,ft&&(An.prototype[ft]=function(){return this}),An}();qe?((qe.exports=Yt)._=Yt,Ve._=Yt):He._=Yt}).call(f)});const Qt=e=>{let{registerRef:r,searchFieldComponents:i}=e;const{t:a}=l.useTranslation(),u=window.Digit.Utils.browser.isMobile();return console.log("searchFieldComponents",i),u?o.createElement(n.Fragment,null,o.createElement(t.SearchField,null,o.createElement("label",null,a("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")),o.createElement(t.TextInput,{name:"applicationNo",inputRef:r({})})),o.createElement(t.SearchField,null,o.createElement("label",null,a("CORE_COMMON_PHONE_NUMBER")),o.createElement(t.TextInput,{name:"mobileNumber",inputRef:r({})}))):o.createElement(o.Fragment,null,o.createElement("div",{className:"search-container ndc-search-container-custom"},o.createElement("div",{className:"search-complaint-container"},o.createElement("div",{className:"complaint-input-container ndc-complaint-input-container"},o.createElement(t.SearchField,null,o.createElement("label",null,a("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")),o.createElement(t.TextInput,{name:"applicationNo",inputRef:r({})})),o.createElement(t.SearchField,null,o.createElement("label",null,a("CORE_COMMON_PHONE_NUMBER")),o.createElement(t.TextInput,{name:"mobileNumber",inputRef:r({})})),o.createElement("div",{className:"search-action-wrapper ndc-search-action-wrapper"},i)))))},Jt=e=>{let{statuses:r,controlFilterForm:i,applicationTypesOfBPA:u,handleFilter:s}=e;const{t:c}=l.useTranslation(),[d,m]=(Digit.ULBService.getStateId(),n.useState({applicationStatus:[]}));n.useEffect(()=>{d&&s(d)},[d]);const v=[{code:"ASSIGNED_TO_ME",name:""+c("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+c("ES_INBOX_ASSIGNED_TO_ALL")}];return null==u||u.forEach(e=>{e.name=c("WF_BPA_"+e.code),e.i18nKey=c("WF_BPA_"+e.code)}),o.createElement(n.Fragment,null,o.createElement(t.FilterFormField,null,o.createElement(a.Controller,{name:"assignee",control:i,render:e=>o.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:v.filter(t=>t.code===e.value)[0],optionsKey:"name",options:v})})),o.createElement(t.FilterFormField,null,o.createElement(a.Controller,{name:"applicationStatus",control:i,defaultValue:[],render:e=>o.createElement(n.Fragment,null,null==r?void 0:r.map((n,r)=>o.createElement(t.CheckBox,{key:n.applicationstatus,label:c(n.applicationstatus)+" - "+n.count,value:n.applicationstatus,checked:e.value.includes(n.applicationstatus),onChange:()=>{return t=n.applicationstatus,console.log(t,"statusCode"),void(e.value.includes(t)?e.onChange(e.value.filter(e=>e!==t)):e.onChange([...e.value,t]));var t},index:r})))})))},en=e=>{var r,i;const{register:u,control:s,setValue:c,getValues:m,reset:v,formState:f}=a.useFormContext(),{t:p}=l.useTranslation(),h=d();return o.createElement(n.Fragment,null,o.createElement(t.SearchField,null,o.createElement("label",null,p("NOC_APP_NO_LABEL")),o.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),o.createElement(t.SearchField,null,o.createElement("label",null,p("NOC_SOURCE_MODULE_NUMBER")),o.createElement(t.TextInput,{name:"sourceRefId",inputRef:u({})})),o.createElement(t.SearchField,null,o.createElement("label",null,p("NOC_TYPE_LABEL")),o.createElement(a.Controller,{control:s,name:"nocType",render:e=>o.createElement(t.Dropdown,{selected:1==(null==h?void 0:h.length)?h[0]:e.value,select:e.onChange,onBlur:e.onBlur,option:h||[],optionKey:"i18nKey",t:p,disable:1==(null==h?void 0:h.length)})})),o.createElement(t.SearchField,null,o.createElement("label",null,p("NOC_APP_MOBILE_NO_SEARCH_PARAM")),o.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:o.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),o.createElement(t.CardLabelError,null,null==f||null===(r=f.errors)||void 0===r||null===(i=r.mobileNumber)||void 0===i?void 0:i.message)),o.createElement(t.SearchField,null,o.createElement("label",null,p("NOC_NUMBER_LABEL")),o.createElement(t.TextInput,{name:"nocNo",inputRef:u({})})),o.createElement(t.SearchField,{className:"submit"},o.createElement(t.SubmitBar,{label:p("ES_COMMON_SEARCH"),submit:!0}),o.createElement("p",{style:{marginTop:"24px"},onClick:()=>{var t,n;c("applicationNo",null),c("sourceRefId",null),c("mobileNumber",null),c("nocType",null==h||null===(t=h[0])||void 0===t?void 0:t.code),c("offset",0),c("limit",10),c("sortBy","commencementDate"),c("sortOrder","DESC"),c("isSubmitSuccessful","false"),v({applicationNo:"",sourceRefId:"",nocType:"",nocNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",isSubmitSuccessful:!1}),c("offset",m("offset")-m("limit")),null==e||e.onSubmit({nocType:null==h||null===(n=h[0])||void 0===n?void 0:n.code,offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},p("ES_COMMON_CLEAR_ALL"))))},tn=["currentlyActiveMobileModal"],nn=["currentlyActiveMobileModal"],on=e=>{var r,i;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:m,data:v,onSubmit:f}=e;const{t:p}=l.useTranslation(),{handleSubmit:h}=a.useFormContext(),[g,y]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),E=()=>{y({type:"remove"})},b=()=>o.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:E},o.createElement(t.CloseSvg,null)),_=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,r=c(e,tn);const{closeMobilePopupModal:l}=r;switch(n){case"SearchFormComponent":return o.createElement(t.SearchForm,r,o.createElement(b,null),o.createElement("div",{className:"MobilePopupHeadingWrapper"},o.createElement("h2",null,p("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),o.createElement(u,{onSubmit:f,handleSubmit:h,isMobileView:!0,closeMobilePopupModal:l}));default:return o.createElement("span",null)}})(s({currentlyActiveMobileModal:n},c(e,nn)))},[g]);return m?o.createElement(t.Loader,null):o.createElement(o.Fragment,null,o.createElement("div",{className:"searchBox"},o.createElement(t.SearchAction,{text:p("ES_COMMON_SEARCH"),handleActionClick:()=>y({type:"set",payload:"SearchFormComponent"})})),g?o.createElement(t.PopUp,null,o.createElement(_,{onSubmit:e=>{y({type:"remove"}),f(e)},handleSubmit:h,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:E})):null,null!=v&&null!==(r=v[0])&&void 0!==r&&r.display?o.createElement(t.Card,{style:{marginTop:20}},p(null==v||null===(i=v[0])||void 0===i?void 0:i.display).split("\\n").map((e,t)=>o.createElement("p",{key:t,style:{textAlign:"center"}},e))):o.createElement(t.DetailsCard,{data:d,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/employee/noc/search/application-overview/",serviceRequestIdKey:p("NOC_APP_NO_LABEL")}))},rn=e=>{let{columns:r,SearchFormFieldsComponent:i,onSubmit:u,data:s,isLoading:c,Count:d}=e;const{handleSubmit:m,setValue:v,getValues:f}=a.useFormContext();null==f("offset")&&v("offset",0),null==f("limit")&&v("limit",10);const[p,h]=n.useState(Number(f("offset"))/Number(f("limit"))),{t:g}=l.useTranslation(),y=()=>{v("offset",d&&10*Math.ceil(d/10)-f("limit")),m(u)()},E=()=>{v("offset",0),m(u)()},b=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function _(e){v("limit",Number(e.target.value)),m(u)()}function N(){v("offset",Number(f("offset"))+Number(f("limit"))),m(u)()}function S(){v("offset",Number(f("offset"))-Number(f("limit"))),m(u)()}n.useEffect(()=>{null!=f("offset")&&null!=f("limit")&&h(Number(f("offset"))/Number(f("limit")))},[f("offset"),f("limit")]);const D=()=>{return c?o.createElement(t.Loader,null):null!=s&&null!==(e=s[0])&&void 0!==e&&e.display?o.createElement(t.Card,{style:{marginTop:20}},g(null==s||null===(n=s[0])||void 0===n?void 0:n.display).split("\\n").map((e,t)=>o.createElement("p",{key:t,style:{textAlign:"center"}},e))):o.createElement(t.Table,{t:g,data:s,columns:r,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:_,currentPage:p,onNextPage:N,onPrevPage:S,pageSizeLimit:Number(f("limit")),onSort:b,totalRecords:d,disableSort:!1,onLastPage:y,onFirstPage:E,sortParams:[{id:f("sortBy"),desc:"DESC"===f("sortOrder")}]});var e,n};return o.createElement(o.Fragment,null,o.createElement(t.SearchForm,{onSubmit:u,handleSubmit:m},o.createElement(i,{onSubmit:u,handleSubmit:m,isMobileView:!1})),o.createElement(D,null))},ln=e=>{let{onGoNext:i}=e;const{t:u}=l.useTranslation(),[s,c]=(r.useHistory(),n.useState(!1)),[d,m]=(Digit.ULBService.getCurrentTenantId(),n.useState(null)),v=a.useForm({defaultValues:{categoryName:""}}),{register:f,handleSubmit:p,formState:{errors:h}}=v;return n.useEffect(()=>{console.log("errors",h)},[h]),o.createElement("div",{className:"card"},o.createElement(a.FormProvider,v,o.createElement("form",{onSubmit:p(function(e){try{return console.log("data is here==========",e),i(),Promise.resolve()}catch(e){return Promise.reject(e)}})},o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"First Name ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"firstName",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),h.firstName&&o.createElement("p",{className:"requiredField"},h.firstName.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Last Name ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"lastName",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),h.lastName&&o.createElement("p",{className:"requiredField"},h.lastName.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Email ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"email",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),h.email&&o.createElement("p",{className:"requiredField"},h.email.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Address ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"address",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),h.address&&o.createElement("p",{className:"requiredField"},h.address.message)),o.createElement(t.ActionBar,null,o.createElement(t.SubmitBar,{label:"Next",submit:"submit"})))),d&&o.createElement(t.Toast,{error:d.isError,label:u(d.label),onClose:()=>{m(null)},isDleteBtn:"true"}),s&&o.createElement(t.Loader,null))},an=n.forwardRef((e,t)=>o.createElement("button",s({ref:t,disabled:!!e.disabled,className:(e.disabled?"submit-bar-disabled":"submit-bar")+" "+(e.className?e.className:""),type:e.submit?"submit":"button",style:s({},e.style),onClick:e.onSubmit},e.form?{form:e.form}:{}),e.label));an.propTypes={submit:Ze.any,style:Ze.object,label:Ze.string,onSubmit:Ze.func},an.defaultProps={};const un=e=>{let{onBackClick:i}=e;const{t:u}=l.useTranslation(),[s,c]=(r.useHistory(),n.useState(!1)),[d,m]=(Digit.ULBService.getCurrentTenantId(),n.useState(null)),v=a.useForm({defaultValues:{propertyID:"",waterConnectionNumbers:[{value:""}],sewageConnectionNumbers:[{value:""}],propertyType:"",propertyUsageType:"",propertyLocationType:"",numberOfFloors:""}}),{register:f,handleSubmit:p,control:h,formState:{errors:g}}=v,{fields:y,append:E,remove:b}=a.useFieldArray({control:h,name:"waterConnectionNumbers"}),{fields:_,append:N,remove:S}=a.useFieldArray({control:h,name:"sewageConnectionNumbers"});return n.useEffect(()=>{console.log("errors",g)},[g]),o.createElement("div",{className:"card"},o.createElement(a.FormProvider,v,o.createElement("form",{onSubmit:p(function(e){try{return console.log("Submitted Data:",e),Promise.resolve()}catch(e){return Promise.reject(e)}})},o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Property ID ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"propertyID",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.propertyID&&o.createElement("p",{className:"requiredField"},g.propertyID.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Water Connection Number ",o.createElement("span",{className:"requiredField"},"*")),y.map((e,n)=>o.createElement("div",{key:e.id,className:"dynamic-field"},o.createElement(t.TextInput,f("waterConnectionNumbers."+n+".value",{required:"This field is required"})),n>0&&o.createElement("button",{type:"button",onClick:()=>b(n)},"❌"))),o.createElement("button",{type:"button",onClick:()=>E({value:""})},"➕ Add")),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Sewage Connection Number ",o.createElement("span",{className:"requiredField"},"*")),_.map((e,n)=>o.createElement("div",{key:e.id,className:"dynamic-field"},o.createElement(t.TextInput,f("sewageConnectionNumbers."+n+".value",{required:"This field is required"})),n>0&&o.createElement("button",{type:"button",onClick:()=>S(n)},"❌"))),o.createElement("button",{type:"button",onClick:()=>N({value:""})},"➕ Add")),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Property Type ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"address",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.propertyType&&o.createElement("p",{className:"requiredField"},g.propertyType.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Property Usage Type ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"address",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.propertyUsageType&&o.createElement("p",{className:"requiredField"},g.propertyUsageType.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Property Location Type ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"address",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.propertyLocationType&&o.createElement("p",{className:"requiredField"},g.propertyLocationType.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"No of Floors ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"numberOfFloors",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.numberOfFloors&&o.createElement("p",{className:"requiredField"},g.numberOfFloors.message)),o.createElement("div",null,"Upload Files"),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Copy of Property Registry ",o.createElement("span",{className:"requiredField"},"*")),o.createElement("input",{name:"numberOfFloors",type:"file",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.numberOfFloors&&o.createElement("p",{className:"requiredField"},g.numberOfFloors.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Approved Building Plan ",o.createElement("span",{className:"requiredField"},"*")),o.createElement("input",{name:"numberOfFloors",type:"file",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.numberOfFloors&&o.createElement("p",{className:"requiredField"},g.numberOfFloors.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Last Water Tax Receipt ",o.createElement("span",{className:"requiredField"},"*")),o.createElement("input",{name:"numberOfFloors",type:"file",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.numberOfFloors&&o.createElement("p",{className:"requiredField"},g.numberOfFloors.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Last Property Tax Receipt ",o.createElement("span",{className:"requiredField"},"*")),o.createElement("input",{name:"numberOfFloors",type:"file",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.numberOfFloors&&o.createElement("p",{className:"requiredField"},g.numberOfFloors.message)),o.createElement(t.ActionBar,null,o.createElement(t.SubmitBar,{label:"Submit",submit:"submit"})),o.createElement("button",{onClick:()=>i()},"Back"))),d&&o.createElement(t.Toast,{error:d.isError,label:u(d.label),onClose:()=>{m(null)},isDleteBtn:"true"}),s&&o.createElement(t.Loader,null))},sn=[{head:"",stepNumber:1,body:[{name:"NDC_COMMON_NDC_REASON",type:"component",component:"SelectNDCReason",key:"NDCReason",withoutLabel:!0},{name:"",type:"component",component:"NDCPropertySearch",key:"cpt",withoutLabel:!0},{name:"NDC_COMMON_PROPERTY_DETAILS",type:"component",component:"PropertyDetailsFormCitizen",key:"PropertyDetails",withoutLabel:!0}]},{head:"",stepNumber:2,body:[{type:"component",component:"SelectNDCDocuments",key:"documents",withoutLabel:!0}]},{head:"Summary",stepNumber:3,body:[{type:"component",component:"NDCSummary",key:"NDCSummary",withoutLabel:!0}]}],cn=[{head:"Application Details",stepLabel:"Application Details",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNDCStepFormOneCitizen",key:"NDCDetails",withoutLabel:!0,texts:{submitBarLabel:"Next"}},{head:"NDC_DOCUMENTS_REQUIRED",stepLabel:"Document Info",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNDCStepFormTwoCitizen",key:"DocummentDetails",withoutLabel:!0,texts:{submitBarLabel:"Next"}},{head:"Summary",stepLabel:"Summary",stepNumber:3,isStepEnabled:!0,type:"component",component:"NDCNewFormSummaryStepThreeCitizen",key:"PTSummary",withoutLabel:!0,texts:{submitBarLabel:"Submit"}}].map(e=>s({},e,{currStepConfig:sn.filter(t=>t.stepNumber===e.stepNumber)})),dn=["status"];function mn(e){let{t:r,document:l,setDocuments:i,setError:a,documents:u,setFormError:s,config:c,formState:d}=e;const m=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==l?void 0:l.code)})[0],[v,f]=(Digit.ULBService.getCurrentTenantId(),n.useState(!1)),[p,h]=n.useState(null),[g,y]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null);return n.useEffect(()=>{null!=m&&m.fileStoreId&&!p&&y(m.fileStoreId)},[m]),n.useEffect(()=>{g?i(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==l?void 0:l.code));return 0===(null==g?void 0:g.length)||null===g?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==g),{documentType:null==l?void 0:l.code,fileStoreId:g,documentUid:g}]}):null===g&&i(e=>e.filter(e=>(null==e?void 0:e.documentType)!==(null==l?void 0:l.code)))},[g]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(p){f(!0);const e=function(){if(p.size>=5242880)a(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),f(!1),d.errors[c.key]||s(c.key,{type:null==l?void 0:l.code});else{const e=ae(function(){return y(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",p,Digit.ULBService.getStateId())).then(function(e){var t,n,o,l;f(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?y(null==e||null===(o=e.data)||void 0===o||null===(l=o.files[0])||void 0===l?void 0:l.fileStoreId):a(r("CS_FILE_UPLOAD_ERROR"))})},function(){f(!1),a(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[p]),o.createElement("div",{className:"ndc-label-field-pair"},o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller"},r(null==l?void 0:l.code)," ",(null==l?void 0:l.required)&&" *"),o.createElement("div",{className:"form-field"},o.createElement(t.UploadFile,{id:"tl-doc",onUpload:function(e){h(e.target.files[0])},onDelete:()=>{y(null)},message:g?"1 "+r("CS_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},accept:"image/*,.pdf"}))),v&&o.createElement(Qe,{page:!0}))}const vn=e=>{let{width:t=20,height:n=20,style:r}=e;return o.createElement("svg",{style:r,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},o.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))};function fn(e){let{value:n={},Code:r,index:i}=e;const{t:a}=l.useTranslation(),{isLoading:u,data:c}=Digit.Hooks.ads.useADSDocumentSearch({value:n},{value:n},r,i);console.log("dataInNDCDocument",c);const d=null!=n&&n.documents?n.documents.documents.filter(e=>e.documentType===r).map(e=>s({},e,{documentType:e.documentType.replace(/\./g,"_")})):n.filter(e=>e.documentType===r).map(e=>s({},e,{documentType:e.documentType.replace(/\./g,"_")}));return u?o.createElement(t.Loader,null):o.createElement("div",{className:"document-container"},o.createElement(o.Fragment,null,o.createElement("div",{className:"document-grid"},(null==c?void 0:c.pdfFiles)&&o.createElement("div",null,null==d?void 0:d.map((e,t)=>{let n=m(c.pdfFiles,null==e?void 0:e.fileStoreId);return o.createElement("a",{className:"document-link",target:"_blank",rel:"noopener noreferrer",href:n,key:t},o.createElement("div",{className:"document-card"},o.createElement("div",{className:"document-icon-wrapper"},o.createElement(vn,{width:80,height:100})),o.createElement("p",{className:"document-name",title:a(null==e?void 0:e.documentType)},(()=>{const t=a(null==e?void 0:e.documentType);return(null==t?void 0:t.length)>7?t.substring(0,7)+"...":t})()),o.createElement("div",{className:"document-action-label"},"View")))})))))}const pn=e=>{var a,u,s,c,d,m,v,f,p,h,g,y,E,b,_,N,S,D,C,w,A,T,O,P,I,x,R,L,F,M,k,B,U,j,W,z,H,V,q,Y,G,$,K,X,Z,Q,J,ee,te,ne,oe,re;let{formData:le,goNext:ie,onGoBack:ae}=e;const{pathname:ue}=r.useLocation(),{t:se}=l.useTranslation(),ce=(r.useHistory(),n.useRef());i.useDispatch(),ue.includes("/property-mutate/");let de=Digit.UserService.getUser(),me=null==le||null===(a=le.DocummentDetails)||void 0===a||null===(u=a.documents)||void 0===u?void 0:u.documents;console.log("formData",le);const ve=(null==le||null===(s=le.apiData)||void 0===s||null===(c=s.Applications)||void 0===c||null===(d=c[0])||void 0===d?void 0:d.applicationNo)||(null==le||null===(m=le.responseData)||void 0===m||null===(v=m[0])||void 0===v?void 0:v.applicationNo),fe=(null==le||null===(f=le.apiData)||void 0===f||null===(p=f.Applications)||void 0===p||null===(h=p[0])||void 0===h?void 0:h.NdcDetails)||(null==le||null===(g=le.responseData)||void 0===g||null===(y=g[0])||void 0===y?void 0:y.NdcDetails),pe=null==fe?void 0:fe.filter(e=>"PT"==(null==e?void 0:e.businessService));console.log("filterType",pe);const he=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),ge=window.location.href.includes("citizen"),[ye,Ee]=n.useState(),[be,_e]=n.useState(!1);Digit.Hooks.useClickOutside(ce,()=>{_e(!1)},be),n.useEffect(()=>{!function(){try{var e,t;const n={CalculationCriteria:[{applicationNumber:ve,tenantId:he,propertyType:null==pe||null===(e=pe[0])||void 0===e||null===(t=e.additionalDetails)||void 0===t?void 0:t.propertyType}]};Promise.resolve(Digit.NDCService.NDCCalculator({tenantId:he,filters:{getCalculationOnly:!0},details:n})).then(function(e){var t;Ee(null==e||null===(t=e.Calculation)||void 0===t?void 0:t[0])})}catch(e){return Promise.reject(e)}}()},[]);const Ne=Digit.Hooks.useWorkflowDetails({tenantId:he,id:ve,moduleCode:"ndc-services"}),Se=null==de||null===(E=de.info)||void 0===E||null===(b=E.roles)||void 0===b?void 0:b.map(e=>e.code);let De=(null==Ne||null===(_=Ne.data)||void 0===_||null===(N=_.actionState)||void 0===N||null===(S=N.nextActions)||void 0===S?void 0:S.filter(e=>(null==Se?void 0:Se.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==Ne||null===(D=Ne.data)||void 0===D||null===(C=D.nextActions)||void 0===C?void 0:C.filter(e=>(null==Se?void 0:Se.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));const Ce={flex:ge?"1 1 18%":"1 1 22%",minWidth:"200px",maxWidth:"250px",backgroundColor:"#fdfdfd",padding:"0.75rem",border:"1px solid #e0e0e0",borderRadius:"6px",boxShadow:"0 1px 3px rgba(0,0,0,0.05)"},we=(e,n)=>o.createElement("div",{className:"bpa-summary-label-field-pair"},o.createElement(t.CardLabel,{className:"bpa-summary-bold-label",style:{width:"auto"}},e),o.createElement("div",null,n||"NA"));return o.createElement("div",{className:"bpa-summary-page"},o.createElement("h2",{className:"bpa-summary-heading"},se("Application Summary")),o.createElement("div",{className:"bpa-summary-section"},we(se("Full Name"),null==le||null===(w=le.NDCDetails)||void 0===w||null===(A=w.PropertyDetails)||void 0===A?void 0:A.firstName),we(se("Mobile Number"),null==le||null===(T=le.NDCDetails)||void 0===T||null===(O=T.PropertyDetails)||void 0===O?void 0:O.mobileNumber),we(se("Email ID"),null==le||null===(P=le.NDCDetails)||void 0===P||null===(I=P.PropertyDetails)||void 0===I?void 0:I.email),we(se("Address"),null==le||null===(x=le.NDCDetails)||void 0===x||null===(R=x.PropertyDetails)||void 0===R?void 0:R.address),"OTHERS"===(null==le||null===(L=le.NDCDetails)||void 0===L||null===(F=L.NDCReason)||void 0===F?void 0:F.i18nKey)?we(se("NDC Reason"),se(null==le||null===(M=le.NDCDetails)||void 0===M||null===(k=M.NDCReason)||void 0===k?void 0:k.reason)):we(se("NDC Reason"),se(null==le||null===(B=le.NDCDetails)||void 0===B||null===(U=B.NDCReason)||void 0===U?void 0:U.i18nKey)),we(se("Remarks"),null==le||null===(j=le.NDCDetails)||void 0===j||null===(W=j.PropertyDetails)||void 0===W?void 0:W.remarks),we(se("Water Connection"),(null==le||null===(z=le.NDCDetails)||void 0===z||null===(H=z.PropertyDetails)||void 0===H||null===(V=H.waterConnection)||void 0===V?void 0:V.length)>0?null==le||null===(q=le.NDCDetails)||void 0===q||null===(Y=q.PropertyDetails)||void 0===Y||null===(G=Y.waterConnection)||void 0===G?void 0:G.map((e,t)=>o.createElement("div",{key:t},null==e?void 0:e.connectionNo)):"NA"),we(se("Sewerage Connection"),(null==le||null===($=le.NDCDetails)||void 0===$||null===(K=$.PropertyDetails)||void 0===K||null===(X=K.sewerageConnection)||void 0===X?void 0:X.length)>0?null==le||null===(Z=le.NDCDetails)||void 0===Z||null===(Q=Z.PropertyDetails)||void 0===Q||null===(J=Q.sewerageConnection)||void 0===J?void 0:J.map((e,t)=>o.createElement("div",{key:t},null==e?void 0:e.connectionNo)):"NA"),we(se("Property ID"),null==le||null===(ee=le.NDCDetails)||void 0===ee||null===(te=ee.cpt)||void 0===te?void 0:te.id),we(se("Application Fees"),null!=ye&&ye.totalAmount?new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"}).format(null==ye?void 0:ye.totalAmount):"NA")),o.createElement("h2",{className:"bpa-summary-heading"},se("Documents Uploaded")),o.createElement("div",{className:"bpa-summary-section"},(null==me?void 0:me.length)>0?o.createElement("div",{className:"ndc-doc-view-comp"},null==me?void 0:me.map((e,t)=>o.createElement("div",{key:t,style:Ce},o.createElement(fn,{value:me,Code:null==e?void 0:e.documentType,index:t,formData:le})))):o.createElement("div",null,se("TL_NO_DOCUMENTS_MSG"))),o.createElement(t.ActionBar,null,o.createElement(t.SubmitBar,{className:"submit-bar-back",label:"Back",onSubmit:ae}),be&&(null!=Ne&&null!==(ne=Ne.data)&&void 0!==ne&&null!==(oe=ne.actionState)&&void 0!==oe&&oe.nextActions||null!=Ne&&null!==(re=Ne.data)&&void 0!==re&&re.nextActions)?o.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NDC",options:De,optionKey:"action",t:se,onSelect:function(e){ie(e)}}):null,o.createElement(t.SubmitBar,{ref:ce,label:se("WF_TAKE_ACTION"),onSubmit:()=>_e(!be)})))},hn=["status"],gn=[{head:"Application Details",stepLabel:"Application Details",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNDCStepFormOneEmployee",key:"NDCDetails",withoutLabel:!0,texts:{submitBarLabel:"Next"}},{head:"NDC_DOCUMENTS_REQUIRED",stepLabel:"Document Info",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNDCStepFormTwoEmployee",key:"DocummentDetails",withoutLabel:!0,texts:{submitBarLabel:"Next"}},{head:"Summary",stepLabel:"Summary",stepNumber:3,isStepEnabled:!0,type:"component",component:"NDCNewFormSummaryStepThreeEmployee",key:"PTSummary",withoutLabel:!0}].map(e=>s({},e,{currStepConfig:sn.filter(t=>t.stepNumber===e.stepNumber)})),yn=["status"],En=["status"],bn={step:1,formData:{}},_n=function(e,t){switch(void 0===e&&(e=bn),t.type){case"UPDATE_NDC_FORM":return s({},e,{formData:s({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_NDC_STEP":return s({},e,{step:t.payload});case"RESET_NDC_FORM":return bn;default:return e}},Nn={NDCModule:e=>{let{stateCode:n,userType:l,tenants:i}=e;const{path:a}=r.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:s}=Digit.Services.useStore({stateCode:n,moduleCode:"common-noc",language:u});return Digit.SessionStorage.set("NOC_TENANTS",i),s?o.createElement(t.Loader,null):"citizen"===l?o.createElement(ie,null):o.createElement(oe,{path:a,stateCode:n})},NOCCard:()=>{var e,i;const{t:a}=l.useTranslation(),u=r.useLocation(),c=Digit.ULBService.getCurrentTenantId();if(!Digit.Utils.NOCAccess())return null;const m={filterForm:{moduleName:"noc-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:d(!0)||[]},searchForm:{},tableForm:{limit:10,offset:0}},{isLoading:v,data:{totalCount:f,nearingSlaCount:p}={}}=Digit.Hooks.noc.useInbox({tenantId:c,filters:s({},m),config:{enabled:(null==m||null===(e=m.filterForm)||void 0===e||null===(i=e.businessServiceArray)||void 0===i?void 0:i.length)>0}}),h=()=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},o.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),o.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",fill:"white"}));n.useEffect(()=>{"/digit-ui/employee"===u.pathname&&Digit.SessionStorage.del("NDC.INBOX")},[u.pathname]);const g=n.useMemo(()=>({Icon:o.createElement(h,null),moduleName:a("ACTION_TEST_NOC"),kpis:[{count:v?"":f,label:a("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:v?"-":p,label:a("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:f,label:a("ES_COMMON_INBOX"),link:"/digit-ui/employee/noc/inbox"},{label:a("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]}),[v,f]);return Digit.Utils.NOCAccess()?o.createElement(t.EmployeeModuleCard,g):null},NDCApplicationOverview:()=>{var e,i,u,c,d,m,f,p,h,g,y,E,b,_,N,S,D,C,w,A,T,O,P,I,x,R,L,F,M;const{id:k}=r.useParams(),{t:B}=l.useTranslation(),U=r.useHistory(),j=n.useRef(null),W=window.localStorage.getItem("Employee.tenant-id"),z=null==W?void 0:W.split(".")[0],[H,V]=n.useState(null),[q,Y]=n.useState(null),[G,$]=n.useState(!1),{control:K,setValue:X}=a.useForm(),[Z,Q]=n.useState(null),[J,ee]=n.useState(null),[te,ne]=n.useState({}),[oe,re]=n.useState(!1),[le,ie]=n.useState(!1),[ue,ce]=n.useState({}),[de,me]=n.useState([]),[ve,fe]=n.useState(!1),[pe,he]=n.useState([]),[ge,ye]=n.useState(!1),[Ee,be]=n.useState(null),[_e,Ne]=n.useState(!1),[Se,De]=n.useState(null),[Ce,we]=n.useState(null),{isLoading:Ae,data:Te}=Digit.Hooks.ndc.useSearchEmployeeApplication({applicationNo:k},W),Oe=Digit.Hooks.useWorkflowDetails({tenantId:W,id:k,moduleCode:"ndc-services",role:"EMPLOYEE"});var Pe,Ie;null!=Oe&&null!==(e=Oe.data)&&void 0!==e&&null!==(i=e.actionState)&&void 0!==i&&i.nextActions&&!Oe.isLoading&&(Oe.data.actionState.nextActions=[...null==Oe||null===(u=Oe.data)||void 0===u?void 0:u.nextActions]),Oe&&Oe.data&&!Oe.isLoading&&(Oe.data.initialActionState=(null==Oe||null===(Pe=Oe.data)||void 0===Pe?void 0:Pe.initialActionState)||s({},null==Oe||null===(Ie=Oe.data)||void 0===Ie?void 0:Ie.actionState)||{},Oe.data.actionState=s({},Oe.data));let xe={data:{actionState:{nextActions:[{action:"APPROVE",roles:["NDC_ADMIN"],tenantId:"pb",assigneeRoles:[],isTerminateState:!1},{action:"ASSIGN",roles:["NDC_ADMIN"],tenantId:"pb",assigneeRoles:["NDC_ADMIN"],isTerminateState:!1},{action:"REJECT",roles:["NDC_ADMIN"],tenantId:"pb",assigneeRoles:[],isTerminateState:!0}]}}};n.useEffect(()=>{let e=null;try{return fe(!0),Promise.resolve(Digit.WorkflowService.init(W,"ndc-services")).then(function(t){var n,o,r,l,i,a;e=t,fe(!1),console.log("WorkflowService====",null===(n=e)||void 0===n||null===(o=n.BusinessServices)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.states),me(null===(l=e)||void 0===l||null===(i=l.BusinessServices)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.states)})}catch(e){Promise.reject(e)}},[W]);const Re=v(W,Ce);console.log("approver for ndc",Ce),console.log("officerData",Re);let Le=Digit.UserService.getUser();const Fe=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};Le=null==t?void 0:t.value}const Me=null===(c=Le)||void 0===c||null===(d=c.info)||void 0===d||null===(m=d.roles)||void 0===m?void 0:m.map(e=>e.code),ke=null===(f=Le)||void 0===f||null===(p=f.info)||void 0===p?void 0:p.roles.filter(e=>"CEMP"===e.code);let Be=(null==Oe||null===(h=Oe.data)||void 0===h||null===(g=h.actionState)||void 0===g||null===(y=g.nextActions)||void 0===y?void 0:y.filter(e=>(null==Me?void 0:Me.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==xe||null===(E=xe.data)||void 0===E||null===(b=E.nextActions)||void 0===b?void 0:b.filter(e=>(null==Me?void 0:Me.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(Fe,()=>{ye(!1)},ge);const Ue=()=>{V(null)},je=e=>{const t=new Set;return e.filter(e=>!t.has(e.uuid)&&(t.add(e.uuid),!0))};n.useEffect(()=>{var e;const t=null==Te||null===(e=Te.Applications)||void 0===e?void 0:e[0];if(t){var n,o,r,l,i,a,u,s,c,d;const e={name:null==t||null===(n=t.owners)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.name,mobile:null==t||null===(r=t.owners)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.mobileNumber,email:null==t||null===(i=t.owners)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.emailId,address:null==t||null===(u=t.NdcDetails)||void 0===u||null===(s=u[0])||void 0===s||null===(c=s.additionalDetails)||void 0===c?void 0:c.propertyAddress,applicationNo:null==t?void 0:t.applicationNo},m=je((null==t?void 0:t.Documents)||[]),v=null===(d=je((null==t?void 0:t.NdcDetails)||[]))||void 0===d?void 0:d.map(e=>{var t;return{businessService:"WS"===(null==e?void 0:e.businessService)?"NDC_WATER_SERVICE_CONNECTION":"SW"===(null==e?void 0:e.businessService)?"NDC_SEWERAGE_SERVICE_CONNECTION":"PT"===(null==e?void 0:e.businessService)?"NDC_PROPERTY_TAX":null==e?void 0:e.businessService,consumerCode:(null==e?void 0:e.consumerCode)||"",status:(null==e?void 0:e.status)||"",dueAmount:(null==e?void 0:e.dueAmount)||0,propertyType:(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.propertyType)||"",isDuePending:null==e?void 0:e.isDuePending}});ne({applicantData:e,Documents:m,NdcDetails:v})}},[null==Te?void 0:Te.Applications]),n.useEffect(()=>{Te&&(re(!0),re(!1))},[Te]);const We=function(e){try{var t;const r=null==Te?void 0:Te.Applications[0],l=s({},r,{NdcDetails:r.NdcDetails.map(e=>{var t;const n=le[e.consumerCode];return s({},e,{isDuePending:null!=(t=null!=n?n:e.isDuePending)&&t,dueAmount:!1===n?0:void 0!==(null==ue?void 0:ue[e.consumerCode])?Number(ue[e.consumerCode]):(null==e?void 0:e.dueAmount)||0})}),workflow:{}}),i=null==e||null===(t=e.Licenses)||void 0===t?void 0:t[0];let a;var n,o;if("SENDBACKTOCITIZEN"==i.action&&(a=[null==r||null===(n=r.owners)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.uuid]),l.workflow={action:i.action,assignes:(null==i?void 0:i.assignee)||a,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments},!(null!=i&&i.assignee||"SENDBACKTOCITIZEN"===i.action||"APPROVE"===i.action||"REJECT"===i.action||"SENDBACK"===i.action))return ee("Assignee is Mandatory"),Q(!0),Promise.resolve();if(null==i||!i.comment)return ee("Comment is Mandatory"),Q(!0),Promise.resolve();const u={Applications:[l]},c=ae(function(){return Promise.resolve(Digit.NDCService.NDCUpdate({tenantId:W,details:u})).then(function(e){$("Successfully updated the status"),Y(!1),V(!0),Oe.revalidate(),setTimeout(()=>{U.push("/digit-ui/employee/ndc/inbox"),window.location.reload()},2e3),be(null),Ne(!1)})},function(){ee("Something went wrong"),Q(!0)});return Promise.resolve(c&&c.then?c.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};n.useEffect(()=>{if(Oe){var e,t,n;console.log("workflowDetails here",Oe);const o=null==Oe||null===(e=Oe.data)||void 0===e||null===(t=e.processInstances)||void 0===t?void 0:t.find(e=>"APPROVE"===(null==e?void 0:e.action)),r=(null==o||null===(n=o.assigner)||void 0===n?void 0:n.name)||"NA";we(r)}},[Oe]);const{data:ze}=Digit.Hooks.useStore.getInitData(),{tenants:He}=ze||{};n.useEffect(()=>{if(te){var e,t;const n=null==te||null===(e=te.NdcDetails)||void 0===e?void 0:e.filter(e=>"NDC_PROPERTY_TAX"==(null==e?void 0:e.businessService));De(null==n||null===(t=n[0])||void 0===t?void 0:t.consumerCode)}},[te]);const{isLoading:Ve,data:qe}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:Se},tenantId:W},{filters:{propertyIds:Se},tenantId:W,enabled:!!Se,privacy:Digit.Utils.getPrivacyObject()});let Ye,Ge;var $e,Ke,Xe,Ze,Je,et;return console.log("applicationDetails",null==Te||null===(_=Te.Applications)||void 0===_||null===(N=_[0])||void 0===N?void 0:N.NdcDetails),n.useEffect(()=>{const e=e=>{j.current&&!j.current.contains(e.target)&&V(null)};return H&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[H]),!Ve&&(null==qe||null===(S=qe.Properties)||void 0===S?void 0:S.length)>0&&(Ye=qe.Properties[0].address,Ge=[null===($e=Ye)||void 0===$e?void 0:$e.doorNo,null===(Ke=Ye)||void 0===Ke?void 0:Ke.buildingName,null===(Xe=Ye)||void 0===Xe?void 0:Xe.street,null===(Ze=Ye)||void 0===Ze||null===(Je=Ze.locality)||void 0===Je?void 0:Je.name,null===(et=Ye)||void 0===et?void 0:et.city].filter(Boolean).join(", ")),Ae||oe?o.createElement(Qe,null):o.createElement("div",{className:"employee-main-application-details"},o.createElement("div",{style:{display:"flex",justifyContent:"end",alignItems:"center",padding:"16px"}},ke&&"APPROVED"===(null==Te||null===(D=Te.Applications)||void 0===D||null===(C=D[0])||void 0===C?void 0:C.applicationStatus)&&o.createElement(t.LinkButton,{className:"downLoadButton",label:B("DOWNLOAD_CERTIFICATE"),onClick:function(){try{const e=ae(function(){var e,t,n;function o(){console.log("acknowledgementData",u),setTimeout(()=>{Digit.Utils.pdf.generateNDC(u),fe(!1)},0)}fe(!0);const r=Te,l=((null==qe||null===(e=qe.Properties)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.owners)||[]).map(e=>null==e?void 0:e.name).filter(Boolean);r.propertyOwnerNames=l,console.log("propertyOwnerNames",l);const i=null==He?void 0:He.find(e=>{var t,n;return(null==e?void 0:e.code)===(null==r||null===(t=r.Applications)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.tenantId)});console.log("tenantInfo",i);const a=null==i||null===(n=i.city)||void 0===n?void 0:n.ulbType;let u;const s=function(){if(Re)return Promise.resolve(it(r,Ge,i,B,Ce,a,Re)).then(function(e){u=e})}();return s&&s.then?s.then(o):o()},function(e){console.error("Error generating acknowledgement:",e),fe(!1)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})),o.createElement(t.Card,null,o.createElement(t.CardSubHeader,null,B("NDC_APPLICATION_DETAILS_OVERVIEW")),o.createElement(t.StatusTable,null,(null==te?void 0:te.applicantData)&&(null===(w=Object.entries(null==te?void 0:te.applicantData))||void 0===w?void 0:w.map(e=>{let[n,r]=e;return o.createElement(t.Row,{key:n,label:B(""+(null==n?void 0:n.toUpperCase())),text:Array.isArray(r)?r.map(e=>B("object"==typeof e?(null==e?void 0:e.code)||"N/A":e||"N/A")).join(", "):B("object"==typeof r?(null==r?void 0:r.code)||"N/A":r||"N/A")})})))),o.createElement(t.Card,null,o.createElement(t.CardSubHeader,null,B("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")),null==te||null===(A=te.NdcDetails)||void 0===A?void 0:A.map((e,r)=>{var l,i,u,c,d,m,v,f,p,h,g,y,E,b,_,N,S,D,C,w,A,T,O,P,I,x,R,L,F,M,k,U,j,W,z,H,V,q;const Y="NDC_PROPERTY_TAX"===(null==e?void 0:e.businessService),G="NDC_SEWERAGE_SERVICE_CONNECTION"===(null==e?void 0:e.businessService),$="NDC_WATER_SERVICE_CONNECTION"===(null==e?void 0:e.businessService),Z=Y&&(null==Me?void 0:Me.includes("NDC_PT_VERIFIER"))||(G||$)&&(null==Me?void 0:Me.includes("NDC_WS_SW_VERIFIER")),Q=le[e.consumerCode]||(null==e?void 0:e.isDuePending),J=e.dueAmount>0;return o.createElement("div",{key:r,className:"ndc-emp-app-overview"},o.createElement(t.StatusTable,null,o.createElement(t.Row,{label:B("NDC_BUSINESS_SERVICE"),text:B(""+e.businessService)||e.businessService}),o.createElement(t.Row,{label:B("NDC_CONSUMER_CODE"),text:e.consumerCode||"N/A"}),(!Z||!Q)&&o.createElement("div",{style:{background:J?"red":"none",color:J?"white":"black",paddingTop:J?"8px":"0",paddingLeft:J?"10px":"0"}},o.createElement(t.Row,{rowContainerStyle:{backgroundColor:J?"red":"none"},label:B("NDC_DUE_AMOUNT"),text:(!1===le[e.consumerCode]?"0":null!=(l=null!=(i=null==ue?void 0:ue[e.consumerCode])?i:null==e?void 0:e.dueAmount)?l:0).toString()})),Z&&Q&&o.createElement("div",null,o.createElement(t.Row,{label:"Due Amount",text:o.createElement(a.Controller,{key:r,control:K,name:"amount["+r+"]",defaultValue:!1===le[e.consumerCode]?0:null!=(u=null!=(c=null==ue?void 0:ue[e.consumerCode])?c:null==e?void 0:e.dueAmount)?u:0,render:n=>o.createElement(t.TextInput,{type:"number",value:n.value,onChange:t=>{n.onChange(t.target.value);const o=t.target.value;ce(t=>s({},t,{[e.consumerCode]:o}))},style:{maxWidth:"200px"},onBlur:n.onBlur,disabled:!1===le[e.consumerCode]})})})),o.createElement(t.Row,{label:B("NDC_PROPERTY_TYPE"),text:B(e.propertyType)||e.propertyType}),Y&&(null==qe?void 0:qe.Properties)&&o.createElement(n.Fragment,null,o.createElement(t.Row,{label:B("CHB_DISCOUNT_REASON"),text:B(""+("OTHERS"==(null==Te||null===(d=Te.Applications)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.reason)?null==Te||null===(v=Te.Applications)||void 0===v||null===(f=v[0])||void 0===f||null===(p=f.NdcDetails)||void 0===p||null===(h=p[2])||void 0===h||null===(g=h.additionalDetails)||void 0===g?void 0:g.reason:null==Te||null===(y=Te.Applications)||void 0===y||null===(E=y[0])||void 0===E?void 0:E.reason))}),o.createElement(t.Row,{label:B("City"),text:null==qe||null===(b=qe.Properties)||void 0===b||null===(_=b[0])||void 0===_||null===(N=_.address)||void 0===N?void 0:N.city}),o.createElement(t.Row,{label:B("House No"),text:null==qe||null===(S=qe.Properties)||void 0===S||null===(D=S[0])||void 0===D||null===(C=D.address)||void 0===C?void 0:C.doorNo}),o.createElement(t.Row,{label:B("Colony Name"),text:null==qe||null===(w=qe.Properties)||void 0===w||null===(A=w[0])||void 0===A||null===(T=A.address)||void 0===T?void 0:T.buildingName}),o.createElement(t.Row,{label:B("Street Name"),text:null==qe||null===(O=qe.Properties)||void 0===O||null===(P=O[0])||void 0===P||null===(I=P.address)||void 0===I?void 0:I.street}),o.createElement(t.Row,{label:B("Pincode"),text:(null==qe||null===(x=qe.Properties)||void 0===x||null===(R=x[0])||void 0===R||null===(L=R.address)||void 0===L?void 0:L.pincode)||"N/A"}),o.createElement(t.Row,{label:B("Survey Id/UID"),text:null==qe||null===(F=qe.Properties)||void 0===F||null===(M=F[0])||void 0===M?void 0:M.surveyId}),o.createElement(t.Row,{label:B("Year of creation of Property"),text:null==qe||null===(k=qe.Properties)||void 0===k||null===(U=k[0])||void 0===U||null===(j=U.additionalDetails)||void 0===j?void 0:j.yearConstruction}),o.createElement(t.Row,{label:B("Remarks"),text:(null==Te||null===(W=Te.Applications)||void 0===W||null===(z=W[0])||void 0===z||null===(H=z.NdcDetails)||void 0===H||null===(V=H[2])||void 0===V||null===(q=V.additionalDetails)||void 0===q?void 0:q.remarks)||"N/A"}))),Z&&o.createElement("div",{className:"mychallan-custom"},o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},o.createElement("b",null," Pending Dues")),o.createElement(t.FilterFormField,{className:"radioButtonSection"},o.createElement(a.Controller,{name:"assignee"+r,control:K,defaultValue:null!=e&&e.isDuePending?"yes":"no",render:n=>o.createElement(t.RadioButtons,{onSelect:t=>{n.onChange(t.code),((e,t,n)=>{ie(o=>{const r=s({},o,{[e]:"yes"===t});return r[e]?console.log("✅ Marked dues pending for",e):(ce(t=>s({},t,{[e]:0})),X("amount["+n+"]",0)),r})})(e.consumerCode,t.code,r)},selectedOption:at.filter(e=>e.code===n.value)[0],optionsKey:"name",options:at})}))))})),o.createElement(t.Card,null,o.createElement(t.CardSubHeader,null,B("NDC_APPLICATION_DOCUMENTS_OVERVIEW")),o.createElement("div",null,Array.isArray(null==te?void 0:te.Documents)&&(null==te||null===(T=te.Documents)||void 0===T?void 0:T.length)>0?o.createElement(se,{value:{workflowDocs:null==te?void 0:te.Documents}}):o.createElement("div",null,B("TL_NO_DOCUMENTS_MSG")))),o.createElement(lt,{workflowDetails:Oe,t:B}),"INITIATED"!==(null==Te||null===(O=Te.Applications)||void 0===O||null===(P=O[0])||void 0===P?void 0:P.applicationStatus)&&Be&&o.createElement(t.ActionBar,null,ge&&(null!=Oe&&null!==(I=Oe.data)&&void 0!==I&&null!==(x=I.actionState)&&void 0!==x&&x.nextActions||null!=Oe&&null!==(R=Oe.data)&&void 0!==R&&R.nextActions)?o.createElement(t.Menu,{localeKeyPrefix:"WF_EDITRENEWAL",options:Be,optionKey:"action",t:B,onSelect:function(e){var t,n,o,r,l,i,a,u;console.log("action====???",null==e||null===(t=e.state)||void 0===t?void 0:t.actions);const s=(null==Te||null===(n=Te.Applications)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.NdcDetails)||[],c=null==s?void 0:s.some(e=>!0===e.isDuePending);console.log("hasDuePending",c);const d=null==e||null===(r=e.state)||void 0===r||null===(l=r.actions)||void 0===l?void 0:l.filter(t=>t.action==(null==e?void 0:e.action));console.log("filterNexState====???",null===(i=d[0])||void 0===i?void 0:i.nextState);const m=null==de?void 0:de.filter(e=>{var t;return(null==e?void 0:e.uuid)==(null===(t=d[0])||void 0===t?void 0:t.nextState)});console.log("filterRoles====???",m),console.log("action test",null==e?void 0:e.action);const v="APPROVE"==(null==e?void 0:e.action);if(console.log("filterRoles && checkactionApp",m&&v,v,m),c&&v)return console.log("alwasy coming appprve"),$("You Can Not Approve This Application, Because It Has Pending Dues. Please Send It To Required Department"),Y(!0),void V(!0);he(null==m||null===(a=m[0])||void 0===a?void 0:a.actions);const f=null==te||null===(u=te.applicantData)||void 0===u?void 0:u.applicationNo;"APPLY"==(null==e?void 0:e.action)?We({Licenses:[e]}):"PAY"==(null==e?void 0:e.action)?U.push("/digit-ui/employee/payment/collect/NDC/"+f+"/"+W+"?tenantId="+W):"EDIT"==(null==e?void 0:e.action)?U.push("/digit-ui/employee/ndc/create/"+f):(Ne(!0),be(e))}}):null,o.createElement(t.SubmitBar,{ref:Fe,label:B("WF_TAKE_ACTION"),onSubmit:()=>ye(!ge)})),"INITIATED"==(null==Te||null===(L=Te.Applications)||void 0===L||null===(F=L[0])||void 0===F?void 0:F.applicationStatus)&&o.createElement(t.ActionBar,null,o.createElement(t.SubmitBar,{label:B("COMMON_EDIT"),onSubmit:()=>{var e,t;const n=null==Te||null===(e=Te.Applications)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.applicationNo;U.push("/digit-ui/employee/ndc/create/"+n)}})),_e?o.createElement(nt,{t:B,action:Ee,tenantId:W,state:z,getEmployees:pe,id:k,applicationDetails:Te,applicationData:null==Te?void 0:Te.applicationData,closeModal:()=>{be(null),Ne(!1)},submitAction:We,actionData:null==Oe||null===(M=Oe.data)||void 0===M?void 0:M.timeline,workflowDetails:Oe,showToast:H,closeToast:Ue,errors:q,showErrorToast:Z,errorOne:J,closeToastOne:()=>{Q(null)}}):null,H&&o.createElement("div",{ref:j},o.createElement(t.Toast,{error:q,label:G,isDleteBtn:!0,onClose:Ue})),(Ae||oe||Ve||ve)&&o.createElement(Qe,{page:!0}))},NDCInbox:e=>{let{parentRoute:i}=e;const{t:u}=l.useTranslation(),c=window.localStorage.getItem("Employee.tenant-id"),[m,v]=n.useState(),f={},p={moduleName:"ndc-services",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:d(!0)||[]},h={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},g=Digit.SessionStorage.get("NDC.INBOX"),y=n.useMemo(()=>g||{filterForm:p,searchForm:f,tableForm:h},[Object.values((null==g?void 0:g.filterForm)||{}),Object.values((null==g?void 0:g.searchForm)||{}),Object.values((null==g?void 0:g.tableForm)||{})]),[E,b]=n.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("NDC.INBOX",s({},e,{searchForm:t.data})),s({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("NDC.INBOX",s({},e,{filterForm:t.data})),s({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("NDC.INBOX",s({},e,{tableForm:t.data})),s({},e,{tableForm:t.data})}},y),{data:_,isLoading:N}=Digit.Hooks.useBoundaryLocalities(c,"revenue",{},u),S=e=>{v(e)},{isLoading:D,data:C}=Digit.Hooks.ndc.useInbox({tenantId:c,filters:s({},E,{getFilter:m})}),[w,A]=n.useState([]),[T,O]=n.useState([]),[P,I]=n.useState(0);n.useEffect(()=>{C&&(O((null==C?void 0:C.statuses)||[]),A((null==C?void 0:C.table)||[]),I((null==C?void 0:C.totalCount)||0))},[C]);const x={logoIcon:o.createElement(t.ComplaintIcon,null),headerText:""+u("MODULE_NKS_NO_DUE_CERTIFICATE_FEES"),links:[{text:"",link:"",accessTo:[""]}]},R=n.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:r}=e;return o.createElement(Qt,{registerRef:t,searchFormState:n,searchFieldComponents:r})},[]),L=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:r,getFilterFormValue:l}=e;return o.createElement(Jt,{statuses:T,isInboxLoading:D,registerRef:t,controlFilterForm:n,setFilterFormValue:r,filterFormState:null==E?void 0:E.filterForm,getFilterFormValue:l,localitiesForEmployeesCurrentTenant:_,loadingLocalitiesForEmployeesCurrentTenant:N,handleFilter:S})},[T,D,_,N]),F={SearchFormFields:R,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),b({action:"mutateTableForm",data:s({},h)}),b({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==E?void 0:E.searchForm,resetSearchFormDefaultValues:f,onSearchFormReset:e=>{e("sourceRefId",null),e("applicationNo",null),e("mobileNumber",null),b({action:"mutateSearchForm",data:f})}},M={FilterFormFields:L,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),b({action:"mutateTableForm",data:s({},h)}),b({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==E?void 0:E.filterForm,resetFilterFormDefaultValues:p,onFilterFormReset:e=>{e("moduleName","bpa-services"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),b({action:"mutateFilterForm",data:p})}},k=(e=>{var t,i,a,u;let{parentRoute:c,onPageSizeChange:d,formState:m,totalCount:v,table:f,dispatch:p,onSortingByData:h}=e;const{t:g}=l.useTranslation(),y=n.useMemo(()=>[{Header:g("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL"),accessor:"uuid",disableSortBy:!0,Cell:e=>{var t,n;let{row:l}=e;return console.log("row",l),o.createElement("div",null,o.createElement(r.Link,{to:c+"/inbox/application-overview/"+(null===(t=l.original)||void 0===t?void 0:t.applicationId)},o.createElement("span",{className:"link"},null===(n=l.original)||void 0===n?void 0:n.applicationId)))}},{Header:g("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"createdtime",Cell:e=>{var t,n;let{row:r}=e;return null!==(t=r.original)&&void 0!==t&&t.date?(l=Xt(new Date(null===(n=r.original)||void 0===n?void 0:n.date),"dd/MM/yyyy"),o.createElement("span",{className:"cell-text styled-cell"},l)):"";var l}},{Header:g("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:"status",Cell:e=>{var t;let{row:n}=e;return g(null===(t=n.original)||void 0===t?void 0:t.status)}}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:d,currentPage:(null===(t=m.tableForm)||void 0===t?void 0:t.offset)/(null===(i=m.tableForm)||void 0===i?void 0:i.limit),onNextPage:()=>{var e,t;return p({action:"mutateTableForm",data:s({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return p({action:"mutateTableForm",data:s({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(a=m.tableForm)||void 0===a?void 0:a.limit,onSort:h,totalRecords:v,onSearch:null==m||null===(u=m.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return p({action:"mutateTableForm",data:s({},m.tableForm,{offset:10*Math.ceil(v/10)-parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>p({action:"mutateTableForm",data:s({},m.tableForm,{offset:0})}),data:f,columns:y}})(s({},{parentRoute:i,onPageSizeChange:e=>{b({action:"mutateTableForm",data:s({},E.tableForm,{limit:e.target.value})})},formState:E,totalCount:P,table:w,dispatch:b,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,o=n?"DESC":"ASC";E.tableForm.sortBy===t&&E.tableForm.sortOrder===o||b({action:"mutateTableForm",data:s({},E.tableForm,{sortBy:t,sortOrder:n?"DESC":"ASC"})})}}})),B=(e=>{let{parentRoute:n,table:r}=e;const{t:i}=l.useTranslation();return{data:null==r?void 0:r.map(e=>({[i("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")]:null==e?void 0:e.applicationId,[i("TL_COMMON_TABLE_COL_APP_DATE")]:Xt(new Date(null==e?void 0:e.date),"dd/MM/yyyy"),[i("PT_COMMON_TABLE_COL_STATUS_LABEL")]:null==e?void 0:e.status})),linkPrefix:n+"/inbox/application-overview/",serviceRequestIdKey:i("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:n}=a.useFormContext();return o.createElement(t.SearchField,null,o.createElement(a.Controller,{name:"sortOrder",control:n,render:n=>{let{onChange:r,value:l}=n;return o.createElement(t.RadioButtons,{onSelect:e=>{r(e.code)},selectedOption:e.filter(e=>e.code===l)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:i,table:w}),U={onMobileSortOrderData:e=>{const{sortOrder:t}=e;b({action:"mutateTableForm",data:s({},E.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==E?void 0:E.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),b({action:"mutateTableForm",data:h})}};return o.createElement(n.Fragment,null,o.createElement(t.Header,null,u("ES_COMMON_INBOX"),P?o.createElement("p",{className:"inbox-count"},P):null),o.createElement("div",{className:"NDCSection"},o.createElement(t.InboxComposer,s({isInboxLoading:D,PropsForInboxLinks:x},F,M,U,{propsForInboxTable:k,propsForInboxMobileCards:B,formState:E}))))},NOCSearchApplication:e=>{let{t:t,onSubmit:i,data:u,error:s,isLoading:c,Count:d}=e;const[m,v]=n.useState(null),f=a.useForm({defaultValues:{}});n.useEffect(()=>{f.register("offset",0),f.register("limit",10),f.register("sortBy","commencementDate"),f.register("sortOrder","DESC")},[f.register]);const p=(()=>{const{t:e}=l.useTranslation(),t=e=>o.createElement("span",{className:"cell-text"},e);return n.useMemo(()=>[{Header:e("NOC_APP_NO_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return o.createElement("div",null,o.createElement("span",{className:"link"},o.createElement(r.Link,{to:"/digit-ui/employee/noc/search/application-overview/"+(t.original.applicationNo||t.original.applicationNumber)},t.original.applicationNo||t.original.applicationNumber)))}},{Header:e("NOC_COMMON_TABLE_COL_APP_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var n,o;return t(null!=e&&null!==(n=e.auditDetails)&&void 0!==n&&n.createdTime?Digit.DateUtils.ConvertEpochToDate(null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.createdTime):"-")}},{Header:e("NOC_APPLICANTS_NAME_LABEL"),disableSortBy:!0,accessor:e=>{var n,o;return t(null!=e&&null!==(n=e.additionalDetails)&&void 0!==n&&n.applicantName?null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.applicantName:"-")}},{Header:e("NOC_SOURCE_MODULE_LABEL"),disableSortBy:!0,accessor:n=>t(e("MODULE_"+(null==n?void 0:n.source)||"-"))},{Header:e("NOC_SOURCE_MODULE_NUMBER"),disableSortBy:!0,accessor:e=>t((null==e?void 0:e.sourceRefId)||"-")},{Header:e("NOC_STATUS_LABEL"),accessor:n=>t(e((null==n?void 0:n.applicationStatus)&&""+n.applicationStatus||"-")),disableSortBy:!0},{Header:e("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:n=>{var o,r;return t(e((null==n||null===(o=n.additionalDetails)||void 0===o?void 0:o.currentOwner)&&""+(null==n||null===(r=n.additionalDetails)||void 0===r?void 0:r.currentOwner)||"-"))},disableSortBy:!0}],[])})(),h=window.Digit.Utils.browser.isMobile(),g=n.useMemo(()=>null==u?void 0:u.map(e=>{var n,o,r;return{[t("NOC_APP_NO_LABEL")]:e.applicationNo,[t("NOC_COMMON_TABLE_COL_APP_DATE_LABEL")]:Digit.DateUtils.ConvertEpochToDate(null===(n=e.auditDetails)||void 0===n?void 0:n.createdTime)||"-",[t("NOC_APPLICANTS_NAME_LABEL")]:(null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.applicantName)||"-",[t("NOC_SOURCE_MODULE_LABEL")]:e.source?t("MODULE_"+e.source):"-",[t("NOC_SOURCE_MODULE_NUMBER")]:(null==e?void 0:e.sourceRefId)||"-",[t("WF_INBOX_HEADER_CURRENT_OWNER")]:(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.currentOwner)||"-",[t("NOC_STATUS_LABEL")]:e.applicationStatus?t(""+e.applicationStatus):"-"}}),[u]);return o.createElement(a.FormProvider,f,h?o.createElement(on,{SearchFormFieldsComponent:en,propsMobileInboxCards:g,isLoading:c,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:i}):o.createElement(rn,{columns:p,SearchFormFieldsComponent:en,onSubmit:i,data:u,error:s,isLoading:c,Count:d}))},PropertyDetailsForm:ln,PropertyDetailsStep1:e=>{let{config:t,onGoNext:n}=e;return i.useDispatch(),i.useSelector(function(e){return e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[t.key]?e.ndc.NDCForm.formData[t.key]:{}}),o.createElement(o.Fragment,null,o.createElement(ln,{onGoNext:n}))},PropertyDetailsStep2:e=>{let{config:t,onBackClick:n}=e;return i.useDispatch(),i.useSelector(function(e){return e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[t.key]?e.ndc.NDCForm.formData[t.key]:{}}),o.createElement(o.Fragment,null,o.createElement(un,{onBackClick:n}))},PropertyDetailsFormUser:un,NewNDCStepFormCitizen:()=>{const e=r.useHistory(),{t:a}=l.useTranslation(),u=i.useDispatch(),[s,c]=n.useState(null),d=i.useSelector(e=>e.ndc.NDCForm).step,m=window.localStorage.getItem("CITIZEN.CITY"),v=window.location.pathname.split("/").pop(),{data:f}=Digit.Hooks.ndc.useSearchEmployeeApplication({applicationNo:v},m);return n.useEffect(()=>{console.log("applicationDetails",f),null!=f&&f.Applications.length&&u(J("responseData",null==f?void 0:f.Applications))},[f]),n.useEffect(()=>{const t=e.listen(()=>{u({type:"RESET_NDC_FORM"})});return()=>t()},[e,u]),o.createElement("div",{className:"employeeCard"},o.createElement(t.CardHeader,{className:"ndc-step-form",divider:!0},a("ndc_header_application")),o.createElement(Z,{stepsList:cn,onSubmit:()=>{},step:d,setStep:e=>{u(ee(e))}}),s&&o.createElement(t.Toast,{error:s.key,label:a(s.label),onClose:()=>{c(null)},isDleteBtn:"true"}))},SelectNDCReason:function(e){var r,u,c;let{config:d,onSelect:m,formData:v}=e;const[f,p]=n.useState((null==v?void 0:v.NDCReason)||{}),{control:h,formState:g,watch:y,setValue:E}=a.useForm({defaultValues:(null==v?void 0:v.NDCReason)||{}}),{t:b}=l.useTranslation(),_=i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.responseData}),N=window.location.href.includes("employee")?Digit.ULBService.getCurrentPermanentCity():localStorage.getItem("CITIZEN.CITY"),{data:S,isLoading:D}=Digit.Hooks.useCustomMDMS(N,"NDC",[{name:"Reasons"}]),C=n.useMemo(()=>{var e,t;const n=[];var o,r;return(null==S||null===(e=S.NDC)||void 0===e||null===(t=e.Reasons)||void 0===t?void 0:t.length)>0&&(null==S||null===(o=S.NDC)||void 0===o||null===(r=o.Reasons)||void 0===r||r.map(e=>{n.push({i18nKey:null==e?void 0:e.code,code:null==e?void 0:e.code})})),n},[S]);return n.useEffect(()=>{m("NDCReason",f,d)},[f]),n.useEffect(()=>{if(_&&(null==C?void 0:C.length)>0){console.log("check apiDataCheck",_);const e=C.find(e=>{var t;return(null==e?void 0:e.code)===(null==_||null===(t=_[0])||void 0===t?void 0:t.reason)});e&&(p(e),E("NDCReason",e))}},[_,C]),D?o.createElement(t.Loader,null):o.createElement("div",null,o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},b("NDC_NEW_NDC_APPLICATION_NDC_REASON")+" * "),o.createElement(a.Controller,{name:"NDCReason",rules:{required:b("REQUIRED_FIELD")},defaultValue:f,control:h,render:e=>o.createElement(t.Dropdown,{className:"form-field",selected:e.value,option:C,select:t=>{p(t),e.onChange(t)},optionKey:"i18nKey",onBlur:e.onBlur,t:b})})),o.createElement(t.CardLabelError,{className:"ndc-card-label-error"},g.touched.structureType?null===(r=errors)||void 0===r||null===(u=r.structureType)||void 0===u?void 0:u.message:""),"OTHERS"==(null===(c=y("NDCReason"))||void 0===c?void 0:c.code)&&o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},""+b("Reason")),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:h,name:"reason",defaultValue:(null==f?void 0:f.reason)||"",render:e=>o.createElement(t.TextInput,{value:e.value,onChange:t=>{console.log("config.key",d.key),console.log("formData",v),m("NDCReason",s({},null==v?void 0:v.NDCReason,{reason:t.target.value}),d),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))))},NewNDCStepFormOneCitizen:e=>{let{config:r,onGoNext:l,onBackClick:a,t:u}=e;const d=i.useDispatch(),[m,v]=n.useState(!1),[f,p]=n.useState(""),h=(Digit.UserService.getUser(),window.location.pathname.split("/").pop()),g=i.useSelector(e=>e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[r.key]?e.ndc.NDCForm.formData[r.key]:{}),y=i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.apiData});i.useSelector(e=>e.ndc.NDCForm.formData),console.log("checkApiDataCheck",y);const[E,b]=n.useState(!1),N=i.useSelector(e=>e.ndc.NDCForm.formData||{}),S=(i.useSelector(e=>e.ndc.NDCForm||{}),window.localStorage.getItem("CITIZEN.CITY"));return o.createElement(o.Fragment,null,o.createElement(t.FormComposer,{defaultValues:g,config:r.currStepConfig,onSubmit:function(e){var t,n,o,r,i;const a=function(e){var t,n,o,r,l;const i=[],a=[],s=(null==e?void 0:e.cpt)||{},c=(null==s?void 0:s.details)||{},d=(null==e?void 0:e.PropertyDetails)||{},m=(null==e?void 0:e.NDCReason)||{};var v,f;return null!=e&&null!==(t=e.cpt)&&void 0!==t&&t.dues||i.push(u("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_PROPERTY_TAX")+" "+(null==s?void 0:s.id)),(null==e||null===(n=e.cpt)||void 0===n||null===(o=n.dues)||void 0===o?void 0:o.totalAmount)>0&&i.push(u("NDC_MESSAGE_PLEASE_PAY_DUES_OF_PROPERTY_TAX")+" "+(null==s?void 0:s.id)),(null==d||null===(r=d.waterConnection)||void 0===r?void 0:r.length)>0&&(null===(v=d.waterConnection)||void 0===v||v.forEach(e=>{var t,n,o;0!=(null==e||null===(t=e.billData)||void 0===t?void 0:t.totalAmount)&&i.push(u("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_WATER_CONNECTION")+" "+(null==e?void 0:e.connectionNo)),null!=e&&null!==(n=e.billData)&&void 0!==n&&n.id&&(null==e||null===(o=e.billData)||void 0===o?void 0:o.totalAmount)>0&&i.push(u("NDC_MESSAGE_PLEASE_PAY_DUES_OF_WATER_CONNECTION")+" "+(null==e?void 0:e.connectionNo))})),(null==d||null===(l=d.sewerageConnection)||void 0===l?void 0:l.length)>0&&(null===(f=d.sewerageConnection)||void 0===f||f.forEach(e=>{var t,n,o;0!=(null==e||null===(t=e.billData)||void 0===t?void 0:t.totalAmount)&&i.push(u("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_SEWERAGE_CONNECTION")+" "+(null==e?void 0:e.connectionNo)),null!=e&&null!==(n=e.billData)&&void 0!==n&&n.id&&(null==e||null===(o=e.billData)||void 0===o?void 0:o.totalAmount)>0&&i.push(u("NDC_MESSAGE_PLEASE_PAY_DUES_OF_SEWERAGE_CONNECTION")+" "+(null==e?void 0:e.connectionNo))})),null!=s&&s.id||i.push(u("NDC_MESSAGE_PROPERTY_ID")),c&&0!==Object.keys(c).length||i.push(u("NDC_MESSAGE_PLEASE_SEARCH_PROPERTY_ID")),null!=d&&d.firstName||i.push(u("NDC_MESSAGE_FIRST_NAME")),null!=d&&d.mobileNumber||i.push(u("NDC_MESSAGE_MOBILE_NUMBER")),null!=d&&d.address||i.push(u("NDC_MESSAGE_ADDRESS")),null!=d&&d.email||i.push(u("NDC_MESSAGE_EMAIL")),null!=m&&m.code||i.push(u("NDC_MESSAGE_NDC_REASON")),null!=d&&d.firstName&&!/^[A-Za-z\s]+(,\s*[A-Za-z\s]+)*$/.test(d.firstName)&&a.push(u("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED")),null!=d&&d.email&&!/^(?!\.)(?!.*\.\.)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/.test(d.email)&&a.push(u("NDC_MESSAGE_EMAIL_INVALID_FORMAT")),null!=d&&d.mobileNumber&&!/^[6-9]\d{9}$/.test(d.mobileNumber)&&a.push(u("NDC_MESSAGE_MOBILE_NUMBER_MUST_BE_A_VALID_TEN_DIGIT_INDIAN_NUMBER")),[...i,...a]}(g);if(a.length>0)return p(""+a[0]),v(!0),void setTimeout(()=>{v(!1)},3e3);console.log("checkFormData",N);const m=h&&h.startsWith("NDC-");console.log("isRealId",m),null!=N&&null!==(t=N.apiData)&&void 0!==t&&null!==(n=t.Applications)&&void 0!==n&&null!==(o=n[0])&&void 0!==o&&o.applicationNo||null!=N&&null!==(r=N.responseData)&&void 0!==r&&null!==(i=r[0])&&void 0!==i&&i.applicationNo||m?(function(e){try{var t,n,o,r,i,a,u,s,c,m,v,f,p,h,g,E,b,_,D;const k=(null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info)||{},B=null==k?void 0:k.uuid,U=(null==y||null===(n=y.Applications)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.owners)||(null==N||null===(r=N.responseData)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.owners);let j=[];var C,w,A,T,O,P;if((null==N||null===(a=N.responseData)||void 0===a||null===(u=a[0])||void 0===u||null===(s=u.NdcDetails)||void 0===s?void 0:s.length)>0)j=N.responseData[0].NdcDetails;else if(null===(C=(null==e||null===(w=e.PropertyDetails)||void 0===w?void 0:w.waterConnection)||[])||void 0===C||C.forEach(t=>{var n,o,r,l,i,a;j.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:B,businessService:"WS",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),null===(A=(null==e||null===(T=e.PropertyDetails)||void 0===T?void 0:T.sewerageConnection)||[])||void 0===A||A.forEach(t=>{var n,o,r,l,i,a;j.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:B,businessService:"SW",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),null!=e&&null!==(O=e.PropertyDetails)&&void 0!==O&&null!==(P=O.propertyBillData)&&void 0!==P&&P.billData){var I,x,R,L,F,M;const t=null==e||null===(I=e.PropertyDetails)||void 0===I||null===(x=I.propertyBillData)||void 0===x?void 0:x.billData;j.push({uuid:null==t?void 0:t.id,applicantId:B,businessService:"PT",consumerCode:null==e||null===(R=e.cpt)||void 0===R?void 0:R.id,additionalDetails:{propertyAddress:null==e||null===(L=e.PropertyDetails)||void 0===L?void 0:L.address,propertyType:null==e||null===(F=e.cpt)||void 0===F||null===(M=F.details)||void 0===M?void 0:M.usageCategory},dueAmount:(null==t?void 0:t.totalAmount)||0,status:null==t?void 0:t.status})}const W=(null==y||null===(c=y.Applications)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.applicationNo)||(null==N||null===(v=N.responseData)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.applicationNo),z=(null==y||null===(p=y.Applications)||void 0===p||null===(h=p[0])||void 0===h?void 0:h.uuid)||(null==N||null===(g=N.responseData)||void 0===g||null===(E=g[0])||void 0===E?void 0:E.uuid),H={Applications:[{tenantId:S,owners:U,NdcDetails:j,Documents:[],active:!0,reason:null==e||null===(b=e.NDCReason)||void 0===b?void 0:b.code,auditDetails:null==e||null===(_=e.cpt)||void 0===_||null===(D=_.details)||void 0===D?void 0:D.auditDetails,applicationNo:W,uuid:z,workflow:{action:"DRAFT"}}]};console.log("payload",H),Promise.resolve(Digit.NDCService.NDCUpdate({tenantId:S,details:H})).then(function(e){var t;return"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(d(J("apiData",e)),l(),{isSuccess:!0,response:e}):{isSuccess:!1,response:e}})}catch(e){return Promise.reject(e)}}(e),console.log("here bab")):function(e){try{var t,n,o,r,i,a,u,m,v,f;const C=(null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info)||{},w=null==C?void 0:C.uuid,A=((null==e||null===(n=e.cpt)||void 0===n||null===(o=n.details)||void 0===o?void 0:o.owners)||[]).map(t=>{var n,o,r,l,i;let a=c(t,dn);var u;return(null==a||null===(n=a.name)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.toLowerCase())===(null==e||null===(r=e.PropertyDetails)||void 0===r||null===(l=r.firstName)||void 0===l||null===(i=l.trim())||void 0===i?void 0:i.toLowerCase())?s({},a,{emailId:null==e||null===(u=e.PropertyDetails)||void 0===u?void 0:u.email,isPrimaryOwner:!0}):a});console.log("checkData==",e);const T=[];if(null===(r=(null==e||null===(i=e.PropertyDetails)||void 0===i?void 0:i.waterConnection)||[])||void 0===r||r.forEach(t=>{var n,o,r,l,i,a;T.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:w,businessService:"WS",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),null===(a=(null==e||null===(u=e.PropertyDetails)||void 0===u?void 0:u.sewerageConnection)||[])||void 0===a||a.forEach(t=>{var n,o,r,l,i,a;T.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:w,businessService:"SW",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),null!=e&&null!==(m=e.PropertyDetails)&&void 0!==m&&null!==(v=m.propertyBillData)&&void 0!==v&&v.billData){var p,h,g,y,E,_,N,D;const t=null==e||null===(p=e.PropertyDetails)||void 0===p||null===(h=p.propertyBillData)||void 0===h?void 0:h.billData;T.push({uuid:null==t?void 0:t.id,applicantId:w,businessService:"PT",consumerCode:null==e||null===(g=e.cpt)||void 0===g?void 0:g.id,additionalDetails:{propertyAddress:null==e||null===(y=e.PropertyDetails)||void 0===y?void 0:y.address,propertyType:null==e||null===(E=e.cpt)||void 0===E||null===(_=E.details)||void 0===_?void 0:_.usageCategory,reason:null==e||null===(N=e.NDCReason)||void 0===N?void 0:N.reason,remarks:null==e||null===(D=e.PropertyDetails)||void 0===D?void 0:D.remarks},dueAmount:(null==t?void 0:t.totalAmount)||0,status:null==t?void 0:t.status})}const O={Applications:[{tenantId:S,owners:A,NdcDetails:T,Documents:[],active:!0,reason:null==e||null===(f=e.NDCReason)||void 0===f?void 0:f.code,workflow:{action:"INITIATE"}}]};Promise.resolve(ae(function(){return Promise.resolve(Digit.NDCService.NDCcreate({tenantId:S,details:O})).then(function(e){var t;return b(!1),console.log("response",e),"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(d(J("apiData",e)),l(),{isSuccess:!0,response:e}):{isSuccess:!1,response:e}})},function(){b(!1)}))}catch(e){return Promise.reject(e)}}(e)},onFormValueChange:function(e,t){_.isEqual(t,g)||d(J(r.key,t))},label:u(""+r.texts.submitBarLabel),currentStep:r.currStepNumber,onBackClick:function(e){a(r.key,e)}}),E&&o.createElement(Qe,{page:!0}),m&&o.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:f,onClose:()=>{v(!1),p("")}}))},PropertyDetailsFormCitizen:e=>{var r,u,c,d,m,v,f,p,h,g,y,E;const b=function(e,t,n){try{if("WS"===e){const e=[...B.waterConnection];e[n].isLoading=!0,U(t=>s({},t,{waterConnection:e}))}else if("SW"===e){const e=[...B.sewerageConnection];e[n].isLoading=!0,U(t=>s({},t,{sewerageConnection:e}))}else if("PT"===e){x(!0);let e=s({},null==B?void 0:B.propertyBillData);e.isLoading=!0,U(t=>s({},t,{propertyBillData:e}))}const o=ae(function(){return Promise.resolve(Digit.PaymentService.fetchBill(w,{businessService:e,consumerCode:t})).then(function(t){var o,r;if(x(!1),(null==t||null===(o=t.Bill)||void 0===o?void 0:o.length)>0){if((null==t||null===(r=t.Bill[0])||void 0===r?void 0:r.totalAmount)>0?P({error:!0,label:C("NDC_MESSAGE_DUES_FOUND_PLEASE_PAY")}):P({error:!1,label:C("NDC_MESSAGE_NO_DUES_FOUND")}),"WS"===e){const e=[...B.waterConnection];e[n].billData=null==t?void 0:t.Bill[0],e[n].isLoading=!1,U(t=>s({},t,{waterConnection:e}))}else if("SW"===e){const e=[...B.sewerageConnection];e[n].billData=null==t?void 0:t.Bill[0],e[n].isLoading=!1,U(t=>s({},t,{sewerageConnection:e}))}else if("PT"===e){let e=s({},B.propertyBillData);e.billData=null==t?void 0:t.Bill[0],e.isLoading=!1,U(t=>s({},t,{propertyBillData:e}))}}else if(null!=t&&t.Bill){if("WS"===e){const e=[...B.waterConnection];e[n].billData={totalAmount:0},e[n].isLoading=!1,U(t=>s({},t,{waterConnection:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_WS")})}else if("SW"===e){const e=[...B.sewerageConnection];e[n].billData={totalAmount:0},e[n].isLoading=!1,U(t=>s({},t,{sewerageConnection:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_SW")})}else if("PT"===e){let e=s({},B.propertyBillData);e.isLoading=!1,U(t=>s({},t,{propertyBillData:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_PROPERTY")})}}else if("WS"===e){const e=[...B.waterConnection];e[n].isLoading=!1,e[n].billData={totalAmount:0},U(t=>s({},t,{waterConnection:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_WS")})}else if("SW"===e){const e=[...B.sewerageConnection];e[n].isLoading=!1,e[n].billData={totalAmount:0},U(t=>s({},t,{sewerageConnection:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_SW")})}else if("PT"===e){let e=s({},B.propertyBillData);e.isLoading=!1,U(t=>s({},t,{propertyBillData:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_PROPERTY")})}})},function(){x(!1),P({error:!0,label:C("NDC_MESSAGE_FETCH_FAILED")})});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};let{config:_,onSelect:N,formData:S}=e;const{control:D}=a.useForm(),{t:C}=l.useTranslation(),w=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),A=i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.responseData}),T=i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.apiData}),[O,P]=n.useState(null),[I,x]=n.useState(!1),[R,L]=n.useState(!1),[F,M]=n.useState({}),k=null==S||null===(r=S.cpt)||void 0===r||null===(u=r.details)||void 0===u?void 0:u.propertyId,[B,U]=n.useState((null==S?void 0:S.PropertyDetails)||{}),[j,W]=n.useState(null);console.log("apiDataCheck",A),console.log("formData==?/??",S),console.log("checkApiDataCheck====",null==T||null===(c=T.Applications)||void 0===c?void 0:c[0]);const{isLoading:z,data:H}=Digit.Hooks.ws.useSearchWS({tenantId:w,filters:{searchType:"CONNECTION",propertyId:k},config:{enabled:!!k},bussinessService:"WS",t:C}),{isLoading:V,data:q}=Digit.Hooks.ws.useSearchWS({tenantId:w,filters:{searchType:"CONNECTION",propertyId:k},config:{enabled:!!k},bussinessService:"SW",t:C}),Y=[{Header:C("TL_COMMON_TABLE_COL_OWN_NAME"),accessor:"name",Cell:e=>{var t;let{row:n}=e;return o.createElement("div",null,null==n||null===(t=n.original)||void 0===t?void 0:t.name)}},{Header:"",accessor:"amount",Cell:e=>{var t;let{row:n}=e;return o.createElement("input",{type:"radio",name:"applicationFee",checked:(null==j?void 0:j.uuid)===(null==n||null===(t=n.original)||void 0===t?void 0:t.uuid),onChange:()=>{console.log("row?.original",null==n?void 0:n.original),W(null==n?void 0:n.original)}})}}];function G(e,t,n){const o=window.location.href.includes("employee")?"employee":"citizen";let r,l;if("WS"===(null==e?void 0:e.businessService)?r="WATER":"SW"===(null==e?void 0:e.businessService)?r="SEWERAGE":"PT"===(null==e?void 0:e.businessService)&&(r="PT"),l="PT"===(null==e?void 0:e.businessService)?"https://sdc-uat.lgpunjab.gov.in/"+o+"/egov-common/pay?consumerCode="+(null==e?void 0:e.consumerCode)+"&tenantId="+(null==e?void 0:e.tenantId)+"&businessService="+r:"https://sdc-uat.lgpunjab.gov.in/"+o+"/wns/viewBill?connectionNumber="+(null==e?void 0:e.consumerCode)+"&tenantId="+(null==e?void 0:e.tenantId)+"&service="+r,window.open(l,"_blank"),"WS"===(null==e?void 0:e.businessService)){const o=[...B.waterConnection];o[t]={connectionNo:null==e?void 0:e.consumerCode,isEdit:n,billData:{},isLoading:!1},U(e=>s({},e,{waterConnection:o}))}else if("SW"===(null==e?void 0:e.businessService)){const o=[...B.sewerageConnection];o[t]={connectionNo:null==e?void 0:e.consumerCode,isEdit:n,billData:{},isLoading:!1},U(e=>s({},e,{sewerageConnection:o}))}else if("PT"===(null==e?void 0:e.businessService)){let t=s({},B.propertyBillData);t={connectionNo:null==e?void 0:e.consumerCode,billData:{},isLoading:!1},U(e=>s({},e,{propertyBillData:t}))}}n.useEffect(()=>{var e,t,n,o,r,l,i,a,u,c;const d=(null==S||null===(e=S.cpt)||void 0===e||null===(t=e.details)||void 0===t?void 0:t.owners)||[],m=(null==d||null===(n=d.map(e=>null==e?void 0:e.name))||void 0===n||null===(o=n.filter(Boolean))||void 0===o||o.join(", "),j),v=null==A||null===(r=A[0])||void 0===r||null===(l=r.owners)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.emailId,f=null==m?void 0:m.name;console.log("ownerObj?.emailId",null==m?void 0:m.emailId),console.log("formData?.PropertyDetails?.email",null==S||null===(a=S.PropertyDetails)||void 0===a?void 0:a.email),console.log("emailApi",v);const p=(null==m?void 0:m.emailId)||v||"",h=null==m?void 0:m.mobileNumber,g=null==m?void 0:m.permanentAddress,y={};f&&(y.firstName=f),y.email=p,h&&(y.mobileNumber=h),g&&(y.address=g),y.propertyBillData={isLoading:!1,billData:(null==S||null===(u=S.PropertyDetails)||void 0===u||null===(c=u.propertyBillData)||void 0===c?void 0:c.billData)||{}},U(e=>s({},e,y))},[null==S||null===(d=S.cpt)||void 0===d?void 0:d.details,A,j]),n.useEffect(()=>{var e;let t;if(null!=A&&null!==(e=A[0])&&void 0!==e&&e.NdcDetails){var n,o;const e=null==A||null===(n=A[0])||void 0===n||null===(o=n.NdcDetails)||void 0===o?void 0:o.filter(e=>"WS"==e.businessService);t=(null==e?void 0:e.map(e=>({connectionNo:null==e?void 0:e.consumerCode,isEdit:!1,billData:{totalAmount:0},isLoading:!1})))||[]}else t=(null==H?void 0:H.map(e=>({connectionNo:null==e?void 0:e.connectionNo,isEdit:!1,billData:{},isLoading:!1})))||[];U(e=>s({},e,{waterConnection:t}))},[H,A]),n.useEffect(()=>{var e;let t;if(null!=A&&null!==(e=A[0])&&void 0!==e&&e.NdcDetails){var n,o;const e=null==A||null===(n=A[0])||void 0===n||null===(o=n.NdcDetails)||void 0===o?void 0:o.filter(e=>"SW"==e.businessService);t=(null==e?void 0:e.map(e=>({connectionNo:null==e?void 0:e.consumerCode,isEdit:!1,billData:{totalAmount:0},isLoading:!1})))||[]}else t=(null==q?void 0:q.map(e=>({connectionNo:null==e?void 0:e.connectionNo,isEdit:!1,billData:{},isLoading:!1})))||[];U(e=>s({},e,{sewerageConnection:t}))},[q,A]),n.useEffect(()=>{N("PropertyDetails",B,_)},[B]);const $=null===(m=Digit)||void 0===m||null===(v=m.ComponentRegistryService)||void 0===v?void 0:v.getComponent("PayWSBillModal");return n.useEffect(()=>{if(O){const e=setTimeout(()=>{P(null)},3e3);return()=>clearTimeout(e)}},[O]),n.useEffect(()=>{var e;if(null!=T&&null!==(e=T.Applications)&&void 0!==e&&e[0]||null!=A&&A[0]){var t,n,o;const e=(null==T||null===(t=T.Applications)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.owners)||(null==A||null===(o=A[0])||void 0===o?void 0:o.owners),r=null==e?void 0:e.find(e=>null==e?void 0:e.isPrimaryOwner);console.log("filterRow===",r),W(r)}},[T,A]),o.createElement("div",{style:{marginBottom:"16px"}},((null==S||null===(f=S.cpt)||void 0===f?void 0:f.details)||(null==A||null===(p=A[0])||void 0===p?void 0:p.NdcDetails))&&o.createElement("div",null,o.createElement(t.LabelFieldPair,{style:{marginTop:"40px"}},o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},""+C("NDC_WATER_CONNECTION")),z?o.createElement(t.Loader,null):o.createElement("div",{className:"form-field",style:{display:"flex",flexDirection:"column",gap:"8px",width:"100%"}},null==B||null===(h=B.waterConnection)||void 0===h?void 0:h.map((e,n)=>{var r,l,i,u,c;return o.createElement("div",{className:"ndc_property_search",key:n,style:{display:"flex",flexDirection:"row",alignItems:"baseline",gap:"16px"}},o.createElement(a.Controller,{key:n,control:D,name:"waterConnection["+n+"]",defaultValue:e.connectionNo,render:r=>o.createElement(t.TextInput,{value:e.connectionNo,onChange:e=>{const t=[...B.waterConnection];t[n]={connectionNo:"",isEdit:!0,billData:{},isLoading:!1},t[n].connectionNo=e.target.value,U(e=>s({},e,{waterConnection:t})),r.onChange(e.target.value)},disabled:!e.isEdit,onBlur:r.onBlur})}),e.isLoading?o.createElement(t.Loader,null):o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},!(null!=A&&null!==(r=A[0])&&void 0!==r&&r.NdcDetails)&&(null==e?void 0:e.connectionNo)&&!(null!=e&&null!==(l=e.billData)&&void 0!==l&&l.id)&&0!=(null==e||null===(i=e.billData)||void 0===i?void 0:i.totalAmount)&&o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",fontSize:"13px"},onClick:()=>{b("WS",e.connectionNo,n)}},""+C("CHECK_STATUS_WATER")),(null==e?void 0:e.connectionNo)&&(null==e||null===(u=e.billData)||void 0===u?void 0:u.totalAmount)>0&&o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white"},onClick:()=>{G(null==e?void 0:e.billData,n,e.isEdit)}},""+C("PAY_DUES")),(null==e?void 0:e.connectionNo)&&0==(null==e||null===(c=e.billData)||void 0===c?void 0:c.totalAmount)&&o.createElement("div",{style:{color:"green"}},C("NO_DUES")),(null==e?void 0:e.isEdit)&&o.createElement("button",{onClick:()=>{let e=[...B.waterConnection];e.splice(n,1),U(t=>s({},t,{waterConnection:e}))}},o.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))))}))),o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",fontSize:"12px"},onClick:()=>{U(e=>s({},e,{waterConnection:[...e.waterConnection||[],{connectionNo:"",isEdit:!0}]}))}},""+C("ADD_WATER")),o.createElement(t.LabelFieldPair,{style:{marginTop:"40px"}},o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},C("NDC_SEWERAGE_CONNECTION")+" "),V?o.createElement(t.Loader,null):o.createElement("div",{className:"form-field",style:{display:"flex",flexDirection:"column",gap:"8px",width:"100%"}},null==B||null===(g=B.sewerageConnection)||void 0===g?void 0:g.map((e,n)=>{var r,l,i,u,c;return o.createElement("div",{className:"ndc_property_search",key:n,style:{display:"flex",flexDirection:"row",alignItems:"baseline",gap:"16px"}},o.createElement(a.Controller,{key:n,control:D,name:"sewerageConnection["+n+"]",defaultValue:e.connectionNo,render:r=>o.createElement(t.TextInput,{value:e.connectionNo,onChange:e=>{const t=[...B.sewerageConnection];t[n]={connectionNo:"",isEdit:!0,billData:{},isLoading:!1},t[n].connectionNo=e.target.value,U(e=>s({},e,{sewerageConnection:t})),r.onChange(e.target.value)},disabled:!e.isEdit,onBlur:r.onBlur})}),e.isLoading?o.createElement(t.Loader,null):o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},!(null!=A&&null!==(r=A[0])&&void 0!==r&&r.NdcDetails)&&(null==e?void 0:e.connectionNo)&&!(null!=e&&null!==(l=e.billData)&&void 0!==l&&l.id)&&0!=(null==e||null===(i=e.billData)||void 0===i?void 0:i.totalAmount)&&o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",fontSize:"13px"},onClick:()=>{b("SW",e.connectionNo,n)}},""+C("CHECK_STATUS_SEWERAGE")),(null==e?void 0:e.connectionNo)&&(null==e||null===(u=e.billData)||void 0===u?void 0:u.totalAmount)>0&&o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white"},onClick:()=>{G(null==e?void 0:e.billData,n)}},""+C("PAY_DUES")),(null==e?void 0:e.connectionNo)&&0==(null==e||null===(c=e.billData)||void 0===c?void 0:c.totalAmount)&&o.createElement("div",{style:{color:"green"}},C("NO_DUES")),(null==e?void 0:e.isEdit)&&o.createElement("button",{onClick:()=>{let e=[...B.sewerageConnection];e.splice(n,1),U(t=>s({},t,{sewerageConnection:e}))}},o.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))))}))),o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",fontSize:" 12px"},onClick:()=>{U(e=>s({},e,{sewerageConnection:[...e.sewerageConnection||[],{connectionNo:"",isEdit:!0}]}))}},""+C("ADD_SEWERAGE")),o.createElement("div",{style:{marginTop:"40px",marginBottom:"20px"}},o.createElement("p",{style:{color:" green",fontSize:"14px",paddingBottom:"10px"}},"Please Select One Owner Name Who will have the access of No Due Certificate"),o.createElement(t.Table,{className:"customTable table-border-style",t:C,data:(null==S||null===(y=S.cpt)||void 0===y||null===(E=y.details)||void 0===E?void 0:E.owners)||[],columns:Y,getCellProps:()=>({style:{}}),disableSort:!0,manualPagination:!1,isPaginationRequired:!1})),j&&o.createElement("div",null,o.createElement(t.LabelFieldPair,{style:{marginTop:"40px"}},o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},C("NDC_FULL_NAME")+" * "),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"firstName",defaultValue:(null==B?void 0:B.firstName)||"",rules:{required:C("REQUIRED_FIELD"),validate:{pattern:e=>!!/^[-@.\/#&+\w\s]*$/.test(e)||C("INVALID_NAME")}},render:e=>{var n,r,l,i,a,u,c;return o.createElement(t.TextInput,{value:(null==B?void 0:B.firstName)||"",onChange:t=>{U(e=>s({},e,{firstName:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disabled:(null==S||null===(n=S.cpt)||void 0===n||null===(r=n.details)||void 0===r||null===(l=r.owners)||void 0===l||null===(i=l[0])||void 0===i||null===(a=i.name)||void 0===a||null===(u=a.split(" "))||void 0===u||null===(c=u[0])||void 0===c?void 0:c.length)>0})}}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},C("NDC_EMAIL")+" * "),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"email",defaultValue:(null==B?void 0:B.email)||"",render:e=>o.createElement(t.TextInput,{value:null==B?void 0:B.email,onChange:t=>{U(e=>s({},e,{email:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},C("NDC_MOBILE_NUMBER")+" * "),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"mobileNumber",defaultValue:(null==B?void 0:B.mobileNumber)||"",render:e=>{var n,r,l,i;return o.createElement(t.TextInput,{value:null==B?void 0:B.mobileNumber,onChange:t=>{U(e=>s({},e,{mobileNumber:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disabled:null==S||null===(n=S.cpt)||void 0===n||null===(r=n.details)||void 0===r||null===(l=r.owners)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.mobileNumber})}}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},C("NDC_ADDRESS")+" * "),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"address",defaultValue:(null==B?void 0:B.address)||"",render:e=>{var n,r,l,i,a;return o.createElement(t.TextInput,{value:null==B?void 0:B.address,onChange:t=>{U(e=>s({},e,{address:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disabled:(null==S||null===(n=S.cpt)||void 0===n||null===(r=n.details)||void 0===r||null===(l=r.owners)||void 0===l||null===(i=l[0])||void 0===i||null===(a=i.permanentAddress)||void 0===a?void 0:a.length)>0})}}))))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},""+C("Remarks")),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"remarks",defaultValue:(null==B?void 0:B.remarks)||"",rules:{required:C("REQUIRED_FIELD")},render:e=>o.createElement(t.TextInput,{value:(null==B?void 0:B.remarks)||"",onChange:t=>{U(e=>s({},e,{remarks:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},""+C("NDC_TL_NUMBER")),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"tlNumber",defaultValue:(null==B?void 0:B.tlNumber)||"",render:e=>o.createElement(t.TextInput,{value:null==B?void 0:B.tlNumber,onChange:t=>{U(e=>s({},e,{tlNumber:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),O&&o.createElement(t.Toast,{isDleteBtn:!0,error:null==O?void 0:O.error,label:null==O?void 0:O.label,onClose:()=>{P(null)}}),R&&o.createElement($,{setShowToast:()=>{L(!1),M({})},billData:F}))},NDCPropertySearch:e=>{var a,u,c,d,m,v,f,p;let{config:h,onSelect:g,formData:y}=e;const{t:E}=l.useTranslation(),b=n.useRef(null),_=i.useDispatch();let{pathname:N,state:S}=r.useLocation();S=S&&("string"==typeof S||S instanceof String)?JSON.parse(S):S;const D=i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.responseData}),C=N.includes("/modify-application/"),w=window.location.href.includes("employee")?Digit.ULBService.getCurrentPermanentCity():localStorage.getItem("CITIZEN.CITY"),A=r.useLocation().search,T=new URLSearchParams(A).get("propertyId"),O=n.useRef(!0),[P,I]=n.useState(!1),x=null==D||null===(a=D[0])||void 0===a||null===(u=a.NdcDetails)||void 0===u?void 0:u.find(e=>"PT"==e.businessService),[R,L]=n.useState((null==y||null===(c=y.cpt)||void 0===c?void 0:c.id)||("null"!==T?T:"")||(null==x?void 0:x.consumerCode)||""),[F,M]=n.useState((null==y||null===(d=y.cpt)||void 0===d?void 0:d.id)||("null"!==T?T:"")||(null==x?void 0:x.consumerCode)||""),[k,B]=n.useState(null),[U,j]=n.useState(()=>{var e,t,n;return null!=y&&null!==(e=y.cpt)&&void 0!==e&&e.details&&Object.keys(null==y||null===(t=y.cpt)||void 0===t?void 0:t.details).length>0?{Properties:[s({},null==y||null===(n=y.cpt)||void 0===n?void 0:n.details)]}:{Properties:[]}}),[W,z]=n.useState(()=>{var e,t,n;return null!=y&&null!==(e=y.cpt)&&void 0!==e&&e.dues&&Object.keys(null==y||null===(t=y.cpt)||void 0===t?void 0:t.dues).length>0?{dues:s({},null==y||null===(n=y.cpt)||void 0===n?void 0:n.dues)}:{dues:{}}}),[H,V]=n.useState(!1),[q,Y]=n.useState(!1),[G,$]=n.useState(!1),[K,X]=n.useState(!1),{isLoading:Z,error:Q,data:J}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:F},tenantId:w},{filters:{propertyIds:F},tenantId:w,enabled:!!F,privacy:Digit.Utils.getPrivacyObject()});if(n.useEffect(()=>{null!=x&&x.consumerCode&&(V(!0),L(x.consumerCode),M(x.consumerCode),Y(!0),z({dues:{totalAmount:0}}),g(h.key,s({},y[h.key],{id:x.consumerCode})))},[x]),n.useEffect(()=>{var e;if(J&&null!=J&&J.Properties&&(null==J||null===(e=J.Properties)||void 0===e?void 0:e.length)>0)j(J),B(null),$(!0);else{var t;if(O.current)return void(O.current=!1);null!=y&&null!==(t=y.cpt)&&void 0!==t&&t.details||(j({}),B({error:!0,label:"CS_PT_NO_PROPERTIES_FOUND"}))}},[J]),n.useEffect(()=>{R&&(window.location.href.includes("/renew-application-details/")||window.location.href.includes("/edit-application-details/"))&&M(R)},[R]),n.useEffect(()=>{var e;0==Z&&Q&&1==Q&&0==(null==U||null===(e=U.Properties)||void 0===e?void 0:e.length)&&B({error:!0,label:"CS_PT_NO_PROPERTIES_FOUND"})},[Q,U]),n.useEffect(()=>{var e;g(h.key,s({},y[h.key],{details:null==U||null===(e=U.Properties)||void 0===e?void 0:e[0]}))},[U,N]),n.useEffect(()=>{g(h.key,s({},y[h.key],{dues:null==W?void 0:W.dues}))},[W,N]),C)return o.createElement(o.Fragment,null);var ee,te;U&&null!=U&&null!==(m=U.Properties)&&void 0!==m&&m.length&&((e,t)=>{t(Digit.Utils.pt.getMohallaLocale(null==e?void 0:e.locality.code,null==e?void 0:e.tenantId)),t(Digit.Utils.pt.getCityLocale(null==e?void 0:e.tenantId)),null!=e&&e.pincode&&t(null==e?void 0:e.pincode)})(null==U||null===(ee=U.Properties)||void 0===ee||null===(te=ee[0])||void 0===te?void 0:te.address,E),window.location.href.includes("/ws/");const ne={label:"PROPERTY_ID",type:"text",name:"id"};return n.useEffect(()=>{if(k){const e=setTimeout(()=>{B(null)},3e3);return()=>clearTimeout(e)}},[k]),o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:"16px"}},o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels",style:window.location.href.includes("/ws/")?{fontWeight:"700"}:{}},E(ne.label)+" *"),o.createElement("div",{className:"field ndc_property_search",ref:b,id:"search-property-field"},o.createElement(t.TextInput,s({key:ne.name,value:R,onChange:e=>{L(e.target.value),g(h.key,s({},y[h.key],{[ne.name]:e.target.value})),V(!1),Y(!1),$(!1),X(!1)},disable:!1,defaultValue:void 0},ne.validation)),!H&&o.createElement("button",{className:"submit-bar",type:"button",onClick:()=>{R?R!==F&&(j({Properties:[]}),M(R),V(!0),z({dues:null}),g("PropertyDetails",{email:"",propertyBillData:{isLoading:!1,billData:{}},waterConnection:[],sewerageConnection:[],firstName:"",mobileNumber:"",address:""}),_({type:"RESET_NDC_FORM"})):B({error:!0,label:"PT_ENTER_PROPERTY_ID_AND_SEARCH"})}},""+E("PT_SEARCH")),!(null!=D&&null!==(v=D[0])&&void 0!==v&&v.NdcDetails)&&G&&!K&&o.createElement("button",{className:"submit-bar",type:"button",onClick:()=>{!function(){try{I(!0);const e=ae(function(){var e;return Promise.resolve(Digit.PaymentService.fetchBill(w,{businessService:"PT",consumerCode:null==y||null===(e=y.cpt)||void 0===e?void 0:e.id})).then(function(e){var t,n;(null==e||null===(t=e.Bill)||void 0===t?void 0:t.length)>0?((null==e||null===(n=e.Bill[0])||void 0===n?void 0:n.totalAmount)>0?(B({error:!0,label:E("NDC_MESSAGE_DUES_FOUND_PLEASE_PAY")}),X(!0)):(B({error:!1,label:E("NDC_NO_BILLS_FOUND_PROPERTY")}),Y(!0),$(!1)),z({dues:null==e?void 0:e.Bill[0]})):(B({error:!1,label:E("NDC_NO_BILLS_FOUND_PROPERTY")}),z({dues:{totalAmount:0}}),Y(!0),$(!1)),I(!1)})},function(){I(!1),B({error:!0,label:E("NDC_MESSAGE_FETCH_FAILED")})});Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()}},""+E("CHECK_STATUS_PROPERTY")),K&&o.createElement("div",{className:"ndc-pay-due-button"},"Rs. ",null==y||null===(f=y.cpt)||void 0===f||null===(p=f.dues)||void 0===p?void 0:p.totalAmount," "),K&&o.createElement("button",{className:"submit-bar",type:"button",onClick:()=>{!function(e,t,n){var o,r,l;const i="https://sdc-uat.lgpunjab.gov.in/"+(window.location.href.includes("employee")?"employee":"citizen")+"/egov-common/pay?consumerCode="+(null==y||null===(o=y.cpt)||void 0===o?void 0:o.id)+"&tenantId="+(null==y||null===(r=y.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.tenantId)+"&businessService=PT";window.open(i,"_blank"),z({})}(),X(!1)}},E("PAY_DUES")+" "),q&&o.createElement("div",{className:"ndc-no-due-button"},E("NO_DUES_FOUND_FOR_PROPERTY")))),k&&o.createElement(t.Toast,{isDleteBtn:!0,labelstyle:{width:"100%"},error:k.error,warning:k.warning,label:E(k.label),onClose:()=>{B(null)}})),(Z||P)&&o.createElement(Qe,{page:!0}))},SelectNDCDocuments:e=>{var r,l;let{t:a,config:u,onSelect:s,formData:c,setError:d,clearErrors:m,formState:v}=e;Digit.ULBService.getCurrentTenantId();const f=i.useSelector(e=>e.ndc.NDCForm.formData||{}),p=Digit.ULBService.getStateId(),[h,g]=n.useState((null==c||null===(r=c.documents)||void 0===r?void 0:r.documents)||[]),[y,E]=n.useState(null);n.useEffect(()=>{var e,t,n;if(console.log("coming here again"),null!=f&&null!==(e=f.responseData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.Documents)&&void 0!==n&&n.length&&0===h.length){var o,r,l;const e=null==f||null===(o=f.responseData)||void 0===o||null===(r=o[0])||void 0===r||null===(l=r.Documents)||void 0===l?void 0:l.map(e=>({documentType:null==e?void 0:e.documentType,fileStoreId:null==e?void 0:e.documentAttachment,documentUid:null==e?void 0:e.documentAttachment}));g(e)}},[f]);const{action:b="create"}=Digit.Hooks.useQueryParams(),{isLoading:_,data:N}=Digit.Hooks.pt.usePropertyMDMS(p,"NDC",["Documents"]),S=null==N||null===(l=N.NDC)||void 0===l?void 0:l.Documents;return n.useEffect(()=>{s(u.key,{documents:h,ndcDocumentsLength:null==S?void 0:S.length})},[h]),_?o.createElement(Qe,null):o.createElement("div",null,null==S?void 0:S.map((e,t)=>o.createElement(mn,{key:t,document:e,action:b,t:a,error:y,setError:E,setDocuments:g,documents:h,formData:c,setFormError:d,clearFormErrors:m,config:u,formState:v})),y&&o.createElement(t.Toast,{isDleteBtn:!0,label:y,onClose:()=>E(null),error:!0}))},NewNDCStepFormTwoCitizen:e=>{let{config:r,onGoNext:l,onBackClick:a,t:u}=e;const c=i.useSelector(e=>e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[r.key]?e.ndc.NDCForm.formData[r.key]:{}),d=i.useDispatch(),m=Digit.ULBService.getStateId(),[v,f]=n.useState(!1),[p,h]=n.useState(""),g=window.localStorage.getItem("CITIZEN.CITY"),{isLoading:y,data:E}=Digit.Hooks.pt.usePropertyMDMS(m,"NDC",["Documents"]),b=i.useSelector(e=>e.ndc.NDCForm.formData||{}),N=window.location.pathname.split("/").pop(),S=Digit.UserService.getUser(),{data:D}=Digit.Hooks.ndc.useSearchEmployeeApplication({applicationNo:N},g);return n.useEffect(()=>{null!=D&&D.Applications.length&&d(J("responseData",null==D?void 0:D.Applications))},[D]),o.createElement(o.Fragment,null,o.createElement(t.FormComposer,{defaultValues:c,config:r.currStepConfig,onSubmit:function(e){console.log("Data in step "+r.currStepNumber+" is: \n",e);const t=function(e){if(!y){var t,n;const o=(null==E||null===(t=E.NDC)||void 0===t?void 0:t.Documents)||[],r=(null==e||null===(n=e.documents)||void 0===n?void 0:n.documents)||[],l=o.filter(e=>e.required).map(e=>e.code),i=r.map(e=>e.documentType);return console.log("DocumentsObject",l),l.filter(e=>!i.includes(e))}}(e);if(t.length>0)return h(""+u("NDC_MESSAGE_"+t[0].replace(".","_").toUpperCase())),f(!0),void setTimeout(()=>{f(!1)},3e3);const n=N&&N.startsWith("NDC-");console.log("here",n),n?(console.log("here bab"),function(e){try{var t,n,o,r,i,a,u,c,m;Digit.UserService.getUser(),console.log("final data===?????",e),console.log("checkFormData???====",b);const v=[{name:null==S||null===(t=S.info)||void 0===t?void 0:t.name,mobileNumber:null==S||null===(n=S.info)||void 0===n?void 0:n.mobileNumber,gender:null==b||null===(o=b.NDCDetails)||void 0===o||null===(r=o.PropertyDetails)||void 0===r?void 0:r.gender,emailId:null==S||null===(i=S.info)||void 0===i?void 0:i.emailId,type:null==S||null===(a=S.info)||void 0===a?void 0:a.type}],f=(null==b||null===(u=b.responseData)||void 0===u?void 0:u[0])||{},p=s({},f,{workflow:s({},null==f?void 0:f.workflow),owners:v,NdcDetails:null==f?void 0:f.NdcDetails,Documents:[]});null===(c=(null==e||null===(m=e.documents)||void 0===m?void 0:m.documents)||[])||void 0===c||c.forEach(e=>{var t;null===(t=p.Documents)||void 0===t||t.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.fileStoreId})});const h={Applications:[p]};console.log("payload",h),Promise.resolve(Digit.NDCService.NDCUpdate({tenantId:g,details:h})).then(function(e){var t;return"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(d(J("apiData",e)),l(),{isSuccess:!0,response:e}):{isSuccess:!1,response:e}})}catch(e){return Promise.reject(e)}}(e)):(console.log("go next"),l())},onFormValueChange:function(e,t){_.isEqual(t,c)||d(J(r.key,t))},label:u(""+r.texts.submitBarLabel),currentStep:r.currStepNumber,onBackClick:function(e){a(r.key,e)}}),v&&o.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{f(!1),h("")}}))},NDCSummary:pn,NDCNewFormSummaryStepThreeCitizen:e=>{let{config:t,onBackClick:n}=e;const l=i.useDispatch(),a=r.useHistory(),u=window.localStorage.getItem("CITIZEN.CITY"),d=(Digit.UserService.getUser(),i.useSelector(e=>e.ndc.NDCForm.formData||{}));return console.log("formData 4th step",d),o.createElement(o.Fragment,null,o.createElement(pn,{formData:d,goNext:function(e){try{const t=null==e?void 0:e.action;console.log("actionStatus",t);const n=ae(function(){return Promise.resolve(function(e,t){try{const n=function(e,t){var n,o,r,l,i,a,u,m,v;Digit.UserService.getUser(),console.log("inputData",e);const f=null===(n=(null==e||null===(o=e.apiData)||void 0===o||null===(r=o.Applications)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.owners)||[])||void 0===n?void 0:n.map(e=>c(e,hn)),p=(null==d||null===(i=d.responseData)||void 0===i?void 0:i[0])||(null==d||null===(a=d.apiData)||void 0===a||null===(u=a.Applications)||void 0===u?void 0:u[0])||{};console.log("baseApplication",p);const h=s({},p,{workflow:s({},null==p?void 0:p.workflow,{action:t}),owners:f,NdcDetails:null==p?void 0:p.NdcDetails,Documents:[]});((null==e||null===(m=e.DocummentDetails)||void 0===m||null===(v=m.documents)||void 0===v?void 0:v.documents)||[]).forEach(e=>{h.Documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId})});const g={Applications:[h]};return console.log("updatedApplication",h),g}(e,t);return console.log("finalPayload",n),Promise.resolve(Digit.NDCService.NDCUpdate({tenantId:u,details:n})).then(function(e){var t;return l({type:"RESET_NDC_FORM"}),"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?{isSuccess:!0,response:e}:{isSuccess:!1,response:e}})}catch(e){return Promise.reject(e)}}(d,t)).then(function(e){var t,n,o;null!=e&&e.isSuccess?a.push("/digit-ui/citizen/ndc/response/"+(null==e||null===(t=e.response)||void 0===t||null===(n=t.Applications)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.applicationNo)):console.error("Submission failed, not moving to next step.",null==e?void 0:e.response)})},function(e){alert("Error: "+(null==e?void 0:e.message))});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onGoBack:e=>{n(t.key,e)}}))},PayWSBillModal:e=>{let{setShowToast:n,billData:r}=e;const{t:i}=l.useTranslation(),a=null==r?void 0:r.consumerCode,u=null==r?void 0:r.businessService,c=null==r?void 0:r.tenantId,{data:d,isLoading:m,isError:v}=Digit.Hooks.useDemandSearch({consumerCode:a,businessService:u,tenantId:c}),f=()=>n(),p=()=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#FFFFFF",viewBox:"0 0 24 24"},o.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o.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 \r 17.59 19 19 17.59 13.41 12 19 6.41z"})),h=e=>{let{onClick:t}=e;return o.createElement("div",{className:"icon-bg-secondary",onClick:t},o.createElement(p,null))},g=e=>new Date(e).toLocaleDateString("en-GB"),y={demandTax:0,demandInterest:0,demandPenalty:0,collectionTax:0,collectionInterest:0,collectionPenalty:0,balanceTax:0,balanceInterest:0,balancePenalty:0},E={border:"1px solid #ddd",padding:"6px 8px",textAlign:"right"},b={border:"1px solid #ddd",padding:"6px 8px",textAlign:"left"};return o.createElement(t.Modal,{headerBarMain:o.createElement(e=>{let{label:t}=e;return o.createElement("h1",{className:"heading-m"},t)},{label:i("Pay Due Amounts for "+("WS"===(null==r?void 0:r.businessService)?"Water Connection":"Sewerage Connection"))}),headerBarEnd:o.createElement(h,{onClick:f}),actionCancelLabel:i("CANCEL"),actionCancelOnSubmit:f,actionSaveLabel:i("PAY"),actionSaveOnSubmit:()=>console.log("Pay API"),formId:"modal-action",popupStyles:{width:"90%",marginTop:"5px"}},m?o.createElement(t.Loader,null):v?o.createElement("p",{style:{color:"red",padding:"1rem"}},i("ERROR_LOADING_DATA")):o.createElement("div",{style:{overflowX:"auto"}},o.createElement("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"14px",marginTop:"1rem"}},o.createElement("thead",null,o.createElement("tr",{style:{backgroundColor:"#f0f0f0"}},o.createElement("th",{rowSpan:2,style:b},"Installments"),o.createElement("th",{colSpan:3,style:s({},E,{textAlign:"center"})},"Demand"),o.createElement("th",{colSpan:3,style:s({},E,{textAlign:"center"})},"Collection"),o.createElement("th",{colSpan:3,style:s({},E,{textAlign:"center"})},"Balance")),o.createElement("tr",{style:{backgroundColor:"#f9f9f9"}},o.createElement("th",{style:E},"Tax"),o.createElement("th",{style:E},"Interest"),o.createElement("th",{style:E},"Penalty"),o.createElement("th",{style:E},"Tax"),o.createElement("th",{style:E},"Interest"),o.createElement("th",{style:E},"Penalty"),o.createElement("th",{style:E},"Tax"),o.createElement("th",{style:E},"Interest"),o.createElement("th",{style:E},"Penalty"))),o.createElement("tbody",null,null==d||null===(_=d.Demands)||void 0===_?void 0:_.map((e,t)=>{const n=g(e.taxPeriodFrom)+" - "+g(e.taxPeriodTo);let r=0,l=0,i=0,a=0,u=0,s=0;e.demandDetails.forEach(e=>{const t=e.taxHeadMasterCode||"",n=e.taxAmount||0,o=e.collectionAmount||0;t.includes("CHARGE")?(r+=n,a+=o):t.includes("INTEREST")?(l+=n,u+=o):t.includes("PENALTY")&&(i+=n,s+=o)});const c=r-a,d=l-u,m=i-s;return y.demandTax+=r,y.demandInterest+=l,y.demandPenalty+=i,y.collectionTax+=a,y.collectionInterest+=u,y.collectionPenalty+=s,y.balanceTax+=c,y.balanceInterest+=d,y.balancePenalty+=m,o.createElement("tr",{key:t},o.createElement("td",{style:b},n),o.createElement("td",{style:E},r.toFixed(2)),o.createElement("td",{style:E},l.toFixed(2)),o.createElement("td",{style:E},i.toFixed(2)),o.createElement("td",{style:E},a.toFixed(2)),o.createElement("td",{style:E},u.toFixed(2)),o.createElement("td",{style:E},s.toFixed(2)),o.createElement("td",{style:E},c.toFixed(2)),o.createElement("td",{style:E},d.toFixed(2)),o.createElement("td",{style:E},m.toFixed(2)))}),o.createElement("tr",{style:{backgroundColor:"#efefef",fontWeight:"bold"}},o.createElement("td",{style:b},"Total"),o.createElement("td",{style:E},y.demandTax.toFixed(2)),o.createElement("td",{style:E},y.demandInterest.toFixed(2)),o.createElement("td",{style:E},y.demandPenalty.toFixed(2)),o.createElement("td",{style:E},y.collectionTax.toFixed(2)),o.createElement("td",{style:E},y.collectionInterest.toFixed(2)),o.createElement("td",{style:E},y.collectionPenalty.toFixed(2)),o.createElement("td",{style:E},y.balanceTax.toFixed(2)),o.createElement("td",{style:E},y.balanceInterest.toFixed(2)),o.createElement("td",{style:E},y.balancePenalty.toFixed(2)))))));var _},NewNDCStepFormEmployee:()=>{const e=r.useHistory(),{t:a}=l.useTranslation(),u=i.useDispatch(),[s,c]=n.useState(null),d=i.useSelector(e=>e.ndc.NDCForm).step,m=Digit.ULBService.getCurrentTenantId(),v=window.location.pathname.split("/").pop(),{data:f}=Digit.Hooks.ndc.useSearchEmployeeApplication({applicationNo:v},m);return n.useEffect(()=>{null!=f&&f.Applications.length&&u(J("responseData",null==f?void 0:f.Applications))},[f]),n.useEffect(()=>{const t=e.listen(()=>{u({type:"RESET_NDC_FORM"})});return()=>t()},[e,u]),o.createElement("div",{className:"card"},o.createElement(t.CardHeader,{className:"ndc-emp-step-form",divider:!0},a("ndc_header_application")),o.createElement(Z,{stepsList:gn,onSubmit:()=>{},step:d,setStep:e=>{u(ee(e))}}),s&&o.createElement(t.Toast,{error:s.key,label:a(s.label),onClose:()=>{c(null)},isDleteBtn:"true"}))},NewNDCStepFormOneEmployee:e=>{var r;let{config:l,onGoNext:a,onBackClick:u,t:d}=e;const m=i.useDispatch(),[v,f]=n.useState(!1),[p,h]=n.useState(""),[g,y]=n.useState(!1),E=i.useSelector(e=>e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[l.key]?e.ndc.NDCForm.formData[l.key]:{}),b=(i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.apiData}),i.useSelector(e=>e.ndc.NDCForm.formData||{})),N=window.localStorage.getItem("Employee.tenant-id");return o.createElement(o.Fragment,null,o.createElement(t.FormComposer,{defaultValues:E,config:l.currStepConfig,onSubmit:function(e){var t,n,o,r,l;const i=function(e){var t,n,o,r,l;const i=[],a=[],u=(null==e?void 0:e.cpt)||{},s=(null==u?void 0:u.details)||{},c=(null==e?void 0:e.PropertyDetails)||{},m=(null==e?void 0:e.NDCReason)||{};return null!=e&&null!==(t=e.cpt)&&void 0!==t&&t.dues||a.push(d("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_PROPERTY_TAX")+" "+(null==u?void 0:u.id)),(null==e||null===(n=e.cpt)||void 0===n||null===(o=n.dues)||void 0===o?void 0:o.totalAmount)>0&&a.push(d("NDC_MESSAGE_PLEASE_PAY_DUES_OF_PROPERTY_TAX")+" "+(null==u?void 0:u.id)),(null==c||null===(r=c.waterConnection)||void 0===r?void 0:r.length)>0&&c.waterConnection.forEach(e=>{var t,n;null!=e&&null!==(t=e.billData)&&void 0!==t&&t.id&&(null==e||null===(n=e.billData)||void 0===n?void 0:n.totalAmount)>0&&a.push(d("NDC_MESSAGE_PLEASE_PAY_DUES_OF_WATER_CONNECTION")+" "+(null==e?void 0:e.connectionNo))}),(null==c||null===(l=c.sewerageConnection)||void 0===l?void 0:l.length)>0&&c.sewerageConnection.forEach(e=>{var t,n;null!=e&&null!==(t=e.billData)&&void 0!==t&&t.id&&(null==e||null===(n=e.billData)||void 0===n?void 0:n.totalAmount)>0&&a.push(d("NDC_MESSAGE_PLEASE_PAY_DUES_OF_SEWERAGE_CONNECTION")+" "+(null==e?void 0:e.connectionNo))}),null!=u&&u.id||i.push(d("NDC_MESSAGE_PROPERTY_ID")),s&&0!==Object.keys(s).length||i.push(d("NDC_MESSAGE_PLEASE_SEARCH_PROPERTY_ID")),null!=c&&c.firstName||i.push(d("NDC_MESSAGE_FIRST_NAME")),null!=c&&c.mobileNumber||i.push(d("NDC_MESSAGE_MOBILE_NUMBER")),null!=c&&c.address||i.push(d("NDC_MESSAGE_ADDRESS")),null!=c&&c.email||i.push(d("NDC_MESSAGE_EMAIL")),null!=m&&m.code||i.push(d("NDC_MESSAGE_NDC_REASON")),null!=c&&c.firstName&&!/^[A-Za-z\s]+$/.test(c.firstName)&&a.push(d("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED")),null!=c&&c.email&&!/^(?!\.)(?!.*\.\.)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/.test(c.email)&&a.push(d("NDC_MESSAGE_EMAIL_INVALID_FORMAT")),null!=c&&c.mobileNumber&&!/^[6-9]\d{9}$/.test(c.mobileNumber)&&a.push(d("NDC_MESSAGE_MOBILE_NUMBER_MUST_BE_A_VALID_TEN_DIGIT_INDIAN_NUMBER")),[...i,...a]}(E);if(i.length>0)return h(""+i[0]),f(!0),void setTimeout(()=>{f(!1)},3e3);null!=b&&null!==(t=b.apiData)&&void 0!==t&&null!==(n=t.Applications)&&void 0!==n&&null!==(o=n[0])&&void 0!==o&&o.applicationNo||null!=b&&null!==(r=b.responseData)&&void 0!==r&&null!==(l=r[0])&&void 0!==l&&l.applicationNo?a():function(e){try{var t,n,o,r,l,i,u,d,v;y(!0);const C=(null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info)||{},w=null==C?void 0:C.uuid,A=((null==e||null===(n=e.cpt)||void 0===n||null===(o=n.details)||void 0===o?void 0:o.owners)||[]).map(t=>{var n,o,r,l,i;let a=c(t,yn);var u;return(null==a||null===(n=a.name)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.toLowerCase())===(null==e||null===(r=e.PropertyDetails)||void 0===r||null===(l=r.firstName)||void 0===l||null===(i=l.trim())||void 0===i?void 0:i.toLowerCase())?s({},a,{emailId:null==e||null===(u=e.PropertyDetails)||void 0===u?void 0:u.email,isPrimaryOwner:!0}):a}),T=[];var f;if(((null==e||null===(r=e.PropertyDetails)||void 0===r?void 0:r.waterConnection)||[]).forEach(t=>{var n,o,r,l,i,a;T.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:w,businessService:"WS",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),((null==e||null===(l=e.PropertyDetails)||void 0===l?void 0:l.sewerageConnection)||[]).forEach(t=>{var n,o,r,l,i,a;T.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:w,businessService:"SW",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),null!=e&&null!==(i=e.PropertyDetails)&&void 0!==i&&i.tlNumber&&T.push({businessService:"TL",consumerCode:null==e||null===(f=e.PropertyDetails)||void 0===f?void 0:f.tlNumber}),null!=e&&null!==(u=e.PropertyDetails)&&void 0!==u&&null!==(d=u.propertyBillData)&&void 0!==d&&d.billData){var p,h,g,E,b,_,S,D;const t=null==e||null===(p=e.PropertyDetails)||void 0===p||null===(h=p.propertyBillData)||void 0===h?void 0:h.billData;T.push({uuid:null==t?void 0:t.id,applicantId:w,businessService:"PT",consumerCode:null==e||null===(g=e.cpt)||void 0===g?void 0:g.id,additionalDetails:{propertyAddress:null==e||null===(E=e.PropertyDetails)||void 0===E?void 0:E.address,propertyType:null==e||null===(b=e.cpt)||void 0===b||null===(_=b.details)||void 0===_?void 0:_.usageCategory,reason:null==e||null===(S=e.NDCReason)||void 0===S?void 0:S.reason,remarks:null==e||null===(D=e.PropertyDetails)||void 0===D?void 0:D.remarks},dueAmount:(null==t?void 0:t.totalAmount)||0,status:null==t?void 0:t.status})}const O={Applications:[{tenantId:N,owners:A,NdcDetails:T,Documents:[],active:!0,reason:null==e||null===(v=e.NDCReason)||void 0===v?void 0:v.code,workflow:{action:"INITIATE"}}]};Promise.resolve(ae(function(){return Promise.resolve(Digit.NDCService.NDCcreate({tenantId:N,details:O})).then(function(e){var t;return y(!1),"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(m(J("apiData",e)),a(),{isSuccess:!0,response:e}):{isSuccess:!1,response:e}})},function(){y(!1)}))}catch(e){return Promise.reject(e)}}(e),a()},onFormValueChange:function(e,t){_.isEqual(t,E)||m(J(l.key,t))},label:d(""+(null==l||null===(r=l.texts)||void 0===r?void 0:r.submitBarLabel)),currentStep:l.currStepNumber,onBackClick:function(e){u(l.key,e)}}),g&&o.createElement(Qe,{page:!0}),v&&o.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{f(!1),h("")}}))},NewNDCStepFormTwoEmployee:e=>{let{config:r,onGoNext:l,onBackClick:a,t:u}=e;const s=i.useSelector(e=>e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[r.key]?e.ndc.NDCForm.formData[r.key]:{}),c=i.useDispatch(),d=Digit.ULBService.getStateId(),[m,v]=n.useState(!1),[f,p]=n.useState(""),{isLoading:h,data:g}=Digit.Hooks.pt.usePropertyMDMS(d,"NDC",["Documents"]);return o.createElement(o.Fragment,null,o.createElement(t.FormComposer,{defaultValues:s,config:r.currStepConfig,onSubmit:function(e){console.log("Data in step "+r.currStepNumber+" is: \n",e);const t=function(e){if(!h){var t,n;const o=(null==g||null===(t=g.NDC)||void 0===t?void 0:t.Documents)||[],r=(null==e||null===(n=e.documents)||void 0===n?void 0:n.documents)||[],l=o.filter(e=>e.required).map(e=>e.code),i=r.map(e=>e.documentType);return console.log("DocumentsObject",l),l.filter(e=>!i.includes(e))}}(e);if(t.length>0)return p(""+u("NDC_MESSAGE_"+t[0].replace(".","_").toUpperCase())),v(!0),void setTimeout(()=>{v(!1)},3e3);l()},onFormValueChange:function(e,t){_.isEqual(t,s)||c(J(r.key,t))},label:u(""+r.texts.submitBarLabel),currentStep:r.currStepNumber,onBackClick:function(e){a(r.key,e)}}),m&&o.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:f,onClose:()=>{v(!1),p("")}}))},NDCNewFormSummaryStepThreeEmployee:e=>{let{config:t,onBackClick:n}=e;const l=i.useDispatch(),a=r.useHistory(),u=window.localStorage.getItem("CITIZEN.CITY"),d=(i.useSelector(e=>e.ndc.NDCForm.formData||{}),i.useSelector(e=>e.ndc.NDCForm.formData||{}));return console.log("formData",d),o.createElement(o.Fragment,null,o.createElement(pn,{formData:d,goNext:function(e){try{console.log("yeah",e),console.log("formData",d);const t=null==e?void 0:e.action,n=ae(function(){return Promise.resolve(function(e,t){try{console.log("coming here btw");const n=function(e,t){var n,o,r,l,i,a,u,m,v;Digit.UserService.getUser(),console.log("checkFormData",d);const f=null===(n=(null==e||null===(o=e.apiData)||void 0===o||null===(r=o.Applications)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.owners)||[])||void 0===n?void 0:n.map(e=>c(e,En)),p=(null==d||null===(i=d.responseData)||void 0===i?void 0:i[0])||(null==d||null===(a=d.apiData)||void 0===a||null===(u=a.Applications)||void 0===u?void 0:u[0])||{},h=s({},p,{workflow:s({},null==p?void 0:p.workflow,{action:t}),owners:f,NdcDetails:null==p?void 0:p.NdcDetails,Documents:[]});return((null==e||null===(m=e.DocummentDetails)||void 0===m||null===(v=m.documents)||void 0===v?void 0:v.documents)||[]).forEach(e=>{h.Documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.fileStoreId})}),{Applications:[h]}}(e,t);return Promise.resolve(Digit.NDCService.NDCUpdate({tenantId:u,details:n})).then(function(e){var t;return l({type:"RESET_NDC_FORM"}),"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?{isSuccess:!0,response:e}:{isSuccess:!1,response:e}})}catch(e){return Promise.reject(e)}}(d,t)).then(function(e){var t,n,o;null!=e&&e.isSuccess?a.push("/digit-ui/employee/ndc/response/"+(null==e||null===(t=e.response)||void 0===t||null===(n=t.Applications)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.applicationNo)):console.error("Submission failed, not moving to next step.",null==e?void 0:e.response)})},function(e){alert("Error: "+(null==e?void 0:e.message))});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onGoBack:e=>{console.log("here",e),n(t.key,e)}}))},MyApplications:e=>{const{t:i}=l.useTranslation(),a=(Digit.UserService.getUser(),window.localStorage.getItem("CITIZEN.CITY")),{isLoading:u,data:s}=Digit.Hooks.ndc.useSearchApplication({},a),[c,d]=n.useState(1);if(u)return o.createElement(t.Loader,null);const m=(null==s?void 0:s.data)||[],v=Math.ceil(m.length/5),f=5*c,p=m.slice(f-5,f);return console.log("currentApplications",p),o.createElement(o.Fragment,null,o.createElement(t.Header,null,i("TL_MY_APPLICATIONS_HEADER")),p.map((e,n)=>{var l,u,s,c,d,m,v;const f=(null==e||null===(l=e.Applications)||void 0===l?void 0:l.owners)||[],p=null==f||null===(u=f.map(e=>null==e?void 0:e.name))||void 0===u||null===(s=u.filter(Boolean))||void 0===s?void 0:s.join(", ");return o.createElement("div",{key:"card-"+n},o.createElement(t.Card,null,o.createElement(t.KeyNote,{keyValue:i("BPA_APPLICATION_NUMBER_LABEL"),note:i(null==e||null===(c=e.Applications)||void 0===c?void 0:c.applicationNo)}),o.createElement(t.KeyNote,{keyValue:i("TL_LOCALIZATION_OWNER_NAME"),note:i(p)}),o.createElement(t.KeyNote,{keyValue:i("TL_HOME_SEARCH_RESULTS_APP_STATUS_LABEL"),note:i(null==e?void 0:e.TL_HOME_SEARCH_RESULTS_APP_STATUS_LABEL)}),o.createElement("div",{className:"action-button-myapplication"},o.createElement(r.Link,{to:"/digit-ui/citizen/ndc/search/application-overview/"+(null==e||null===(d=e.Applications)||void 0===d?void 0:d.applicationNo)},o.createElement(t.SubmitBar,{label:i("CS_VIEW_DETAILS")})),"PENDINGPAYMENT"===(null==e||null===(m=e.Applications)||void 0===m?void 0:m.applicationStatus)&&o.createElement(r.Link,{to:"/digit-ui/citizen/payment/collect/NDC/"+(null==e||null===(v=e.Applications)||void 0===v?void 0:v.applicationNo)+"/"+a+"?tenantId="+a},o.createElement(t.SubmitBar,{label:i("CS_APPLICATION_DETAILS_MAKE_PAYMENT")})))))}),!m.length&&o.createElement("p",{className:"ndc-application-list"},i("PTR_NO_APPLICATION_FOUND_MSG")),m.length>5&&o.createElement("div",{className:"ndc-application-overview-custom"},o.createElement("button",{disabled:1===c,onClick:()=>d(e=>e-1),style:{cursor:1===c?"not-allowed":"pointer"}},"← Prev"),o.createElement("span",null,"Page ",c," of ",v),o.createElement("button",{disabled:c===v,onClick:()=>d(e=>e+1),style:{cursor:c===v?"not-allowed":"pointer"}},"Next →")),o.createElement("p",{className:"ndc-application-list"},i("PTR_TEXT_NOT_ABLE_TO_FIND_THE_APPLICATION")," ",o.createElement("span",{className:"link",style:{display:"block"}},o.createElement(r.Link,{to:"/digit-ui/citizen/ndc/new-application"},i("NDC_COMMON_CLICK_HERE_TO_REGISTER_NEW_APPLICATION")))))},NDCResponseCitizen:e=>{var n,i,a;const{state:u}=e.location,{t:s}=l.useTranslation(),c=r.useHistory(),d=null==u||null===(n=u.data)||void 0===n||null===(i=n.Noc)||void 0===i?void 0:i[0],m=window.localStorage.getItem("CITIZEN.CITY"),v=((null==c||null===(a=c.location)||void 0===a?void 0:a.pathname)||"").split("/").pop();return o.createElement("div",null,o.createElement(t.Card,null,o.createElement(t.Banner,{message:"NDC Application Submitted Successfully",applicationNumber:v,info:"REJECTED"==(null==d?void 0:d.applicationStatus)?"":s("NDC_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==d?void 0:d.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),o.createElement(t.ActionBar,{className:"ndc-action-bar"},o.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{c.push("/digit-ui/citizen")}}),o.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_NDC"),onSubmit:()=>{c.push("/digit-ui/citizen/ndc-home")}}),o.createElement(t.SubmitBar,{label:s("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:()=>{c.push("/digit-ui/citizen/payment/collect/NDC/"+v+"/"+m+"?tenantId="+m)}}))))},CitizenApplicationOverview:()=>{var e,i,a,u,c,d,m,f,p,h,g,y,E,b,_,N,S,D,C;const{id:w}=r.useParams(),{t:A}=l.useTranslation(),T=r.useHistory(),O=window.localStorage.getItem("CITIZEN.CITY"),P=null==O?void 0:O.split(".")[0],[I,x]=n.useState({}),[R,L]=n.useState(null),[F,M]=n.useState(null),[k,B]=n.useState([]),[U,j]=n.useState({}),[W,z]=n.useState(!1),[H,V]=n.useState(!1),{isLoading:q,data:Y}=(window.Digit.Utils.browser.isMobile(),Digit.Hooks.pt.usePropertyMDMS(P,"NDC",["Documents"]),Digit.Hooks.ndc.useSearchEmployeeApplication({applicationNo:w},O)),G=Digit.Hooks.useWorkflowDetails({tenantId:O,id:w,moduleCode:"ndc-services"});n.useEffect(()=>{if(G){var e,t,n;console.log("workflowDetails here",G);const o=null==G||null===(e=G.data)||void 0===e||null===(t=e.processInstances)||void 0===t?void 0:t.find(e=>"APPROVE"===(null==e?void 0:e.action)),r=(null==o||null===(n=o.assigner)||void 0===n?void 0:n.name)||"NA";M(r)}},[G]);const $=v(O,F);console.log("approver for ndc",F),console.log("officerData",$);const{data:K}=Digit.Hooks.useStore.getInitData(),{tenants:X}=K||{};let Z=Digit.UserService.getUser();if(n.useRef(),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};Z=null==t?void 0:t.value}null===(e=Z)||void 0===e||null===(i=e.info)||void 0===i||null===(a=i.roles)||void 0===a||a.map(e=>e.code);const Q=e=>{const t=new Set;return e.filter(e=>!t.has(e.uuid)&&(t.add(e.uuid),!0))};n.useEffect(()=>{var e;const t=null==Y||null===(e=Y.Applications)||void 0===e?void 0:e[0];if(console.log("ndcObject",t),t){var n,o,r;const e=(null==t||null===(n=t.owners)||void 0===n?void 0:n.find(e=>null==e?void 0:e.isPrimaryOwner))||(null==t||null===(o=t.owners)||void 0===o?void 0:o[0]),l={name:null==e?void 0:e.name,mobile:null==e?void 0:e.mobileNumber,email:null==e?void 0:e.emailId,address:null==e?void 0:e.permanentAddress,applicationNo:null==t?void 0:t.applicationNo},i=Q((null==t?void 0:t.Documents)||[]),a=null===(r=Q((null==t?void 0:t.NdcDetails)||[]))||void 0===r?void 0:r.map(e=>{var t;return{businessService:"WS"===(null==e?void 0:e.businessService)?"NDC_WATER_SERVICE_CONNECTION":"SW"===(null==e?void 0:e.businessService)?"NDC_SEWERAGE_SERVICE_CONNECTION":"PT"===(null==e?void 0:e.businessService)?"NDC_PROPERTY_TAX":null==e?void 0:e.businessService,consumerCode:(null==e?void 0:e.consumerCode)||"",status:(null==e?void 0:e.status)||"",dueAmount:(null==e?void 0:e.dueAmount)||0,propertyType:(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.propertyType)||""}});j({applicantData:l,Documents:i,NdcDetails:a})}},[null==Y?void 0:Y.Applications]),n.useEffect(()=>{Y&&(V(!0),x(s({},Y,{applicationDetails:[{title:"NOC_DETAILS_SUMMARY_LABEL"}]})),V(!1))},[Y]);const[J,ee]=n.useState(null);n.useEffect(()=>{if(U){var e,t;console.log("here");const n=null==U||null===(e=U.NdcDetails)||void 0===e?void 0:e.filter(e=>"NDC_PROPERTY_TAX"==(null==e?void 0:e.businessService));console.log("checkProperty",n),ee(null==n||null===(t=n[0])||void 0===t?void 0:t.consumerCode)}},[U]);const{isLoading:te,data:ne}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:J},tenantId:O},{filters:{propertyIds:J},tenantId:O,enabled:!!J,privacy:Digit.Utils.getPrivacyObject()});let oe,re;var le,ie,ue,ce,de,me;if(!te&&(null==ne||null===(u=ne.Properties)||void 0===u?void 0:u.length)>0&&(oe=ne.Properties[0].address,re=[null===(le=oe)||void 0===le?void 0:le.doorNo,null===(ie=oe)||void 0===ie?void 0:ie.buildingName,null===(ue=oe)||void 0===ue?void 0:ue.street,null===(ce=oe)||void 0===ce||null===(de=ce.locality)||void 0===de?void 0:de.name,null===(me=oe)||void 0===me?void 0:me.city].filter(Boolean).join(", ")),q||H)return o.createElement(Qe,null);console.log("propertyDetailsFetch",ne),console.log("displayData?.applicantData",U);const ve=(null==ne||null===(c=ne.Properties)||void 0===c||null===(d=c[0])||void 0===d?void 0:d.owners)||[],fe=null==ve||null===(m=ve.map(e=>null==e?void 0:e.name))||void 0===m||null===(f=m.filter(Boolean))||void 0===f?void 0:f.join(", ");return console.log("applicationDetails?.[0]",null==Y||null===(p=Y.Applications)||void 0===p?void 0:p[0]),o.createElement("div",{className:"employee-main-application-details"},o.createElement("div",{className:"ndc-application-overview"},o.createElement("div",{style:{display:"flex",justifyContent:"end",alignItems:"center",padding:"16px"}},"APPROVED"===(null==Y||null===(h=Y.Applications)||void 0===h||null===(g=h[0])||void 0===g?void 0:g.applicationStatus)&&o.createElement(t.LinkButton,{className:"downLoadButton",label:A("DOWNLOAD_CERTIFICATE"),onClick:function(){try{const e=function(e,t){try{var n=ae(function(){var e,t,n;function o(){console.log("acknowledgementData",u),setTimeout(()=>{Digit.Utils.pdf.generateNDC(u)},0)}z(!0);const r=Y,l=((null==ne||null===(e=ne.Properties)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.owners)||[]).map(e=>null==e?void 0:e.name).filter(Boolean);r.propertyOwnerNames=l,console.log("propertyOwnerNames",l);const i=null==X?void 0:X.find(e=>{var t,n;return(null==e?void 0:e.code)===(null==r||null===(t=r.Applications)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.tenantId)});console.log("tenantInfo",i);const a=null==i||null===(n=i.city)||void 0===n?void 0:n.ulbType;let u;const s=function(){if($)return Promise.resolve(it(r,re,i,A,F,a,$)).then(function(e){u=e})}();return s&&s.then?s.then(o):o()},function(e){console.error("Error generating acknowledgement:",e)})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(z(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})),("INITIATED"==(null==Y||null===(y=Y.Applications)||void 0===y||null===(E=y[0])||void 0===E?void 0:E.applicationStatus)||"CITIZENACTIONREQUIRED"==(null==Y||null===(b=Y.Applications)||void 0===b||null===(_=b[0])||void 0===_?void 0:_.applicationStatus))&&o.createElement(t.ActionBar,null,o.createElement(t.SubmitBar,{label:A("COMMON_EDIT"),onSubmit:()=>{var e,t;const n=null==Y||null===(e=Y.Applications)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.applicationNo;T.push("/digit-ui/citizen/ndc/new-application/"+n)}}))),o.createElement(t.Card,{className:"ndc_card_main"},o.createElement(t.CardSubHeader,{className:"ndc_label"},A("NDC_APPLICATION_DETAILS_OVERVIEW")),o.createElement(t.StatusTable,null,o.createElement(t.Row,{label:A("Name"),text:fe}),(null==U?void 0:U.applicantData)&&(null===(N=Object.entries(null==U?void 0:U.applicantData))||void 0===N||null===(S=N.filter(e=>{let[t]=e;return"name"!==t}))||void 0===S?void 0:S.map(e=>{let[n,r]=e;return o.createElement(t.Row,{key:n,label:A(""+(null==n?void 0:n.toUpperCase())),text:Array.isArray(r)?r.map(e=>A("object"==typeof e?(null==e?void 0:e.code)||"N/A":e||"N/A")).join(", "):A("object"==typeof r?(null==r?void 0:r.code)||"N/A":r||"N/A")})})))),o.createElement(t.Card,{className:"ndc_card_main"},o.createElement(t.CardSubHeader,{className:"ndc_label"},A("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")),null==U||null===(D=U.NdcDetails)||void 0===D?void 0:D.map((e,r)=>{var l,i,a,u,s,c,d,m,v,f,p,h,g,y,E,b,_,N,S,D,C,w,T,O,P,I,x,R,L,F,M,k,B,U,j;console.log("detail",e);const W=e.dueAmount>0;return o.createElement("div",{className:"ndc-application-overview-table",key:r},o.createElement(t.StatusTable,null,o.createElement(t.Row,{label:A("NDC_BUSINESS_SERVICE"),text:A(""+e.businessService)||e.businessService}),o.createElement(t.Row,{label:A("NDC_CONSUMER_CODE"),text:e.consumerCode||"N/A"}),o.createElement("div",{style:{background:W?"red":"none",color:W?"white":"black",paddingTop:W?"8px":"0",paddingLeft:W?"10px":"0"}},o.createElement(t.Row,{rowContainerStyle:{backgroundColor:W?"red":"none"},label:A("NDC_DUE_AMOUNT"),text:(null===(l=e.dueAmount)||void 0===l?void 0:l.toString())||"0"})),o.createElement(t.Row,{label:A("NDC_PROPERTY_TYPE"),text:A(e.propertyType)||e.propertyType}),"NDC_PROPERTY_TAX"==(null==e?void 0:e.businessService)&&(null==ne?void 0:ne.Properties)&&o.createElement(n.Fragment,null,o.createElement(t.Row,{label:A("CHB_DISCOUNT_REASON"),text:A(""+("OTHERS"===(null==Y||null===(i=Y.Applications)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.reason)?null==Y||null===(u=Y.Applications)||void 0===u||null===(s=u[0])||void 0===s||null===(c=s.NdcDetails)||void 0===c||null===(d=c[2])||void 0===d||null===(m=d.additionalDetails)||void 0===m?void 0:m.reason:null==Y||null===(v=Y.Applications)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.reason))}),o.createElement(t.Row,{label:A("City"),text:(null==ne||null===(p=ne.Properties)||void 0===p||null===(h=p[0])||void 0===h||null===(g=h.address)||void 0===g?void 0:g.city)||"N/A"}),o.createElement(t.Row,{label:A("House No"),text:(null==ne||null===(y=ne.Properties)||void 0===y||null===(E=y[0])||void 0===E||null===(b=E.address)||void 0===b?void 0:b.doorNo)||"N/A"}),o.createElement(t.Row,{label:A("Colony Name"),text:(null==ne||null===(_=ne.Properties)||void 0===_||null===(N=_[0])||void 0===N||null===(S=N.address)||void 0===S?void 0:S.buildingName)||"N/A"}),o.createElement(t.Row,{label:A("Street Name"),text:(null==ne||null===(D=ne.Properties)||void 0===D||null===(C=D[0])||void 0===C||null===(w=C.address)||void 0===w?void 0:w.street)||"N/A"}),o.createElement(t.Row,{label:A("Pincode"),text:(null==ne||null===(T=ne.Properties)||void 0===T||null===(O=T[0])||void 0===O||null===(P=O.address)||void 0===P?void 0:P.pincode)||"N/A"}),o.createElement(t.Row,{label:A("Survey Id/UID"),text:(null==ne||null===(I=ne.Properties)||void 0===I||null===(x=I[0])||void 0===x?void 0:x.surveyId)||"N/A"}),o.createElement(t.Row,{label:A("Year of creation of Property"),text:null==ne||null===(R=ne.Properties)||void 0===R||null===(L=R[0])||void 0===L||null===(F=L.additionalDetails)||void 0===F?void 0:F.yearConstruction}),o.createElement(t.Row,{label:A("Remarks"),text:(null==Y||null===(M=Y.Applications)||void 0===M||null===(k=M[0])||void 0===k||null===(B=k.NdcDetails)||void 0===B||null===(U=B[0])||void 0===U||null===(j=U.additionalDetails)||void 0===j?void 0:j.remarks)||"N/A"}))))})),o.createElement(t.Card,{className:"ndc_card_main"},o.createElement(t.CardSubHeader,{className:"ndc_label"},A("NDC_APPLICATION_DOCUMENTS_OVERVIEW")),o.createElement("div",null,Array.isArray(null==U?void 0:U.Documents)&&(null==U||null===(C=U.Documents)||void 0===C?void 0:C.length)>0?o.createElement(se,{value:{workflowDocs:null==U?void 0:U.Documents}}):o.createElement("div",null,A("TL_NO_DOCUMENTS_MSG")))),o.createElement(lt,{workflowDetails:G,t:A}),(q||H||te||W)&&o.createElement(Qe,{page:!0}))}};exports.NDCReducers=()=>u.combineReducers({NDCForm:_n}),exports.initNDCComponents=()=>{Object.entries(Nn).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|
|
1
|
+
var e,t=require("@mseva/digit-ui-react-components"),n=require("react"),o=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-router-dom"),l=require("react-i18next"),i=require("react-redux"),a=require("react-hook-form");require("react-query");var u=require("redux");function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(null,arguments)}function c(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}const d=function(e){void 0===e&&(e=!1);let t=window.location.href.includes("/search");const n=[{code:t?"FIRE_NOC":"FIRE_NOC_SRV",active:!0,roles:["FIRE_NOC_APPROVER"],i18nKey:"WF_FIRE_NOC_FIRE_NOC_SRV"},{code:t?"AIRPORT_AUTHORITY":"AIRPORT_NOC_SRV",active:!0,roles:["AIRPORT_AUTHORITY_APPROVER"],i18nKey:"WF_FIRE_NOC_AIRPORT_NOC_SRV"}],o=[],r=Digit.UserService.getUser().info.roles;return n.map((t,l)=>{let{roles:i}=t;i.map(t=>{r.map(r=>{var i;r.code===t&&o.push(e?null==n||null===(i=n[l])||void 0===i?void 0:i.code:null==n?void 0:n[l])})})}),o},m=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let o=e[t]||"",r=(null==o?void 0:o.split(","))||[],l="";return r.length>0&&r.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(l=e)}),l},v=(e,t)=>{var n,o,r,l,i,a,u,s;const c=Digit.Hooks.useEmployeeSearch(e,{codes:t,isActive:!0},{enabled:!!t}),d=Digit.Hooks.useEmployeeSearch(e,{names:t,isActive:!0},{enabled:!(!t||null!=c&&null!==(n=c.data)&&void 0!==n&&null!==(o=n.Employees)&&void 0!==o&&o.length)}),m=null!=c&&null!==(r=c.data)&&void 0!==r&&null!==(l=r.Employees)&&void 0!==l&&l.length?c:d;console.log("employeeData",m);const v=null==m||null===(i=m.data)||void 0===i||null===(a=i.Employees)||void 0===a?void 0:a[0],f=null==v||null===(u=v.assignments)||void 0===u?void 0:u[0];return{officer:v?{code:null==v?void 0:v.code,id:null==v?void 0:v.id,name:null==v||null===(s=v.user)||void 0===s?void 0:s.name,department:null==f?void 0:f.department,designation:null==f?void 0:f.designation}:null}};var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var h,g,y="object"==typeof f&&f&&f.Object===Object&&f,E="object"==typeof self&&self&&self.Object===Object&&self,b=y||E||Function("return this")(),N=b.Symbol,S=Object.prototype,D=S.hasOwnProperty,C=S.toString,w=N?N.toStringTag:void 0,A=Object.prototype.toString,T=N?N.toStringTag:void 0,O=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?function(e){var t=D.call(e,w),n=e[w];try{e[w]=void 0;var o=!0}catch(e){}var r=C.call(e);return o&&(t?e[w]=n:delete e[w]),r}(e):function(e){return A.call(e)}(e)},P=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},I=b["__core-js_shared__"],x=(h=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+h:"",R=Function.prototype.toString,L=function(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""},F=/^\[object .+?Constructor\]$/,M=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!P(e)||(t=e,x&&x in t))&&(function(e){if(!P(e))return!1;var t=O(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?M:F).test(L(e));var t}(n)?n:void 0},B=k(b,"Map");k(Object,"create"),function(){try{k(Object,"defineProperty")({},"",{})}catch(e){}}(),function(e){return null!=e&&"object"==typeof e}(g=function(){return arguments}())&&O(g);var U=function(){return!1},j=(p(function(e,t){var n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,r=o&&o.exports===n?b.Buffer:void 0;e.exports=(r?r.isBuffer:void 0)||U}),p(function(e,t){var n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,r=o&&o.exports===n&&y.process,l=function(){try{return o&&o.require&&o.require("util").types||r&&r.binding&&r.binding("util")}catch(e){}}();e.exports=l}),p(function(e,t){var n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,r=o&&o.exports===n?b.Buffer:void 0,l=r?r.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,o=l?l(n):new e.constructor(n);return e.copy(o),o}}),k(b,"DataView")),W=k(b,"Promise"),z=k(b,"Set"),H=k(b,"WeakMap"),V=L(j),q=L(B),Y=L(W),G=L(z),$=L(H),K=O;(j&&"[object DataView]"!=K(new j(new ArrayBuffer(1)))||B&&"[object Map]"!=K(new B)||W&&"[object Promise]"!=K(W.resolve())||z&&"[object Set]"!=K(new z)||H&&"[object WeakMap]"!=K(new H))&&(K=function(e){var t=O(e),n="[object Object]"==t?e.constructor:void 0,o=n?L(n):"";if(o)switch(o){case V:return"[object DataView]";case q:return"[object Map]";case Y:return"[object Promise]";case G:return"[object Set]";case $:return"[object WeakMap]"}return t});const X=e=>{let{children:t,currentStep:n=1,stepsList:r=[]}=e;const{t:i}=l.useTranslation(),a=e=>{const t=e<=n;return{width:"56px",height:"56px",borderRadius:"50%",background:t?"linear-gradient(135deg,#2563eb,#7c3aed)":"#ffffff",color:t?"#ffffff":"#0f172a",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"8px",fontWeight:600,fontSize:"18px",border:t?"none":"1px solid rgba(15,23,42,0.08)",boxShadow:t?"0 6px 18px rgba(37,99,235,0.18)":"0 2px 6px rgba(2,6,23,0.04)",position:"relative"}},u={fontSize:"16px",color:"#0f172a",fontWeight:600,fontFamily:"Noto Sans, sans-serif",marginRight:"8px",textAlign:"right"},c={fontSize:"14px",color:"#6b7280",fontWeight:500,fontFamily:"Noto Sans, sans-serif",margin:"0 6px 0 0"},d={position:"absolute",width:"3px",height:"56px",backgroundColor:"rgba(15,23,42,0.06)",left:"50%",top:"100%",transform:"translateX(-50%)",borderRadius:"2px"},m=window.Digit.Utils.browser.isMobile(),v=r.length,f=m?{width:"32px",height:"32px",fontSize:"12px"}:{},p=m?{fontSize:"10px"}:{},h=m?{width:"auto",padding:"6px",marginBottom:"0",flexDirection:"column",alignItems:"center"}:{};return o.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:m?"column":"row",gap:"24px"}},o.createElement("div",{className:"stepper-navigation-bar",style:s({display:"flex",flexDirection:"column",alignItems:"center",padding:"18px",minWidth:"120px",maxWidth:"320px",marginBottom:"20px",marginTop:m?"20px":"0",height:m?"106px":""},m?{flexDirection:"row",overflowX:"auto",whiteSpace:"nowrap",minWidth:"100%",maxWidth:"100%",gap:"8px",padding:"10px"}:{})},[...Array(v)].map((e,t)=>{return o.createElement("div",{className:"step-content",key:t,style:s({},(l=t+1<=n,g=t===v-1,{display:"flex",alignItems:"center",justifyContent:"flex-start",flex:"0 0 auto",color:l?"#0D43A7":"#9CA3AF",padding:"14px 12px",width:"260px",marginBottom:g?"6px":"18px"}),h)},o.createElement("div",{className:"step-circle",style:s({},a(t+1),f)},t+1,t<v-1&&!m&&o.createElement("div",{style:d})),o.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:m?"center":"flex-end",margin:m?"4px":"10px"}},t+1===v?null:o.createElement("div",{className:"step-number",style:c}),o.createElement("div",{className:"step-label",style:s({},u,p,{textAlign:m?"center":"right"})},i(r[t].stepLabel))));var l,g})),o.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px",background:"transparent"}},t))},Z=e=>{let{stepsList:t=[],onSubmit:n,step:r,setStep:i}=e;const a=t.filter(e=>e.isStepEnabled),{t:u}=l.useTranslation();function s(){r<a.length?d():r===a.length&&n()}function c(){r>1&&m()}const d=()=>i(r+1),m=()=>i(r-1);return o.createElement(X,{currentStep:r,nextStep:d,prevStep:m,stepsList:a},(()=>{var e,t;const n=a[r-1],{component:l,key:i,texts:d,currStepConfig:m}=n,v=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(l);return o.createElement(o.Fragment,null,o.createElement(v,{config:{key:i,texts:d,component:l,currStepNumber:r,currStepConfig:m},onGoNext:s,onBackClick:c,t:u}))})())},Q=[{head:"Applicant Details",stepNumber:1,body:[{type:"component",component:"PropertyDetailsForm",key:"PropertyDetailsForm",withoutLabel:!0}]},{head:"Property Details",stepNumber:2,body:[{type:"component",component:"PropertyDetailsFormUser",key:"PropertyDetailsFormUser",withoutLabel:!0}]}],J=(e,t)=>({type:"UPDATE_NDC_FORM",payload:{key:e,value:t}}),ee=e=>({type:"SET_NDC_STEP",payload:e}),te=([{head:"APPLICANT_DETAILS",stepLabel:"Applicant Details",stepNumber:1,isStepEnabled:!0,type:"component",component:"PropertyDetailsStep1",key:"PropertyDetailsStep1",withoutLabel:!0,texts:{submitBarLabel:"Next Step"}},{head:"PROPERTY_DETAILS",stepLabel:"Property Details",stepNumber:2,isStepEnabled:!0,type:"component",component:"PropertyDetailsStep2",key:"PropertyDetailsStep2",withoutLabel:!0,texts:{submitBarLabel:"Submit"}}].map(e=>s({},e,{currStepConfig:Q.filter(t=>t.stepNumber===e.stepNumber)})),e=>{var n,i,a;const{state:u}=e.location,{t:s}=l.useTranslation(),c=r.useHistory(),d=null==u||null===(n=u.data)||void 0===n||null===(i=n.Noc)||void 0===i?void 0:i[0],m=window.localStorage.getItem("Employee.tenant-id"),v=((null==c||null===(a=c.location)||void 0===a?void 0:a.pathname)||"").split("/").pop();return o.createElement("div",null,o.createElement(t.Card,null,o.createElement(t.Banner,{message:"NDC Application Submitted Successfully",applicationNumber:v,info:"REJECTED"==(null==d?void 0:d.applicationStatus)?"":s("NDC_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==d?void 0:d.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),o.createElement(t.ActionBar,{classname:"challan-emp-acknowledgement"},o.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{c.push("/digit-ui/employee")}}),o.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_NDC"),onSubmit:()=>{c.push("/digit-ui/employee/ndc/inbox")}}),o.createElement(t.SubmitBar,{label:s("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:()=>{c.push("/digit-ui/employee/payment/collect/NDC/"+v+"/"+m+"?tenantId="+m)}}))))}),ne=e=>{let{location:n}=e;const{t:r}=l.useTranslation(),i=[{path:"/digit-ui/employee",content:r("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/ndc/inbox",content:r("ES_COMMON_INBOX"),show:!!n.pathname.includes("ndc/inbox")},{path:"/digit-ui/employee/ndc/create",content:"NDC Application Create Page",show:!!n.pathname.includes("ndc/create")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:r("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:r("ES_COMMON_APPLICATION_SEARCH"),show:!!n.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:r("NOC_APP_OVER_VIEW_HEADER"),show:!!n.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return o.createElement(t.BreadCrumb,{crumbs:i})},oe=e=>{var i,a,u,c;let{path:d}=e;const m=r.useLocation(),v=(l.useTranslation(),null===(i=Digit)||void 0===i||null===(a=i.ComponentRegistryService)||void 0===a?void 0:a.getComponent("NDCApplicationOverview")),f=null===(u=Digit)||void 0===u||null===(c=u.ComponentRegistryService)||void 0===c?void 0:c.getComponent("NDCInbox"),p=Digit.ComponentRegistryService.getComponent("NewNDCStepFormEmployee"),h=window.location.href.includes("/response");return window.Digit.Utils.browser.isMobile(),o.createElement(n.Fragment,null,o.createElement("div",{className:"ground-container"},h?null:o.createElement(ne,{location:m}),o.createElement(r.Switch,null,o.createElement(t.PrivateRoute,{path:d+"/inbox/application-overview/:id",component:v}),o.createElement(t.PrivateRoute,{path:d+"/search/application-overview/:id",component:v}),o.createElement(r.Route,{path:d+"/inbox",component:e=>o.createElement(f,s({},e,{parentRoute:d}))}),o.createElement(t.PrivateRoute,{path:d+"/create",component:e=>o.createElement(p,s({},e,{parentRoute:d}))}),o.createElement(t.PrivateRoute,{path:d+"/response/:id",component:te}))))},re=["path","url"],le=e=>{let{location:n}=e;const{t:r}=l.useTranslation(),i=[{path:"/digit-ui/citizen",content:r("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/citizen/ndc-home",content:r("NDC")+" Home",show:!!n.pathname.includes("ndc/")},{path:"/digit-ui/citizen/ptr-home",content:r("PET_NDCSERVICE"),show:!!n.pathname.includes("ptr/petservice/test")}];return o.createElement(t.BreadCrumb,{crumbs:i})},ie=()=>{var e,n;const i=r.useRouteMatch(),{path:a}=i,u=(c(i,re),l.useTranslation(),r.useLocation()),s=Digit.ComponentRegistryService.getComponent("NewNDCStepFormCitizen"),d=Digit.ComponentRegistryService.getComponent("MyApplications"),m=Digit.ComponentRegistryService.getComponent("NDCResponseCitizen"),v=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("CitizenApplicationOverview"),f=window.location.href.includes("/response"),p=window.Digit.Utils.browser.isMobile();return o.createElement("span",{className:"chb-citizen",style:{width:"100%",paddingRight:"25px",paddingLeft:"25px"}},o.createElement(r.Switch,null,o.createElement(t.AppContainer,null,f?null:o.createElement("div",{style:window.location.href.includes("application-overview")||p?{marginLeft:"10px"}:{}},o.createElement(le,{location:u})),o.createElement(t.PrivateRoute,{path:a+"/new-application",component:s}),o.createElement(t.PrivateRoute,{path:a+"/my-application",component:d}),o.createElement(t.PrivateRoute,{path:a+"/response/:id",component:m}),o.createElement(t.PrivateRoute,{path:a+"/search/application-overview/:id",component:v}))))};function ae(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.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const ue=e=>{let{width:t=20,height:n=20,style:r}=e;return o.createElement("svg",{style:r,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},o.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))};function se(e){var t;let{value:n={}}=e;const{t:r}=l.useTranslation(),i=window.Digit.Utils.browser.isMobile(),{data:a}=Digit.Hooks.ndc.useNDCDocumentSearch({value:n},{value:n});let u=[];return null!=n&&n.workflowDocs&&(u=null==n?void 0:n.workflowDocs),o.createElement("div",{className:"document-container"},o.createElement(o.Fragment,null,o.createElement("div",{className:"document-grid"},null===(t=u)||void 0===t?void 0:t.map((e,t)=>{let n=m(a.pdfFiles,null==e?void 0:e.uuid);return o.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:n,className:"document-link",key:t},o.createElement("div",{className:"document-card"},o.createElement("div",{className:"document-icon-wrapper"},o.createElement(ue,{width:i?50:80,height:i?60:100})),o.createElement("p",{className:"document-name",title:r(null==e?void 0:e.documentType)},(()=>{const t=r(null==e?void 0:e.documentType),n=i?8:12;return(null==t?void 0:t.length)>n?t.substring(0,n)+"...":t})()),o.createElement("div",{className:"document-action-label"},"View")))}))))}var ce="function"==typeof Symbol&&Symbol.for,de=ce?Symbol.for("react.element"):60103,me=ce?Symbol.for("react.portal"):60106,ve=ce?Symbol.for("react.fragment"):60107,fe=ce?Symbol.for("react.strict_mode"):60108,pe=ce?Symbol.for("react.profiler"):60114,he=ce?Symbol.for("react.provider"):60109,ge=ce?Symbol.for("react.context"):60110,ye=ce?Symbol.for("react.async_mode"):60111,Ee=ce?Symbol.for("react.concurrent_mode"):60111,be=ce?Symbol.for("react.forward_ref"):60112,_e=ce?Symbol.for("react.suspense"):60113,Ne=ce?Symbol.for("react.suspense_list"):60120,Se=ce?Symbol.for("react.memo"):60115,De=ce?Symbol.for("react.lazy"):60116,Ce=ce?Symbol.for("react.block"):60121,we=ce?Symbol.for("react.fundamental"):60117,Ae=ce?Symbol.for("react.responder"):60118,Te=ce?Symbol.for("react.scope"):60119;function Oe(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case de:switch(e=e.type){case ye:case Ee:case ve:case pe:case fe:case _e:return e;default:switch(e=e&&e.$$typeof){case ge:case be:case De:case Se:case he:return e;default:return t}}case me:return t}}}function Pe(e){return Oe(e)===Ee}var Ie={AsyncMode:ye,ConcurrentMode:Ee,ContextConsumer:ge,ContextProvider:he,Element:de,ForwardRef:be,Fragment:ve,Lazy:De,Memo:Se,Portal:me,Profiler:pe,StrictMode:fe,Suspense:_e,isAsyncMode:function(e){return Pe(e)||Oe(e)===ye},isConcurrentMode:Pe,isContextConsumer:function(e){return Oe(e)===ge},isContextProvider:function(e){return Oe(e)===he},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===de},isForwardRef:function(e){return Oe(e)===be},isFragment:function(e){return Oe(e)===ve},isLazy:function(e){return Oe(e)===De},isMemo:function(e){return Oe(e)===Se},isPortal:function(e){return Oe(e)===me},isProfiler:function(e){return Oe(e)===pe},isStrictMode:function(e){return Oe(e)===fe},isSuspense:function(e){return Oe(e)===_e},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===ve||e===Ee||e===pe||e===fe||e===_e||e===Ne||"object"==typeof e&&null!==e&&(e.$$typeof===De||e.$$typeof===Se||e.$$typeof===he||e.$$typeof===ge||e.$$typeof===be||e.$$typeof===we||e.$$typeof===Ae||e.$$typeof===Te||e.$$typeof===Ce)},typeOf:Oe},xe=p(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,l=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var v=e.type;switch(v){case s:case c:case r:case i:case l:case m:return v;default:var h=v&&v.$$typeof;switch(h){case u:case d:case p:case f:case a:return h;default:return t}}case o:return t}}}var _=c,N=u,S=a,D=n,C=d,w=r,A=p,T=f,O=o,P=i,I=l,x=m,R=!1;function L(e){return b(e)===c}t.AsyncMode=s,t.ConcurrentMode=_,t.ContextConsumer=N,t.ContextProvider=S,t.Element=D,t.ForwardRef=C,t.Fragment=w,t.Lazy=A,t.Memo=T,t.Portal=O,t.Profiler=P,t.StrictMode=I,t.Suspense=x,t.isAsyncMode=function(e){return R||(R=!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.")),L(e)||b(e)===s},t.isConcurrentMode=L,t.isContextConsumer=function(e){return b(e)===u},t.isContextProvider=function(e){return b(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===r},t.isLazy=function(e){return b(e)===p},t.isMemo=function(e){return b(e)===f},t.isPortal=function(e){return b(e)===o},t.isProfiler=function(e){return b(e)===i},t.isStrictMode=function(e){return b(e)===l},t.isSuspense=function(e){return b(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===l||e===m||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===a||e.$$typeof===u||e.$$typeof===d||e.$$typeof===g||e.$$typeof===y||e.$$typeof===E||e.$$typeof===h)},t.typeOf=b}()}),Re=p(function(e){e.exports="production"===process.env.NODE_ENV?Ie:xe}),Le=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable;function ke(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var Be=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,o,r=ke(e),l=1;l<arguments.length;l++){for(var i in n=Object(arguments[l]))Fe.call(n,i)&&(r[i]=n[i]);if(Le){o=Le(n);for(var a=0;a<o.length;a++)Me.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r},Ue="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",je=Function.call.bind(Object.prototype.hasOwnProperty),We=function(){};if("production"!==process.env.NODE_ENV){var ze=Ue,He={},Ve=je;We=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function qe(e,t,n,o,r){if("production"!==process.env.NODE_ENV)for(var l in e)if(Ve(e,l)){var i;try{if("function"!=typeof e[l]){var a=Error((o||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}i=e[l](t,l,o,n,null,ze)}catch(e){i=e}if(!i||i instanceof Error||We((o||"React class")+": type specification of "+n+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in He)){He[i.message]=!0;var u=r?r():"";We("Failed "+n+" type: "+i.message+(null!=u?u:""))}}}qe.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(He={})};var Ye=qe,Ge=function(){};function $e(){return null}function Ke(){}function Xe(){}"production"!==process.env.NODE_ENV&&(Ge=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Xe.resetWarningCache=Ke;var Ze=p(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,o={array:a("array"),bigint:a("bigint"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:i($e),arrayOf:function(e){return i(function(t,n,o,r,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new l("Invalid "+r+" `"+i+"` of type `"+c(a)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<a.length;u++){var s=e(a,u,o,r,i+"["+u+"]",Ue);if(s instanceof Error)return s}return null})},element:i(function(t,n,o,r,i){var a=t[n];return e(a)?null:new l("Invalid "+r+" `"+i+"` of type `"+c(a)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:i(function(e,t,n,o,r){var i=e[t];return Re.isValidElementType(i)?null:new l("Invalid "+o+" `"+r+"` of type `"+c(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return i(function(t,n,o,r,i){var a;return t[n]instanceof e?null:new l("Invalid "+r+" `"+i+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+o+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:i(function(e,t,n,o,r){return s(e[t])?null:new l("Invalid "+o+" `"+r+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return i(function(t,n,o,r,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var a=t[n],u=c(a);if("object"!==u)return new l("Invalid "+r+" `"+i+"` of type `"+u+"` supplied to `"+o+"`, expected an object.");for(var s in a)if(je(a,s)){var d=e(a,s,o,r,i+"."+s,Ue);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Ge(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."),$e;function t(t,n,o,i,a){for(var u=t[n],s=0;s<e.length;s++)if(r(u,e[s]))return null;var c=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new l("Invalid "+i+" `"+a+"` of value `"+String(u)+"` supplied to `"+o+"`, expected one of "+c+".")}return i(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Ge("Invalid argument supplied to oneOfType, expected an instance of array."),$e;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return Ge("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),$e}return i(function(t,n,o,r,i){for(var a=[],u=0;u<e.length;u++){var s=(0,e[u])(t,n,o,r,i,Ue);if(null==s)return null;s.data&&je(s.data,"expectedType")&&a.push(s.data.expectedType)}return new l("Invalid "+r+" `"+i+"` supplied to `"+o+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return i(function(t,n,o,r,i){var a=t[n],s=c(a);if("object"!==s)return new l("Invalid "+r+" `"+i+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var m in e){var v=e[m];if("function"!=typeof v)return u(o,r,i,m,d(v));var f=v(a,m,o,r,i+"."+m,Ue);if(f)return f}return null})},exact:function(e){return i(function(t,n,o,r,i){var a=t[n],s=c(a);if("object"!==s)return new l("Invalid "+r+" `"+i+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");var m=Be({},t[n],e);for(var v in m){var f=e[v];if(je(e,v)&&"function"!=typeof f)return u(o,r,i,v,d(f));if(!f)return new l("Invalid "+r+" `"+i+"` key `"+v+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=f(a,v,o,r,i+"."+v,Ue);if(p)return p}return null})}};function r(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function l(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function i(e){function t(t,n,o,r,i,a,u){if(r=r||"<<anonymous>>",a=a||o,u!==Ue){var s=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 s.name="Invariant Violation",s}return null==n[o]?t?new l(null===n[o]?"The "+i+" `"+a+"` is marked as required in `"+r+"`, but its value is `null`.":"The "+i+" `"+a+"` is marked as required in `"+r+"`, but its value is `undefined`."):null:e(n,o,r,i,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return i(function(t,n,o,r,i,a){var u=t[n];return c(u)!==e?new l("Invalid "+r+" `"+i+"` of type `"+d(u)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,o,r){return new l((e||"React class")+": "+t+" type `"+n+"."+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+r+"`.")}function s(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(s);if(null===t||e(t))return!0;var o=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!o)return!1;var r,l=o.call(t);if(o!==t.entries){for(;!(r=l.next()).done;)if(!s(r.value))return!1}else for(;!(r=l.next()).done;){var i=r.value;if(i&&!s(i[1]))return!1}return!0;default:return!1}}function c(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=c(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 l.prototype=Error.prototype,o.checkPropTypes=Ye,o.resetWarningCache=Ye.resetWarningCache,o.PropTypes=o,o}(Re.isElement):function(){function e(e,t,n,o,r,l){if(l!==Ue){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Xe,resetWarningCache:Ke};return n.PropTypes=n,n}()});const Qe=e=>{let{page:t=!1}=e;const n={display:"flex",justifyContent:"center",alignItems:"center"},r=s({},n,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(255,255,255,0.6)",backdropFilter:"blur(4px)",zIndex:9999}),l=s({},n,{minHeight:"100px",width:"100%",position:"relative"});return o.createElement("div",{style:t?r:l},o.createElement("div",{style:{width:"64px",height:"64px",border:"8px solid #1976d2",borderTop:"8px solid transparent",borderRadius:"50%",animation:"spin 1.2s linear infinite"}}),o.createElement("style",null,"\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "))};Qe.propTypes={page:Ze.bool},Qe.defaultProps={page:!1};const Je=e=>o.createElement("h1",{className:"heading-m"},e.label),et=()=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},o.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o.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"})),tt=e=>o.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},o.createElement(et,null)),nt=e=>{var r;let{t:l,action:i,tenantId:a,closeModal:u,submitAction:c,applicationData:d,businessService:m,showToast:v,closeToast:f,errors:p,showErrorToast:h,errorOne:g,closeToastOne:y,getEmployees:E}=e;const[b,_]=n.useState({}),[N,S]=n.useState({}),[D,C]=n.useState([]),[w,A]=n.useState({}),[T,O]=n.useState(null),[P,I]=n.useState(null),[x,R]=n.useState(null),[L,F]=n.useState([]),[M,k]=n.useState(null),B=null==i||null===(r=i.state)||void 0===r?void 0:r.actions,U=[...new Set(null==B?void 0:B.flatMap(e=>e.roles))],j=[...new Set(null==E?void 0:E.flatMap(e=>e.roles))];console.log("getEmployees",E),console.log("allRoles",U),console.log("allRolesNew",j);const{data:W,isLoading:z}=Digit.Hooks.useEmployeeSearch(a,{roles:null==j?void 0:j.map(e=>({code:e})),isActive:!0},{enabled:!(null!=i&&i.isTerminateState)}),{data:H}=Digit.Hooks.pt.useMDMS(a,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}});n.useEffect(()=>{var e;H&&H["egf-master"]&&F(null===(e=H["egf-master"])||void 0===e?void 0:e.FinancialYear)},[H]);const{data:V}=Digit.Hooks.useCustomMDMS(a,"common-masters",[{name:"Department"}]);function q(e){O(e.target.files[0])}return n.useEffect(()=>{if(W&&V){var e;const t=V["common-masters"].Department;C(null==W||null===(e=W.Employees)||void 0===e?void 0:e.map(e=>{var n,o,r;const l=null==e||null===(n=e.assignments)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.department,i=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===l);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(r=e.user)||void 0===r?void 0:r.name)+" - "+(null==i?void 0:i.name)}}))}},[W,V]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)R(l("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=ae(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",T,Digit.ULBService.getStateId())).then(function(e){var t,n,o,r;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(o=e.data)||void 0===o||null===(r=o.files[0])||void 0===r?void 0:r.fileStoreId):R(l("CS_FILE_UPLOAD_ERROR"))})},function(){R(l("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{i&&_((e=>{let{t:n,action:r,approvers:l,selectedApprover:i,setSelectedApprover:a,selectFile:u,uploadedFile:s,setUploadedFile:c}=e,d=!0;return"SENDBACKTOCITIZEN"!=(null==r?void 0:r.action)&&"APPROVE"!=(null==r?void 0:r.action)&&"REJECT"!=(null==r?void 0:r.action)&&"SENDBACK"!=(null==r?void 0:r.action)||(d=!1),r.isTerminateState&&(d=!1),console.log("action=====",r.action),{label:{heading:"",submit:""+(null==r?void 0:r.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:d?n("WF_ASSIGNEE_NAME_LABEL")+" *":null,placeholder:d?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:d?o.createElement(t.Dropdown,{option:l,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:i}):null},{label:n("CS_COMMON_COMMENTS")+" *",type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:o.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:l,action:i,approvers:D,selectedApprover:w,setSelectedApprover:A,selectFile:q,uploadedFile:P,setUploadedFile:I,businessService:m}))},[i,D,L,M,P]),i&&b.form?o.createElement(t.Modal,{headerBarMain:o.createElement(Je,{label:l(b.label.heading)}),headerBarEnd:o.createElement(tt,{onClick:u}),actionCancelLabel:l(b.label.cancel),actionCancelOnSubmit:u,actionSaveLabel:l(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},o.createElement(t.FormComposer,{config:b.form,className:"BPAemployeeCard bpa-workflow-modal-form",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){d=s({},d,{action:null==i?void 0:i.action,comment:null==e?void 0:e.comments,assignee:null!=w&&w.uuid?[null==w?void 0:w.uuid]:null,wfDocuments:P?[{documentType:null==T?void 0:T.type,documentUid:null==T?void 0:T.name,fileStoreId:P}]:null}),c({Licenses:[d]})},defaultValues:N,formId:"modal-action"}),v&&o.createElement(t.Toast,{error:"error"===v.key,label:p,onClose:f}),h&&o.createElement(t.Toast,{error:!0,label:g,isDleteBtn:!0,onClose:y}),z&&o.createElement(Qe,{page:!0})):null},ot=o.memo(e=>{let{width:t=20,height:n=20,style:r}=e;return o.createElement("svg",{style:r,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},o.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))}),rt=o.memo(e=>{let{value:r,Code:l,index:i}=e;const{isLoading:a,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:r},{value:r},l,i),s=n.useMemo(()=>{var e;const t=null!=r&&r.documents?null==r||null===(e=r.documents)||void 0===e?void 0:e.documents:r;return(null==t?void 0:t.filter(e=>(null==e?void 0:e.documentType)===l))||[]},[r,l]);return a?o.createElement(t.Loader,null):o.createElement("div",{className:"custom-doc-container"},null==s?void 0:s.map((e,t)=>{const n=((e,t)=>{var n;const o=(null==e?void 0:e[t])||"",r=(null==o||null===(n=o.split(","))||void 0===n?void 0:n.filter(Boolean))||[];return(null==r?void 0:r.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==r?void 0:r[0])||""})(null==u?void 0:u.pdfFiles,(null==e?void 0:e.fileStoreId)||(null==e?void 0:e.documentUid));return n?o.createElement("a",{key:t,target:"_blank",rel:"noopener noreferrer",href:n,className:"custom-doc-link"},o.createElement(ot,null),o.createElement("span",null,(null==e?void 0:e.fileName)||"Document")):null}))});function lt(e){var r,l,i,a,u,c;let{workflowDetails:d,t:m,tenantId:v=Digit.ULBService.getCurrentTenantId(),timeObj:f}=e;const{isLoading:p,data:h}=Digit.Hooks.ads.useADSDocumentSearch({value:(null==d||null===(r=d.data)||void 0===r||null===(l=r.timeline)||void 0===l?void 0:l.flatMap(e=>null==e?void 0:e.wfDocuments))||[]},{value:(null==d||null===(i=d.data)||void 0===i||null===(a=i.timeline)||void 0===a?void 0:a.flatMap(e=>null==e?void 0:e.wfDocuments))||[]},null,0),g=o.useCallback(()=>{if(!p){const e=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")||{},t=function(e,t,n,o){var r,l,i,a,u,s,c,d,m;void 0===n&&(n={}),console.log("pdfFiles",n);const v=(null==e||null===(r=e.data)||void 0===r?void 0:r.timeline)||(null==e?void 0:e.timeline)||[],f=(null==e||null===(l=e.data)||void 0===l?void 0:l.processInstances)||(null==e?void 0:e.processInstances)||[],p=(null==f||null===(i=f[0])||void 0===i?void 0:i.businessId)||"N/A",h=(null==f||null===(a=f[0])||void 0===a?void 0:a.businessService)||"N/A",g=(null==f||null===(u=f[0])||void 0===u?void 0:u.moduleName)||"N/A",y=(e,t)=>{var n;const o=(null==e?void 0:e[t])||"",r=(null==o||null===(n=o.split(","))||void 0===n?void 0:n.filter(Boolean))||[];return(null==r?void 0:r.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==r?void 0:r[0])||""},E=v.map((e,t)=>{var r,l,i,a,u,s;const c=(null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.created)||"N/A",d=(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.timing)||"N/A",m=(null==e||null===(i=e.assigner)||void 0===i?void 0:i.name)||"N/A",v=(null==e||null===(a=e.assigner)||void 0===a?void 0:a.type)||"N/A",f=(null==e||null===(u=e.assigner)||void 0===u?void 0:u.mobileNumber)||"N/A",p=(null==e?void 0:e.performedAction)||"N/A",h=(null==e?void 0:e.status)||(null==e?void 0:e.state)||"N/A",g=(null==e||null===(s=e.wfComment)||void 0===s?void 0:s[0])||"-",E=(null==e?void 0:e.wfDocuments)||[],b=(null==e?void 0:e.sla)||"N/A",_=Array.isArray(null==e?void 0:e.assignes)?e.assignes.map(e=>null==e?void 0:e.name).filter(Boolean).join(", "):"";return{sNo:t+1,action:o?o(p):p,status:o?o(h):h,assignerName:m,assignerType:v,mobileNumber:f,designation:v,date:c,time:d,dateTime:(c+" "+("N/A"!==d?d:"")).trim(),comment:g,documents:E.map(e=>({name:(null==e?void 0:e.fileName)||(null==e?void 0:e.documentType)||"Document",type:(null==e?void 0:e.documentType)||"Document",fileStoreId:null==e?void 0:e.fileStoreId,link:y(n,null==e?void 0:e.fileStoreId)})),hasDocuments:E.length>0,sla:b,assignedTo:_}});return{t:o,tenantId:(null==t?void 0:t.code)||"",tenantName:(null==t?void 0:t.name)||(null==t?void 0:t.i18nKey)||"Government Department",name:o?o("TIMELINE_PDF_TITLE"):"Application Timeline",heading:o?o("TIMELINE_PDF_HEADING"):"File Movement Report",businessId:p,businessService:o?o("CS_COMMON_"+(null==h?void 0:h.toUpperCase())):h,moduleName:g,currentStatus:o?o((null==v||null===(s=v[0])||void 0===s?void 0:s.status)||(null==v||null===(c=v[0])||void 0===c?void 0:c.state)||"N/A"):(null==v||null===(d=v[0])||void 0===d?void 0:d.status)||(null==v||null===(m=v[0])||void 0===m?void 0:m.state)||"N/A",generatedDate:(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"}),generatedDateTime:(new Date).toLocaleString("en-IN",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}),timelineRows:E,totalSteps:E.length}}(d,e,(null==h?void 0:h.pdfFiles)||{},m);Digit.Utils.pdf.generateTimelinePDF(t)}},[d,h,m,p]),y=e=>{if(null==e||!e.created||null==e||!e.timing)return null;const[t,n,o]=e.created.split("/");return new Date(o+"-"+n+"-"+t+" "+e.timing)},E=(e,t)=>{if(!e||!t)return null;const n=Math.floor((e-t)/6e4),o=Math.floor(n/60),r=Math.floor(o/24);return r>0?r+" day(s)":o>0?o+" hour(s)":n+" minute(s)"},b=n.useMemo(()=>(e=>{const t=(null==e?void 0:e.data)||e,n=null==t?void 0:t.timeline;if(!Array.isArray(n))return[];const o=[...n].reverse();return o.map((e,t)=>{var n;const r=y(e.auditDetails),l=t>0?y(null===(n=o[t-1])||void 0===n?void 0:n.auditDetails):null;return s({},e,{status:(null==e?void 0:e.state)||(null==e?void 0:e.status),assigner:(null==e?void 0:e.assigner)||null,assignes:Array.isArray(null==e?void 0:e.assignes)?e.assignes:[],wfComment:Array.isArray(null==e?void 0:e.wfComment)?e.wfComment:null!=e&&e.comment?[e.comment]:[],wfDocuments:Array.isArray(null==e?void 0:e.wfDocuments)?e.wfDocuments:[],actionDateTime:r,sla:E(r,l)})}).reverse()})(d),[d]),_=(null==b?void 0:b.filter(e=>!("SAVE_AS_DRAFT"===(null==e?void 0:e.performedAction))))||[],N=_.map(e=>{var t;return null==e||null===(t=e.assigner)||void 0===t?void 0:t.userName}).filter(Boolean),S=[...new Set(N)].join(","),D=Digit.Hooks.useEmployeeSearch(v,{codes:S,isActive:!0},{enabled:!!S}),C={};return null==D||null===(u=D.data)||void 0===u||null===(c=u.Employees)||void 0===c||c.forEach(e=>{var t;const n=null==e||null===(t=e.assignments)||void 0===t?void 0:t[0];C[null==e?void 0:e.code]="COMMON_MASTERS_DESIGNATION_"+(null==n?void 0:n.designation)}),p?o.createElement(t.Loader,null):o.createElement(o.Fragment,null,o.createElement("div",{className:"custom-timeline-container"},f&&o.createElement("div",{style:{marginBottom:"8px",fontStyle:"italic"}},m("TOTAL_TIME_TAKEN"),": ",null==f?void 0:f.days," ",m("DAYS")," ",null==f?void 0:f.hours," ",m("HOURS")," ",null==f?void 0:f.minutes," ",m("MINUTES")," ",null==f?void 0:f.seconds," ",m("SECONDS")),o.createElement("div",{className:"custom-timeline-header"},o.createElement("div",{className:"custom-tracking-status-header"},o.createElement("div",{className:"custom-tracking-line"}),o.createElement("span",{className:"custom-tracking-status-text"},m("TRACKING STATUS")),o.createElement("div",{className:"custom-tracking-line"})),o.createElement("div",{className:"custom-title-bar-row"},o.createElement("h2",{className:"custom-timeline-title"},m("Application History")),o.createElement("span",{onClick:g,className:"download-button"},m("CS_COMMON_DOWNLOAD")),o.createElement("div",{className:"custom-blue-bar"}))),o.createElement("div",{className:"custom-timeline-entries"},null==_?void 0:_.map((e,t)=>{var n,r,l,i,a,u,s,c,d,v,f,p,h,g,y,E;return o.createElement("div",{key:t,className:"custom-timeline-entry"},o.createElement("div",{className:"custom-vertical-line"}),o.createElement("div",{className:"custom-date-badge"},null==e||null===(n=e.auditDetails)||void 0===n?void 0:n.created," ",null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.timing),o.createElement("div",{className:"custom-entry-content"},o.createElement("div",{className:"custom-icon-container"},o.createElement("div",{className:"custom-circular-icon"},o.createElement("svg",{className:"custom-mail-icon",viewBox:"0 0 24 24"},o.createElement("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),o.createElement("path",{d:"M3 7l9 6 9-6"})))),o.createElement("div",{className:"custom-content-card"},o.createElement("div",{className:"custom-card-top"},o.createElement("div",{className:"custom-card-column"},o.createElement("h3",{className:"custom-action-title"},m("Action taken by")),(null==e?void 0:e.assigner)&&o.createElement("div",{className:"custom-officer-info"},o.createElement("div",{className:"custom-officer-name"},(null==e||null===(l=e.assigner)||void 0===l?void 0:l.name)||m("CS_COMMON_NA"),C[null==e||null===(i=e.assigner)||void 0===i?void 0:i.userName]&&o.createElement("span",{className:"custom-officer-name"},"- ",m(C[null==e||null===(a=e.assigner)||void 0===a?void 0:a.userName]))),(null==e||null===(u=e.assigner)||void 0===u?void 0:u.emailId)&&o.createElement("div",{className:"custom-officer-email"},o.createElement("span",{className:"custom-email-label"},m("Email"))," ",null==e||null===(s=e.assigner)||void 0===s?void 0:s.emailId))),o.createElement("div",{className:"custom-card-column custom-card-column-mid"},(null==e?void 0:e.sla)&&o.createElement(o.Fragment,null,o.createElement("h3",{className:"custom-action-title"},m("Time Taken")),o.createElement("div",{className:"custom-officer-email"},o.createElement("span",{className:"custom-email-label"},null==e?void 0:e.sla)))),o.createElement("div",{className:"custom-card-column custom-card-column-right"},o.createElement("h3",{className:"custom-action-title"},m("Action")),o.createElement("div",{className:"custom-status-text"},m((null==e?void 0:e.performedAction)||"CS_COMMON_NA")))),(null==e?void 0:e.wfComment)&&(null==e||null===(c=e.wfComment)||void 0===c?void 0:c.length)>0&&(null==e||null===(d=e.wfComment)||void 0===d?void 0:d.some(e=>null==e?void 0:e.trim()))&&o.createElement("div",{className:"custom-comments-section container-full-width"},o.createElement("div",{className:"custom-comments-content"},o.createElement("h4",{className:"custom-comments-title"},m("Officer Comments")),o.createElement("div",{className:"custom-comment-text"},null==e||null===(v=e.wfComment)||void 0===v?void 0:v.map((e,t)=>{const n="string"==typeof e?null==e?void 0:e.split(/\[#\?.*?\*\*\]/)[0]:e;return o.createElement("p",{key:t},n)}))),(null==e||null===(f=e.assignes)||void 0===f?void 0:f.length)>0&&o.createElement("div",{className:"custom-assigned-to-footer"},o.createElement("h3",{className:"custom-comments-title"},m("Assigned To")),o.createElement("div",{className:"custom-officer-info"},o.createElement("div",{className:"custom-officer-name"},null===(p=e.assignes[0])||void 0===p?void 0:p.name,C[null===(h=e.assignes[0])||void 0===h?void 0:h.userName]&&o.createElement("span",{className:"custom-officer-email"},"- ",m(C[null===(g=e.assignes[0])||void 0===g?void 0:g.userName])))))),(null==e?void 0:e.wfDocuments)&&(null==e||null===(y=e.wfDocuments)||void 0===y?void 0:y.length)>0&&o.createElement("div",{className:"custom-comments-section-no-border"},o.createElement("h4",{className:"custom-comments-title"},"Document Attached:"),o.createElement("div",{className:"custom-comment-text"},null==e||null===(E=e.wfDocuments)||void 0===E?void 0:E.map((t,n)=>o.createElement(rt,{key:(null==t?void 0:t.documentType)+"-"+n,value:null==e?void 0:e.wfDocuments,Code:null==t?void 0:t.documentType,index:n})))))))}))))}const it=function(e,t,n,o,r,l,i){try{var a,u,s,c,d,m,v,f,p,h,g,y,E,b,_;const N=(null==e||null===(a=e.Applications)||void 0===a?void 0:a[0])||{},S=(null==N||null===(u=N.owners)||void 0===u?void 0:u[0])||{},D=(null==N||null===(s=N.NdcDetails)||void 0===s?void 0:s[0])||{},C=(null==D?void 0:D.additionalDetails)||{},w=null!=N&&null!==(c=N.auditDetails)&&void 0!==c&&c.lastModifiedTime?new Date(null===(d=N.auditDetails)||void 0===d?void 0:d.lastModifiedTime).toLocaleDateString("en-GB"):"N/A",A=null==i||null===(m=i.officer)||void 0===m?void 0:m.designation,T=A?"COMMON_MASTERS_DESIGNATION_"+A:null,O=T?o(T,{defaultValue:A}):"NA",P=(null==N?void 0:N.applicationNo)||"NA",I=null==N||null===(v=N.NdcDetails)||void 0===v?void 0:v.find(e=>"PT"===e.businessService),x=null==I?void 0:I.consumerCode;console.log("ptObj",I);const R=null!=C&&C.propertyType?o(C.propertyType):"NA",L=(null==S?void 0:S.name)||"NA",F=(null==N||null===(f=N.NdcDetails)||void 0===f||null===(p=f[0])||void 0===p||null===(h=p.additionalDetails)||void 0===h?void 0:h.propertyAddress)||(null==S?void 0:S.permanentAddress)||(null==S?void 0:S.correspondenceAddress)||"NA",M=(null==N||null===(g=N.NdcDetails)||void 0===g||null===(y=g[0])||void 0===y||null===(E=y.additionalDetails)||void 0===E?void 0:E.remarks)||null,k=(null==n?void 0:n.name)||(null==N?void 0:N.tenantId)||"NA",B=((null==e?void 0:e.propertyOwnerNames)||[]).join(", ")||"NA";console.log(N,"APPDATA"),function(e){if(void 0===e&&(e=""),!e)return"NA";const t=e.split(".");if(t.length<2)return e;const n=t[1].toLowerCase();var o;({testing:"Testing",amritsar:"Amritsar",punjab:"Punjab",chandigarh:"Chandigarh",ludhiana:"Ludhiana"})[n]||(null==(o=n)||o.charAt(0).toUpperCase(),null==o||o.slice(1))}(null==N?void 0:N.tenantId),console.log(n,"TENANT INFO IN ACKNOWLEDGEMENT");const U=[{text:"NDC No: ",bold:!1,fontSize:9},{text:""+(null==N?void 0:N.applicationNo),bold:!0,fontSize:9},{text:", Property ID: ",bold:!1,fontSize:9},{text:""+x,bold:!0,fontSize:9},{text:", Property Type: ",bold:!1,fontSize:9},{text:R+"\n",bold:!0,fontSize:9},{text:"Property Address: ",bold:!1,fontSize:9},{text:""+t,bold:!0,fontSize:9},{text:" Owned by: ",bold:!1,fontSize:9},{text:B+"\n",bold:!0,fontSize:9},{text:"Applicant Name: ",bold:!1,fontSize:9},{text:""+L,bold:!0,fontSize:9},{text:" (s/o, d/o) ",bold:!1,fontSize:9},{text:""+((null==N||null===(b=N.owners)||void 0===b||null===(_=b[0])||void 0===_?void 0:_.fatherOrHusbandName)||"NA"),bold:!0,fontSize:9},{text:" resident of ",bold:!1,fontSize:9},{text:F+".\n",bold:!0,fontSize:9},{text:[{text:"• This is to certify that, as per the records and data with "+k+", all applicable municipal dues related to the above mentioned property have been duly recovered/deposited. ",bold:!0,fontSize:9},{text:o("NDC_CERTIFY_NOTE_ONE_PB")+" "+k+" "+o("NDC_CERTIFY_NOTE_TWO_PB")+"\n",bold:!1,fontSize:9}]},{text:[{text:"• This No Dues Certificate is valid for one month from the date of issuance.",bold:!0,fontSize:9},{text:o("NDC_VALIDITY_NOTE_PB")+"\n",bold:!1,fontSize:9}]},{text:[{text:"• This is only a No Dues Certificate for municipal dues as on date and it does not regulate the compliance of building regulations, change of land use, any fire safety regulations or any other compliance under any act/rules. ",bold:!0,fontSize:9},{text:o("NDC_BUILDING_NOTE_PB")+"\n",bold:!1,fontSize:9}]},{text:[{text:"• This No Dues Certificate does not bar any competent authority to take action under their prevailing act/rules. ",bold:!0,fontSize:9},{text:o("NDC_AUTHORITY_NOTE_PB")+"\n",bold:!1,fontSize:9}]},{text:[{text:"• In case any discrepancies in the amount deposited are discovered by the Municipal Corporation/Council at any stage, it shall be the responsibility of the owner to deposit the differential amount as notified by the Municipal Corporation/Council, which will have the full right to recover the same. ",bold:!0,fontSize:9},{text:o("NDC_DISCREPANCY_NOTE_PB")+"\n",bold:!1,fontSize:9}]},{text:[{text:"• This certificate is only for the purpose of municipal dues and this certificate is not a proof of ownership. ",bold:!0,fontSize:9},{text:o("NDC_OWNERSHIP_NOTE_PB")+"\n",bold:!1,fontSize:9}]},M&&""!==M.trim()&&{text:[{text:"• Remarks: "+M+"\n",bold:!0,fontSize:9}]}];return Promise.resolve({t:o,approvalDate:w,approver:r,designation:O,ulbType:l,tenantId:null==N?void 0:N.tenantId,name:" No Dues Certificate ",email:null==n?void 0:n.emailId,phoneNumber:null==n?void 0:n.contactNumber,heading:"Local Government, Punjab",applicationNumber:P,details:[{value:U}]})}catch(e){return Promise.reject(e)}},at=[{code:"yes",name:"Yes"},{code:"no",name:"No"}];function ut(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function st(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function ct(e){st(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function dt(e,t){st(2,arguments);var n=ct(e).getTime(),o=ut(t);return new Date(n+o)}function mt(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function vt(e){return st(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function ft(e){if(st(1,arguments),!vt(e)&&"number"!=typeof e)return!1;var t=ct(e);return!isNaN(Number(t))}var pt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function ht(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,o=e.formats[n]||e.formats[e.defaultWidth];return o}}var gt={date:ht({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ht({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ht({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},yt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Et(e){return function(t,n){var o,r=n||{};if("formatting"===(r.context?String(r.context):"standalone")&&e.formattingValues){var l=e.defaultFormattingWidth||e.defaultWidth,i=r.width?String(r.width):l;o=e.formattingValues[i]||e.formattingValues[l]}else{var a=e.defaultWidth,u=r.width?String(r.width):e.defaultWidth;o=e.values[u]||e.values[a]}return o[e.argumentCallback?e.argumentCallback(t):t]}}function bt(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.width,r=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],l=t.match(r);if(!l)return null;var i,a=l[0],u=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(u)?Nt(u,function(e){return e.test(a)}):_t(u,function(e){return e.test(a)});i=e.valueCallback?e.valueCallback(s):s,i=n.valueCallback?n.valueCallback(i):i;var c=t.slice(a.length);return{value:i,rest:c}}}function _t(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function Nt(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}var St,Dt={code:"en-US",formatDistance:function(e,t,n){var o,r=pt[e];return o="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o},formatLong:gt,formatRelative:function(e,t,n,o){return yt[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Et({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Et({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Et({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Et({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Et({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(St={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(St.matchPattern);if(!n)return null;var o=n[0],r=e.match(St.parsePattern);if(!r)return null;var l=St.valueCallback?St.valueCallback(r[0]):r[0];l=t.valueCallback?t.valueCallback(l):l;var i=e.slice(o.length);return{value:l,rest:i}}),era:bt({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:bt({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:bt({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:bt({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:bt({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ct(e,t){st(2,arguments);var n=ut(t);return dt(e,-n)}function wt(e){st(1,arguments);var t=1,n=ct(e),o=n.getUTCDay(),r=(o<t?7:0)+o-t;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function At(e){st(1,arguments);var t=ct(e),n=t.getUTCFullYear(),o=new Date(0);o.setUTCFullYear(n+1,0,4),o.setUTCHours(0,0,0,0);var r=wt(o),l=new Date(0);l.setUTCFullYear(n,0,4),l.setUTCHours(0,0,0,0);var i=wt(l);return t.getTime()>=r.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Tt(e){st(1,arguments);var t=At(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var o=wt(n);return o}function Ot(e,t){st(1,arguments);var n=t||{},o=n.locale,r=o&&o.options&&o.options.weekStartsOn,l=null==r?0:ut(r),i=null==n.weekStartsOn?l:ut(n.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=ct(e),u=a.getUTCDay(),s=(u<i?7:0)+u-i;return a.setUTCDate(a.getUTCDate()-s),a.setUTCHours(0,0,0,0),a}function Pt(e,t){st(1,arguments);var n=ct(e),o=n.getUTCFullYear(),r=t||{},l=r.locale,i=l&&l.options&&l.options.firstWeekContainsDate,a=null==i?1:ut(i),u=null==r.firstWeekContainsDate?a:ut(r.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=new Date(0);s.setUTCFullYear(o+1,0,u),s.setUTCHours(0,0,0,0);var c=Ot(s,t),d=new Date(0);d.setUTCFullYear(o,0,u),d.setUTCHours(0,0,0,0);var m=Ot(d,t);return n.getTime()>=c.getTime()?o+1:n.getTime()>=m.getTime()?o:o-1}function It(e,t){st(1,arguments);var n=t||{},o=n.locale,r=o&&o.options&&o.options.firstWeekContainsDate,l=null==r?1:ut(r),i=null==n.firstWeekContainsDate?l:ut(n.firstWeekContainsDate),a=Pt(e,t),u=new Date(0);u.setUTCFullYear(a,0,i),u.setUTCHours(0,0,0,0);var s=Ot(u,t);return s}function xt(e,t){for(var n=e<0?"-":"",o=Math.abs(e).toString();o.length<t;)o="0"+o;return n+o}var Rt={G:function(e,t,n){var o=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});case"GGGG":default:return n.era(o,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var o=e.getUTCFullYear();return n.ordinalNumber(o>0?o:1-o,{unit:"year"})}return function(e,t){var n=e.getUTCFullYear(),o=n>0?n:1-n;return xt("yy"===t?o%100:o,t.length)}(e,t)},Y:function(e,t,n,o){var r=Pt(e,o),l=r>0?r:1-r;return"YY"===t?xt(l%100,2):"Yo"===t?n.ordinalNumber(l,{unit:"year"}):xt(l,t.length)},R:function(e,t){return xt(At(e),t.length)},u:function(e,t){return xt(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var o=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return xt(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,t,n){var o=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return xt(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,t,n){var o=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):xt(n+1,2)}(e,t);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(e,t,n){var o=e.getUTCMonth();switch(t){case"L":return String(o+1);case"LL":return xt(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(e,t,n,o){var r=function(e,t){st(1,arguments);var n=ct(e),o=Ot(n,t).getTime()-It(n,t).getTime();return Math.round(o/6048e5)+1}(e,o);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):xt(r,t.length)},I:function(e,t,n){var o=function(e){st(1,arguments);var t=ct(e),n=wt(t).getTime()-Tt(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(o,{unit:"week"}):xt(o,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return xt(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,n){var o=function(e){st(1,arguments);var t=ct(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var o=t.getTime(),r=n-o;return Math.floor(r/864e5)+1}(e);return"Do"===t?n.ordinalNumber(o,{unit:"dayOfYear"}):xt(o,t.length)},E:function(e,t,n){var o=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});case"EEEE":default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(e,t,n,o){var r=e.getUTCDay(),l=(r-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return xt(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,o){var r=e.getUTCDay(),l=(r-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return xt(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){var o=e.getUTCDay(),r=0===o?7:o;switch(t){case"i":return String(r);case"ii":return xt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});case"iiii":default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(e,t,n){var o=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){var o,r=e.getUTCHours();switch(o=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){var o,r=e.getUTCHours();switch(o=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var o=e.getUTCHours()%12;return 0===o&&(o=12),n.ordinalNumber(o,{unit:"hour"})}return function(e,t){return xt(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return xt(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,n){var o=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(o,{unit:"hour"}):xt(o,t.length)},k:function(e,t,n){var o=e.getUTCHours();return 0===o&&(o=24),"ko"===t?n.ordinalNumber(o,{unit:"hour"}):xt(o,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return xt(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return xt(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var n=t.length,o=e.getUTCMilliseconds();return xt(Math.floor(o*Math.pow(10,n-3)),t.length)}(e,t)},X:function(e,t,n,o){var r=(o._originalDate||e).getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return Ft(r);case"XXXX":case"XX":return Mt(r);case"XXXXX":case"XXX":default:return Mt(r,":")}},x:function(e,t,n,o){var r=(o._originalDate||e).getTimezoneOffset();switch(t){case"x":return Ft(r);case"xxxx":case"xx":return Mt(r);case"xxxxx":case"xxx":default:return Mt(r,":")}},O:function(e,t,n,o){var r=(o._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Lt(r,":");case"OOOO":default:return"GMT"+Mt(r,":")}},z:function(e,t,n,o){var r=(o._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Lt(r,":");case"zzzz":default:return"GMT"+Mt(r,":")}},t:function(e,t,n,o){return xt(Math.floor((o._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,o){return xt((o._originalDate||e).getTime(),t.length)}};function Lt(e,t){var n=e>0?"-":"+",o=Math.abs(e),r=Math.floor(o/60),l=o%60;if(0===l)return n+String(r);var i=t||"";return n+String(r)+i+xt(l,2)}function Ft(e,t){return e%60==0?(e>0?"-":"+")+xt(Math.abs(e)/60,2):Mt(e,t)}function Mt(e,t){var n=t||"",o=e>0?"-":"+",r=Math.abs(e);return o+xt(Math.floor(r/60),2)+n+xt(r%60,2)}function kt(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Bt(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var Ut={p:Bt,P:function(e,t){var n,o=e.match(/(P+)(p+)?/)||[],r=o[1],l=o[2];if(!l)return kt(e,t);switch(r){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",kt(r,t)).replace("{{time}}",Bt(l,t))}},jt=["D","DD"],Wt=["YY","YYYY"];function zt(e){return-1!==jt.indexOf(e)}function Ht(e){return-1!==Wt.indexOf(e)}function Vt(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var qt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Gt=/^'([^]*?)'?$/,$t=/''/g,Kt=/[a-zA-Z]/;function Xt(e,t,n){st(2,arguments);var o=String(t),r=n||{},l=r.locale||Dt,i=l.options&&l.options.firstWeekContainsDate,a=null==i?1:ut(i),u=null==r.firstWeekContainsDate?a:ut(r.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var s=l.options&&l.options.weekStartsOn,c=null==s?0:ut(s),d=null==r.weekStartsOn?c:ut(r.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!l.localize)throw new RangeError("locale must contain localize property");if(!l.formatLong)throw new RangeError("locale must contain formatLong property");var m=ct(e);if(!ft(m))throw new RangeError("Invalid time value");var v=mt(m),f=Ct(m,v),p={firstWeekContainsDate:u,weekStartsOn:d,locale:l,_originalDate:m},h=o.match(Yt).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,Ut[t])(e,l.formatLong,p):e}).join("").match(qt).map(function(n){if("''"===n)return"'";var o=n[0];if("'"===o)return Zt(n);var i=Rt[o];if(i)return!r.useAdditionalWeekYearTokens&&Ht(n)&&Vt(n,t,e),!r.useAdditionalDayOfYearTokens&&zt(n)&&Vt(n,t,e),i(f,n,l.localize,p);if(o.match(Kt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return n}).join("");return h}function Zt(e){return e.match(Gt)[1].replace($t,"'")}p(function(e,t){(function(){var n="Expected a function",o="__lodash_placeholder__",r=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],l="[object Arguments]",i="[object Array]",a="[object Boolean]",u="[object Date]",s="[object Error]",c="[object Function]",d="[object GeneratorFunction]",m="[object Map]",v="[object Number]",p="[object Object]",h="[object RegExp]",g="[object Set]",y="[object String]",E="[object Symbol]",b="[object WeakMap]",_="[object ArrayBuffer]",N="[object DataView]",S="[object Float32Array]",D="[object Float64Array]",C="[object Int8Array]",w="[object Int16Array]",A="[object Int32Array]",T="[object Uint8Array]",O="[object Uint16Array]",P="[object Uint32Array]",I=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,M=RegExp(L.source),k=RegExp(F.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,q=RegExp(V.source),Y=/^\s+/,G=/\s/,$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,K=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Q=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,oe=/^0b[01]+$/i,re=/^\[object .+?Constructor\]$/,le=/^0o[0-7]+$/i,ie=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\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",me="["+de+"]",ve="["+ce+"]",fe="\\d+",pe="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+fe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",ye="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",be="[\\ud800-\\udbff][\\udc00-\\udfff]",_e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ne="(?:"+pe+"|"+he+")",Se="(?:"+_e+"|"+he+")",De="(?:"+ve+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+De+"(?:\\u200d(?:"+[ye,Ee,be].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*",we="(?:"+["[\\u2700-\\u27bf]",Ee,be].join("|")+")"+Ce,Ae="(?:"+[ye+ve+"?",ve,Ee,be,"[\\ud800-\\udfff]"].join("|")+")",Te=RegExp("['’]","g"),Oe=RegExp(ve,"g"),Pe=RegExp(ge+"(?="+ge+")|"+Ae+Ce,"g"),Ie=RegExp([_e+"?"+pe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[me,_e,"$"].join("|")+")",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[me,_e+Ne,"$"].join("|")+")",_e+"?"+Ne+"+(?:['’](?:d|ll|m|re|s|t|ve))?",_e+"+(?:['’](?: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_])",fe,we].join("|"),"g"),xe=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Le=["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"],Fe=-1,Me={};Me[S]=Me[D]=Me[C]=Me[w]=Me[A]=Me[T]=Me["[object Uint8ClampedArray]"]=Me[O]=Me[P]=!0,Me[l]=Me[i]=Me[_]=Me[a]=Me[N]=Me[u]=Me[s]=Me[c]=Me[m]=Me[v]=Me[p]=Me[h]=Me[g]=Me[y]=Me[b]=!1;var ke={};ke[l]=ke[i]=ke[_]=ke[N]=ke[a]=ke[u]=ke[S]=ke[D]=ke[C]=ke[w]=ke[A]=ke[m]=ke[v]=ke[p]=ke[h]=ke[g]=ke[y]=ke[E]=ke[T]=ke["[object Uint8ClampedArray]"]=ke[O]=ke[P]=!0,ke[s]=ke[c]=ke[b]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,je=parseInt,We="object"==typeof f&&f&&f.Object===Object&&f,ze="object"==typeof self&&self&&self.Object===Object&&self,He=We||ze||Function("return this")(),Ve=t&&!t.nodeType&&t,qe=Ve&&e&&!e.nodeType&&e,Ye=qe&&qe.exports===Ve,Ge=Ye&&We.process,$e=function(){try{return qe&&qe.require&&qe.require("util").types||Ge&&Ge.binding&&Ge.binding("util")}catch(e){}}(),Ke=$e&&$e.isArrayBuffer,Xe=$e&&$e.isDate,Ze=$e&&$e.isMap,Qe=$e&&$e.isRegExp,Je=$e&&$e.isSet,et=$e&&$e.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,o){for(var r=-1,l=null==e?0:e.length;++r<l;){var i=e[r];t(o,i,n(i),e)}return o}function ot(e,t){for(var n=-1,o=null==e?0:e.length;++n<o&&!1!==t(e[n],n,e););return e}function rt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function lt(e,t){for(var n=-1,o=null==e?0:e.length;++n<o;)if(!t(e[n],n,e))return!1;return!0}function it(e,t){for(var n=-1,o=null==e?0:e.length,r=0,l=[];++n<o;){var i=e[n];t(i,n,e)&&(l[r++]=i)}return l}function at(e,t){return!(null==e||!e.length)&>(e,t,0)>-1}function ut(e,t,n){for(var o=-1,r=null==e?0:e.length;++o<r;)if(n(t,e[o]))return!0;return!1}function st(e,t){for(var n=-1,o=null==e?0:e.length,r=Array(o);++n<o;)r[n]=t(e[n],n,e);return r}function ct(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}function dt(e,t,n,o){var r=-1,l=null==e?0:e.length;for(o&&l&&(n=e[++r]);++r<l;)n=t(n,e[r],r,e);return n}function mt(e,t,n,o){var r=null==e?0:e.length;for(o&&r&&(n=e[--r]);r--;)n=t(n,e[r],r,e);return n}function vt(e,t){for(var n=-1,o=null==e?0:e.length;++n<o;)if(t(e[n],n,e))return!0;return!1}var ft=_t("length");function pt(e,t,n){var o;return n(e,function(e,n,r){if(t(e,n,r))return o=n,!1}),o}function ht(e,t,n,o){for(var r=e.length,l=n+(o?1:-1);o?l--:++l<r;)if(t(e[l],l,e))return l;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var o=n-1,r=e.length;++o<r;)if(e[o]===t)return o;return-1}(e,t,n):ht(e,Et,n)}function yt(e,t,n,o){for(var r=n-1,l=e.length;++r<l;)if(o(e[r],t))return r;return-1}function Et(e){return e!=e}function bt(e,t){var n=null==e?0:e.length;return n?Dt(e,t)/n:NaN}function _t(e){return function(t){return null==t?void 0:t[e]}}function Nt(e){return function(t){return null==e?void 0:e[t]}}function St(e,t,n,o,r){return r(e,function(e,r,l){n=o?(o=!1,e):t(n,e,r,l)}),n}function Dt(e,t){for(var n,o=-1,r=e.length;++o<r;){var l=t(e[o]);void 0!==l&&(n=void 0===n?l:n+l)}return n}function Ct(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}function wt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function At(e){return function(t){return e(t)}}function Tt(e,t){return st(t,function(t){return e[t]})}function Ot(e,t){return e.has(t)}function Pt(e,t){for(var n=-1,o=e.length;++n<o&>(t,e[n],0)>-1;);return n}function It(e,t){for(var n=e.length;n--&>(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length,o=0;n--;)e[n]===t&&++o;return o}var Rt=Nt({"À":"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"}),Lt=Nt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ft(e){return"\\"+Be[e]}function Mt(e){return xe.test(e)}function kt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,o){n[++t]=[o,e]}),n}function Bt(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,r=e.length,l=0,i=[];++n<r;){var a=e[n];a!==t&&a!==o||(e[n]=o,i[l++]=n)}return i}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Wt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function zt(e){return Mt(e)?function(e){for(var t=Pe.lastIndex=0;Pe.test(e);)++t;return t}(e):ft(e)}function Ht(e){return Mt(e)?function(e){return e.match(Pe)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var qt=Nt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var f=(t=null==t?He:Yt.defaults(He.Object(),t,Yt.pick(He,Le))).Array,G=t.Date,ce=t.Error,de=t.Function,me=t.Math,ve=t.Object,fe=t.RegExp,pe=t.String,he=t.TypeError,ge=f.prototype,ye=ve.prototype,Ee=t["__core-js_shared__"],be=de.prototype.toString,_e=ye.hasOwnProperty,Ne=0,Se=function(){var e=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),De=ye.toString,Ce=be.call(ve),we=He._,Ae=fe("^"+be.call(_e).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pe=Ye?t.Buffer:void 0,xe=t.Symbol,Be=t.Uint8Array,We=Pe?Pe.allocUnsafe:void 0,ze=Bt(ve.getPrototypeOf,ve),Ve=ve.create,qe=ye.propertyIsEnumerable,Ge=ge.splice,$e=xe?xe.isConcatSpreadable:void 0,ft=xe?xe.iterator:void 0,Nt=xe?xe.toStringTag:void 0,Gt=function(){try{var e=Qr(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==He.clearTimeout&&t.clearTimeout,Kt=G&&G.now!==He.Date.now&&G.now,Xt=t.setTimeout!==He.setTimeout&&t.setTimeout,Zt=me.ceil,Qt=me.floor,Jt=ve.getOwnPropertySymbols,en=Pe?Pe.isBuffer:void 0,tn=t.isFinite,nn=ge.join,on=Bt(ve.keys,ve),rn=me.max,ln=me.min,an=G.now,un=t.parseInt,sn=me.random,cn=ge.reverse,dn=Qr(t,"DataView"),mn=Qr(t,"Map"),vn=Qr(t,"Promise"),fn=Qr(t,"Set"),pn=Qr(t,"WeakMap"),hn=Qr(ve,"create"),gn=pn&&new pn,yn={},En=Al(dn),bn=Al(mn),_n=Al(vn),Nn=Al(fn),Sn=Al(pn),Dn=xe?xe.prototype:void 0,Cn=Dn?Dn.valueOf:void 0,wn=Dn?Dn.toString:void 0;function An(e){if(Vi(e)&&!Ri(e)&&!(e instanceof In)){if(e instanceof Pn)return e;if(_e.call(e,"__wrapped__"))return Tl(e)}return new Pn(e)}var Tn=function(){function e(){}return function(t){if(!Hi(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function On(){}function Pn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function In(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 o=e[t];this.set(o[0],o[1])}}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ln;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new Rn(e);this.size=t.size}function kn(e,t){var n=Ri(e),o=!n&&xi(e),r=!n&&!o&&ki(e),l=!n&&!o&&!r&&Qi(e),i=n||o||r||l,a=i?Ct(e.length,pe):[],u=a.length;for(var s in e)!t&&!_e.call(e,s)||i&&("length"==s||r&&("offset"==s||"parent"==s)||l&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ll(s,u))||a.push(s);return a}function Bn(e){var t=e.length;return t?e[Fo(0,t-1)]:void 0}function Un(e,t){return Nl(hr(e),$n(t,0,e.length))}function jn(e){return Nl(hr(e))}function Wn(e,t,n){(void 0!==n&&!Oi(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function zn(e,t,n){var o=e[t];_e.call(e,t)&&Oi(o,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function Hn(e,t){for(var n=e.length;n--;)if(Oi(e[n][0],t))return n;return-1}function Vn(e,t,n,o){return Jn(e,function(e,r,l){t(o,e,n(e),l)}),o}function qn(e,t){return e&&gr(t,ba(t),e)}function Yn(e,t,n){"__proto__"==t&&Gt?Gt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Gn(e,t){for(var n=-1,o=t.length,r=f(o),l=null==e;++n<o;)r[n]=l?void 0:pa(e,t[n]);return r}function $n(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,o,r,i){var s,f=1&t,b=2&t,I=4&t;if(n&&(s=r?n(e,o,r,i):n(e)),void 0!==s)return s;if(!Hi(e))return e;var x=Ri(e);if(x){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_e.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!f)return hr(e,s)}else{var R=tl(e),L=R==c||R==d;if(ki(e))return cr(e,f);if(R==p||R==l||L&&!r){if(s=b||L?{}:ol(e),!f)return b?function(e,t){return gr(e,el(e),t)}(e,function(e,t){return e&&gr(t,_a(t),e)}(s,e)):function(e,t){return gr(e,Jr(e),t)}(e,qn(s,e))}else{if(!ke[R])return r?e:{};s=function(e,t,n){var o=e.constructor;switch(t){case _:return dr(e);case a:case u:return new o(+e);case N:return function(e,t){var n=t?dr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case S:case D:case C:case w:case A:case T:case"[object Uint8ClampedArray]":case O:case P:return mr(e,n);case m:return new o;case v:case y:return new o(e);case h:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return new o;case E:return Cn?ve(Cn.call(e)):{}}}(e,R,f)}}i||(i=new Mn);var F=i.get(e);if(F)return F;i.set(e,s),Ki(e)?e.forEach(function(o){s.add(Kn(o,t,n,o,e,i))}):qi(e)&&e.forEach(function(o,r){s.set(r,Kn(o,t,n,r,e,i))});var M=x?void 0:(I?b?qr:Vr:b?_a:ba)(e);return ot(M||e,function(o,r){M&&(o=e[r=o]),zn(s,r,Kn(o,t,n,r,e,i))}),s}function Xn(e,t,n){var o=n.length;if(null==e)return!o;for(e=ve(e);o--;){var r=n[o],l=e[r];if(void 0===l&&!(r in e)||!(0,t[r])(l))return!1}return!0}function Zn(e,t,o){if("function"!=typeof e)throw new he(n);return yl(function(){e.apply(void 0,o)},t)}function Qn(e,t,n,o){var r=-1,l=at,i=!0,a=e.length,u=[],s=t.length;if(!a)return u;n&&(t=st(t,At(n))),o?(l=ut,i=!1):t.length>=200&&(l=Ot,i=!1,t=new Fn(t));e:for(;++r<a;){var c=e[r],d=null==n?c:n(c);if(c=o||0!==c?c:0,i&&d==d){for(var m=s;m--;)if(t[m]===d)continue e;u.push(c)}else l(t,d,o)||u.push(c)}return u}An.templateSettings={escape:B,evaluate:U,interpolate:j,variable:"",imports:{_:An}},(An.prototype=On.prototype).constructor=An,(Pn.prototype=Tn(On.prototype)).constructor=Pn,(In.prototype=Tn(On.prototype)).constructor=In,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 _e.call(t,e)?t[e]:void 0},xn.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:_e.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},Rn.prototype.clear=function(){this.__data__=[],this.size=0},Rn.prototype.delete=function(e){var t=this.__data__,n=Hn(t,e);return!(n<0||(n==t.length-1?t.pop():Ge.call(t,n,1),--this.size,0))},Rn.prototype.get=function(e){var t=this.__data__,n=Hn(t,e);return n<0?void 0:t[n][1]},Rn.prototype.has=function(e){return Hn(this.__data__,e)>-1},Rn.prototype.set=function(e,t){var n=this.__data__,o=Hn(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this},Ln.prototype.clear=function(){this.size=0,this.__data__={hash:new xn,map:new(mn||Rn),string:new xn}},Ln.prototype.delete=function(e){var t=Xr(this,e).delete(e);return this.size-=t?1:0,t},Ln.prototype.get=function(e){return Xr(this,e).get(e)},Ln.prototype.has=function(e){return Xr(this,e).has(e)},Ln.prototype.set=function(e,t){var n=Xr(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new Rn,this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mn.prototype.get=function(e){return this.__data__.get(e)},Mn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Rn){var o=n.__data__;if(!mn||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ln(o)}return n.set(e,t),this.size=n.size,this};var Jn=br(ao),eo=br(uo,!0);function to(e,t){var n=!0;return Jn(e,function(e,o,r){return n=!!t(e,o,r)}),n}function no(e,t,n){for(var o=-1,r=e.length;++o<r;){var l=e[o],i=t(l);if(null!=i&&(void 0===a?i==i&&!Zi(i):n(i,a)))var a=i,u=l}return u}function oo(e,t){var n=[];return Jn(e,function(e,o,r){t(e,o,r)&&n.push(e)}),n}function ro(e,t,n,o,r){var l=-1,i=e.length;for(n||(n=rl),r||(r=[]);++l<i;){var a=e[l];t>0&&n(a)?t>1?ro(a,t-1,n,o,r):ct(r,a):o||(r[r.length]=a)}return r}var lo=_r(),io=_r(!0);function ao(e,t){return e&&lo(e,t,ba)}function uo(e,t){return e&&io(e,t,ba)}function so(e,t){return it(t,function(t){return ji(e[t])})}function co(e,t){for(var n=0,o=(t=ir(t,e)).length;null!=e&&n<o;)e=e[wl(t[n++])];return n&&n==o?e:void 0}function mo(e,t,n){var o=t(e);return Ri(e)?o:ct(o,n(e))}function vo(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Nt&&Nt in ve(e)?function(e){var t=_e.call(e,Nt),n=e[Nt];try{e[Nt]=void 0;var o=!0}catch(e){}var r=De.call(e);return o&&(t?e[Nt]=n:delete e[Nt]),r}(e):function(e){return De.call(e)}(e)}function fo(e,t){return e>t}function po(e,t){return null!=e&&_e.call(e,t)}function ho(e,t){return null!=e&&t in ve(e)}function go(e,t,n){for(var o=n?ut:at,r=e[0].length,l=e.length,i=l,a=f(l),u=Infinity,s=[];i--;){var c=e[i];i&&t&&(c=st(c,At(t))),u=ln(c.length,u),a[i]=!n&&(t||r>=120&&c.length>=120)?new Fn(i&&c):void 0}c=e[0];var d=-1,m=a[0];e:for(;++d<r&&s.length<u;){var v=c[d],p=t?t(v):v;if(v=n||0!==v?v:0,!(m?Ot(m,p):o(s,p,n))){for(i=l;--i;){var h=a[i];if(!(h?Ot(h,p):o(e[i],p,n)))continue e}m&&m.push(p),s.push(v)}}return s}function yo(e,t,n){var o=null==(e=fl(e,t=ir(t,e)))?e:e[wl(Ul(t))];return null==o?void 0:tt(o,e,n)}function Eo(e){return Vi(e)&&vo(e)==l}function bo(e,t,n,o,r){return e===t||(null==e||null==t||!Vi(e)&&!Vi(t)?e!=e&&t!=t:function(e,t,n,o,r,c){var d=Ri(e),f=Ri(t),b=d?i:tl(e),S=f?i:tl(t),D=(b=b==l?p:b)==p,C=(S=S==l?p:S)==p,w=b==S;if(w&&ki(e)){if(!ki(t))return!1;d=!0,D=!1}if(w&&!D)return c||(c=new Mn),d||Qi(e)?zr(e,t,n,o,r,c):function(e,t,n,o,r,l,i){switch(n){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!l(new Be(e),new Be(t)));case a:case u:case v:return Oi(+e,+t);case s:return e.name==t.name&&e.message==t.message;case h:case y:return e==t+"";case m:var c=kt;case g:if(c||(c=jt),e.size!=t.size&&!(1&o))return!1;var d=i.get(e);if(d)return d==t;o|=2,i.set(e,t);var f=zr(c(e),c(t),o,r,l,i);return i.delete(e),f;case E:if(Cn)return Cn.call(e)==Cn.call(t)}return!1}(e,t,b,n,o,r,c);if(!(1&n)){var A=D&&_e.call(e,"__wrapped__"),T=C&&_e.call(t,"__wrapped__");if(A||T){var O=A?e.value():e,P=T?t.value():t;return c||(c=new Mn),r(O,P,n,o,c)}}return!!w&&(c||(c=new Mn),function(e,t,n,o,r,l){var i=1&n,a=Vr(e),u=a.length;if(u!=Vr(t).length&&!i)return!1;for(var s=u;s--;){var c=a[s];if(!(i?c in t:_e.call(t,c)))return!1}var d=l.get(e),m=l.get(t);if(d&&m)return d==t&&m==e;var v=!0;l.set(e,t),l.set(t,e);for(var f=i;++s<u;){var p=e[c=a[s]],h=t[c];if(o)var g=i?o(h,p,c,t,e,l):o(p,h,c,e,t,l);if(!(void 0===g?p===h||r(p,h,n,o,l):g)){v=!1;break}f||(f="constructor"==c)}if(v&&!f){var y=e.constructor,E=t.constructor;y==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof E&&E instanceof E||(v=!1)}return l.delete(e),l.delete(t),v}(e,t,n,o,r,c))}(e,t,n,o,bo,r))}function _o(e,t,n,o){var r=n.length,l=r,i=!o;if(null==e)return!l;for(e=ve(e);r--;){var a=n[r];if(i&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<l;){var u=(a=n[r])[0],s=e[u],c=a[1];if(i&&a[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Mn;if(o)var m=o(s,c,u,e,t,d);if(!(void 0===m?bo(c,s,3,o,d):m))return!1}}return!0}function No(e){return!(!Hi(e)||(t=e,Se&&Se in t))&&(ji(e)?Ae:re).test(Al(e));var t}function So(e){return"function"==typeof e?e:null==e?Ya:"object"==typeof e?Ri(e)?To(e[0],e[1]):Ao(e):tu(e)}function Do(e){if(!cl(e))return on(e);var t=[];for(var n in ve(e))_e.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Co(e,t){return e<t}function wo(e,t){var n=-1,o=Fi(e)?f(e.length):[];return Jn(e,function(e,r,l){o[++n]=t(e,r,l)}),o}function Ao(e){var t=Zr(e);return 1==t.length&&t[0][2]?ml(t[0][0],t[0][1]):function(n){return n===e||_o(n,e,t)}}function To(e,t){return al(e)&&dl(t)?ml(wl(e),t):function(n){var o=pa(n,e);return void 0===o&&o===t?ha(n,e):bo(t,o,3)}}function Oo(e,t,n,o,r){e!==t&&lo(t,function(l,i){if(r||(r=new Mn),Hi(l))!function(e,t,n,o,r,l,i){var a=hl(e,n),u=hl(t,n),s=i.get(u);if(s)Wn(e,n,s);else{var c=l?l(a,u,n+"",e,t,i):void 0,d=void 0===c;if(d){var m=Ri(u),v=!m&&ki(u),f=!m&&!v&&Qi(u);c=u,m||v||f?Ri(a)?c=a:Mi(a)?c=hr(a):v?(d=!1,c=cr(u,!0)):f?(d=!1,c=mr(u,!0)):c=[]:Gi(u)||xi(u)?(c=a,xi(a)?c=ia(a):Hi(a)&&!ji(a)||(c=ol(u))):d=!1}d&&(i.set(u,c),r(c,u,o,l,i),i.delete(u)),Wn(e,n,c)}}(e,t,i,n,Oo,o,r);else{var a=o?o(hl(e,i),l,i+"",e,t,r):void 0;void 0===a&&(a=l),Wn(e,i,a)}},_a)}function Po(e,t){var n=e.length;if(n)return ll(t+=t<0?n:0,n)?e[t]:void 0}function Io(e,t,n){t=t.length?st(t,function(e){return Ri(e)?function(t){return co(t,1===e.length?e[0]:e)}:e}):[Ya];var o=-1;return t=st(t,At(Kr())),function(e,t){var o=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var o=-1,r=e.criteria,l=t.criteria,i=r.length,a=n.length;++o<i;){var u=vr(r[o],l[o]);if(u)return o>=a?u:u*("desc"==n[o]?-1:1)}return e.index-t.index}(e,t,n)});o--;)e[o]=e[o].value;return e}(wo(e,function(e,n,r){return{criteria:st(t,function(t){return t(e)}),index:++o,value:e}}))}function xo(e,t,n){for(var o=-1,r=t.length,l={};++o<r;){var i=t[o],a=co(e,i);n(a,i)&&jo(l,ir(i,e),a)}return l}function Ro(e,t,n,o){var r=o?yt:gt,l=-1,i=t.length,a=e;for(e===t&&(t=hr(t)),n&&(a=st(e,At(n)));++l<i;)for(var u=0,s=t[l],c=n?n(s):s;(u=r(a,c,u,o))>-1;)a!==e&&Ge.call(a,u,1),Ge.call(e,u,1);return e}function Lo(e,t){for(var n=e?t.length:0,o=n-1;n--;){var r=t[n];if(n==o||r!==l){var l=r;ll(r)?Ge.call(e,r,1):Qo(e,r)}}return e}function Fo(e,t){return e+Qt(sn()*(t-e+1))}function Mo(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 ko(e,t){return El(vl(e,t,Ya),e+"")}function Bo(e){return Bn(Oa(e))}function Uo(e,t){var n=Oa(e);return Nl(n,$n(t,0,n.length))}function jo(e,t,n,o){if(!Hi(e))return e;for(var r=-1,l=(t=ir(t,e)).length,i=l-1,a=e;null!=a&&++r<l;){var u=wl(t[r]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(r!=i){var c=a[u];void 0===(s=o?o(c,u,a):void 0)&&(s=Hi(c)?c:ll(t[r+1])?[]:{})}zn(a,u,s),a=a[u]}return e}var Wo=gn?function(e,t){return gn.set(e,t),e}:Ya,zo=Gt?function(e,t){return Gt(e,"toString",{configurable:!0,enumerable:!1,value:Ha(t),writable:!0})}:Ya;function Ho(e){return Nl(Oa(e))}function Vo(e,t,n){var o=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var l=f(r);++o<r;)l[o]=e[o+t];return l}function qo(e,t){var n;return Jn(e,function(e,o,r){return!(n=t(e,o,r))}),!!n}function Yo(e,t,n){var o=0,r=null==e?o:e.length;if("number"==typeof t&&t==t&&r<=2147483647){for(;o<r;){var l=o+r>>>1,i=e[l];null!==i&&!Zi(i)&&(n?i<=t:i<t)?o=l+1:r=l}return r}return Go(e,t,Ya,n)}function Go(e,t,n,o){var r=0,l=null==e?0:e.length;if(0===l)return 0;for(var i=(t=n(t))!=t,a=null===t,u=Zi(t),s=void 0===t;r<l;){var c=Qt((r+l)/2),d=n(e[c]),m=void 0!==d,v=null===d,f=d==d,p=Zi(d);if(i)var h=o||f;else h=s?f&&(o||m):a?f&&m&&(o||!v):u?f&&m&&!v&&(o||!p):!v&&!p&&(o?d<=t:d<t);h?r=c+1:l=c}return ln(l,4294967294)}function $o(e,t){for(var n=-1,o=e.length,r=0,l=[];++n<o;){var i=e[n],a=t?t(i):i;if(!n||!Oi(a,u)){var u=a;l[r++]=0===i?0:i}}return l}function Ko(e){return"number"==typeof e?e:Zi(e)?NaN:+e}function Xo(e){if("string"==typeof e)return e;if(Ri(e))return st(e,Xo)+"";if(Zi(e))return wn?wn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Zo(e,t,n){var o=-1,r=at,l=e.length,i=!0,a=[],u=a;if(n)i=!1,r=ut;else if(l>=200){var s=t?null:Mr(e);if(s)return jt(s);i=!1,r=Ot,u=new Fn}else u=t?[]:a;e:for(;++o<l;){var c=e[o],d=t?t(c):c;if(c=n||0!==c?c:0,i&&d==d){for(var m=u.length;m--;)if(u[m]===d)continue e;t&&u.push(d),a.push(c)}else r(u,d,n)||(u!==a&&u.push(d),a.push(c))}return a}function Qo(e,t){return null==(e=fl(e,t=ir(t,e)))||delete e[wl(Ul(t))]}function Jo(e,t,n,o){return jo(e,t,n(co(e,t)),o)}function er(e,t,n,o){for(var r=e.length,l=o?r:-1;(o?l--:++l<r)&&t(e[l],l,e););return n?Vo(e,o?0:l,o?l+1:r):Vo(e,o?l+1:0,o?r:l)}function tr(e,t){var n=e;return n instanceof In&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function nr(e,t,n){var o=e.length;if(o<2)return o?Zo(e[0]):[];for(var r=-1,l=f(o);++r<o;)for(var i=e[r],a=-1;++a<o;)a!=r&&(l[r]=Qn(l[r]||i,e[a],t,n));return Zo(ro(l,1),t,n)}function or(e,t,n){for(var o=-1,r=e.length,l=t.length,i={};++o<r;)n(i,e[o],o<l?t[o]:void 0);return i}function rr(e){return Mi(e)?e:[]}function lr(e){return"function"==typeof e?e:Ya}function ir(e,t){return Ri(e)?e:al(e,t)?[e]:Cl(aa(e))}var ar=ko;function ur(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:Vo(e,t,n)}var sr=$t||function(e){return He.clearTimeout(e)};function cr(e,t){if(t)return e.slice();var n=e.length,o=We?We(n):new e.constructor(n);return e.copy(o),o}function dr(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function mr(e,t){var n=t?dr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vr(e,t){if(e!==t){var n=void 0!==e,o=null===e,r=e==e,l=Zi(e),i=void 0!==t,a=null===t,u=t==t,s=Zi(t);if(!a&&!s&&!l&&e>t||l&&i&&u&&!a&&!s||o&&i&&u||!n&&u||!r)return 1;if(!o&&!l&&!s&&e<t||s&&n&&r&&!o&&!l||a&&n&&r||!i&&r||!u)return-1}return 0}function fr(e,t,n,o){for(var r=-1,l=e.length,i=n.length,a=-1,u=t.length,s=rn(l-i,0),c=f(u+s),d=!o;++a<u;)c[a]=t[a];for(;++r<i;)(d||r<l)&&(c[n[r]]=e[r]);for(;s--;)c[a++]=e[r++];return c}function pr(e,t,n,o){for(var r=-1,l=e.length,i=-1,a=n.length,u=-1,s=t.length,c=rn(l-a,0),d=f(c+s),m=!o;++r<c;)d[r]=e[r];for(var v=r;++u<s;)d[v+u]=t[u];for(;++i<a;)(m||r<l)&&(d[v+n[i]]=e[r++]);return d}function hr(e,t){var n=-1,o=e.length;for(t||(t=f(o));++n<o;)t[n]=e[n];return t}function gr(e,t,n,o){var r=!n;n||(n={});for(var l=-1,i=t.length;++l<i;){var a=t[l],u=o?o(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),r?Yn(n,a,u):zn(n,a,u)}return n}function yr(e,t){return function(n,o){var r=Ri(n)?nt:Vn,l=t?t():{};return r(n,e,Kr(o,2),l)}}function Er(e){return ko(function(t,n){var o=-1,r=n.length,l=r>1?n[r-1]:void 0,i=r>2?n[2]:void 0;for(l=e.length>3&&"function"==typeof l?(r--,l):void 0,i&&il(n[0],n[1],i)&&(l=r<3?void 0:l,r=1),t=ve(t);++o<r;){var a=n[o];a&&e(t,a,o,l)}return t})}function br(e,t){return function(n,o){if(null==n)return n;if(!Fi(n))return e(n,o);for(var r=n.length,l=t?r:-1,i=ve(n);(t?l--:++l<r)&&!1!==o(i[l],l,i););return n}}function _r(e){return function(t,n,o){for(var r=-1,l=ve(t),i=o(t),a=i.length;a--;){var u=i[e?a:++r];if(!1===n(l[u],u,l))break}return t}}function Nr(e){return function(t){var n=Mt(t=aa(t))?Ht(t):void 0,o=n?n[0]:t.charAt(0),r=n?ur(n,1).join(""):t.slice(1);return o[e]()+r}}function Sr(e){return function(t){return dt(ja(xa(t).replace(Te,"")),e,"")}}function Dr(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=Tn(e.prototype),o=e.apply(n,t);return Hi(o)?o:n}}function Cr(e){return function(t,n,o){var r=ve(t);if(!Fi(t)){var l=Kr(n,3);t=ba(t),n=function(e){return l(r[e],e,r)}}var i=e(t,n,o);return i>-1?r[l?t[i]:i]:void 0}}function wr(e){return Hr(function(t){var o=t.length,r=o,l=Pn.prototype.thru;for(e&&t.reverse();r--;){var i=t[r];if("function"!=typeof i)throw new he(n);if(l&&!a&&"wrapper"==Gr(i))var a=new Pn([],!0)}for(r=a?r:o;++r<o;){var u=Gr(i=t[r]),s="wrapper"==u?Yr(i):void 0;a=s&&ul(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?a[Gr(s[0])].apply(a,s[3]):1==i.length&&ul(i)?a[u]():a.thru(i)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Ri(n))return a.plant(n).value();for(var r=0,l=o?t[r].apply(this,e):n;++r<o;)l=t[r].call(this,l);return l}})}function Ar(e,t,n,o,r,l,i,a,u,s){var c=128&t,d=1&t,m=2&t,v=24&t,p=512&t,h=m?void 0:Dr(e);return function g(){for(var y=arguments.length,E=f(y),b=y;b--;)E[b]=arguments[b];if(v)var _=$r(g),N=xt(E,_);if(o&&(E=fr(E,o,r,v)),l&&(E=pr(E,l,i,v)),y-=N,v&&y<s){var S=Ut(E,_);return Lr(e,t,Ar,g.placeholder,n,E,S,a,u,s-y)}var D=d?n:this,C=m?D[e]:e;return y=E.length,a?E=pl(E,a):p&&y>1&&E.reverse(),c&&u<y&&(E.length=u),this&&this!==He&&this instanceof g&&(C=h||Dr(C)),C.apply(D,E)}}function Tr(e,t){return function(n,o){return function(e,t,n,o){return ao(e,function(e,r,l){t(o,n(e),r,l)}),o}(n,e,t(o),{})}}function Or(e,t){return function(n,o){var r;if(void 0===n&&void 0===o)return t;if(void 0!==n&&(r=n),void 0!==o){if(void 0===r)return o;"string"==typeof n||"string"==typeof o?(n=Xo(n),o=Xo(o)):(n=Ko(n),o=Ko(o)),r=e(n,o)}return r}}function Pr(e){return Hr(function(t){return t=st(t,At(Kr())),ko(function(n){var o=this;return e(t,function(e){return tt(e,o,n)})})})}function Ir(e,t){var n=(t=void 0===t?" ":Xo(t)).length;if(n<2)return n?Mo(t,e):t;var o=Mo(t,Zt(e/zt(t)));return Mt(t)?ur(Ht(o),0,e).join(""):o.slice(0,e)}function xr(e){return function(t,n,o){return o&&"number"!=typeof o&&il(t,n,o)&&(n=o=void 0),t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n,o){for(var r=-1,l=rn(Zt((t-e)/(n||1)),0),i=f(l);l--;)i[o?l:++r]=e,e+=n;return i}(t,n,o=void 0===o?t<n?1:-1:na(o),e)}}function Rr(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=la(t),n=la(n)),e(t,n)}}function Lr(e,t,n,o,r,l,i,a,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,r,c?l:void 0,c?i:void 0,c?void 0:l,c?void 0:i,a,u,s],m=n.apply(void 0,d);return ul(e)&&gl(m,d),m.placeholder=o,bl(m,e,t)}function Fr(e){var t=me[e];return function(e,n){if(e=la(e),(n=null==n?0:ln(oa(n),292))&&tn(e)){var o=(aa(e)+"e").split("e");return+((o=(aa(t(o[0]+"e"+(+o[1]+n)))+"e").split("e"))[0]+"e"+(+o[1]-n))}return t(e)}}var Mr=fn&&1/jt(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Za;function kr(e){return function(t){var n=tl(t);return n==m?kt(t):n==g?Wt(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Br(e,t,r,l,i,a,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new he(n);var d=l?l.length:0;if(d||(t&=-97,l=i=void 0),u=void 0===u?u:rn(oa(u),0),s=void 0===s?s:oa(s),d-=i?i.length:0,64&t){var m=l,v=i;l=i=void 0}var p=c?void 0:Yr(e),h=[e,t,r,l,i,m,v,a,u,s];if(p&&function(e,t){var n=e[1],r=t[1],l=n|r;if(!(l<131||128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n))return e;1&r&&(e[2]=t[2],l|=1&n?0:4);var i=t[3];if(i){var a=e[3];e[3]=a?fr(a,i,t[4]):i,e[4]=a?Ut(e[3],o):t[4]}(i=t[5])&&(e[5]=(a=e[5])?pr(a,i,t[6]):i,e[6]=a?Ut(e[5],o):t[6]),(i=t[7])&&(e[7]=i),128&r&&(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]=l}(h,p),e=h[0],t=h[1],r=h[2],l=h[3],i=h[4],!(s=h[9]=void 0===h[9]?c?0:e.length:rn(h[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var o=Dr(e);return function r(){for(var l=arguments.length,i=f(l),a=l,u=$r(r);a--;)i[a]=arguments[a];var s=l<3&&i[0]!==u&&i[l-1]!==u?[]:Ut(i,u);if((l-=s.length)<n)return Lr(e,t,Ar,r.placeholder,void 0,i,s,void 0,void 0,n-l);var c=this&&this!==He&&this instanceof r?o:e;return tt(c,this,i)}}(e,t,s):32!=t&&33!=t||i.length?Ar.apply(void 0,h):function(e,t,n,o){var r=1&t,l=Dr(e);return function t(){for(var i=-1,a=arguments.length,u=-1,s=o.length,c=f(s+a),d=this&&this!==He&&this instanceof t?l:e;++u<s;)c[u]=o[u];for(;a--;)c[u++]=arguments[++i];return tt(d,r?n:this,c)}}(e,t,r,l);else var g=function(e,t,n){var o=1&t,r=Dr(e);return function t(){var l=this&&this!==He&&this instanceof t?r:e;return l.apply(o?n:this,arguments)}}(e,t,r);return bl((p?Wo:gl)(g,h),e,t)}function Ur(e,t,n,o){return void 0===e||Oi(e,ye[n])&&!_e.call(o,n)?t:e}function jr(e,t,n,o,r,l){return Hi(e)&&Hi(t)&&(l.set(t,e),Oo(e,t,void 0,jr,l),l.delete(t)),e}function Wr(e){return Gi(e)?void 0:e}function zr(e,t,n,o,r,l){var i=1&n,a=e.length,u=t.length;if(a!=u&&!(i&&u>a))return!1;var s=l.get(e),c=l.get(t);if(s&&c)return s==t&&c==e;var d=-1,m=!0,v=2&n?new Fn:void 0;for(l.set(e,t),l.set(t,e);++d<a;){var f=e[d],p=t[d];if(o)var h=i?o(p,f,d,t,e,l):o(f,p,d,e,t,l);if(void 0!==h){if(h)continue;m=!1;break}if(v){if(!vt(t,function(e,t){if(!Ot(v,t)&&(f===e||r(f,e,n,o,l)))return v.push(t)})){m=!1;break}}else if(f!==p&&!r(f,p,n,o,l)){m=!1;break}}return l.delete(e),l.delete(t),m}function Hr(e){return El(vl(e,void 0,Ll),e+"")}function Vr(e){return mo(e,ba,Jr)}function qr(e){return mo(e,_a,el)}var Yr=gn?function(e){return gn.get(e)}:Za;function Gr(e){for(var t=e.name+"",n=yn[t],o=_e.call(yn,t)?n.length:0;o--;){var r=n[o],l=r.func;if(null==l||l==e)return r.name}return t}function $r(e){return(_e.call(An,"placeholder")?An:e).placeholder}function Kr(){var e=An.iteratee||Ga;return e=e===Ga?So:e,arguments.length?e(arguments[0],arguments[1]):e}function Xr(e,t){var n,o,r=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Zr(e){for(var t=ba(e),n=t.length;n--;){var o=t[n],r=e[o];t[n]=[o,r,dl(r)]}return t}function Qr(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return No(n)?n:void 0}var Jr=Jt?function(e){return null==e?[]:(e=ve(e),it(Jt(e),function(t){return qe.call(e,t)}))}:ru,el=Jt?function(e){for(var t=[];e;)ct(t,Jr(e)),e=ze(e);return t}:ru,tl=vo;function nl(e,t,n){for(var o=-1,r=(t=ir(t,e)).length,l=!1;++o<r;){var i=wl(t[o]);if(!(l=null!=e&&n(e,i)))break;e=e[i]}return l||++o!=r?l:!!(r=null==e?0:e.length)&&zi(r)&&ll(i,r)&&(Ri(e)||xi(e))}function ol(e){return"function"!=typeof e.constructor||cl(e)?{}:Tn(ze(e))}function rl(e){return Ri(e)||xi(e)||!!($e&&e&&e[$e])}function ll(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ie.test(e))&&e>-1&&e%1==0&&e<t}function il(e,t,n){if(!Hi(n))return!1;var o=typeof t;return!!("number"==o?Fi(n)&&ll(t,n.length):"string"==o&&t in n)&&Oi(n[t],e)}function al(e,t){if(Ri(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Zi(e))||z.test(e)||!W.test(e)||null!=t&&e in ve(t)}function ul(e){var t=Gr(e),n=An[t];if("function"!=typeof n||!(t in In.prototype))return!1;if(e===n)return!0;var o=Yr(n);return!!o&&e===o[0]}(dn&&tl(new dn(new ArrayBuffer(1)))!=N||mn&&tl(new mn)!=m||vn&&"[object Promise]"!=tl(vn.resolve())||fn&&tl(new fn)!=g||pn&&tl(new pn)!=b)&&(tl=function(e){var t=vo(e),n=t==p?e.constructor:void 0,o=n?Al(n):"";if(o)switch(o){case En:return N;case bn:return m;case _n:return"[object Promise]";case Nn:return g;case Sn:return b}return t});var sl=Ee?ji:lu;function cl(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ye)}function dl(e){return e==e&&!Hi(e)}function ml(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in ve(n))}}function vl(e,t,n){return t=rn(void 0===t?e.length-1:t,0),function(){for(var o=arguments,r=-1,l=rn(o.length-t,0),i=f(l);++r<l;)i[r]=o[t+r];r=-1;for(var a=f(t+1);++r<t;)a[r]=o[r];return a[t]=n(i),tt(e,this,a)}}function fl(e,t){return t.length<2?e:co(e,Vo(t,0,-1))}function pl(e,t){for(var n=e.length,o=ln(t.length,n),r=hr(e);o--;){var l=t[o];e[o]=ll(l,n)?r[l]:void 0}return e}function hl(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var gl=_l(Wo),yl=Xt||function(e,t){return He.setTimeout(e,t)},El=_l(zo);function bl(e,t,n){var o=t+"";return El(e,function(e,t){var n=t.length;if(!n)return e;var o=n-1;return t[o]=(n>1?"& ":"")+t[o],t=t.join(n>2?", ":" "),e.replace($,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return ot(r,function(n){var o="_."+n[0];t&n[1]&&!at(e,o)&&e.push(o)}),e.sort()}(function(e){var t=e.match(K);return t?t[1].split(X):[]}(o),n)))}function _l(e){var t=0,n=0;return function(){var o=an(),r=16-(o-n);if(n=o,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Nl(e,t){var n=-1,o=e.length,r=o-1;for(t=void 0===t?o:t;++n<t;){var l=Fo(n,r),i=e[l];e[l]=e[n],e[n]=i}return e.length=t,e}var Sl,Dl,Cl=(Sl=Si(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(H,function(e,n,o,r){t.push(o?r.replace(J,"$1"):n||e)}),t},function(e){return 500===Dl.size&&Dl.clear(),e}),Dl=Sl.cache,Sl);function wl(e){if("string"==typeof e||Zi(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Al(e){if(null!=e){try{return be.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Tl(e){if(e instanceof In)return e.clone();var t=new Pn(e.__wrapped__,e.__chain__);return t.__actions__=hr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ol=ko(function(e,t){return Mi(e)?Qn(e,ro(t,1,Mi,!0)):[]}),Pl=ko(function(e,t){var n=Ul(t);return Mi(n)&&(n=void 0),Mi(e)?Qn(e,ro(t,1,Mi,!0),Kr(n,2)):[]}),Il=ko(function(e,t){var n=Ul(t);return Mi(n)&&(n=void 0),Mi(e)?Qn(e,ro(t,1,Mi,!0),void 0,n):[]});function xl(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=null==n?0:oa(n);return r<0&&(r=rn(o+r,0)),ht(e,Kr(t,3),r)}function Rl(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=o-1;return void 0!==n&&(r=oa(n),r=n<0?rn(o+r,0):ln(r,o-1)),ht(e,Kr(t,3),r,!0)}function Ll(e){return null!=e&&e.length?ro(e,1):[]}function Fl(e){return e&&e.length?e[0]:void 0}var Ml=ko(function(e){var t=st(e,rr);return t.length&&t[0]===e[0]?go(t):[]}),kl=ko(function(e){var t=Ul(e),n=st(e,rr);return t===Ul(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?go(n,Kr(t,2)):[]}),Bl=ko(function(e){var t=Ul(e),n=st(e,rr);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?go(n,void 0,t):[]});function Ul(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var jl=ko(Wl);function Wl(e,t){return e&&e.length&&t&&t.length?Ro(e,t):e}var zl=Hr(function(e,t){var n=null==e?0:e.length,o=Gn(e,t);return Lo(e,st(t,function(e){return ll(e,n)?+e:e}).sort(vr)),o});function Hl(e){return null==e?e:cn.call(e)}var Vl=ko(function(e){return Zo(ro(e,1,Mi,!0))}),ql=ko(function(e){var t=Ul(e);return Mi(t)&&(t=void 0),Zo(ro(e,1,Mi,!0),Kr(t,2))}),Yl=ko(function(e){var t=Ul(e);return t="function"==typeof t?t:void 0,Zo(ro(e,1,Mi,!0),void 0,t)});function Gl(e){if(!e||!e.length)return[];var t=0;return e=it(e,function(e){if(Mi(e))return t=rn(e.length,t),!0}),Ct(t,function(t){return st(e,_t(t))})}function $l(e,t){if(!e||!e.length)return[];var n=Gl(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Kl=ko(function(e,t){return Mi(e)?Qn(e,t):[]}),Xl=ko(function(e){return nr(it(e,Mi))}),Zl=ko(function(e){var t=Ul(e);return Mi(t)&&(t=void 0),nr(it(e,Mi),Kr(t,2))}),Ql=ko(function(e){var t=Ul(e);return t="function"==typeof t?t:void 0,nr(it(e,Mi),void 0,t)}),Jl=ko(Gl),ei=ko(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,$l(e,n)});function ti(e){var t=An(e);return t.__chain__=!0,t}function ni(e,t){return t(e)}var oi=Hr(function(e){var t=e.length,n=t?e[0]:0,o=this.__wrapped__,r=function(t){return Gn(t,e)};return!(t>1||this.__actions__.length)&&o instanceof In&&ll(n)?((o=o.slice(n,+n+(t?1:0))).__actions__.push({func:ni,args:[r],thisArg:void 0}),new Pn(o,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(r)}),ri=yr(function(e,t,n){_e.call(e,n)?++e[n]:Yn(e,n,1)}),li=Cr(xl),ii=Cr(Rl);function ai(e,t){return(Ri(e)?ot:Jn)(e,Kr(t,3))}function ui(e,t){return(Ri(e)?rt:eo)(e,Kr(t,3))}var si=yr(function(e,t,n){_e.call(e,n)?e[n].push(t):Yn(e,n,[t])}),ci=ko(function(e,t,n){var o=-1,r="function"==typeof t,l=Fi(e)?f(e.length):[];return Jn(e,function(e){l[++o]=r?tt(t,e,n):yo(e,t,n)}),l}),di=yr(function(e,t,n){Yn(e,n,t)});function mi(e,t){return(Ri(e)?st:wo)(e,Kr(t,3))}var vi=yr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fi=ko(function(e,t){if(null==e)return[];var n=t.length;return n>1&&il(e,t[0],t[1])?t=[]:n>2&&il(t[0],t[1],t[2])&&(t=[t[0]]),Io(e,ro(t,1),[])}),pi=Kt||function(){return He.Date.now()};function hi(e,t,n){return t=n?void 0:t,Br(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function gi(e,t){var o;if("function"!=typeof t)throw new he(n);return e=oa(e),function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=void 0),o}}var yi=ko(function(e,t,n){var o=1;if(n.length){var r=Ut(n,$r(yi));o|=32}return Br(e,o,t,n,r)}),Ei=ko(function(e,t,n){var o=3;if(n.length){var r=Ut(n,$r(Ei));o|=32}return Br(t,o,e,n,r)});function bi(e,t,o){var r,l,i,a,u,s,c=0,d=!1,m=!1,v=!0;if("function"!=typeof e)throw new he(n);function f(t){var n=r,o=l;return r=l=void 0,c=t,a=e.apply(o,n)}function p(e){return c=e,u=yl(g,t),d?f(e):a}function h(e){var n=e-s;return void 0===s||n>=t||n<0||m&&e-c>=i}function g(){var e=pi();if(h(e))return y(e);u=yl(g,function(e){var n=t-(e-s);return m?ln(n,i-(e-c)):n}(e))}function y(e){return u=void 0,v&&r?f(e):(r=l=void 0,a)}function E(){var e=pi(),n=h(e);if(r=arguments,l=this,s=e,n){if(void 0===u)return p(s);if(m)return sr(u),u=yl(g,t),f(s)}return void 0===u&&(u=yl(g,t)),a}return t=la(t)||0,Hi(o)&&(d=!!o.leading,i=(m="maxWait"in o)?rn(la(o.maxWait)||0,t):i,v="trailing"in o?!!o.trailing:v),E.cancel=function(){void 0!==u&&sr(u),c=0,r=s=l=u=void 0},E.flush=function(){return void 0===u?a:y(pi())},E}var _i=ko(function(e,t){return Zn(e,1,t)}),Ni=ko(function(e,t,n){return Zn(e,la(t)||0,n)});function Si(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new he(n);var o=function(){var n=arguments,r=t?t.apply(this,n):n[0],l=o.cache;if(l.has(r))return l.get(r);var i=e.apply(this,n);return o.cache=l.set(r,i)||l,i};return o.cache=new(Si.Cache||Ln),o}function Di(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)}}Si.Cache=Ln;var Ci=ar(function(e,t){var n=(t=1==t.length&&Ri(t[0])?st(t[0],At(Kr())):st(ro(t,1),At(Kr()))).length;return ko(function(o){for(var r=-1,l=ln(o.length,n);++r<l;)o[r]=t[r].call(this,o[r]);return tt(e,this,o)})}),wi=ko(function(e,t){return Br(e,32,void 0,t,Ut(t,$r(wi)))}),Ai=ko(function(e,t){return Br(e,64,void 0,t,Ut(t,$r(Ai)))}),Ti=Hr(function(e,t){return Br(e,256,void 0,void 0,void 0,t)});function Oi(e,t){return e===t||e!=e&&t!=t}var Pi=Rr(fo),Ii=Rr(function(e,t){return e>=t}),xi=Eo(function(){return arguments}())?Eo:function(e){return Vi(e)&&_e.call(e,"callee")&&!qe.call(e,"callee")},Ri=f.isArray,Li=Ke?At(Ke):function(e){return Vi(e)&&vo(e)==_};function Fi(e){return null!=e&&zi(e.length)&&!ji(e)}function Mi(e){return Vi(e)&&Fi(e)}var ki=en||lu,Bi=Xe?At(Xe):function(e){return Vi(e)&&vo(e)==u};function Ui(e){if(!Vi(e))return!1;var t=vo(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Gi(e)}function ji(e){if(!Hi(e))return!1;var t=vo(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wi(e){return"number"==typeof e&&e==oa(e)}function zi(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Hi(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Vi(e){return null!=e&&"object"==typeof e}var qi=Ze?At(Ze):function(e){return Vi(e)&&tl(e)==m};function Yi(e){return"number"==typeof e||Vi(e)&&vo(e)==v}function Gi(e){if(!Vi(e)||vo(e)!=p)return!1;var t=ze(e);if(null===t)return!0;var n=_e.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&be.call(n)==Ce}var $i=Qe?At(Qe):function(e){return Vi(e)&&vo(e)==h},Ki=Je?At(Je):function(e){return Vi(e)&&tl(e)==g};function Xi(e){return"string"==typeof e||!Ri(e)&&Vi(e)&&vo(e)==y}function Zi(e){return"symbol"==typeof e||Vi(e)&&vo(e)==E}var Qi=et?At(et):function(e){return Vi(e)&&zi(e.length)&&!!Me[vo(e)]},Ji=Rr(Co),ea=Rr(function(e,t){return e<=t});function ta(e){if(!e)return[];if(Fi(e))return Xi(e)?Ht(e):hr(e);if(ft&&e[ft])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[ft]());var t=tl(e);return(t==m?kt:t==g?jt:Oa)(e)}function na(e){return e?(e=la(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function oa(e){var t=na(e),n=t%1;return t==t?n?t-n:t:0}function ra(e){return e?$n(oa(e),0,4294967295):0}function la(e){if("number"==typeof e)return e;if(Zi(e))return NaN;if(Hi(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Hi(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=wt(e);var n=oe.test(e);return n||le.test(e)?je(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ia(e){return gr(e,_a(e))}function aa(e){return null==e?"":Xo(e)}var ua=Er(function(e,t){if(cl(t)||Fi(t))gr(t,ba(t),e);else for(var n in t)_e.call(t,n)&&zn(e,n,t[n])}),sa=Er(function(e,t){gr(t,_a(t),e)}),ca=Er(function(e,t,n,o){gr(t,_a(t),e,o)}),da=Er(function(e,t,n,o){gr(t,ba(t),e,o)}),ma=Hr(Gn),va=ko(function(e,t){e=ve(e);var n=-1,o=t.length,r=o>2?t[2]:void 0;for(r&&il(t[0],t[1],r)&&(o=1);++n<o;)for(var l=t[n],i=_a(l),a=-1,u=i.length;++a<u;){var s=i[a],c=e[s];(void 0===c||Oi(c,ye[s])&&!_e.call(e,s))&&(e[s]=l[s])}return e}),fa=ko(function(e){return e.push(void 0,jr),tt(Sa,void 0,e)});function pa(e,t,n){var o=null==e?void 0:co(e,t);return void 0===o?n:o}function ha(e,t){return null!=e&&nl(e,t,ho)}var ga=Tr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),e[t]=n},Ha(Ya)),ya=Tr(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),_e.call(e,t)?e[t].push(n):e[t]=[n]},Kr),Ea=ko(yo);function ba(e){return Fi(e)?kn(e):Do(e)}function _a(e){return Fi(e)?kn(e,!0):function(e){if(!Hi(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=cl(e),n=[];for(var o in e)("constructor"!=o||!t&&_e.call(e,o))&&n.push(o);return n}(e)}var Na=Er(function(e,t,n){Oo(e,t,n)}),Sa=Er(function(e,t,n,o){Oo(e,t,n,o)}),Da=Hr(function(e,t){var n={};if(null==e)return n;var o=!1;t=st(t,function(t){return t=ir(t,e),o||(o=t.length>1),t}),gr(e,qr(e),n),o&&(n=Kn(n,7,Wr));for(var r=t.length;r--;)Qo(n,t[r]);return n}),Ca=Hr(function(e,t){return null==e?{}:function(e,t){return xo(e,t,function(t,n){return ha(e,n)})}(e,t)});function wa(e,t){if(null==e)return{};var n=st(qr(e),function(e){return[e]});return t=Kr(t),xo(e,n,function(e,n){return t(e,n[0])})}var Aa=kr(ba),Ta=kr(_a);function Oa(e){return null==e?[]:Tt(e,ba(e))}var Pa=Sr(function(e,t,n){return t=t.toLowerCase(),e+(n?Ia(t):t)});function Ia(e){return Ua(aa(e).toLowerCase())}function xa(e){return(e=aa(e))&&e.replace(ae,Rt).replace(Oe,"")}var Ra=Sr(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),La=Sr(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fa=Nr("toLowerCase"),Ma=Sr(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),ka=Sr(function(e,t,n){return e+(n?" ":"")+Ua(t)}),Ba=Sr(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ua=Nr("toUpperCase");function ja(e,t,n){return e=aa(e),void 0===(t=n?void 0:t)?function(e){return Re.test(e)}(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Wa=ko(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ui(e)?e:new ce(e)}}),za=Hr(function(e,t){return ot(t,function(t){t=wl(t),Yn(e,t,yi(e[t],e))}),e});function Ha(e){return function(){return e}}var Va=wr(),qa=wr(!0);function Ya(e){return e}function Ga(e){return So("function"==typeof e?e:Kn(e,1))}var $a=ko(function(e,t){return function(n){return yo(n,e,t)}}),Ka=ko(function(e,t){return function(n){return yo(e,n,t)}});function Xa(e,t,n){var o=ba(t),r=so(t,o);null!=n||Hi(t)&&(r.length||!o.length)||(n=t,t=e,e=this,r=so(t,ba(t)));var l=!(Hi(n)&&"chain"in n&&!n.chain),i=ji(e);return ot(r,function(n){var o=t[n];e[n]=o,i&&(e.prototype[n]=function(){var t=this.__chain__;if(l||t){var n=e(this.__wrapped__),r=n.__actions__=hr(this.__actions__);return r.push({func:o,args:arguments,thisArg:e}),n.__chain__=t,n}return o.apply(e,ct([this.value()],arguments))})}),e}function Za(){}var Qa=Pr(st),Ja=Pr(lt),eu=Pr(vt);function tu(e){return al(e)?_t(wl(e)):function(e){return function(t){return co(t,e)}}(e)}var nu=xr(),ou=xr(!0);function ru(){return[]}function lu(){return!1}var iu,au=Or(function(e,t){return e+t},0),uu=Fr("ceil"),su=Or(function(e,t){return e/t},1),cu=Fr("floor"),du=Or(function(e,t){return e*t},1),mu=Fr("round"),vu=Or(function(e,t){return e-t},0);return An.after=function(e,t){if("function"!=typeof t)throw new he(n);return e=oa(e),function(){if(--e<1)return t.apply(this,arguments)}},An.ary=hi,An.assign=ua,An.assignIn=sa,An.assignInWith=ca,An.assignWith=da,An.at=ma,An.before=gi,An.bind=yi,An.bindAll=za,An.bindKey=Ei,An.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ri(e)?e:[e]},An.chain=ti,An.chunk=function(e,t,n){t=(n?il(e,t,n):void 0===t)?1:rn(oa(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var r=0,l=0,i=f(Zt(o/t));r<o;)i[l++]=Vo(e,r,r+=t);return i},An.compact=function(e){for(var t=-1,n=null==e?0:e.length,o=0,r=[];++t<n;){var l=e[t];l&&(r[o++]=l)}return r},An.concat=function(){var e=arguments.length;if(!e)return[];for(var t=f(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return ct(Ri(n)?hr(n):[n],ro(t,1))},An.cond=function(e){var t=null==e?0:e.length,o=Kr();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new he(n);return[o(e[0]),e[1]]}):[],ko(function(n){for(var o=-1;++o<t;){var r=e[o];if(tt(r[0],this,n))return tt(r[1],this,n)}})},An.conforms=function(e){return function(e){var t=ba(e);return function(n){return Xn(n,e,t)}}(Kn(e,1))},An.constant=Ha,An.countBy=ri,An.create=function(e,t){var n=Tn(e);return null==t?n:qn(n,t)},An.curry=function e(t,n,o){var r=Br(t,8,void 0,void 0,void 0,void 0,void 0,n=o?void 0:n);return r.placeholder=e.placeholder,r},An.curryRight=function e(t,n,o){var r=Br(t,16,void 0,void 0,void 0,void 0,void 0,n=o?void 0:n);return r.placeholder=e.placeholder,r},An.debounce=bi,An.defaults=va,An.defaultsDeep=fa,An.defer=_i,An.delay=Ni,An.difference=Ol,An.differenceBy=Pl,An.differenceWith=Il,An.drop=function(e,t,n){var o=null==e?0:e.length;return o?Vo(e,(t=n||void 0===t?1:oa(t))<0?0:t,o):[]},An.dropRight=function(e,t,n){var o=null==e?0:e.length;return o?Vo(e,0,(t=o-(t=n||void 0===t?1:oa(t)))<0?0:t):[]},An.dropRightWhile=function(e,t){return e&&e.length?er(e,Kr(t,3),!0,!0):[]},An.dropWhile=function(e,t){return e&&e.length?er(e,Kr(t,3),!0):[]},An.fill=function(e,t,n,o){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&il(e,t,n)&&(n=0,o=r),function(e,t,n,o){var r=e.length;for((n=oa(n))<0&&(n=-n>r?0:r+n),(o=void 0===o||o>r?r:oa(o))<0&&(o+=r),o=n>o?0:ra(o);n<o;)e[n++]=t;return e}(e,t,n,o)):[]},An.filter=function(e,t){return(Ri(e)?it:oo)(e,Kr(t,3))},An.flatMap=function(e,t){return ro(mi(e,t),1)},An.flatMapDeep=function(e,t){return ro(mi(e,t),1/0)},An.flatMapDepth=function(e,t,n){return n=void 0===n?1:oa(n),ro(mi(e,t),n)},An.flatten=Ll,An.flattenDeep=function(e){return null!=e&&e.length?ro(e,1/0):[]},An.flattenDepth=function(e,t){return null!=e&&e.length?ro(e,t=void 0===t?1:oa(t)):[]},An.flip=function(e){return Br(e,512)},An.flow=Va,An.flowRight=qa,An.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,o={};++t<n;){var r=e[t];o[r[0]]=r[1]}return o},An.functions=function(e){return null==e?[]:so(e,ba(e))},An.functionsIn=function(e){return null==e?[]:so(e,_a(e))},An.groupBy=si,An.initial=function(e){return null!=e&&e.length?Vo(e,0,-1):[]},An.intersection=Ml,An.intersectionBy=kl,An.intersectionWith=Bl,An.invert=ga,An.invertBy=ya,An.invokeMap=ci,An.iteratee=Ga,An.keyBy=di,An.keys=ba,An.keysIn=_a,An.map=mi,An.mapKeys=function(e,t){var n={};return t=Kr(t,3),ao(e,function(e,o,r){Yn(n,t(e,o,r),e)}),n},An.mapValues=function(e,t){var n={};return t=Kr(t,3),ao(e,function(e,o,r){Yn(n,o,t(e,o,r))}),n},An.matches=function(e){return Ao(Kn(e,1))},An.matchesProperty=function(e,t){return To(e,Kn(t,1))},An.memoize=Si,An.merge=Na,An.mergeWith=Sa,An.method=$a,An.methodOf=Ka,An.mixin=Xa,An.negate=Di,An.nthArg=function(e){return e=oa(e),ko(function(t){return Po(t,e)})},An.omit=Da,An.omitBy=function(e,t){return wa(e,Di(Kr(t)))},An.once=function(e){return gi(2,e)},An.orderBy=function(e,t,n,o){return null==e?[]:(Ri(t)||(t=null==t?[]:[t]),Ri(n=o?void 0:n)||(n=null==n?[]:[n]),Io(e,t,n))},An.over=Qa,An.overArgs=Ci,An.overEvery=Ja,An.overSome=eu,An.partial=wi,An.partialRight=Ai,An.partition=vi,An.pick=Ca,An.pickBy=wa,An.property=tu,An.propertyOf=function(e){return function(t){return null==e?void 0:co(e,t)}},An.pull=jl,An.pullAll=Wl,An.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ro(e,t,Kr(n,2)):e},An.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ro(e,t,void 0,n):e},An.pullAt=zl,An.range=nu,An.rangeRight=ou,An.rearg=Ti,An.reject=function(e,t){return(Ri(e)?it:oo)(e,Di(Kr(t,3)))},An.remove=function(e,t){var n=[];if(!e||!e.length)return n;var o=-1,r=[],l=e.length;for(t=Kr(t,3);++o<l;){var i=e[o];t(i,o,e)&&(n.push(i),r.push(o))}return Lo(e,r),n},An.rest=function(e,t){if("function"!=typeof e)throw new he(n);return ko(e,t=void 0===t?t:oa(t))},An.reverse=Hl,An.sampleSize=function(e,t,n){return t=(n?il(e,t,n):void 0===t)?1:oa(t),(Ri(e)?Un:Uo)(e,t)},An.set=function(e,t,n){return null==e?e:jo(e,t,n)},An.setWith=function(e,t,n,o){return o="function"==typeof o?o:void 0,null==e?e:jo(e,t,n,o)},An.shuffle=function(e){return(Ri(e)?jn:Ho)(e)},An.slice=function(e,t,n){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&il(e,t,n)?(t=0,n=o):(t=null==t?0:oa(t),n=void 0===n?o:oa(n)),Vo(e,t,n)):[]},An.sortBy=fi,An.sortedUniq=function(e){return e&&e.length?$o(e):[]},An.sortedUniqBy=function(e,t){return e&&e.length?$o(e,Kr(t,2)):[]},An.split=function(e,t,n){return n&&"number"!=typeof n&&il(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=aa(e))&&("string"==typeof t||null!=t&&!$i(t))&&!(t=Xo(t))&&Mt(e)?ur(Ht(e),0,n):e.split(t,n):[]},An.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:rn(oa(t),0),ko(function(n){var o=n[t],r=ur(n,0,t);return o&&ct(r,o),tt(e,this,r)})},An.tail=function(e){var t=null==e?0:e.length;return t?Vo(e,1,t):[]},An.take=function(e,t,n){return e&&e.length?Vo(e,0,(t=n||void 0===t?1:oa(t))<0?0:t):[]},An.takeRight=function(e,t,n){var o=null==e?0:e.length;return o?Vo(e,(t=o-(t=n||void 0===t?1:oa(t)))<0?0:t,o):[]},An.takeRightWhile=function(e,t){return e&&e.length?er(e,Kr(t,3),!1,!0):[]},An.takeWhile=function(e,t){return e&&e.length?er(e,Kr(t,3)):[]},An.tap=function(e,t){return t(e),e},An.throttle=function(e,t,o){var r=!0,l=!0;if("function"!=typeof e)throw new he(n);return Hi(o)&&(r="leading"in o?!!o.leading:r,l="trailing"in o?!!o.trailing:l),bi(e,t,{leading:r,maxWait:t,trailing:l})},An.thru=ni,An.toArray=ta,An.toPairs=Aa,An.toPairsIn=Ta,An.toPath=function(e){return Ri(e)?st(e,wl):Zi(e)?[e]:hr(Cl(aa(e)))},An.toPlainObject=ia,An.transform=function(e,t,n){var o=Ri(e),r=o||ki(e)||Qi(e);if(t=Kr(t,4),null==n){var l=e&&e.constructor;n=r?o?new l:[]:Hi(e)&&ji(l)?Tn(ze(e)):{}}return(r?ot:ao)(e,function(e,o,r){return t(n,e,o,r)}),n},An.unary=function(e){return hi(e,1)},An.union=Vl,An.unionBy=ql,An.unionWith=Yl,An.uniq=function(e){return e&&e.length?Zo(e):[]},An.uniqBy=function(e,t){return e&&e.length?Zo(e,Kr(t,2)):[]},An.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zo(e,void 0,t):[]},An.unset=function(e,t){return null==e||Qo(e,t)},An.unzip=Gl,An.unzipWith=$l,An.update=function(e,t,n){return null==e?e:Jo(e,t,lr(n))},An.updateWith=function(e,t,n,o){return o="function"==typeof o?o:void 0,null==e?e:Jo(e,t,lr(n),o)},An.values=Oa,An.valuesIn=function(e){return null==e?[]:Tt(e,_a(e))},An.without=Kl,An.words=ja,An.wrap=function(e,t){return wi(lr(t),e)},An.xor=Xl,An.xorBy=Zl,An.xorWith=Ql,An.zip=Jl,An.zipObject=function(e,t){return or(e||[],t||[],zn)},An.zipObjectDeep=function(e,t){return or(e||[],t||[],jo)},An.zipWith=ei,An.entries=Aa,An.entriesIn=Ta,An.extend=sa,An.extendWith=ca,Xa(An,An),An.add=au,An.attempt=Wa,An.camelCase=Pa,An.capitalize=Ia,An.ceil=uu,An.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=la(n))==n?n:0),void 0!==t&&(t=(t=la(t))==t?t:0),$n(la(e),t,n)},An.clone=function(e){return Kn(e,4)},An.cloneDeep=function(e){return Kn(e,5)},An.cloneDeepWith=function(e,t){return Kn(e,5,t="function"==typeof t?t:void 0)},An.cloneWith=function(e,t){return Kn(e,4,t="function"==typeof t?t:void 0)},An.conformsTo=function(e,t){return null==t||Xn(e,t,ba(t))},An.deburr=xa,An.defaultTo=function(e,t){return null==e||e!=e?t:e},An.divide=su,An.endsWith=function(e,t,n){e=aa(e),t=Xo(t);var o=e.length,r=n=void 0===n?o:$n(oa(n),0,o);return(n-=t.length)>=0&&e.slice(n,r)==t},An.eq=Oi,An.escape=function(e){return(e=aa(e))&&k.test(e)?e.replace(F,Lt):e},An.escapeRegExp=function(e){return(e=aa(e))&&q.test(e)?e.replace(V,"\\$&"):e},An.every=function(e,t,n){var o=Ri(e)?lt:to;return n&&il(e,t,n)&&(t=void 0),o(e,Kr(t,3))},An.find=li,An.findIndex=xl,An.findKey=function(e,t){return pt(e,Kr(t,3),ao)},An.findLast=ii,An.findLastIndex=Rl,An.findLastKey=function(e,t){return pt(e,Kr(t,3),uo)},An.floor=cu,An.forEach=ai,An.forEachRight=ui,An.forIn=function(e,t){return null==e?e:lo(e,Kr(t,3),_a)},An.forInRight=function(e,t){return null==e?e:io(e,Kr(t,3),_a)},An.forOwn=function(e,t){return e&&ao(e,Kr(t,3))},An.forOwnRight=function(e,t){return e&&uo(e,Kr(t,3))},An.get=pa,An.gt=Pi,An.gte=Ii,An.has=function(e,t){return null!=e&&nl(e,t,po)},An.hasIn=ha,An.head=Fl,An.identity=Ya,An.includes=function(e,t,n,o){e=Fi(e)?e:Oa(e),n=n&&!o?oa(n):0;var r=e.length;return n<0&&(n=rn(r+n,0)),Xi(e)?n<=r&&e.indexOf(t,n)>-1:!!r&>(e,t,n)>-1},An.indexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=null==n?0:oa(n);return r<0&&(r=rn(o+r,0)),gt(e,t,r)},An.inRange=function(e,t,n){return t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n){return e>=ln(t,n)&&e<rn(t,n)}(e=la(e),t,n)},An.invoke=Ea,An.isArguments=xi,An.isArray=Ri,An.isArrayBuffer=Li,An.isArrayLike=Fi,An.isArrayLikeObject=Mi,An.isBoolean=function(e){return!0===e||!1===e||Vi(e)&&vo(e)==a},An.isBuffer=ki,An.isDate=Bi,An.isElement=function(e){return Vi(e)&&1===e.nodeType&&!Gi(e)},An.isEmpty=function(e){if(null==e)return!0;if(Fi(e)&&(Ri(e)||"string"==typeof e||"function"==typeof e.splice||ki(e)||Qi(e)||xi(e)))return!e.length;var t=tl(e);if(t==m||t==g)return!e.size;if(cl(e))return!Do(e).length;for(var n in e)if(_e.call(e,n))return!1;return!0},An.isEqual=function(e,t){return bo(e,t)},An.isEqualWith=function(e,t,n){var o=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===o?bo(e,t,void 0,n):!!o},An.isError=Ui,An.isFinite=function(e){return"number"==typeof e&&tn(e)},An.isFunction=ji,An.isInteger=Wi,An.isLength=zi,An.isMap=qi,An.isMatch=function(e,t){return e===t||_o(e,t,Zr(t))},An.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,_o(e,t,Zr(t),n)},An.isNaN=function(e){return Yi(e)&&e!=+e},An.isNative=function(e){if(sl(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return No(e)},An.isNil=function(e){return null==e},An.isNull=function(e){return null===e},An.isNumber=Yi,An.isObject=Hi,An.isObjectLike=Vi,An.isPlainObject=Gi,An.isRegExp=$i,An.isSafeInteger=function(e){return Wi(e)&&e>=-9007199254740991&&e<=9007199254740991},An.isSet=Ki,An.isString=Xi,An.isSymbol=Zi,An.isTypedArray=Qi,An.isUndefined=function(e){return void 0===e},An.isWeakMap=function(e){return Vi(e)&&tl(e)==b},An.isWeakSet=function(e){return Vi(e)&&"[object WeakSet]"==vo(e)},An.join=function(e,t){return null==e?"":nn.call(e,t)},An.kebabCase=Ra,An.last=Ul,An.lastIndexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=o;return void 0!==n&&(r=(r=oa(n))<0?rn(o+r,0):ln(r,o-1)),t==t?function(e,t,n){for(var o=n+1;o--;)if(e[o]===t)return o;return o}(e,t,r):ht(e,Et,r,!0)},An.lowerCase=La,An.lowerFirst=Fa,An.lt=Ji,An.lte=ea,An.max=function(e){return e&&e.length?no(e,Ya,fo):void 0},An.maxBy=function(e,t){return e&&e.length?no(e,Kr(t,2),fo):void 0},An.mean=function(e){return bt(e,Ya)},An.meanBy=function(e,t){return bt(e,Kr(t,2))},An.min=function(e){return e&&e.length?no(e,Ya,Co):void 0},An.minBy=function(e,t){return e&&e.length?no(e,Kr(t,2),Co):void 0},An.stubArray=ru,An.stubFalse=lu,An.stubObject=function(){return{}},An.stubString=function(){return""},An.stubTrue=function(){return!0},An.multiply=du,An.nth=function(e,t){return e&&e.length?Po(e,oa(t)):void 0},An.noConflict=function(){return He._===this&&(He._=we),this},An.noop=Za,An.now=pi,An.pad=function(e,t,n){e=aa(e);var o=(t=oa(t))?zt(e):0;if(!t||o>=t)return e;var r=(t-o)/2;return Ir(Qt(r),n)+e+Ir(Zt(r),n)},An.padEnd=function(e,t,n){e=aa(e);var o=(t=oa(t))?zt(e):0;return t&&o<t?e+Ir(t-o,n):e},An.padStart=function(e,t,n){e=aa(e);var o=(t=oa(t))?zt(e):0;return t&&o<t?Ir(t-o,n)+e:e},An.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(aa(e).replace(Y,""),t||0)},An.random=function(e,t,n){if(n&&"boolean"!=typeof n&&il(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=na(e),void 0===t?(t=e,e=0):t=na(t)),e>t){var o=e;e=t,t=o}if(n||e%1||t%1){var r=sn();return ln(e+r*(t-e+Ue("1e-"+((r+"").length-1))),t)}return Fo(e,t)},An.reduce=function(e,t,n){var o=Ri(e)?dt:St,r=arguments.length<3;return o(e,Kr(t,4),n,r,Jn)},An.reduceRight=function(e,t,n){var o=Ri(e)?mt:St,r=arguments.length<3;return o(e,Kr(t,4),n,r,eo)},An.repeat=function(e,t,n){return t=(n?il(e,t,n):void 0===t)?1:oa(t),Mo(aa(e),t)},An.replace=function(){var e=arguments,t=aa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},An.result=function(e,t,n){var o=-1,r=(t=ir(t,e)).length;for(r||(r=1,e=void 0);++o<r;){var l=null==e?void 0:e[wl(t[o])];void 0===l&&(o=r,l=n),e=ji(l)?l.call(e):l}return e},An.round=mu,An.runInContext=e,An.sample=function(e){return(Ri(e)?Bn:Bo)(e)},An.size=function(e){if(null==e)return 0;if(Fi(e))return Xi(e)?zt(e):e.length;var t=tl(e);return t==m||t==g?e.size:Do(e).length},An.snakeCase=Ma,An.some=function(e,t,n){var o=Ri(e)?vt:qo;return n&&il(e,t,n)&&(t=void 0),o(e,Kr(t,3))},An.sortedIndex=function(e,t){return Yo(e,t)},An.sortedIndexBy=function(e,t,n){return Go(e,t,Kr(n,2))},An.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var o=Yo(e,t);if(o<n&&Oi(e[o],t))return o}return-1},An.sortedLastIndex=function(e,t){return Yo(e,t,!0)},An.sortedLastIndexBy=function(e,t,n){return Go(e,t,Kr(n,2),!0)},An.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Yo(e,t,!0)-1;if(Oi(e[n],t))return n}return-1},An.startCase=ka,An.startsWith=function(e,t,n){return e=aa(e),n=null==n?0:$n(oa(n),0,e.length),t=Xo(t),e.slice(n,n+t.length)==t},An.subtract=vu,An.sum=function(e){return e&&e.length?Dt(e,Ya):0},An.sumBy=function(e,t){return e&&e.length?Dt(e,Kr(t,2)):0},An.template=function(e,t,n){var o=An.templateSettings;n&&il(e,t,n)&&(t=void 0),e=aa(e),t=ca({},t,o,Ur);var r,l,i=ca({},t.imports,o.imports,Ur),a=ba(i),u=Tt(i,a),s=0,c=t.interpolate||ue,d="__p += '",m=fe((t.escape||ue).source+"|"+c.source+"|"+(c===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(_e.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fe+"]")+"\n";e.replace(m,function(t,n,o,i,a,u){return o||(o=i),d+=e.slice(s,u).replace(se,Ft),n&&(r=!0,d+="' +\n__e("+n+") +\n'"),a&&(l=!0,d+="';\n"+a+";\n__p += '"),o&&(d+="' +\n((__t = ("+o+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var f=_e.call(t,"variable")&&t.variable;if(f){if(Q.test(f))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(l?d.replace(I,""):d).replace(x,"$1").replace(R,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(l?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var p=Wa(function(){return de(a,v+"return "+d).apply(void 0,u)});if(p.source=d,Ui(p))throw p;return p},An.times=function(e,t){if((e=oa(e))<1||e>9007199254740991)return[];var n=4294967295,o=ln(e,4294967295);e-=4294967295;for(var r=Ct(o,t=Kr(t));++n<e;)t(n);return r},An.toFinite=na,An.toInteger=oa,An.toLength=ra,An.toLower=function(e){return aa(e).toLowerCase()},An.toNumber=la,An.toSafeInteger=function(e){return e?$n(oa(e),-9007199254740991,9007199254740991):0===e?e:0},An.toString=aa,An.toUpper=function(e){return aa(e).toUpperCase()},An.trim=function(e,t,n){if((e=aa(e))&&(n||void 0===t))return wt(e);if(!e||!(t=Xo(t)))return e;var o=Ht(e),r=Ht(t);return ur(o,Pt(o,r),It(o,r)+1).join("")},An.trimEnd=function(e,t,n){if((e=aa(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xo(t)))return e;var o=Ht(e);return ur(o,0,It(o,Ht(t))+1).join("")},An.trimStart=function(e,t,n){if((e=aa(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Xo(t)))return e;var o=Ht(e);return ur(o,Pt(o,Ht(t))).join("")},An.truncate=function(e,t){var n=30,o="...";if(Hi(t)){var r="separator"in t?t.separator:r;n="length"in t?oa(t.length):n,o="omission"in t?Xo(t.omission):o}var l=(e=aa(e)).length;if(Mt(e)){var i=Ht(e);l=i.length}if(n>=l)return e;var a=n-zt(o);if(a<1)return o;var u=i?ur(i,0,a).join(""):e.slice(0,a);if(void 0===r)return u+o;if(i&&(a+=u.length-a),$i(r)){if(e.slice(a).search(r)){var s,c=u;for(r.global||(r=fe(r.source,aa(te.exec(r))+"g")),r.lastIndex=0;s=r.exec(c);)var d=s.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Xo(r),a)!=a){var m=u.lastIndexOf(r);m>-1&&(u=u.slice(0,m))}return u+o},An.unescape=function(e){return(e=aa(e))&&M.test(e)?e.replace(L,qt):e},An.uniqueId=function(e){var t=++Ne;return aa(e)+t},An.upperCase=Ba,An.upperFirst=Ua,An.each=ai,An.eachRight=ui,An.first=Fl,Xa(An,(iu={},ao(An,function(e,t){_e.call(An.prototype,t)||(iu[t]=e)}),iu),{chain:!1}),An.VERSION="4.17.21",ot(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){An[e].placeholder=An}),ot(["drop","take"],function(e,t){In.prototype[e]=function(n){n=void 0===n?1:rn(oa(n),0);var o=this.__filtered__&&!t?new In(this):this.clone();return o.__filtered__?o.__takeCount__=ln(n,o.__takeCount__):o.__views__.push({size:ln(n,4294967295),type:e+(o.__dir__<0?"Right":"")}),o},In.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),ot(["filter","map","takeWhile"],function(e,t){var n=t+1,o=1==n||3==n;In.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Kr(e,3),type:n}),t.__filtered__=t.__filtered__||o,t}}),ot(["head","last"],function(e,t){var n="take"+(t?"Right":"");In.prototype[e]=function(){return this[n](1).value()[0]}}),ot(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");In.prototype[e]=function(){return this.__filtered__?new In(this):this[n](1)}}),In.prototype.compact=function(){return this.filter(Ya)},In.prototype.find=function(e){return this.filter(e).head()},In.prototype.findLast=function(e){return this.reverse().find(e)},In.prototype.invokeMap=ko(function(e,t){return"function"==typeof e?new In(this):this.map(function(n){return yo(n,e,t)})}),In.prototype.reject=function(e){return this.filter(Di(Kr(e)))},In.prototype.slice=function(e,t){e=oa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new In(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=oa(t))<0?n.dropRight(-t):n.take(t-e)),n)},In.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},In.prototype.toArray=function(){return this.take(4294967295)},ao(In.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),r=An[o?"take"+("last"==t?"Right":""):t],l=o||/^find/.test(t);r&&(An.prototype[t]=function(){var t=this.__wrapped__,i=o?[1]:arguments,a=t instanceof In,u=i[0],s=a||Ri(t),c=function(e){var t=r.apply(An,ct([e],i));return o&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(a=s=!1);var d=this.__chain__,m=!!this.__actions__.length,v=l&&!d,f=a&&!m;if(!l&&s){t=f?t:new In(this);var p=e.apply(t,i);return p.__actions__.push({func:ni,args:[c],thisArg:void 0}),new Pn(p,d)}return v&&f?e.apply(this,i):(p=this.thru(c),v?o?p.value()[0]:p.value():p)})}),ot(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);An.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var r=this.value();return t.apply(Ri(r)?r:[],e)}return this[n](function(n){return t.apply(Ri(n)?n:[],e)})}}),ao(In.prototype,function(e,t){var n=An[t];if(n){var o=n.name+"";_e.call(yn,o)||(yn[o]=[]),yn[o].push({name:t,func:n})}}),yn[Ar(void 0,2).name]=[{name:"wrapper",func:void 0}],In.prototype.clone=function(){var e=new In(this.__wrapped__);return e.__actions__=hr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=hr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=hr(this.__views__),e},In.prototype.reverse=function(){if(this.__filtered__){var e=new In(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},In.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ri(e),o=t<0,r=n?e.length:0,l=function(e,t,n){for(var o=-1,r=n.length;++o<r;){var l=n[o],i=l.size;switch(l.type){case"drop":e+=i;break;case"dropRight":t-=i;break;case"take":t=ln(t,e+i);break;case"takeRight":e=rn(e,t-i)}}return{start:e,end:t}}(0,r,this.__views__),i=l.start,a=l.end,u=a-i,s=o?a:i-1,c=this.__iteratees__,d=c.length,m=0,v=ln(u,this.__takeCount__);if(!n||!o&&r==u&&v==u)return tr(e,this.__actions__);var f=[];e:for(;u--&&m<v;){for(var p=-1,h=e[s+=t];++p<d;){var g=c[p],y=g.type,E=(0,g.iteratee)(h);if(2==y)h=E;else if(!E){if(1==y)continue e;break e}}f[m++]=h}return f},An.prototype.at=oi,An.prototype.chain=function(){return ti(this)},An.prototype.commit=function(){return new Pn(this.value(),this.__chain__)},An.prototype.next=function(){void 0===this.__values__&&(this.__values__=ta(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},An.prototype.plant=function(e){for(var t,n=this;n instanceof On;){var o=Tl(n);o.__index__=0,o.__values__=void 0,t?r.__wrapped__=o:t=o;var r=o;n=n.__wrapped__}return r.__wrapped__=e,t},An.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof In){var t=e;return this.__actions__.length&&(t=new In(this)),(t=t.reverse()).__actions__.push({func:ni,args:[Hl],thisArg:void 0}),new Pn(t,this.__chain__)}return this.thru(Hl)},An.prototype.toJSON=An.prototype.valueOf=An.prototype.value=function(){return tr(this.__wrapped__,this.__actions__)},An.prototype.first=An.prototype.head,ft&&(An.prototype[ft]=function(){return this}),An}();qe?((qe.exports=Yt)._=Yt,Ve._=Yt):He._=Yt}).call(f)});const Qt=e=>{let{registerRef:r,searchFieldComponents:i}=e;const{t:a}=l.useTranslation(),u=window.Digit.Utils.browser.isMobile();return console.log("searchFieldComponents",i),u?o.createElement(n.Fragment,null,o.createElement(t.SearchField,null,o.createElement("label",null,a("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")),o.createElement(t.TextInput,{name:"applicationNo",inputRef:r({})})),o.createElement(t.SearchField,null,o.createElement("label",null,a("CORE_COMMON_PHONE_NUMBER")),o.createElement(t.TextInput,{name:"mobileNumber",inputRef:r({})}))):o.createElement(o.Fragment,null,o.createElement("div",{className:"search-container ndc-search-container-custom"},o.createElement("div",{className:"search-complaint-container"},o.createElement("div",{className:"complaint-input-container ndc-complaint-input-container"},o.createElement(t.SearchField,null,o.createElement("label",null,a("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")),o.createElement(t.TextInput,{name:"applicationNo",inputRef:r({})})),o.createElement(t.SearchField,null,o.createElement("label",null,a("CORE_COMMON_PHONE_NUMBER")),o.createElement(t.TextInput,{name:"mobileNumber",inputRef:r({})})),o.createElement("div",{className:"search-action-wrapper ndc-search-action-wrapper"},i)))))},Jt=e=>{let{statuses:r,controlFilterForm:i,applicationTypesOfBPA:u,handleFilter:s}=e;const{t:c}=l.useTranslation(),[d,m]=(Digit.ULBService.getStateId(),n.useState({applicationStatus:[]}));n.useEffect(()=>{d&&s(d)},[d]);const v=[{code:"ASSIGNED_TO_ME",name:""+c("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+c("ES_INBOX_ASSIGNED_TO_ALL")}];return null==u||u.forEach(e=>{e.name=c("WF_BPA_"+e.code),e.i18nKey=c("WF_BPA_"+e.code)}),o.createElement(n.Fragment,null,o.createElement(t.FilterFormField,null,o.createElement(a.Controller,{name:"assignee",control:i,render:e=>o.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:v.filter(t=>t.code===e.value)[0],optionsKey:"name",options:v})})),o.createElement(t.FilterFormField,null,o.createElement(a.Controller,{name:"applicationStatus",control:i,defaultValue:[],render:e=>o.createElement(n.Fragment,null,null==r?void 0:r.map((n,r)=>o.createElement(t.CheckBox,{key:n.applicationstatus,label:c(n.applicationstatus)+" - "+n.count,value:n.applicationstatus,checked:e.value.includes(n.applicationstatus),onChange:()=>{return t=n.applicationstatus,console.log(t,"statusCode"),void(e.value.includes(t)?e.onChange(e.value.filter(e=>e!==t)):e.onChange([...e.value,t]));var t},index:r})))})))},en=e=>{var r,i;const{register:u,control:s,setValue:c,getValues:m,reset:v,formState:f}=a.useFormContext(),{t:p}=l.useTranslation(),h=d();return o.createElement(n.Fragment,null,o.createElement(t.SearchField,null,o.createElement("label",null,p("NOC_APP_NO_LABEL")),o.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),o.createElement(t.SearchField,null,o.createElement("label",null,p("NOC_SOURCE_MODULE_NUMBER")),o.createElement(t.TextInput,{name:"sourceRefId",inputRef:u({})})),o.createElement(t.SearchField,null,o.createElement("label",null,p("NOC_TYPE_LABEL")),o.createElement(a.Controller,{control:s,name:"nocType",render:e=>o.createElement(t.Dropdown,{selected:1==(null==h?void 0:h.length)?h[0]:e.value,select:e.onChange,onBlur:e.onBlur,option:h||[],optionKey:"i18nKey",t:p,disable:1==(null==h?void 0:h.length)})})),o.createElement(t.SearchField,null,o.createElement("label",null,p("NOC_APP_MOBILE_NO_SEARCH_PARAM")),o.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:o.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),o.createElement(t.CardLabelError,null,null==f||null===(r=f.errors)||void 0===r||null===(i=r.mobileNumber)||void 0===i?void 0:i.message)),o.createElement(t.SearchField,null,o.createElement("label",null,p("NOC_NUMBER_LABEL")),o.createElement(t.TextInput,{name:"nocNo",inputRef:u({})})),o.createElement(t.SearchField,{className:"submit"},o.createElement(t.SubmitBar,{label:p("ES_COMMON_SEARCH"),submit:!0}),o.createElement("p",{style:{marginTop:"24px"},onClick:()=>{var t,n;c("applicationNo",null),c("sourceRefId",null),c("mobileNumber",null),c("nocType",null==h||null===(t=h[0])||void 0===t?void 0:t.code),c("offset",0),c("limit",10),c("sortBy","commencementDate"),c("sortOrder","DESC"),c("isSubmitSuccessful","false"),v({applicationNo:"",sourceRefId:"",nocType:"",nocNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",isSubmitSuccessful:!1}),c("offset",m("offset")-m("limit")),null==e||e.onSubmit({nocType:null==h||null===(n=h[0])||void 0===n?void 0:n.code,offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},p("ES_COMMON_CLEAR_ALL"))))},tn=["currentlyActiveMobileModal"],nn=["currentlyActiveMobileModal"],on=e=>{var r,i;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:m,data:v,onSubmit:f}=e;const{t:p}=l.useTranslation(),{handleSubmit:h}=a.useFormContext(),[g,y]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),E=()=>{y({type:"remove"})},b=()=>o.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:E},o.createElement(t.CloseSvg,null)),_=n.useCallback(e=>{let{currentlyActiveMobileModal:n}=e;return(e=>{let{currentlyActiveMobileModal:n}=e,r=c(e,tn);const{closeMobilePopupModal:l}=r;switch(n){case"SearchFormComponent":return o.createElement(t.SearchForm,r,o.createElement(b,null),o.createElement("div",{className:"MobilePopupHeadingWrapper"},o.createElement("h2",null,p("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),o.createElement(u,{onSubmit:f,handleSubmit:h,isMobileView:!0,closeMobilePopupModal:l}));default:return o.createElement("span",null)}})(s({currentlyActiveMobileModal:n},c(e,nn)))},[g]);return m?o.createElement(t.Loader,null):o.createElement(o.Fragment,null,o.createElement("div",{className:"searchBox"},o.createElement(t.SearchAction,{text:p("ES_COMMON_SEARCH"),handleActionClick:()=>y({type:"set",payload:"SearchFormComponent"})})),g?o.createElement(t.PopUp,null,o.createElement(_,{onSubmit:e=>{y({type:"remove"}),f(e)},handleSubmit:h,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:E})):null,null!=v&&null!==(r=v[0])&&void 0!==r&&r.display?o.createElement(t.Card,{style:{marginTop:20}},p(null==v||null===(i=v[0])||void 0===i?void 0:i.display).split("\\n").map((e,t)=>o.createElement("p",{key:t,style:{textAlign:"center"}},e))):o.createElement(t.DetailsCard,{data:d,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/employee/noc/search/application-overview/",serviceRequestIdKey:p("NOC_APP_NO_LABEL")}))},rn=e=>{let{columns:r,SearchFormFieldsComponent:i,onSubmit:u,data:s,isLoading:c,Count:d}=e;const{handleSubmit:m,setValue:v,getValues:f}=a.useFormContext();null==f("offset")&&v("offset",0),null==f("limit")&&v("limit",10);const[p,h]=n.useState(Number(f("offset"))/Number(f("limit"))),{t:g}=l.useTranslation(),y=()=>{v("offset",d&&10*Math.ceil(d/10)-f("limit")),m(u)()},E=()=>{v("offset",0),m(u)()},b=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function _(e){v("limit",Number(e.target.value)),m(u)()}function N(){v("offset",Number(f("offset"))+Number(f("limit"))),m(u)()}function S(){v("offset",Number(f("offset"))-Number(f("limit"))),m(u)()}n.useEffect(()=>{null!=f("offset")&&null!=f("limit")&&h(Number(f("offset"))/Number(f("limit")))},[f("offset"),f("limit")]);const D=()=>{return c?o.createElement(t.Loader,null):null!=s&&null!==(e=s[0])&&void 0!==e&&e.display?o.createElement(t.Card,{style:{marginTop:20}},g(null==s||null===(n=s[0])||void 0===n?void 0:n.display).split("\\n").map((e,t)=>o.createElement("p",{key:t,style:{textAlign:"center"}},e))):o.createElement(t.Table,{t:g,data:s,columns:r,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:_,currentPage:p,onNextPage:N,onPrevPage:S,pageSizeLimit:Number(f("limit")),onSort:b,totalRecords:d,disableSort:!1,onLastPage:y,onFirstPage:E,sortParams:[{id:f("sortBy"),desc:"DESC"===f("sortOrder")}]});var e,n};return o.createElement(o.Fragment,null,o.createElement(t.SearchForm,{onSubmit:u,handleSubmit:m},o.createElement(i,{onSubmit:u,handleSubmit:m,isMobileView:!1})),o.createElement(D,null))},ln=e=>{let{onGoNext:i}=e;const{t:u}=l.useTranslation(),[s,c]=(r.useHistory(),n.useState(!1)),[d,m]=(Digit.ULBService.getCurrentTenantId(),n.useState(null)),v=a.useForm({defaultValues:{categoryName:""}}),{register:f,handleSubmit:p,formState:{errors:h}}=v;return n.useEffect(()=>{console.log("errors",h)},[h]),o.createElement("div",{className:"card"},o.createElement(a.FormProvider,v,o.createElement("form",{onSubmit:p(function(e){try{return console.log("data is here==========",e),i(),Promise.resolve()}catch(e){return Promise.reject(e)}})},o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"First Name ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"firstName",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),h.firstName&&o.createElement("p",{className:"requiredField"},h.firstName.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Last Name ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"lastName",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),h.lastName&&o.createElement("p",{className:"requiredField"},h.lastName.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Email ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"email",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),h.email&&o.createElement("p",{className:"requiredField"},h.email.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Address ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"address",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),h.address&&o.createElement("p",{className:"requiredField"},h.address.message)),o.createElement(t.ActionBar,null,o.createElement(t.SubmitBar,{label:"Next",submit:"submit"})))),d&&o.createElement(t.Toast,{error:d.isError,label:u(d.label),onClose:()=>{m(null)},isDleteBtn:"true"}),s&&o.createElement(t.Loader,null))},an=n.forwardRef((e,t)=>o.createElement("button",s({ref:t,disabled:!!e.disabled,className:(e.disabled?"submit-bar-disabled":"submit-bar")+" "+(e.className?e.className:""),type:e.submit?"submit":"button",style:s({},e.style),onClick:e.onSubmit},e.form?{form:e.form}:{}),e.label));an.propTypes={submit:Ze.any,style:Ze.object,label:Ze.string,onSubmit:Ze.func},an.defaultProps={};const un=e=>{let{onBackClick:i}=e;const{t:u}=l.useTranslation(),[s,c]=(r.useHistory(),n.useState(!1)),[d,m]=(Digit.ULBService.getCurrentTenantId(),n.useState(null)),v=a.useForm({defaultValues:{propertyID:"",waterConnectionNumbers:[{value:""}],sewageConnectionNumbers:[{value:""}],propertyType:"",propertyUsageType:"",propertyLocationType:"",numberOfFloors:""}}),{register:f,handleSubmit:p,control:h,formState:{errors:g}}=v,{fields:y,append:E,remove:b}=a.useFieldArray({control:h,name:"waterConnectionNumbers"}),{fields:_,append:N,remove:S}=a.useFieldArray({control:h,name:"sewageConnectionNumbers"});return n.useEffect(()=>{console.log("errors",g)},[g]),o.createElement("div",{className:"card"},o.createElement(a.FormProvider,v,o.createElement("form",{onSubmit:p(function(e){try{return console.log("Submitted Data:",e),Promise.resolve()}catch(e){return Promise.reject(e)}})},o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Property ID ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"propertyID",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.propertyID&&o.createElement("p",{className:"requiredField"},g.propertyID.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Water Connection Number ",o.createElement("span",{className:"requiredField"},"*")),y.map((e,n)=>o.createElement("div",{key:e.id,className:"dynamic-field"},o.createElement(t.TextInput,f("waterConnectionNumbers."+n+".value",{required:"This field is required"})),n>0&&o.createElement("button",{type:"button",onClick:()=>b(n)},"❌"))),o.createElement("button",{type:"button",onClick:()=>E({value:""})},"➕ Add")),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Sewage Connection Number ",o.createElement("span",{className:"requiredField"},"*")),_.map((e,n)=>o.createElement("div",{key:e.id,className:"dynamic-field"},o.createElement(t.TextInput,f("sewageConnectionNumbers."+n+".value",{required:"This field is required"})),n>0&&o.createElement("button",{type:"button",onClick:()=>S(n)},"❌"))),o.createElement("button",{type:"button",onClick:()=>N({value:""})},"➕ Add")),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Property Type ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"address",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.propertyType&&o.createElement("p",{className:"requiredField"},g.propertyType.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Property Usage Type ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"address",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.propertyUsageType&&o.createElement("p",{className:"requiredField"},g.propertyUsageType.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Property Location Type ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"address",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.propertyLocationType&&o.createElement("p",{className:"requiredField"},g.propertyLocationType.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"No of Floors ",o.createElement("span",{className:"requiredField"},"*")),o.createElement(t.TextInput,{name:"numberOfFloors",type:"text",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.numberOfFloors&&o.createElement("p",{className:"requiredField"},g.numberOfFloors.message)),o.createElement("div",null,"Upload Files"),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Copy of Property Registry ",o.createElement("span",{className:"requiredField"},"*")),o.createElement("input",{name:"numberOfFloors",type:"file",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.numberOfFloors&&o.createElement("p",{className:"requiredField"},g.numberOfFloors.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Approved Building Plan ",o.createElement("span",{className:"requiredField"},"*")),o.createElement("input",{name:"numberOfFloors",type:"file",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.numberOfFloors&&o.createElement("p",{className:"requiredField"},g.numberOfFloors.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Last Water Tax Receipt ",o.createElement("span",{className:"requiredField"},"*")),o.createElement("input",{name:"numberOfFloors",type:"file",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.numberOfFloors&&o.createElement("p",{className:"requiredField"},g.numberOfFloors.message)),o.createElement("div",{className:"surveydetailsform-wrapper"},o.createElement("label",null,"Last Property Tax Receipt ",o.createElement("span",{className:"requiredField"},"*")),o.createElement("input",{name:"numberOfFloors",type:"file",inputRef:f({required:"This field is required",maxLength:{value:500,message:"Category length should be less than or equal to 500 characters"}})}),g.numberOfFloors&&o.createElement("p",{className:"requiredField"},g.numberOfFloors.message)),o.createElement(t.ActionBar,null,o.createElement(t.SubmitBar,{label:"Submit",submit:"submit"})),o.createElement("button",{onClick:()=>i()},"Back"))),d&&o.createElement(t.Toast,{error:d.isError,label:u(d.label),onClose:()=>{m(null)},isDleteBtn:"true"}),s&&o.createElement(t.Loader,null))},sn=[{head:"",stepNumber:1,body:[{name:"NDC_COMMON_NDC_REASON",type:"component",component:"SelectNDCReason",key:"NDCReason",withoutLabel:!0},{name:"",type:"component",component:"NDCPropertySearch",key:"cpt",withoutLabel:!0},{name:"NDC_COMMON_PROPERTY_DETAILS",type:"component",component:"PropertyDetailsFormCitizen",key:"PropertyDetails",withoutLabel:!0}]},{head:"",stepNumber:2,body:[{type:"component",component:"SelectNDCDocuments",key:"documents",withoutLabel:!0}]},{head:"Summary",stepNumber:3,body:[{type:"component",component:"NDCSummary",key:"NDCSummary",withoutLabel:!0}]}],cn=[{head:"Application Details",stepLabel:"Application Details",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNDCStepFormOneCitizen",key:"NDCDetails",withoutLabel:!0,texts:{submitBarLabel:"Next"}},{head:"NDC_DOCUMENTS_REQUIRED",stepLabel:"Document Info",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNDCStepFormTwoCitizen",key:"DocummentDetails",withoutLabel:!0,texts:{submitBarLabel:"Next"}},{head:"Summary",stepLabel:"Summary",stepNumber:3,isStepEnabled:!0,type:"component",component:"NDCNewFormSummaryStepThreeCitizen",key:"PTSummary",withoutLabel:!0,texts:{submitBarLabel:"Submit"}}].map(e=>s({},e,{currStepConfig:sn.filter(t=>t.stepNumber===e.stepNumber)})),dn=["status"];function mn(e){let{t:r,document:l,setDocuments:i,setError:a,documents:u,setFormError:s,config:c,formState:d}=e;const m=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==l?void 0:l.code)})[0],[v,f]=(Digit.ULBService.getCurrentTenantId(),n.useState(!1)),[p,h]=n.useState(null),[g,y]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null);return n.useEffect(()=>{null!=m&&m.fileStoreId&&!p&&y(m.fileStoreId)},[m]),n.useEffect(()=>{g?i(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==l?void 0:l.code));return 0===(null==g?void 0:g.length)||null===g?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==g),{documentType:null==l?void 0:l.code,fileStoreId:g,documentUid:g}]}):null===g&&i(e=>e.filter(e=>(null==e?void 0:e.documentType)!==(null==l?void 0:l.code)))},[g]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(p){f(!0);const e=function(){if(p.size>=5242880)a(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),f(!1),d.errors[c.key]||s(c.key,{type:null==l?void 0:l.code});else{const e=ae(function(){return y(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",p,Digit.ULBService.getStateId())).then(function(e){var t,n,o,l;f(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?y(null==e||null===(o=e.data)||void 0===o||null===(l=o.files[0])||void 0===l?void 0:l.fileStoreId):a(r("CS_FILE_UPLOAD_ERROR"))})},function(){f(!1),a(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[p]),o.createElement("div",{className:"ndc-label-field-pair"},o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller"},r(null==l?void 0:l.code)," ",(null==l?void 0:l.required)&&" *"),o.createElement("div",{className:"form-field"},o.createElement(t.UploadFile,{id:"tl-doc",onUpload:function(e){h(e.target.files[0])},onDelete:()=>{y(null)},message:g?"1 "+r("CS_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},accept:"image/*,.pdf"}))),v&&o.createElement(Qe,{page:!0}))}const vn=e=>{let{width:t=20,height:n=20,style:r}=e;return o.createElement("svg",{style:r,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},o.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))};function fn(e){let{value:n={},Code:r,index:i}=e;const{t:a}=l.useTranslation(),{isLoading:u,data:c}=Digit.Hooks.ads.useADSDocumentSearch({value:n},{value:n},r,i);console.log("dataInNDCDocument",c);const d=null!=n&&n.documents?n.documents.documents.filter(e=>e.documentType===r).map(e=>s({},e,{documentType:e.documentType.replace(/\./g,"_")})):n.filter(e=>e.documentType===r).map(e=>s({},e,{documentType:e.documentType.replace(/\./g,"_")}));return u?o.createElement(t.Loader,null):o.createElement("div",{className:"document-container"},o.createElement(o.Fragment,null,o.createElement("div",{className:"document-grid"},(null==c?void 0:c.pdfFiles)&&o.createElement("div",null,null==d?void 0:d.map((e,t)=>{let n=m(c.pdfFiles,null==e?void 0:e.fileStoreId);return o.createElement("a",{className:"document-link",target:"_blank",rel:"noopener noreferrer",href:n,key:t},o.createElement("div",{className:"document-card"},o.createElement("div",{className:"document-icon-wrapper"},o.createElement(vn,{width:80,height:100})),o.createElement("p",{className:"document-name",title:a(null==e?void 0:e.documentType)},(()=>{const t=a(null==e?void 0:e.documentType);return(null==t?void 0:t.length)>7?t.substring(0,7)+"...":t})()),o.createElement("div",{className:"document-action-label"},"View")))})))))}const pn=e=>{var a,u,s,c,d,m,v,f,p,h,g,y,E,b,_,N,S,D,C,w,A,T,O,P,I,x,R,L,F,M,k,B,U,j,W,z,H,V,q,Y,G,$,K,X,Z,Q,J,ee,te,ne,oe,re;let{formData:le,goNext:ie,onGoBack:ae}=e;const{pathname:ue}=r.useLocation(),{t:se}=l.useTranslation(),ce=(r.useHistory(),n.useRef());i.useDispatch(),ue.includes("/property-mutate/");let de=Digit.UserService.getUser(),me=null==le||null===(a=le.DocummentDetails)||void 0===a||null===(u=a.documents)||void 0===u?void 0:u.documents;console.log("formData",le);const ve=(null==le||null===(s=le.apiData)||void 0===s||null===(c=s.Applications)||void 0===c||null===(d=c[0])||void 0===d?void 0:d.applicationNo)||(null==le||null===(m=le.responseData)||void 0===m||null===(v=m[0])||void 0===v?void 0:v.applicationNo),fe=(null==le||null===(f=le.apiData)||void 0===f||null===(p=f.Applications)||void 0===p||null===(h=p[0])||void 0===h?void 0:h.NdcDetails)||(null==le||null===(g=le.responseData)||void 0===g||null===(y=g[0])||void 0===y?void 0:y.NdcDetails),pe=null==fe?void 0:fe.filter(e=>"PT"==(null==e?void 0:e.businessService));console.log("filterType",pe);const he=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),ge=window.location.href.includes("citizen"),[ye,Ee]=n.useState(),[be,_e]=n.useState(!1);Digit.Hooks.useClickOutside(ce,()=>{_e(!1)},be),n.useEffect(()=>{!function(){try{var e,t;const n={CalculationCriteria:[{applicationNumber:ve,tenantId:he,propertyType:null==pe||null===(e=pe[0])||void 0===e||null===(t=e.additionalDetails)||void 0===t?void 0:t.propertyType}]};Promise.resolve(Digit.NDCService.NDCCalculator({tenantId:he,filters:{getCalculationOnly:!0},details:n})).then(function(e){var t;Ee(null==e||null===(t=e.Calculation)||void 0===t?void 0:t[0])})}catch(e){return Promise.reject(e)}}()},[]);const Ne=Digit.Hooks.useWorkflowDetails({tenantId:he,id:ve,moduleCode:"ndc-services"}),Se=null==de||null===(E=de.info)||void 0===E||null===(b=E.roles)||void 0===b?void 0:b.map(e=>e.code);let De=(null==Ne||null===(_=Ne.data)||void 0===_||null===(N=_.actionState)||void 0===N||null===(S=N.nextActions)||void 0===S?void 0:S.filter(e=>(null==Se?void 0:Se.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==Ne||null===(D=Ne.data)||void 0===D||null===(C=D.nextActions)||void 0===C?void 0:C.filter(e=>(null==Se?void 0:Se.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));const Ce={flex:ge?"1 1 18%":"1 1 22%",minWidth:"200px",maxWidth:"250px",backgroundColor:"#fdfdfd",padding:"0.75rem",border:"1px solid #e0e0e0",borderRadius:"6px",boxShadow:"0 1px 3px rgba(0,0,0,0.05)"},we=(e,n)=>o.createElement("div",{className:"bpa-summary-label-field-pair"},o.createElement(t.CardLabel,{className:"bpa-summary-bold-label",style:{width:"auto"}},e),o.createElement("div",null,n||"NA"));return o.createElement("div",{className:"bpa-summary-page"},o.createElement("h2",{className:"bpa-summary-heading"},se("Application Summary")),o.createElement("div",{className:"bpa-summary-section"},we(se("Full Name"),null==le||null===(w=le.NDCDetails)||void 0===w||null===(A=w.PropertyDetails)||void 0===A?void 0:A.firstName),we(se("Mobile Number"),null==le||null===(T=le.NDCDetails)||void 0===T||null===(O=T.PropertyDetails)||void 0===O?void 0:O.mobileNumber),we(se("Email ID"),null==le||null===(P=le.NDCDetails)||void 0===P||null===(I=P.PropertyDetails)||void 0===I?void 0:I.email),we(se("Address"),null==le||null===(x=le.NDCDetails)||void 0===x||null===(R=x.PropertyDetails)||void 0===R?void 0:R.address),"OTHERS"===(null==le||null===(L=le.NDCDetails)||void 0===L||null===(F=L.NDCReason)||void 0===F?void 0:F.i18nKey)?we(se("NDC Reason"),se(null==le||null===(M=le.NDCDetails)||void 0===M||null===(k=M.NDCReason)||void 0===k?void 0:k.reason)):we(se("NDC Reason"),se(null==le||null===(B=le.NDCDetails)||void 0===B||null===(U=B.NDCReason)||void 0===U?void 0:U.i18nKey)),we(se("Remarks"),null==le||null===(j=le.NDCDetails)||void 0===j||null===(W=j.PropertyDetails)||void 0===W?void 0:W.remarks),we(se("Water Connection"),(null==le||null===(z=le.NDCDetails)||void 0===z||null===(H=z.PropertyDetails)||void 0===H||null===(V=H.waterConnection)||void 0===V?void 0:V.length)>0?null==le||null===(q=le.NDCDetails)||void 0===q||null===(Y=q.PropertyDetails)||void 0===Y||null===(G=Y.waterConnection)||void 0===G?void 0:G.map((e,t)=>o.createElement("div",{key:t},null==e?void 0:e.connectionNo)):"NA"),we(se("Sewerage Connection"),(null==le||null===($=le.NDCDetails)||void 0===$||null===(K=$.PropertyDetails)||void 0===K||null===(X=K.sewerageConnection)||void 0===X?void 0:X.length)>0?null==le||null===(Z=le.NDCDetails)||void 0===Z||null===(Q=Z.PropertyDetails)||void 0===Q||null===(J=Q.sewerageConnection)||void 0===J?void 0:J.map((e,t)=>o.createElement("div",{key:t},null==e?void 0:e.connectionNo)):"NA"),we(se("Property ID"),null==le||null===(ee=le.NDCDetails)||void 0===ee||null===(te=ee.cpt)||void 0===te?void 0:te.id),we(se("Application Fees"),null!=ye&&ye.totalAmount?new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"}).format(null==ye?void 0:ye.totalAmount):"NA")),o.createElement("h2",{className:"bpa-summary-heading"},se("Documents Uploaded")),o.createElement("div",{className:"bpa-summary-section"},(null==me?void 0:me.length)>0?o.createElement("div",{className:"ndc-doc-view-comp"},null==me?void 0:me.map((e,t)=>o.createElement("div",{key:t,style:Ce},o.createElement(fn,{value:me,Code:null==e?void 0:e.documentType,index:t,formData:le})))):o.createElement("div",null,se("TL_NO_DOCUMENTS_MSG"))),o.createElement(t.ActionBar,null,o.createElement(t.SubmitBar,{className:"submit-bar-back",label:"Back",onSubmit:ae}),be&&(null!=Ne&&null!==(ne=Ne.data)&&void 0!==ne&&null!==(oe=ne.actionState)&&void 0!==oe&&oe.nextActions||null!=Ne&&null!==(re=Ne.data)&&void 0!==re&&re.nextActions)?o.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NDC",options:De,optionKey:"action",t:se,onSelect:function(e){ie(e)}}):null,o.createElement(t.SubmitBar,{ref:ce,label:se("WF_TAKE_ACTION"),onSubmit:()=>_e(!be)})))},hn=["status"],gn=[{head:"Application Details",stepLabel:"Application Details",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNDCStepFormOneEmployee",key:"NDCDetails",withoutLabel:!0,texts:{submitBarLabel:"Next"}},{head:"NDC_DOCUMENTS_REQUIRED",stepLabel:"Document Info",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNDCStepFormTwoEmployee",key:"DocummentDetails",withoutLabel:!0,texts:{submitBarLabel:"Next"}},{head:"Summary",stepLabel:"Summary",stepNumber:3,isStepEnabled:!0,type:"component",component:"NDCNewFormSummaryStepThreeEmployee",key:"PTSummary",withoutLabel:!0}].map(e=>s({},e,{currStepConfig:sn.filter(t=>t.stepNumber===e.stepNumber)})),yn=["status"],En=["status"],bn={step:1,formData:{}},_n=function(e,t){switch(void 0===e&&(e=bn),t.type){case"UPDATE_NDC_FORM":return s({},e,{formData:s({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_NDC_STEP":return s({},e,{step:t.payload});case"RESET_NDC_FORM":return bn;default:return e}},Nn={NDCModule:e=>{let{stateCode:n,userType:l,tenants:i}=e;const{path:a}=r.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:s}=Digit.Services.useStore({stateCode:n,moduleCode:"common-noc",language:u});return Digit.SessionStorage.set("NOC_TENANTS",i),s?o.createElement(t.Loader,null):"citizen"===l?o.createElement(ie,null):o.createElement(oe,{path:a,stateCode:n})},NOCCard:()=>{var e,i;const{t:a}=l.useTranslation(),u=r.useLocation(),c=Digit.ULBService.getCurrentTenantId();if(!Digit.Utils.NOCAccess())return null;const m={filterForm:{moduleName:"noc-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:d(!0)||[]},searchForm:{},tableForm:{limit:10,offset:0}},{isLoading:v,data:{totalCount:f,nearingSlaCount:p}={}}=Digit.Hooks.noc.useInbox({tenantId:c,filters:s({},m),config:{enabled:(null==m||null===(e=m.filterForm)||void 0===e||null===(i=e.businessServiceArray)||void 0===i?void 0:i.length)>0}}),h=()=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},o.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),o.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",fill:"white"}));n.useEffect(()=>{"/digit-ui/employee"===u.pathname&&Digit.SessionStorage.del("NDC.INBOX")},[u.pathname]);const g=n.useMemo(()=>({Icon:o.createElement(h,null),moduleName:a("ACTION_TEST_NOC"),kpis:[{count:v?"":f,label:a("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:v?"-":p,label:a("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:f,label:a("ES_COMMON_INBOX"),link:"/digit-ui/employee/noc/inbox"},{label:a("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]}),[v,f]);return Digit.Utils.NOCAccess()?o.createElement(t.EmployeeModuleCard,g):null},NDCApplicationOverview:()=>{var e,i,u,c,d,m,f,p,h,g,y,E,b,_,N,S,D,C,w,A,T,O,P,I,x,R,L,F,M;const{id:k}=r.useParams(),{t:B}=l.useTranslation(),U=r.useHistory(),j=n.useRef(null),W=window.localStorage.getItem("Employee.tenant-id"),z=null==W?void 0:W.split(".")[0],[H,V]=n.useState(null),[q,Y]=n.useState(null),[G,$]=n.useState(!1),{control:K,setValue:X}=a.useForm(),[Z,Q]=n.useState(null),[J,ee]=n.useState(null),[te,ne]=n.useState({}),[oe,re]=n.useState(!1),[le,ie]=n.useState(!1),[ue,ce]=n.useState({}),[de,me]=n.useState([]),[ve,fe]=n.useState(!1),[pe,he]=n.useState([]),[ge,ye]=n.useState(!1),[Ee,be]=n.useState(null),[_e,Ne]=n.useState(!1),[Se,De]=n.useState(null),[Ce,we]=n.useState(null),{isLoading:Ae,data:Te}=Digit.Hooks.ndc.useSearchEmployeeApplication({applicationNo:k},W),Oe=Digit.Hooks.useWorkflowDetails({tenantId:W,id:k,moduleCode:"ndc-services",role:"EMPLOYEE"});var Pe,Ie;null!=Oe&&null!==(e=Oe.data)&&void 0!==e&&null!==(i=e.actionState)&&void 0!==i&&i.nextActions&&!Oe.isLoading&&(Oe.data.actionState.nextActions=[...null==Oe||null===(u=Oe.data)||void 0===u?void 0:u.nextActions]),Oe&&Oe.data&&!Oe.isLoading&&(Oe.data.initialActionState=(null==Oe||null===(Pe=Oe.data)||void 0===Pe?void 0:Pe.initialActionState)||s({},null==Oe||null===(Ie=Oe.data)||void 0===Ie?void 0:Ie.actionState)||{},Oe.data.actionState=s({},Oe.data));let xe={data:{actionState:{nextActions:[{action:"APPROVE",roles:["NDC_ADMIN"],tenantId:"pb",assigneeRoles:[],isTerminateState:!1},{action:"ASSIGN",roles:["NDC_ADMIN"],tenantId:"pb",assigneeRoles:["NDC_ADMIN"],isTerminateState:!1},{action:"REJECT",roles:["NDC_ADMIN"],tenantId:"pb",assigneeRoles:[],isTerminateState:!0}]}}};n.useEffect(()=>{let e=null;try{return fe(!0),Promise.resolve(Digit.WorkflowService.init(W,"ndc-services")).then(function(t){var n,o,r,l,i,a;e=t,fe(!1),console.log("WorkflowService====",null===(n=e)||void 0===n||null===(o=n.BusinessServices)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.states),me(null===(l=e)||void 0===l||null===(i=l.BusinessServices)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.states)})}catch(e){Promise.reject(e)}},[W]);const Re=v(W,Ce);console.log("approver for ndc",Ce),console.log("officerData",Re);let Le=Digit.UserService.getUser();const Fe=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};Le=null==t?void 0:t.value}const Me=null===(c=Le)||void 0===c||null===(d=c.info)||void 0===d||null===(m=d.roles)||void 0===m?void 0:m.map(e=>e.code),ke=null===(f=Le)||void 0===f||null===(p=f.info)||void 0===p?void 0:p.roles.filter(e=>"CEMP"===e.code);let Be=(null==Oe||null===(h=Oe.data)||void 0===h||null===(g=h.actionState)||void 0===g||null===(y=g.nextActions)||void 0===y?void 0:y.filter(e=>(null==Me?void 0:Me.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==xe||null===(E=xe.data)||void 0===E||null===(b=E.nextActions)||void 0===b?void 0:b.filter(e=>(null==Me?void 0:Me.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(Fe,()=>{ye(!1)},ge);const Ue=()=>{V(null)},je=e=>{const t=new Set;return e.filter(e=>!t.has(e.uuid)&&(t.add(e.uuid),!0))};n.useEffect(()=>{var e;const t=null==Te||null===(e=Te.Applications)||void 0===e?void 0:e[0];if(t){var n,o,r,l,i,a,u,s,c,d;const e={name:null==t||null===(n=t.owners)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.name,mobile:null==t||null===(r=t.owners)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.mobileNumber,email:null==t||null===(i=t.owners)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.emailId,address:null==t||null===(u=t.NdcDetails)||void 0===u||null===(s=u[0])||void 0===s||null===(c=s.additionalDetails)||void 0===c?void 0:c.propertyAddress,applicationNo:null==t?void 0:t.applicationNo},m=je((null==t?void 0:t.Documents)||[]),v=null===(d=je((null==t?void 0:t.NdcDetails)||[]))||void 0===d?void 0:d.map(e=>{var t;return{businessService:"WS"===(null==e?void 0:e.businessService)?"NDC_WATER_SERVICE_CONNECTION":"SW"===(null==e?void 0:e.businessService)?"NDC_SEWERAGE_SERVICE_CONNECTION":"PT"===(null==e?void 0:e.businessService)?"NDC_PROPERTY_TAX":null==e?void 0:e.businessService,consumerCode:(null==e?void 0:e.consumerCode)||"",status:(null==e?void 0:e.status)||"",dueAmount:(null==e?void 0:e.dueAmount)||0,propertyType:(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.propertyType)||"",isDuePending:null==e?void 0:e.isDuePending}});ne({applicantData:e,Documents:m,NdcDetails:v})}},[null==Te?void 0:Te.Applications]),n.useEffect(()=>{Te&&(re(!0),re(!1))},[Te]);const We=function(e){try{var t;const r=null==Te?void 0:Te.Applications[0],l=s({},r,{NdcDetails:r.NdcDetails.map(e=>{var t;const n=le[e.consumerCode];return s({},e,{isDuePending:null!=(t=null!=n?n:e.isDuePending)&&t,dueAmount:!1===n?0:void 0!==(null==ue?void 0:ue[e.consumerCode])?Number(ue[e.consumerCode]):(null==e?void 0:e.dueAmount)||0})}),workflow:{}}),i=null==e||null===(t=e.Licenses)||void 0===t?void 0:t[0];let a;var n,o;if("SENDBACKTOCITIZEN"==i.action&&(a=[null==r||null===(n=r.owners)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.uuid]),l.workflow={action:i.action,assignes:(null==i?void 0:i.assignee)||a,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments},!(null!=i&&i.assignee||"SENDBACKTOCITIZEN"===i.action||"APPROVE"===i.action||"REJECT"===i.action||"SENDBACK"===i.action))return ee("Assignee is Mandatory"),Q(!0),Promise.resolve();if(null==i||!i.comment)return ee("Comment is Mandatory"),Q(!0),Promise.resolve();const u={Applications:[l]},c=ae(function(){return Promise.resolve(Digit.NDCService.NDCUpdate({tenantId:W,details:u})).then(function(e){$("Successfully updated the status"),Y(!1),V(!0),Oe.revalidate(),setTimeout(()=>{U.push("/digit-ui/employee/ndc/inbox"),window.location.reload()},2e3),be(null),Ne(!1)})},function(){ee("Something went wrong"),Q(!0)});return Promise.resolve(c&&c.then?c.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};n.useEffect(()=>{if(Oe){var e,t,n;console.log("workflowDetails here",Oe);const o=null==Oe||null===(e=Oe.data)||void 0===e||null===(t=e.processInstances)||void 0===t?void 0:t.find(e=>"APPROVE"===(null==e?void 0:e.action)),r=(null==o||null===(n=o.assigner)||void 0===n?void 0:n.name)||"NA";we(r)}},[Oe]);const{data:ze}=Digit.Hooks.useStore.getInitData(),{tenants:He}=ze||{};n.useEffect(()=>{if(te){var e,t;const n=null==te||null===(e=te.NdcDetails)||void 0===e?void 0:e.filter(e=>"NDC_PROPERTY_TAX"==(null==e?void 0:e.businessService));De(null==n||null===(t=n[0])||void 0===t?void 0:t.consumerCode)}},[te]);const{isLoading:Ve,data:qe}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:Se},tenantId:W},{filters:{propertyIds:Se},tenantId:W,enabled:!!Se,privacy:Digit.Utils.getPrivacyObject()});let Ye,Ge;var $e,Ke,Xe,Ze,Je,et;return console.log("applicationDetails",null==Te||null===(_=Te.Applications)||void 0===_||null===(N=_[0])||void 0===N?void 0:N.NdcDetails),n.useEffect(()=>{const e=e=>{j.current&&!j.current.contains(e.target)&&V(null)};return H&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[H]),!Ve&&(null==qe||null===(S=qe.Properties)||void 0===S?void 0:S.length)>0&&(Ye=qe.Properties[0].address,Ge=[null===($e=Ye)||void 0===$e?void 0:$e.doorNo,null===(Ke=Ye)||void 0===Ke?void 0:Ke.buildingName,null===(Xe=Ye)||void 0===Xe?void 0:Xe.street,null===(Ze=Ye)||void 0===Ze||null===(Je=Ze.locality)||void 0===Je?void 0:Je.name,null===(et=Ye)||void 0===et?void 0:et.city].filter(Boolean).join(", ")),Ae||oe?o.createElement(Qe,null):o.createElement("div",{className:"employee-main-application-details"},o.createElement("div",{style:{display:"flex",justifyContent:"end",alignItems:"center",padding:"16px"}},ke&&"APPROVED"===(null==Te||null===(D=Te.Applications)||void 0===D||null===(C=D[0])||void 0===C?void 0:C.applicationStatus)&&o.createElement(t.LinkButton,{className:"downLoadButton",label:B("DOWNLOAD_CERTIFICATE"),onClick:function(){try{const e=ae(function(){var e,t,n;function o(){console.log("acknowledgementData",u),setTimeout(()=>{Digit.Utils.pdf.generateNDC(u),fe(!1)},0)}fe(!0);const r=Te,l=((null==qe||null===(e=qe.Properties)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.owners)||[]).map(e=>null==e?void 0:e.name).filter(Boolean);r.propertyOwnerNames=l,console.log("propertyOwnerNames",l);const i=null==He?void 0:He.find(e=>{var t,n;return(null==e?void 0:e.code)===(null==r||null===(t=r.Applications)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.tenantId)});console.log("tenantInfo",i);const a=null==i||null===(n=i.city)||void 0===n?void 0:n.ulbType;let u;const s=function(){if(Re)return Promise.resolve(it(r,Ge,i,B,Ce,a,Re)).then(function(e){u=e})}();return s&&s.then?s.then(o):o()},function(e){console.error("Error generating acknowledgement:",e),fe(!1)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})),o.createElement(t.Card,null,o.createElement(t.CardSubHeader,null,B("NDC_APPLICATION_DETAILS_OVERVIEW")),o.createElement(t.StatusTable,null,(null==te?void 0:te.applicantData)&&(null===(w=Object.entries(null==te?void 0:te.applicantData))||void 0===w?void 0:w.map(e=>{let[n,r]=e;return o.createElement(t.Row,{key:n,label:B(""+(null==n?void 0:n.toUpperCase())),text:Array.isArray(r)?r.map(e=>B("object"==typeof e?(null==e?void 0:e.code)||"N/A":e||"N/A")).join(", "):B("object"==typeof r?(null==r?void 0:r.code)||"N/A":r||"N/A")})})))),o.createElement(t.Card,null,o.createElement(t.CardSubHeader,null,B("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")),null==te||null===(A=te.NdcDetails)||void 0===A?void 0:A.map((e,r)=>{var l,i,u,c,d,m,v,f,p,h,g,y,E,b,_,N,S,D,C,w,A,T,O,P,I,x,R,L,F,M,k,U,j,W,z,H,V,q;const Y="NDC_PROPERTY_TAX"===(null==e?void 0:e.businessService),G="NDC_SEWERAGE_SERVICE_CONNECTION"===(null==e?void 0:e.businessService),$="NDC_WATER_SERVICE_CONNECTION"===(null==e?void 0:e.businessService),Z=Y&&(null==Me?void 0:Me.includes("NDC_PT_VERIFIER"))||(G||$)&&(null==Me?void 0:Me.includes("NDC_WS_SW_VERIFIER")),Q=le[e.consumerCode]||(null==e?void 0:e.isDuePending),J=e.dueAmount>0;return o.createElement("div",{key:r,className:"ndc-emp-app-overview"},o.createElement(t.StatusTable,null,o.createElement(t.Row,{label:B("NDC_BUSINESS_SERVICE"),text:B(""+e.businessService)||e.businessService}),o.createElement(t.Row,{label:B("NDC_CONSUMER_CODE"),text:e.consumerCode||"N/A"}),(!Z||!Q)&&o.createElement("div",{style:{background:J?"red":"none",color:J?"white":"black",paddingTop:J?"8px":"0",paddingLeft:J?"10px":"0"}},o.createElement(t.Row,{rowContainerStyle:{backgroundColor:J?"red":"none"},label:B("NDC_DUE_AMOUNT"),text:(!1===le[e.consumerCode]?"0":null!=(l=null!=(i=null==ue?void 0:ue[e.consumerCode])?i:null==e?void 0:e.dueAmount)?l:0).toString()})),Z&&Q&&o.createElement("div",null,o.createElement(t.Row,{label:"Due Amount",text:o.createElement(a.Controller,{key:r,control:K,name:"amount["+r+"]",defaultValue:!1===le[e.consumerCode]?0:null!=(u=null!=(c=null==ue?void 0:ue[e.consumerCode])?c:null==e?void 0:e.dueAmount)?u:0,render:n=>o.createElement(t.TextInput,{type:"number",value:n.value,onChange:t=>{n.onChange(t.target.value);const o=t.target.value;ce(t=>s({},t,{[e.consumerCode]:o}))},style:{maxWidth:"200px"},onBlur:n.onBlur,disabled:!1===le[e.consumerCode]})})})),o.createElement(t.Row,{label:B("NDC_PROPERTY_TYPE"),text:B(e.propertyType)||e.propertyType}),Y&&(null==qe?void 0:qe.Properties)&&o.createElement(n.Fragment,null,o.createElement(t.Row,{label:B("CHB_DISCOUNT_REASON"),text:B(""+("OTHERS"==(null==Te||null===(d=Te.Applications)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.reason)?null==Te||null===(v=Te.Applications)||void 0===v||null===(f=v[0])||void 0===f||null===(p=f.NdcDetails)||void 0===p||null===(h=p.find(e=>"PT"===(null==e?void 0:e.businessService)))||void 0===h||null===(g=h.additionalDetails)||void 0===g?void 0:g.reason:null==Te||null===(y=Te.Applications)||void 0===y||null===(E=y[0])||void 0===E?void 0:E.reason))}),o.createElement(t.Row,{label:B("City"),text:null==qe||null===(b=qe.Properties)||void 0===b||null===(_=b[0])||void 0===_||null===(N=_.address)||void 0===N?void 0:N.city}),o.createElement(t.Row,{label:B("House No"),text:null==qe||null===(S=qe.Properties)||void 0===S||null===(D=S[0])||void 0===D||null===(C=D.address)||void 0===C?void 0:C.doorNo}),o.createElement(t.Row,{label:B("Colony Name"),text:null==qe||null===(w=qe.Properties)||void 0===w||null===(A=w[0])||void 0===A||null===(T=A.address)||void 0===T?void 0:T.buildingName}),o.createElement(t.Row,{label:B("Street Name"),text:null==qe||null===(O=qe.Properties)||void 0===O||null===(P=O[0])||void 0===P||null===(I=P.address)||void 0===I?void 0:I.street}),o.createElement(t.Row,{label:B("Pincode"),text:(null==qe||null===(x=qe.Properties)||void 0===x||null===(R=x[0])||void 0===R||null===(L=R.address)||void 0===L?void 0:L.pincode)||"N/A"}),o.createElement(t.Row,{label:B("Survey Id/UID"),text:null==qe||null===(F=qe.Properties)||void 0===F||null===(M=F[0])||void 0===M?void 0:M.surveyId}),o.createElement(t.Row,{label:B("Year of creation of Property"),text:null==qe||null===(k=qe.Properties)||void 0===k||null===(U=k[0])||void 0===U||null===(j=U.additionalDetails)||void 0===j?void 0:j.yearConstruction}),o.createElement(t.Row,{label:B("Remarks"),text:(null==Te||null===(W=Te.Applications)||void 0===W||null===(z=W[0])||void 0===z||null===(H=z.NdcDetails)||void 0===H||null===(V=H.find(e=>"PT"===(null==e?void 0:e.businessService)))||void 0===V||null===(q=V.additionalDetails)||void 0===q?void 0:q.remarks)||"N/A"}))),Z&&o.createElement("div",{className:"mychallan-custom"},o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},o.createElement("b",null," Pending Dues")),o.createElement(t.FilterFormField,{className:"radioButtonSection"},o.createElement(a.Controller,{name:"assignee"+r,control:K,defaultValue:null!=e&&e.isDuePending?"yes":"no",render:n=>o.createElement(t.RadioButtons,{onSelect:t=>{n.onChange(t.code),((e,t,n)=>{ie(o=>{const r=s({},o,{[e]:"yes"===t});return r[e]?console.log("✅ Marked dues pending for",e):(ce(t=>s({},t,{[e]:0})),X("amount["+n+"]",0)),r})})(e.consumerCode,t.code,r)},selectedOption:at.filter(e=>e.code===n.value)[0],optionsKey:"name",options:at})}))))})),o.createElement(t.Card,null,o.createElement(t.CardSubHeader,null,B("NDC_APPLICATION_DOCUMENTS_OVERVIEW")),o.createElement("div",null,Array.isArray(null==te?void 0:te.Documents)&&(null==te||null===(T=te.Documents)||void 0===T?void 0:T.length)>0?o.createElement(se,{value:{workflowDocs:null==te?void 0:te.Documents}}):o.createElement("div",null,B("TL_NO_DOCUMENTS_MSG")))),o.createElement(lt,{workflowDetails:Oe,t:B}),"INITIATED"!==(null==Te||null===(O=Te.Applications)||void 0===O||null===(P=O[0])||void 0===P?void 0:P.applicationStatus)&&Be&&o.createElement(t.ActionBar,null,ge&&(null!=Oe&&null!==(I=Oe.data)&&void 0!==I&&null!==(x=I.actionState)&&void 0!==x&&x.nextActions||null!=Oe&&null!==(R=Oe.data)&&void 0!==R&&R.nextActions)?o.createElement(t.Menu,{localeKeyPrefix:"WF_EDITRENEWAL",options:Be,optionKey:"action",t:B,onSelect:function(e){var t,n,o,r,l,i,a,u;console.log("action====???",null==e||null===(t=e.state)||void 0===t?void 0:t.actions);const s=(null==Te||null===(n=Te.Applications)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.NdcDetails)||[],c=null==s?void 0:s.some(e=>!0===e.isDuePending);console.log("hasDuePending",c);const d=null==e||null===(r=e.state)||void 0===r||null===(l=r.actions)||void 0===l?void 0:l.filter(t=>t.action==(null==e?void 0:e.action));console.log("filterNexState====???",null===(i=d[0])||void 0===i?void 0:i.nextState);const m=null==de?void 0:de.filter(e=>{var t;return(null==e?void 0:e.uuid)==(null===(t=d[0])||void 0===t?void 0:t.nextState)});console.log("filterRoles====???",m),console.log("action test",null==e?void 0:e.action);const v="APPROVE"==(null==e?void 0:e.action);if(console.log("filterRoles && checkactionApp",m&&v,v,m),c&&v)return console.log("alwasy coming appprve"),$("You Can Not Approve This Application, Because It Has Pending Dues. Please Send It To Required Department"),Y(!0),void V(!0);he(null==m||null===(a=m[0])||void 0===a?void 0:a.actions);const f=null==te||null===(u=te.applicantData)||void 0===u?void 0:u.applicationNo;"APPLY"==(null==e?void 0:e.action)?We({Licenses:[e]}):"PAY"==(null==e?void 0:e.action)?U.push("/digit-ui/employee/payment/collect/NDC/"+f+"/"+W+"?tenantId="+W):"EDIT"==(null==e?void 0:e.action)?U.push("/digit-ui/employee/ndc/create/"+f):(Ne(!0),be(e))}}):null,o.createElement(t.SubmitBar,{ref:Fe,label:B("WF_TAKE_ACTION"),onSubmit:()=>ye(!ge)})),"INITIATED"==(null==Te||null===(L=Te.Applications)||void 0===L||null===(F=L[0])||void 0===F?void 0:F.applicationStatus)&&o.createElement(t.ActionBar,null,o.createElement(t.SubmitBar,{label:B("COMMON_EDIT"),onSubmit:()=>{var e,t;const n=null==Te||null===(e=Te.Applications)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.applicationNo;U.push("/digit-ui/employee/ndc/create/"+n)}})),_e?o.createElement(nt,{t:B,action:Ee,tenantId:W,state:z,getEmployees:pe,id:k,applicationDetails:Te,applicationData:null==Te?void 0:Te.applicationData,closeModal:()=>{be(null),Ne(!1)},submitAction:We,actionData:null==Oe||null===(M=Oe.data)||void 0===M?void 0:M.timeline,workflowDetails:Oe,showToast:H,closeToast:Ue,errors:q,showErrorToast:Z,errorOne:J,closeToastOne:()=>{Q(null)}}):null,H&&o.createElement("div",{ref:j},o.createElement(t.Toast,{error:q,label:G,isDleteBtn:!0,onClose:Ue})),(Ae||oe||Ve||ve)&&o.createElement(Qe,{page:!0}))},NDCInbox:e=>{let{parentRoute:i}=e;const{t:u}=l.useTranslation(),c=window.localStorage.getItem("Employee.tenant-id"),[m,v]=n.useState(),f={},p={moduleName:"ndc-services",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:d(!0)||[]},h={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},g=Digit.SessionStorage.get("NDC.INBOX"),y=n.useMemo(()=>g||{filterForm:p,searchForm:f,tableForm:h},[Object.values((null==g?void 0:g.filterForm)||{}),Object.values((null==g?void 0:g.searchForm)||{}),Object.values((null==g?void 0:g.tableForm)||{})]),[E,b]=n.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("NDC.INBOX",s({},e,{searchForm:t.data})),s({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("NDC.INBOX",s({},e,{filterForm:t.data})),s({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("NDC.INBOX",s({},e,{tableForm:t.data})),s({},e,{tableForm:t.data})}},y),{data:_,isLoading:N}=Digit.Hooks.useBoundaryLocalities(c,"revenue",{},u),S=e=>{v(e)},{isLoading:D,data:C}=Digit.Hooks.ndc.useInbox({tenantId:c,filters:s({},E,{getFilter:m})}),[w,A]=n.useState([]),[T,O]=n.useState([]),[P,I]=n.useState(0);n.useEffect(()=>{C&&(O((null==C?void 0:C.statuses)||[]),A((null==C?void 0:C.table)||[]),I((null==C?void 0:C.totalCount)||0))},[C]);const x={logoIcon:o.createElement(t.ComplaintIcon,null),headerText:""+u("MODULE_NKS_NO_DUE_CERTIFICATE_FEES"),links:[{text:"",link:"",accessTo:[""]}]},R=n.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:r}=e;return o.createElement(Qt,{registerRef:t,searchFormState:n,searchFieldComponents:r})},[]),L=n.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:r,getFilterFormValue:l}=e;return o.createElement(Jt,{statuses:T,isInboxLoading:D,registerRef:t,controlFilterForm:n,setFilterFormValue:r,filterFormState:null==E?void 0:E.filterForm,getFilterFormValue:l,localitiesForEmployeesCurrentTenant:_,loadingLocalitiesForEmployeesCurrentTenant:N,handleFilter:S})},[T,D,_,N]),F={SearchFormFields:R,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),b({action:"mutateTableForm",data:s({},h)}),b({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==E?void 0:E.searchForm,resetSearchFormDefaultValues:f,onSearchFormReset:e=>{e("sourceRefId",null),e("applicationNo",null),e("mobileNumber",null),b({action:"mutateSearchForm",data:f})}},M={FilterFormFields:L,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),b({action:"mutateTableForm",data:s({},h)}),b({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==E?void 0:E.filterForm,resetFilterFormDefaultValues:p,onFilterFormReset:e=>{e("moduleName","bpa-services"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),b({action:"mutateFilterForm",data:p})}},k=(e=>{var t,i,a,u;let{parentRoute:c,onPageSizeChange:d,formState:m,totalCount:v,table:f,dispatch:p,onSortingByData:h}=e;const{t:g}=l.useTranslation(),y=n.useMemo(()=>[{Header:g("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL"),accessor:"uuid",disableSortBy:!0,Cell:e=>{var t,n;let{row:l}=e;return console.log("row",l),o.createElement("div",null,o.createElement(r.Link,{to:c+"/inbox/application-overview/"+(null===(t=l.original)||void 0===t?void 0:t.applicationId)},o.createElement("span",{className:"link"},null===(n=l.original)||void 0===n?void 0:n.applicationId)))}},{Header:g("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"createdtime",Cell:e=>{var t,n;let{row:r}=e;return null!==(t=r.original)&&void 0!==t&&t.date?(l=Xt(new Date(null===(n=r.original)||void 0===n?void 0:n.date),"dd/MM/yyyy"),o.createElement("span",{className:"cell-text styled-cell"},l)):"";var l}},{Header:g("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:"status",Cell:e=>{var t;let{row:n}=e;return g(null===(t=n.original)||void 0===t?void 0:t.status)}}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:d,currentPage:(null===(t=m.tableForm)||void 0===t?void 0:t.offset)/(null===(i=m.tableForm)||void 0===i?void 0:i.limit),onNextPage:()=>{var e,t;return p({action:"mutateTableForm",data:s({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return p({action:"mutateTableForm",data:s({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(a=m.tableForm)||void 0===a?void 0:a.limit,onSort:h,totalRecords:v,onSearch:null==m||null===(u=m.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return p({action:"mutateTableForm",data:s({},m.tableForm,{offset:10*Math.ceil(v/10)-parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>p({action:"mutateTableForm",data:s({},m.tableForm,{offset:0})}),data:f,columns:y}})(s({},{parentRoute:i,onPageSizeChange:e=>{b({action:"mutateTableForm",data:s({},E.tableForm,{limit:e.target.value})})},formState:E,totalCount:P,table:w,dispatch:b,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:n}]=e,o=n?"DESC":"ASC";E.tableForm.sortBy===t&&E.tableForm.sortOrder===o||b({action:"mutateTableForm",data:s({},E.tableForm,{sortBy:t,sortOrder:n?"DESC":"ASC"})})}}})),B=(e=>{let{parentRoute:n,table:r}=e;const{t:i}=l.useTranslation();return{data:null==r?void 0:r.map(e=>({[i("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")]:null==e?void 0:e.applicationId,[i("TL_COMMON_TABLE_COL_APP_DATE")]:Xt(new Date(null==e?void 0:e.date),"dd/MM/yyyy"),[i("PT_COMMON_TABLE_COL_STATUS_LABEL")]:null==e?void 0:e.status})),linkPrefix:n+"/inbox/application-overview/",serviceRequestIdKey:i("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:n}=a.useFormContext();return o.createElement(t.SearchField,null,o.createElement(a.Controller,{name:"sortOrder",control:n,render:n=>{let{onChange:r,value:l}=n;return o.createElement(t.RadioButtons,{onSelect:e=>{r(e.code)},selectedOption:e.filter(e=>e.code===l)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:i,table:w}),U={onMobileSortOrderData:e=>{const{sortOrder:t}=e;b({action:"mutateTableForm",data:s({},E.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==E?void 0:E.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),b({action:"mutateTableForm",data:h})}};return o.createElement(n.Fragment,null,o.createElement(t.Header,null,u("ES_COMMON_INBOX"),P?o.createElement("p",{className:"inbox-count"},P):null),o.createElement("div",{className:"NDCSection"},o.createElement(t.InboxComposer,s({isInboxLoading:D,PropsForInboxLinks:x},F,M,U,{propsForInboxTable:k,propsForInboxMobileCards:B,formState:E}))))},NOCSearchApplication:e=>{let{t:t,onSubmit:i,data:u,error:s,isLoading:c,Count:d}=e;const[m,v]=n.useState(null),f=a.useForm({defaultValues:{}});n.useEffect(()=>{f.register("offset",0),f.register("limit",10),f.register("sortBy","commencementDate"),f.register("sortOrder","DESC")},[f.register]);const p=(()=>{const{t:e}=l.useTranslation(),t=e=>o.createElement("span",{className:"cell-text"},e);return n.useMemo(()=>[{Header:e("NOC_APP_NO_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return o.createElement("div",null,o.createElement("span",{className:"link"},o.createElement(r.Link,{to:"/digit-ui/employee/noc/search/application-overview/"+(t.original.applicationNo||t.original.applicationNumber)},t.original.applicationNo||t.original.applicationNumber)))}},{Header:e("NOC_COMMON_TABLE_COL_APP_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var n,o;return t(null!=e&&null!==(n=e.auditDetails)&&void 0!==n&&n.createdTime?Digit.DateUtils.ConvertEpochToDate(null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.createdTime):"-")}},{Header:e("NOC_APPLICANTS_NAME_LABEL"),disableSortBy:!0,accessor:e=>{var n,o;return t(null!=e&&null!==(n=e.additionalDetails)&&void 0!==n&&n.applicantName?null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.applicantName:"-")}},{Header:e("NOC_SOURCE_MODULE_LABEL"),disableSortBy:!0,accessor:n=>t(e("MODULE_"+(null==n?void 0:n.source)||"-"))},{Header:e("NOC_SOURCE_MODULE_NUMBER"),disableSortBy:!0,accessor:e=>t((null==e?void 0:e.sourceRefId)||"-")},{Header:e("NOC_STATUS_LABEL"),accessor:n=>t(e((null==n?void 0:n.applicationStatus)&&""+n.applicationStatus||"-")),disableSortBy:!0},{Header:e("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:n=>{var o,r;return t(e((null==n||null===(o=n.additionalDetails)||void 0===o?void 0:o.currentOwner)&&""+(null==n||null===(r=n.additionalDetails)||void 0===r?void 0:r.currentOwner)||"-"))},disableSortBy:!0}],[])})(),h=window.Digit.Utils.browser.isMobile(),g=n.useMemo(()=>null==u?void 0:u.map(e=>{var n,o,r;return{[t("NOC_APP_NO_LABEL")]:e.applicationNo,[t("NOC_COMMON_TABLE_COL_APP_DATE_LABEL")]:Digit.DateUtils.ConvertEpochToDate(null===(n=e.auditDetails)||void 0===n?void 0:n.createdTime)||"-",[t("NOC_APPLICANTS_NAME_LABEL")]:(null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.applicantName)||"-",[t("NOC_SOURCE_MODULE_LABEL")]:e.source?t("MODULE_"+e.source):"-",[t("NOC_SOURCE_MODULE_NUMBER")]:(null==e?void 0:e.sourceRefId)||"-",[t("WF_INBOX_HEADER_CURRENT_OWNER")]:(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.currentOwner)||"-",[t("NOC_STATUS_LABEL")]:e.applicationStatus?t(""+e.applicationStatus):"-"}}),[u]);return o.createElement(a.FormProvider,f,h?o.createElement(on,{SearchFormFieldsComponent:en,propsMobileInboxCards:g,isLoading:c,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:i}):o.createElement(rn,{columns:p,SearchFormFieldsComponent:en,onSubmit:i,data:u,error:s,isLoading:c,Count:d}))},PropertyDetailsForm:ln,PropertyDetailsStep1:e=>{let{config:t,onGoNext:n}=e;return i.useDispatch(),i.useSelector(function(e){return e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[t.key]?e.ndc.NDCForm.formData[t.key]:{}}),o.createElement(o.Fragment,null,o.createElement(ln,{onGoNext:n}))},PropertyDetailsStep2:e=>{let{config:t,onBackClick:n}=e;return i.useDispatch(),i.useSelector(function(e){return e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[t.key]?e.ndc.NDCForm.formData[t.key]:{}}),o.createElement(o.Fragment,null,o.createElement(un,{onBackClick:n}))},PropertyDetailsFormUser:un,NewNDCStepFormCitizen:()=>{const e=r.useHistory(),{t:a}=l.useTranslation(),u=i.useDispatch(),[s,c]=n.useState(null),d=i.useSelector(e=>e.ndc.NDCForm).step,m=window.localStorage.getItem("CITIZEN.CITY"),v=window.location.pathname.split("/").pop(),{data:f}=Digit.Hooks.ndc.useSearchEmployeeApplication({applicationNo:v},m);return n.useEffect(()=>{console.log("applicationDetails",f),null!=f&&f.Applications.length&&u(J("responseData",null==f?void 0:f.Applications))},[f]),n.useEffect(()=>{const t=e.listen(()=>{u({type:"RESET_NDC_FORM"})});return()=>t()},[e,u]),o.createElement("div",{className:"employeeCard"},o.createElement(t.CardHeader,{className:"ndc-step-form",divider:!0},a("ndc_header_application")),o.createElement(Z,{stepsList:cn,onSubmit:()=>{},step:d,setStep:e=>{u(ee(e))}}),s&&o.createElement(t.Toast,{error:s.key,label:a(s.label),onClose:()=>{c(null)},isDleteBtn:"true"}))},SelectNDCReason:function(e){var r,u,c;let{config:d,onSelect:m,formData:v}=e;const[f,p]=n.useState((null==v?void 0:v.NDCReason)||{}),{control:h,formState:g,watch:y,setValue:E}=a.useForm({defaultValues:(null==v?void 0:v.NDCReason)||{}}),{t:b}=l.useTranslation(),_=i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.responseData}),N=window.location.href.includes("employee")?Digit.ULBService.getCurrentPermanentCity():localStorage.getItem("CITIZEN.CITY"),{data:S,isLoading:D}=Digit.Hooks.useCustomMDMS(N,"NDC",[{name:"Reasons"}]),C=n.useMemo(()=>{var e,t;const n=[];var o,r;return(null==S||null===(e=S.NDC)||void 0===e||null===(t=e.Reasons)||void 0===t?void 0:t.length)>0&&(null==S||null===(o=S.NDC)||void 0===o||null===(r=o.Reasons)||void 0===r||r.map(e=>{n.push({i18nKey:null==e?void 0:e.code,code:null==e?void 0:e.code})})),n},[S]);return n.useEffect(()=>{m("NDCReason",f,d)},[f]),n.useEffect(()=>{if(_&&(null==C?void 0:C.length)>0){console.log("check apiDataCheck",_);const e=C.find(e=>{var t;return(null==e?void 0:e.code)===(null==_||null===(t=_[0])||void 0===t?void 0:t.reason)});e&&(p(e),E("NDCReason",e))}},[_,C]),D?o.createElement(t.Loader,null):o.createElement("div",null,o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},b("NDC_NEW_NDC_APPLICATION_NDC_REASON")+" * "),o.createElement(a.Controller,{name:"NDCReason",rules:{required:b("REQUIRED_FIELD")},defaultValue:f,control:h,render:e=>o.createElement(t.Dropdown,{className:"form-field",selected:e.value,option:C,select:t=>{p(t),e.onChange(t)},optionKey:"i18nKey",onBlur:e.onBlur,t:b})})),o.createElement(t.CardLabelError,{className:"ndc-card-label-error"},g.touched.structureType?null===(r=errors)||void 0===r||null===(u=r.structureType)||void 0===u?void 0:u.message:""),"OTHERS"==(null===(c=y("NDCReason"))||void 0===c?void 0:c.code)&&o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},""+b("Reason")),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:h,name:"reason",defaultValue:(null==f?void 0:f.reason)||"",render:e=>o.createElement(t.TextInput,{value:e.value,onChange:t=>{console.log("config.key",d.key),console.log("formData",v),m("NDCReason",s({},null==v?void 0:v.NDCReason,{reason:t.target.value}),d),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))))},NewNDCStepFormOneCitizen:e=>{let{config:r,onGoNext:l,onBackClick:a,t:u}=e;const d=i.useDispatch(),[m,v]=n.useState(!1),[f,p]=n.useState(""),h=(Digit.UserService.getUser(),window.location.pathname.split("/").pop()),g=i.useSelector(e=>e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[r.key]?e.ndc.NDCForm.formData[r.key]:{}),y=i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.apiData});i.useSelector(e=>e.ndc.NDCForm.formData),console.log("checkApiDataCheck",y);const[E,b]=n.useState(!1),N=i.useSelector(e=>e.ndc.NDCForm.formData||{}),S=(i.useSelector(e=>e.ndc.NDCForm||{}),window.localStorage.getItem("CITIZEN.CITY"));return o.createElement(o.Fragment,null,o.createElement(t.FormComposer,{defaultValues:g,config:r.currStepConfig,onSubmit:function(e){var t,n,o,r,i;const a=function(e){var t,n,o,r,l;const i=[],a=[],s=(null==e?void 0:e.cpt)||{},c=(null==s?void 0:s.details)||{},d=(null==e?void 0:e.PropertyDetails)||{},m=(null==e?void 0:e.NDCReason)||{};var v,f;return null!=e&&null!==(t=e.cpt)&&void 0!==t&&t.dues||i.push(u("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_PROPERTY_TAX")+" "+(null==s?void 0:s.id)),(null==e||null===(n=e.cpt)||void 0===n||null===(o=n.dues)||void 0===o?void 0:o.totalAmount)>0&&i.push(u("NDC_MESSAGE_PLEASE_PAY_DUES_OF_PROPERTY_TAX")+" "+(null==s?void 0:s.id)),(null==d||null===(r=d.waterConnection)||void 0===r?void 0:r.length)>0&&(null===(v=d.waterConnection)||void 0===v||v.forEach(e=>{var t,n,o;0!=(null==e||null===(t=e.billData)||void 0===t?void 0:t.totalAmount)&&i.push(u("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_WATER_CONNECTION")+" "+(null==e?void 0:e.connectionNo)),null!=e&&null!==(n=e.billData)&&void 0!==n&&n.id&&(null==e||null===(o=e.billData)||void 0===o?void 0:o.totalAmount)>0&&i.push(u("NDC_MESSAGE_PLEASE_PAY_DUES_OF_WATER_CONNECTION")+" "+(null==e?void 0:e.connectionNo))})),(null==d||null===(l=d.sewerageConnection)||void 0===l?void 0:l.length)>0&&(null===(f=d.sewerageConnection)||void 0===f||f.forEach(e=>{var t,n,o;0!=(null==e||null===(t=e.billData)||void 0===t?void 0:t.totalAmount)&&i.push(u("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_SEWERAGE_CONNECTION")+" "+(null==e?void 0:e.connectionNo)),null!=e&&null!==(n=e.billData)&&void 0!==n&&n.id&&(null==e||null===(o=e.billData)||void 0===o?void 0:o.totalAmount)>0&&i.push(u("NDC_MESSAGE_PLEASE_PAY_DUES_OF_SEWERAGE_CONNECTION")+" "+(null==e?void 0:e.connectionNo))})),null!=s&&s.id||i.push(u("NDC_MESSAGE_PROPERTY_ID")),c&&0!==Object.keys(c).length||i.push(u("NDC_MESSAGE_PLEASE_SEARCH_PROPERTY_ID")),null!=d&&d.firstName||i.push(u("NDC_MESSAGE_FIRST_NAME")),null!=d&&d.mobileNumber||i.push(u("NDC_MESSAGE_MOBILE_NUMBER")),null!=d&&d.address||i.push(u("NDC_MESSAGE_ADDRESS")),null!=d&&d.email||i.push(u("NDC_MESSAGE_EMAIL")),null!=m&&m.code||i.push(u("NDC_MESSAGE_NDC_REASON")),null!=d&&d.firstName&&!/^[A-Za-z\s]+(,\s*[A-Za-z\s]+)*$/.test(d.firstName)&&a.push(u("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED")),null!=d&&d.email&&!/^(?!\.)(?!.*\.\.)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/.test(d.email)&&a.push(u("NDC_MESSAGE_EMAIL_INVALID_FORMAT")),null!=d&&d.mobileNumber&&!/^[6-9]\d{9}$/.test(d.mobileNumber)&&a.push(u("NDC_MESSAGE_MOBILE_NUMBER_MUST_BE_A_VALID_TEN_DIGIT_INDIAN_NUMBER")),[...i,...a]}(g);if(a.length>0)return p(""+a[0]),v(!0),void setTimeout(()=>{v(!1)},3e3);console.log("checkFormData",N);const m=h&&h.startsWith("NDC-");console.log("isRealId",m),null!=N&&null!==(t=N.apiData)&&void 0!==t&&null!==(n=t.Applications)&&void 0!==n&&null!==(o=n[0])&&void 0!==o&&o.applicationNo||null!=N&&null!==(r=N.responseData)&&void 0!==r&&null!==(i=r[0])&&void 0!==i&&i.applicationNo||m?(function(e){try{var t,n,o,r,i,a,u,s,c,m,v,f,p,h,g,E,b,_,D;const k=(null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info)||{},B=null==k?void 0:k.uuid,U=(null==y||null===(n=y.Applications)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.owners)||(null==N||null===(r=N.responseData)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.owners);let j=[];var C,w,A,T,O,P;if((null==N||null===(a=N.responseData)||void 0===a||null===(u=a[0])||void 0===u||null===(s=u.NdcDetails)||void 0===s?void 0:s.length)>0)j=N.responseData[0].NdcDetails;else if(null===(C=(null==e||null===(w=e.PropertyDetails)||void 0===w?void 0:w.waterConnection)||[])||void 0===C||C.forEach(t=>{var n,o,r,l,i,a;j.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:B,businessService:"WS",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),null===(A=(null==e||null===(T=e.PropertyDetails)||void 0===T?void 0:T.sewerageConnection)||[])||void 0===A||A.forEach(t=>{var n,o,r,l,i,a;j.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:B,businessService:"SW",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),null!=e&&null!==(O=e.PropertyDetails)&&void 0!==O&&null!==(P=O.propertyBillData)&&void 0!==P&&P.billData){var I,x,R,L,F,M;const t=null==e||null===(I=e.PropertyDetails)||void 0===I||null===(x=I.propertyBillData)||void 0===x?void 0:x.billData;j.push({uuid:null==t?void 0:t.id,applicantId:B,businessService:"PT",consumerCode:null==e||null===(R=e.cpt)||void 0===R?void 0:R.id,additionalDetails:{propertyAddress:null==e||null===(L=e.PropertyDetails)||void 0===L?void 0:L.address,propertyType:null==e||null===(F=e.cpt)||void 0===F||null===(M=F.details)||void 0===M?void 0:M.usageCategory},dueAmount:(null==t?void 0:t.totalAmount)||0,status:null==t?void 0:t.status})}const W=(null==y||null===(c=y.Applications)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.applicationNo)||(null==N||null===(v=N.responseData)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.applicationNo),z=(null==y||null===(p=y.Applications)||void 0===p||null===(h=p[0])||void 0===h?void 0:h.uuid)||(null==N||null===(g=N.responseData)||void 0===g||null===(E=g[0])||void 0===E?void 0:E.uuid),H={Applications:[{tenantId:S,owners:U,NdcDetails:j,Documents:[],active:!0,reason:null==e||null===(b=e.NDCReason)||void 0===b?void 0:b.code,auditDetails:null==e||null===(_=e.cpt)||void 0===_||null===(D=_.details)||void 0===D?void 0:D.auditDetails,applicationNo:W,uuid:z,workflow:{action:"DRAFT"}}]};console.log("payload",H),Promise.resolve(Digit.NDCService.NDCUpdate({tenantId:S,details:H})).then(function(e){var t;return"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(d(J("apiData",e)),l(),{isSuccess:!0,response:e}):{isSuccess:!1,response:e}})}catch(e){return Promise.reject(e)}}(e),console.log("here bab")):function(e){try{var t,n,o,r,i,a,u,m,v,f;const C=(null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info)||{},w=null==C?void 0:C.uuid,A=((null==e||null===(n=e.cpt)||void 0===n||null===(o=n.details)||void 0===o?void 0:o.owners)||[]).map(t=>{var n,o,r,l,i;let a=c(t,dn);var u;return(null==a||null===(n=a.name)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.toLowerCase())===(null==e||null===(r=e.PropertyDetails)||void 0===r||null===(l=r.firstName)||void 0===l||null===(i=l.trim())||void 0===i?void 0:i.toLowerCase())?s({},a,{emailId:null==e||null===(u=e.PropertyDetails)||void 0===u?void 0:u.email,isPrimaryOwner:!0}):a});console.log("checkData==",e);const T=[];if(null===(r=(null==e||null===(i=e.PropertyDetails)||void 0===i?void 0:i.waterConnection)||[])||void 0===r||r.forEach(t=>{var n,o,r,l,i,a;T.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:w,businessService:"WS",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),null===(a=(null==e||null===(u=e.PropertyDetails)||void 0===u?void 0:u.sewerageConnection)||[])||void 0===a||a.forEach(t=>{var n,o,r,l,i,a;T.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:w,businessService:"SW",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),null!=e&&null!==(m=e.PropertyDetails)&&void 0!==m&&null!==(v=m.propertyBillData)&&void 0!==v&&v.billData){var p,h,g,y,E,_,N,D;const t=null==e||null===(p=e.PropertyDetails)||void 0===p||null===(h=p.propertyBillData)||void 0===h?void 0:h.billData;T.push({uuid:null==t?void 0:t.id,applicantId:w,businessService:"PT",consumerCode:null==e||null===(g=e.cpt)||void 0===g?void 0:g.id,additionalDetails:{propertyAddress:null==e||null===(y=e.PropertyDetails)||void 0===y?void 0:y.address,propertyType:null==e||null===(E=e.cpt)||void 0===E||null===(_=E.details)||void 0===_?void 0:_.usageCategory,reason:null==e||null===(N=e.NDCReason)||void 0===N?void 0:N.reason,remarks:null==e||null===(D=e.PropertyDetails)||void 0===D?void 0:D.remarks},dueAmount:(null==t?void 0:t.totalAmount)||0,status:null==t?void 0:t.status})}const O={Applications:[{tenantId:S,owners:A,NdcDetails:T,Documents:[],active:!0,reason:null==e||null===(f=e.NDCReason)||void 0===f?void 0:f.code,workflow:{action:"INITIATE"}}]};Promise.resolve(ae(function(){return Promise.resolve(Digit.NDCService.NDCcreate({tenantId:S,details:O})).then(function(e){var t;return b(!1),console.log("response",e),"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(d(J("apiData",e)),l(),{isSuccess:!0,response:e}):{isSuccess:!1,response:e}})},function(){b(!1)}))}catch(e){return Promise.reject(e)}}(e)},onFormValueChange:function(e,t){_.isEqual(t,g)||d(J(r.key,t))},label:u(""+r.texts.submitBarLabel),currentStep:r.currStepNumber,onBackClick:function(e){a(r.key,e)}}),E&&o.createElement(Qe,{page:!0}),m&&o.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:f,onClose:()=>{v(!1),p("")}}))},PropertyDetailsFormCitizen:e=>{var r,u,c,d,m,v,f,p,h,g,y,E;const b=function(e,t,n){try{if("WS"===e){const e=[...B.waterConnection];e[n].isLoading=!0,U(t=>s({},t,{waterConnection:e}))}else if("SW"===e){const e=[...B.sewerageConnection];e[n].isLoading=!0,U(t=>s({},t,{sewerageConnection:e}))}else if("PT"===e){x(!0);let e=s({},null==B?void 0:B.propertyBillData);e.isLoading=!0,U(t=>s({},t,{propertyBillData:e}))}const o=ae(function(){return Promise.resolve(Digit.PaymentService.fetchBill(w,{businessService:e,consumerCode:t})).then(function(t){var o,r;if(x(!1),(null==t||null===(o=t.Bill)||void 0===o?void 0:o.length)>0){if((null==t||null===(r=t.Bill[0])||void 0===r?void 0:r.totalAmount)>0?P({error:!0,label:C("NDC_MESSAGE_DUES_FOUND_PLEASE_PAY")}):P({error:!1,label:C("NDC_MESSAGE_NO_DUES_FOUND")}),"WS"===e){const e=[...B.waterConnection];e[n].billData=null==t?void 0:t.Bill[0],e[n].isLoading=!1,U(t=>s({},t,{waterConnection:e}))}else if("SW"===e){const e=[...B.sewerageConnection];e[n].billData=null==t?void 0:t.Bill[0],e[n].isLoading=!1,U(t=>s({},t,{sewerageConnection:e}))}else if("PT"===e){let e=s({},B.propertyBillData);e.billData=null==t?void 0:t.Bill[0],e.isLoading=!1,U(t=>s({},t,{propertyBillData:e}))}}else if(null!=t&&t.Bill){if("WS"===e){const e=[...B.waterConnection];e[n].billData={totalAmount:0},e[n].isLoading=!1,U(t=>s({},t,{waterConnection:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_WS")})}else if("SW"===e){const e=[...B.sewerageConnection];e[n].billData={totalAmount:0},e[n].isLoading=!1,U(t=>s({},t,{sewerageConnection:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_SW")})}else if("PT"===e){let e=s({},B.propertyBillData);e.isLoading=!1,U(t=>s({},t,{propertyBillData:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_PROPERTY")})}}else if("WS"===e){const e=[...B.waterConnection];e[n].isLoading=!1,e[n].billData={totalAmount:0},U(t=>s({},t,{waterConnection:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_WS")})}else if("SW"===e){const e=[...B.sewerageConnection];e[n].isLoading=!1,e[n].billData={totalAmount:0},U(t=>s({},t,{sewerageConnection:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_SW")})}else if("PT"===e){let e=s({},B.propertyBillData);e.isLoading=!1,U(t=>s({},t,{propertyBillData:e})),P({error:!1,label:C("NDC_NO_BILLS_FOUND_PROPERTY")})}})},function(){x(!1),P({error:!0,label:C("NDC_MESSAGE_FETCH_FAILED")})});return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};let{config:_,onSelect:N,formData:S}=e;const{control:D}=a.useForm(),{t:C}=l.useTranslation(),w=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),A=i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.responseData}),T=i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.apiData}),[O,P]=n.useState(null),[I,x]=n.useState(!1),[R,L]=n.useState(!1),[F,M]=n.useState({}),k=null==S||null===(r=S.cpt)||void 0===r||null===(u=r.details)||void 0===u?void 0:u.propertyId,[B,U]=n.useState((null==S?void 0:S.PropertyDetails)||{}),[j,W]=n.useState(null);console.log("apiDataCheck",A),console.log("formData==?/??",S),console.log("checkApiDataCheck====",null==T||null===(c=T.Applications)||void 0===c?void 0:c[0]);const{isLoading:z,data:H}=Digit.Hooks.ws.useSearchWS({tenantId:w,filters:{searchType:"CONNECTION",propertyId:k},config:{enabled:!!k},bussinessService:"WS",t:C}),{isLoading:V,data:q}=Digit.Hooks.ws.useSearchWS({tenantId:w,filters:{searchType:"CONNECTION",propertyId:k},config:{enabled:!!k},bussinessService:"SW",t:C}),Y=[{Header:C("TL_COMMON_TABLE_COL_OWN_NAME"),accessor:"name",Cell:e=>{var t;let{row:n}=e;return o.createElement("div",null,null==n||null===(t=n.original)||void 0===t?void 0:t.name)}},{Header:"",accessor:"amount",Cell:e=>{var t;let{row:n}=e;return o.createElement("input",{type:"radio",name:"applicationFee",checked:(null==j?void 0:j.uuid)===(null==n||null===(t=n.original)||void 0===t?void 0:t.uuid),onChange:()=>{console.log("row?.original",null==n?void 0:n.original),W(null==n?void 0:n.original)}})}}];function G(e,t,n){const o=window.location.href.includes("employee")?"employee":"citizen";let r,l;if("WS"===(null==e?void 0:e.businessService)?r="WATER":"SW"===(null==e?void 0:e.businessService)?r="SEWERAGE":"PT"===(null==e?void 0:e.businessService)&&(r="PT"),l="PT"===(null==e?void 0:e.businessService)?"https://sdc-uat.lgpunjab.gov.in/"+o+"/egov-common/pay?consumerCode="+(null==e?void 0:e.consumerCode)+"&tenantId="+(null==e?void 0:e.tenantId)+"&businessService="+r:"https://sdc-uat.lgpunjab.gov.in/"+o+"/wns/viewBill?connectionNumber="+(null==e?void 0:e.consumerCode)+"&tenantId="+(null==e?void 0:e.tenantId)+"&service="+r,window.open(l,"_blank"),"WS"===(null==e?void 0:e.businessService)){const o=[...B.waterConnection];o[t]={connectionNo:null==e?void 0:e.consumerCode,isEdit:n,billData:{},isLoading:!1},U(e=>s({},e,{waterConnection:o}))}else if("SW"===(null==e?void 0:e.businessService)){const o=[...B.sewerageConnection];o[t]={connectionNo:null==e?void 0:e.consumerCode,isEdit:n,billData:{},isLoading:!1},U(e=>s({},e,{sewerageConnection:o}))}else if("PT"===(null==e?void 0:e.businessService)){let t=s({},B.propertyBillData);t={connectionNo:null==e?void 0:e.consumerCode,billData:{},isLoading:!1},U(e=>s({},e,{propertyBillData:t}))}}n.useEffect(()=>{var e,t,n,o,r,l,i,a,u,c;const d=(null==S||null===(e=S.cpt)||void 0===e||null===(t=e.details)||void 0===t?void 0:t.owners)||[],m=(null==d||null===(n=d.map(e=>null==e?void 0:e.name))||void 0===n||null===(o=n.filter(Boolean))||void 0===o||o.join(", "),j),v=null==A||null===(r=A[0])||void 0===r||null===(l=r.owners)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.emailId,f=null==m?void 0:m.name;console.log("ownerObj?.emailId",null==m?void 0:m.emailId),console.log("formData?.PropertyDetails?.email",null==S||null===(a=S.PropertyDetails)||void 0===a?void 0:a.email),console.log("emailApi",v);const p=(null==m?void 0:m.emailId)||v||"",h=null==m?void 0:m.mobileNumber,g=null==m?void 0:m.permanentAddress,y={};f&&(y.firstName=f),y.email=p,h&&(y.mobileNumber=h),g&&(y.address=g),y.propertyBillData={isLoading:!1,billData:(null==S||null===(u=S.PropertyDetails)||void 0===u||null===(c=u.propertyBillData)||void 0===c?void 0:c.billData)||{}},U(e=>s({},e,y))},[null==S||null===(d=S.cpt)||void 0===d?void 0:d.details,A,j]),n.useEffect(()=>{var e;let t;if(null!=A&&null!==(e=A[0])&&void 0!==e&&e.NdcDetails){var n,o;const e=null==A||null===(n=A[0])||void 0===n||null===(o=n.NdcDetails)||void 0===o?void 0:o.filter(e=>"WS"==e.businessService);t=(null==e?void 0:e.map(e=>({connectionNo:null==e?void 0:e.consumerCode,isEdit:!1,billData:{totalAmount:0},isLoading:!1})))||[]}else t=(null==H?void 0:H.map(e=>({connectionNo:null==e?void 0:e.connectionNo,isEdit:!1,billData:{},isLoading:!1})))||[];U(e=>s({},e,{waterConnection:t}))},[H,A]),n.useEffect(()=>{var e;let t;if(null!=A&&null!==(e=A[0])&&void 0!==e&&e.NdcDetails){var n,o;const e=null==A||null===(n=A[0])||void 0===n||null===(o=n.NdcDetails)||void 0===o?void 0:o.filter(e=>"SW"==e.businessService);t=(null==e?void 0:e.map(e=>({connectionNo:null==e?void 0:e.consumerCode,isEdit:!1,billData:{totalAmount:0},isLoading:!1})))||[]}else t=(null==q?void 0:q.map(e=>({connectionNo:null==e?void 0:e.connectionNo,isEdit:!1,billData:{},isLoading:!1})))||[];U(e=>s({},e,{sewerageConnection:t}))},[q,A]),n.useEffect(()=>{N("PropertyDetails",B,_)},[B]);const $=null===(m=Digit)||void 0===m||null===(v=m.ComponentRegistryService)||void 0===v?void 0:v.getComponent("PayWSBillModal");return n.useEffect(()=>{if(O){const e=setTimeout(()=>{P(null)},3e3);return()=>clearTimeout(e)}},[O]),n.useEffect(()=>{var e;if(null!=T&&null!==(e=T.Applications)&&void 0!==e&&e[0]||null!=A&&A[0]){var t,n,o;const e=(null==T||null===(t=T.Applications)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.owners)||(null==A||null===(o=A[0])||void 0===o?void 0:o.owners),r=null==e?void 0:e.find(e=>null==e?void 0:e.isPrimaryOwner);console.log("filterRow===",r),W(r)}},[T,A]),o.createElement("div",{style:{marginBottom:"16px"}},((null==S||null===(f=S.cpt)||void 0===f?void 0:f.details)||(null==A||null===(p=A[0])||void 0===p?void 0:p.NdcDetails))&&o.createElement("div",null,o.createElement(t.LabelFieldPair,{style:{marginTop:"40px"}},o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},""+C("NDC_WATER_CONNECTION")),z?o.createElement(t.Loader,null):o.createElement("div",{className:"form-field",style:{display:"flex",flexDirection:"column",gap:"8px",width:"100%"}},null==B||null===(h=B.waterConnection)||void 0===h?void 0:h.map((e,n)=>{var r,l,i,u,c;return o.createElement("div",{className:"ndc_property_search",key:n,style:{display:"flex",flexDirection:"row",alignItems:"baseline",gap:"16px"}},o.createElement(a.Controller,{key:n,control:D,name:"waterConnection["+n+"]",defaultValue:e.connectionNo,render:r=>o.createElement(t.TextInput,{value:e.connectionNo,onChange:e=>{const t=[...B.waterConnection];t[n]={connectionNo:"",isEdit:!0,billData:{},isLoading:!1},t[n].connectionNo=e.target.value,U(e=>s({},e,{waterConnection:t})),r.onChange(e.target.value)},disabled:!e.isEdit,onBlur:r.onBlur})}),e.isLoading?o.createElement(t.Loader,null):o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},!(null!=A&&null!==(r=A[0])&&void 0!==r&&r.NdcDetails)&&(null==e?void 0:e.connectionNo)&&!(null!=e&&null!==(l=e.billData)&&void 0!==l&&l.id)&&0!=(null==e||null===(i=e.billData)||void 0===i?void 0:i.totalAmount)&&o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",fontSize:"13px"},onClick:()=>{b("WS",e.connectionNo,n)}},""+C("CHECK_STATUS_WATER")),(null==e?void 0:e.connectionNo)&&(null==e||null===(u=e.billData)||void 0===u?void 0:u.totalAmount)>0&&o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white"},onClick:()=>{G(null==e?void 0:e.billData,n,e.isEdit)}},""+C("PAY_DUES")),(null==e?void 0:e.connectionNo)&&0==(null==e||null===(c=e.billData)||void 0===c?void 0:c.totalAmount)&&o.createElement("div",{style:{color:"green"}},C("NO_DUES")),(null==e?void 0:e.isEdit)&&o.createElement("button",{onClick:()=>{let e=[...B.waterConnection];e.splice(n,1),U(t=>s({},t,{waterConnection:e}))}},o.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))))}))),o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",fontSize:"12px"},onClick:()=>{U(e=>s({},e,{waterConnection:[...e.waterConnection||[],{connectionNo:"",isEdit:!0}]}))}},""+C("ADD_WATER")),o.createElement(t.LabelFieldPair,{style:{marginTop:"40px"}},o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},C("NDC_SEWERAGE_CONNECTION")+" "),V?o.createElement(t.Loader,null):o.createElement("div",{className:"form-field",style:{display:"flex",flexDirection:"column",gap:"8px",width:"100%"}},null==B||null===(g=B.sewerageConnection)||void 0===g?void 0:g.map((e,n)=>{var r,l,i,u,c;return o.createElement("div",{className:"ndc_property_search",key:n,style:{display:"flex",flexDirection:"row",alignItems:"baseline",gap:"16px"}},o.createElement(a.Controller,{key:n,control:D,name:"sewerageConnection["+n+"]",defaultValue:e.connectionNo,render:r=>o.createElement(t.TextInput,{value:e.connectionNo,onChange:e=>{const t=[...B.sewerageConnection];t[n]={connectionNo:"",isEdit:!0,billData:{},isLoading:!1},t[n].connectionNo=e.target.value,U(e=>s({},e,{sewerageConnection:t})),r.onChange(e.target.value)},disabled:!e.isEdit,onBlur:r.onBlur})}),e.isLoading?o.createElement(t.Loader,null):o.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},!(null!=A&&null!==(r=A[0])&&void 0!==r&&r.NdcDetails)&&(null==e?void 0:e.connectionNo)&&!(null!=e&&null!==(l=e.billData)&&void 0!==l&&l.id)&&0!=(null==e||null===(i=e.billData)||void 0===i?void 0:i.totalAmount)&&o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",fontSize:"13px"},onClick:()=>{b("SW",e.connectionNo,n)}},""+C("CHECK_STATUS_SEWERAGE")),(null==e?void 0:e.connectionNo)&&(null==e||null===(u=e.billData)||void 0===u?void 0:u.totalAmount)>0&&o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white"},onClick:()=>{G(null==e?void 0:e.billData,n)}},""+C("PAY_DUES")),(null==e?void 0:e.connectionNo)&&0==(null==e||null===(c=e.billData)||void 0===c?void 0:c.totalAmount)&&o.createElement("div",{style:{color:"green"}},C("NO_DUES")),(null==e?void 0:e.isEdit)&&o.createElement("button",{onClick:()=>{let e=[...B.sewerageConnection];e.splice(n,1),U(t=>s({},t,{sewerageConnection:e}))}},o.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))))}))),o.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",fontSize:" 12px"},onClick:()=>{U(e=>s({},e,{sewerageConnection:[...e.sewerageConnection||[],{connectionNo:"",isEdit:!0}]}))}},""+C("ADD_SEWERAGE")),o.createElement("div",{style:{marginTop:"40px",marginBottom:"20px"}},o.createElement("p",{style:{color:" green",fontSize:"14px",paddingBottom:"10px"}},"Please Select One Owner Name Who will have the access of No Due Certificate"),o.createElement(t.Table,{className:"customTable table-border-style",t:C,data:(null==S||null===(y=S.cpt)||void 0===y||null===(E=y.details)||void 0===E?void 0:E.owners)||[],columns:Y,getCellProps:()=>({style:{}}),disableSort:!0,manualPagination:!1,isPaginationRequired:!1})),j&&o.createElement("div",null,o.createElement(t.LabelFieldPair,{style:{marginTop:"40px"}},o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},C("NDC_FULL_NAME")+" * "),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"firstName",defaultValue:(null==B?void 0:B.firstName)||"",rules:{required:C("REQUIRED_FIELD"),validate:{pattern:e=>!!/^[-@.\/#&+\w\s]*$/.test(e)||C("INVALID_NAME")}},render:e=>{var n,r,l,i,a,u,c;return o.createElement(t.TextInput,{value:(null==B?void 0:B.firstName)||"",onChange:t=>{U(e=>s({},e,{firstName:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disabled:(null==S||null===(n=S.cpt)||void 0===n||null===(r=n.details)||void 0===r||null===(l=r.owners)||void 0===l||null===(i=l[0])||void 0===i||null===(a=i.name)||void 0===a||null===(u=a.split(" "))||void 0===u||null===(c=u[0])||void 0===c?void 0:c.length)>0})}}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},C("NDC_EMAIL")+" * "),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"email",defaultValue:(null==B?void 0:B.email)||"",render:e=>o.createElement(t.TextInput,{value:null==B?void 0:B.email,onChange:t=>{U(e=>s({},e,{email:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},C("NDC_MOBILE_NUMBER")+" * "),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"mobileNumber",defaultValue:(null==B?void 0:B.mobileNumber)||"",render:e=>{var n,r,l,i;return o.createElement(t.TextInput,{value:null==B?void 0:B.mobileNumber,onChange:t=>{U(e=>s({},e,{mobileNumber:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disabled:null==S||null===(n=S.cpt)||void 0===n||null===(r=n.details)||void 0===r||null===(l=r.owners)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.mobileNumber})}}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},C("NDC_ADDRESS")+" * "),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"address",defaultValue:(null==B?void 0:B.address)||"",render:e=>{var n,r,l,i,a;return o.createElement(t.TextInput,{value:null==B?void 0:B.address,onChange:t=>{U(e=>s({},e,{address:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disabled:(null==S||null===(n=S.cpt)||void 0===n||null===(r=n.details)||void 0===r||null===(l=r.owners)||void 0===l||null===(i=l[0])||void 0===i||null===(a=i.permanentAddress)||void 0===a?void 0:a.length)>0})}}))))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},""+C("Remarks")),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"remarks",defaultValue:(null==B?void 0:B.remarks)||"",rules:{required:C("REQUIRED_FIELD")},render:e=>o.createElement(t.TextInput,{value:(null==B?void 0:B.remarks)||"",onChange:t=>{U(e=>s({},e,{remarks:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels"},""+C("NDC_TL_NUMBER")),o.createElement("div",{className:"form-field"},o.createElement(a.Controller,{control:D,name:"tlNumber",defaultValue:(null==B?void 0:B.tlNumber)||"",render:e=>o.createElement(t.TextInput,{value:null==B?void 0:B.tlNumber,onChange:t=>{U(e=>s({},e,{tlNumber:t.target.value})),e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),O&&o.createElement(t.Toast,{isDleteBtn:!0,error:null==O?void 0:O.error,label:null==O?void 0:O.label,onClose:()=>{P(null)}}),R&&o.createElement($,{setShowToast:()=>{L(!1),M({})},billData:F}))},NDCPropertySearch:e=>{var a,u,c,d,m,v,f,p;let{config:h,onSelect:g,formData:y}=e;const{t:E}=l.useTranslation(),b=n.useRef(null),_=i.useDispatch();let{pathname:N,state:S}=r.useLocation();S=S&&("string"==typeof S||S instanceof String)?JSON.parse(S):S;const D=i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.responseData}),C=N.includes("/modify-application/"),w=window.location.href.includes("employee")?Digit.ULBService.getCurrentPermanentCity():localStorage.getItem("CITIZEN.CITY"),A=r.useLocation().search,T=new URLSearchParams(A).get("propertyId"),O=n.useRef(!0),[P,I]=n.useState(!1),x=null==D||null===(a=D[0])||void 0===a||null===(u=a.NdcDetails)||void 0===u?void 0:u.find(e=>"PT"==e.businessService),[R,L]=n.useState((null==y||null===(c=y.cpt)||void 0===c?void 0:c.id)||("null"!==T?T:"")||(null==x?void 0:x.consumerCode)||""),[F,M]=n.useState((null==y||null===(d=y.cpt)||void 0===d?void 0:d.id)||("null"!==T?T:"")||(null==x?void 0:x.consumerCode)||""),[k,B]=n.useState(null),[U,j]=n.useState(()=>{var e,t,n;return null!=y&&null!==(e=y.cpt)&&void 0!==e&&e.details&&Object.keys(null==y||null===(t=y.cpt)||void 0===t?void 0:t.details).length>0?{Properties:[s({},null==y||null===(n=y.cpt)||void 0===n?void 0:n.details)]}:{Properties:[]}}),[W,z]=n.useState(()=>{var e,t,n;return null!=y&&null!==(e=y.cpt)&&void 0!==e&&e.dues&&Object.keys(null==y||null===(t=y.cpt)||void 0===t?void 0:t.dues).length>0?{dues:s({},null==y||null===(n=y.cpt)||void 0===n?void 0:n.dues)}:{dues:{}}}),[H,V]=n.useState(!1),[q,Y]=n.useState(!1),[G,$]=n.useState(!1),[K,X]=n.useState(!1),{isLoading:Z,error:Q,data:J}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:F},tenantId:w},{filters:{propertyIds:F},tenantId:w,enabled:!!F,privacy:Digit.Utils.getPrivacyObject()});if(n.useEffect(()=>{null!=x&&x.consumerCode&&(V(!0),L(x.consumerCode),M(x.consumerCode),Y(!0),z({dues:{totalAmount:0}}),g(h.key,s({},y[h.key],{id:x.consumerCode})))},[x]),n.useEffect(()=>{var e;if(J&&null!=J&&J.Properties&&(null==J||null===(e=J.Properties)||void 0===e?void 0:e.length)>0)j(J),B(null),$(!0);else{var t;if(O.current)return void(O.current=!1);null!=y&&null!==(t=y.cpt)&&void 0!==t&&t.details||(j({}),B({error:!0,label:"CS_PT_NO_PROPERTIES_FOUND"}))}},[J]),n.useEffect(()=>{R&&(window.location.href.includes("/renew-application-details/")||window.location.href.includes("/edit-application-details/"))&&M(R)},[R]),n.useEffect(()=>{var e;0==Z&&Q&&1==Q&&0==(null==U||null===(e=U.Properties)||void 0===e?void 0:e.length)&&B({error:!0,label:"CS_PT_NO_PROPERTIES_FOUND"})},[Q,U]),n.useEffect(()=>{var e;g(h.key,s({},y[h.key],{details:null==U||null===(e=U.Properties)||void 0===e?void 0:e[0]}))},[U,N]),n.useEffect(()=>{g(h.key,s({},y[h.key],{dues:null==W?void 0:W.dues}))},[W,N]),C)return o.createElement(o.Fragment,null);var ee,te;U&&null!=U&&null!==(m=U.Properties)&&void 0!==m&&m.length&&((e,t)=>{t(Digit.Utils.pt.getMohallaLocale(null==e?void 0:e.locality.code,null==e?void 0:e.tenantId)),t(Digit.Utils.pt.getCityLocale(null==e?void 0:e.tenantId)),null!=e&&e.pincode&&t(null==e?void 0:e.pincode)})(null==U||null===(ee=U.Properties)||void 0===ee||null===(te=ee[0])||void 0===te?void 0:te.address,E),window.location.href.includes("/ws/");const ne={label:"PROPERTY_ID",type:"text",name:"id"};return n.useEffect(()=>{if(k){const e=setTimeout(()=>{B(null)},3e3);return()=>clearTimeout(e)}},[k]),o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:"16px"}},o.createElement(t.LabelFieldPair,null,o.createElement(t.CardLabel,{className:"card-label-smaller ndc_card_labels",style:window.location.href.includes("/ws/")?{fontWeight:"700"}:{}},E(ne.label)+" *"),o.createElement("div",{className:"field ndc_property_search",ref:b,id:"search-property-field"},o.createElement(t.TextInput,s({key:ne.name,value:R,onChange:e=>{L(e.target.value),g(h.key,s({},y[h.key],{[ne.name]:e.target.value})),V(!1),Y(!1),$(!1),X(!1)},disable:!1,defaultValue:void 0},ne.validation)),!H&&o.createElement("button",{className:"submit-bar",type:"button",onClick:()=>{R?R!==F&&(j({Properties:[]}),M(R),V(!0),z({dues:null}),g("PropertyDetails",{email:"",propertyBillData:{isLoading:!1,billData:{}},waterConnection:[],sewerageConnection:[],firstName:"",mobileNumber:"",address:""}),_({type:"RESET_NDC_FORM"})):B({error:!0,label:"PT_ENTER_PROPERTY_ID_AND_SEARCH"})}},""+E("PT_SEARCH")),!(null!=D&&null!==(v=D[0])&&void 0!==v&&v.NdcDetails)&&G&&!K&&o.createElement("button",{className:"submit-bar",type:"button",onClick:()=>{!function(){try{I(!0);const e=ae(function(){var e;return Promise.resolve(Digit.PaymentService.fetchBill(w,{businessService:"PT",consumerCode:null==y||null===(e=y.cpt)||void 0===e?void 0:e.id})).then(function(e){var t,n;(null==e||null===(t=e.Bill)||void 0===t?void 0:t.length)>0?((null==e||null===(n=e.Bill[0])||void 0===n?void 0:n.totalAmount)>0?(B({error:!0,label:E("NDC_MESSAGE_DUES_FOUND_PLEASE_PAY")}),X(!0)):(B({error:!1,label:E("NDC_NO_BILLS_FOUND_PROPERTY")}),Y(!0),$(!1)),z({dues:null==e?void 0:e.Bill[0]})):(B({error:!1,label:E("NDC_NO_BILLS_FOUND_PROPERTY")}),z({dues:{totalAmount:0}}),Y(!0),$(!1)),I(!1)})},function(){I(!1),B({error:!0,label:E("NDC_MESSAGE_FETCH_FAILED")})});Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()}},""+E("CHECK_STATUS_PROPERTY")),K&&o.createElement("div",{className:"ndc-pay-due-button"},"Rs. ",null==y||null===(f=y.cpt)||void 0===f||null===(p=f.dues)||void 0===p?void 0:p.totalAmount," "),K&&o.createElement("button",{className:"submit-bar",type:"button",onClick:()=>{!function(e,t,n){var o,r,l;const i="https://sdc-uat.lgpunjab.gov.in/"+(window.location.href.includes("employee")?"employee":"citizen")+"/egov-common/pay?consumerCode="+(null==y||null===(o=y.cpt)||void 0===o?void 0:o.id)+"&tenantId="+(null==y||null===(r=y.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.tenantId)+"&businessService=PT";window.open(i,"_blank"),z({})}(),X(!1)}},E("PAY_DUES")+" "),q&&o.createElement("div",{className:"ndc-no-due-button"},E("NO_DUES_FOUND_FOR_PROPERTY")))),k&&o.createElement(t.Toast,{isDleteBtn:!0,labelstyle:{width:"100%"},error:k.error,warning:k.warning,label:E(k.label),onClose:()=>{B(null)}})),(Z||P)&&o.createElement(Qe,{page:!0}))},SelectNDCDocuments:e=>{var r,l;let{t:a,config:u,onSelect:s,formData:c,setError:d,clearErrors:m,formState:v}=e;Digit.ULBService.getCurrentTenantId();const f=i.useSelector(e=>e.ndc.NDCForm.formData||{}),p=Digit.ULBService.getStateId(),[h,g]=n.useState((null==c||null===(r=c.documents)||void 0===r?void 0:r.documents)||[]),[y,E]=n.useState(null);n.useEffect(()=>{var e,t,n;if(console.log("coming here again"),null!=f&&null!==(e=f.responseData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.Documents)&&void 0!==n&&n.length&&0===h.length){var o,r,l;const e=null==f||null===(o=f.responseData)||void 0===o||null===(r=o[0])||void 0===r||null===(l=r.Documents)||void 0===l?void 0:l.map(e=>({documentType:null==e?void 0:e.documentType,fileStoreId:null==e?void 0:e.documentAttachment,documentUid:null==e?void 0:e.documentAttachment}));g(e)}},[f]);const{action:b="create"}=Digit.Hooks.useQueryParams(),{isLoading:_,data:N}=Digit.Hooks.pt.usePropertyMDMS(p,"NDC",["Documents"]),S=null==N||null===(l=N.NDC)||void 0===l?void 0:l.Documents;return n.useEffect(()=>{s(u.key,{documents:h,ndcDocumentsLength:null==S?void 0:S.length})},[h]),_?o.createElement(Qe,null):o.createElement("div",null,null==S?void 0:S.map((e,t)=>o.createElement(mn,{key:t,document:e,action:b,t:a,error:y,setError:E,setDocuments:g,documents:h,formData:c,setFormError:d,clearFormErrors:m,config:u,formState:v})),y&&o.createElement(t.Toast,{isDleteBtn:!0,label:y,onClose:()=>E(null),error:!0}))},NewNDCStepFormTwoCitizen:e=>{let{config:r,onGoNext:l,onBackClick:a,t:u}=e;const c=i.useSelector(e=>e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[r.key]?e.ndc.NDCForm.formData[r.key]:{}),d=i.useDispatch(),m=Digit.ULBService.getStateId(),[v,f]=n.useState(!1),[p,h]=n.useState(""),g=window.localStorage.getItem("CITIZEN.CITY"),{isLoading:y,data:E}=Digit.Hooks.pt.usePropertyMDMS(m,"NDC",["Documents"]),b=i.useSelector(e=>e.ndc.NDCForm.formData||{}),N=window.location.pathname.split("/").pop(),S=Digit.UserService.getUser(),{data:D}=Digit.Hooks.ndc.useSearchEmployeeApplication({applicationNo:N},g);return n.useEffect(()=>{null!=D&&D.Applications.length&&d(J("responseData",null==D?void 0:D.Applications))},[D]),o.createElement(o.Fragment,null,o.createElement(t.FormComposer,{defaultValues:c,config:r.currStepConfig,onSubmit:function(e){console.log("Data in step "+r.currStepNumber+" is: \n",e);const t=function(e){if(!y){var t,n;const o=(null==E||null===(t=E.NDC)||void 0===t?void 0:t.Documents)||[],r=(null==e||null===(n=e.documents)||void 0===n?void 0:n.documents)||[],l=o.filter(e=>e.required).map(e=>e.code),i=r.map(e=>e.documentType);return console.log("DocumentsObject",l),l.filter(e=>!i.includes(e))}}(e);if(t.length>0)return h(""+u("NDC_MESSAGE_"+t[0].replace(".","_").toUpperCase())),f(!0),void setTimeout(()=>{f(!1)},3e3);const n=N&&N.startsWith("NDC-");console.log("here",n),n?(console.log("here bab"),function(e){try{var t,n,o,r,i,a,u,c,m;Digit.UserService.getUser(),console.log("final data===?????",e),console.log("checkFormData???====",b);const v=[{name:null==S||null===(t=S.info)||void 0===t?void 0:t.name,mobileNumber:null==S||null===(n=S.info)||void 0===n?void 0:n.mobileNumber,gender:null==b||null===(o=b.NDCDetails)||void 0===o||null===(r=o.PropertyDetails)||void 0===r?void 0:r.gender,emailId:null==S||null===(i=S.info)||void 0===i?void 0:i.emailId,type:null==S||null===(a=S.info)||void 0===a?void 0:a.type}],f=(null==b||null===(u=b.responseData)||void 0===u?void 0:u[0])||{},p=s({},f,{workflow:s({},null==f?void 0:f.workflow),owners:v,NdcDetails:null==f?void 0:f.NdcDetails,Documents:[]});null===(c=(null==e||null===(m=e.documents)||void 0===m?void 0:m.documents)||[])||void 0===c||c.forEach(e=>{var t;null===(t=p.Documents)||void 0===t||t.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.fileStoreId})});const h={Applications:[p]};console.log("payload",h),Promise.resolve(Digit.NDCService.NDCUpdate({tenantId:g,details:h})).then(function(e){var t;return"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(d(J("apiData",e)),l(),{isSuccess:!0,response:e}):{isSuccess:!1,response:e}})}catch(e){return Promise.reject(e)}}(e)):(console.log("go next"),l())},onFormValueChange:function(e,t){_.isEqual(t,c)||d(J(r.key,t))},label:u(""+r.texts.submitBarLabel),currentStep:r.currStepNumber,onBackClick:function(e){a(r.key,e)}}),v&&o.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{f(!1),h("")}}))},NDCSummary:pn,NDCNewFormSummaryStepThreeCitizen:e=>{let{config:t,onBackClick:n}=e;const l=i.useDispatch(),a=r.useHistory(),u=window.localStorage.getItem("CITIZEN.CITY"),d=(Digit.UserService.getUser(),i.useSelector(e=>e.ndc.NDCForm.formData||{}));return console.log("formData 4th step",d),o.createElement(o.Fragment,null,o.createElement(pn,{formData:d,goNext:function(e){try{const t=null==e?void 0:e.action;console.log("actionStatus",t);const n=ae(function(){return Promise.resolve(function(e,t){try{const n=function(e,t){var n,o,r,l,i,a,u,m,v;Digit.UserService.getUser(),console.log("inputData",e);const f=null===(n=(null==e||null===(o=e.apiData)||void 0===o||null===(r=o.Applications)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.owners)||[])||void 0===n?void 0:n.map(e=>c(e,hn)),p=(null==d||null===(i=d.responseData)||void 0===i?void 0:i[0])||(null==d||null===(a=d.apiData)||void 0===a||null===(u=a.Applications)||void 0===u?void 0:u[0])||{};console.log("baseApplication",p);const h=s({},p,{workflow:s({},null==p?void 0:p.workflow,{action:t}),owners:f,NdcDetails:null==p?void 0:p.NdcDetails,Documents:[]});((null==e||null===(m=e.DocummentDetails)||void 0===m||null===(v=m.documents)||void 0===v?void 0:v.documents)||[]).forEach(e=>{h.Documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId})});const g={Applications:[h]};return console.log("updatedApplication",h),g}(e,t);return console.log("finalPayload",n),Promise.resolve(Digit.NDCService.NDCUpdate({tenantId:u,details:n})).then(function(e){var t;return l({type:"RESET_NDC_FORM"}),"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?{isSuccess:!0,response:e}:{isSuccess:!1,response:e}})}catch(e){return Promise.reject(e)}}(d,t)).then(function(e){var t,n,o;null!=e&&e.isSuccess?a.push("/digit-ui/citizen/ndc/response/"+(null==e||null===(t=e.response)||void 0===t||null===(n=t.Applications)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.applicationNo)):console.error("Submission failed, not moving to next step.",null==e?void 0:e.response)})},function(e){alert("Error: "+(null==e?void 0:e.message))});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onGoBack:e=>{n(t.key,e)}}))},PayWSBillModal:e=>{let{setShowToast:n,billData:r}=e;const{t:i}=l.useTranslation(),a=null==r?void 0:r.consumerCode,u=null==r?void 0:r.businessService,c=null==r?void 0:r.tenantId,{data:d,isLoading:m,isError:v}=Digit.Hooks.useDemandSearch({consumerCode:a,businessService:u,tenantId:c}),f=()=>n(),p=()=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#FFFFFF",viewBox:"0 0 24 24"},o.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o.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 \r 17.59 19 19 17.59 13.41 12 19 6.41z"})),h=e=>{let{onClick:t}=e;return o.createElement("div",{className:"icon-bg-secondary",onClick:t},o.createElement(p,null))},g=e=>new Date(e).toLocaleDateString("en-GB"),y={demandTax:0,demandInterest:0,demandPenalty:0,collectionTax:0,collectionInterest:0,collectionPenalty:0,balanceTax:0,balanceInterest:0,balancePenalty:0},E={border:"1px solid #ddd",padding:"6px 8px",textAlign:"right"},b={border:"1px solid #ddd",padding:"6px 8px",textAlign:"left"};return o.createElement(t.Modal,{headerBarMain:o.createElement(e=>{let{label:t}=e;return o.createElement("h1",{className:"heading-m"},t)},{label:i("Pay Due Amounts for "+("WS"===(null==r?void 0:r.businessService)?"Water Connection":"Sewerage Connection"))}),headerBarEnd:o.createElement(h,{onClick:f}),actionCancelLabel:i("CANCEL"),actionCancelOnSubmit:f,actionSaveLabel:i("PAY"),actionSaveOnSubmit:()=>console.log("Pay API"),formId:"modal-action",popupStyles:{width:"90%",marginTop:"5px"}},m?o.createElement(t.Loader,null):v?o.createElement("p",{style:{color:"red",padding:"1rem"}},i("ERROR_LOADING_DATA")):o.createElement("div",{style:{overflowX:"auto"}},o.createElement("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"14px",marginTop:"1rem"}},o.createElement("thead",null,o.createElement("tr",{style:{backgroundColor:"#f0f0f0"}},o.createElement("th",{rowSpan:2,style:b},"Installments"),o.createElement("th",{colSpan:3,style:s({},E,{textAlign:"center"})},"Demand"),o.createElement("th",{colSpan:3,style:s({},E,{textAlign:"center"})},"Collection"),o.createElement("th",{colSpan:3,style:s({},E,{textAlign:"center"})},"Balance")),o.createElement("tr",{style:{backgroundColor:"#f9f9f9"}},o.createElement("th",{style:E},"Tax"),o.createElement("th",{style:E},"Interest"),o.createElement("th",{style:E},"Penalty"),o.createElement("th",{style:E},"Tax"),o.createElement("th",{style:E},"Interest"),o.createElement("th",{style:E},"Penalty"),o.createElement("th",{style:E},"Tax"),o.createElement("th",{style:E},"Interest"),o.createElement("th",{style:E},"Penalty"))),o.createElement("tbody",null,null==d||null===(_=d.Demands)||void 0===_?void 0:_.map((e,t)=>{const n=g(e.taxPeriodFrom)+" - "+g(e.taxPeriodTo);let r=0,l=0,i=0,a=0,u=0,s=0;e.demandDetails.forEach(e=>{const t=e.taxHeadMasterCode||"",n=e.taxAmount||0,o=e.collectionAmount||0;t.includes("CHARGE")?(r+=n,a+=o):t.includes("INTEREST")?(l+=n,u+=o):t.includes("PENALTY")&&(i+=n,s+=o)});const c=r-a,d=l-u,m=i-s;return y.demandTax+=r,y.demandInterest+=l,y.demandPenalty+=i,y.collectionTax+=a,y.collectionInterest+=u,y.collectionPenalty+=s,y.balanceTax+=c,y.balanceInterest+=d,y.balancePenalty+=m,o.createElement("tr",{key:t},o.createElement("td",{style:b},n),o.createElement("td",{style:E},r.toFixed(2)),o.createElement("td",{style:E},l.toFixed(2)),o.createElement("td",{style:E},i.toFixed(2)),o.createElement("td",{style:E},a.toFixed(2)),o.createElement("td",{style:E},u.toFixed(2)),o.createElement("td",{style:E},s.toFixed(2)),o.createElement("td",{style:E},c.toFixed(2)),o.createElement("td",{style:E},d.toFixed(2)),o.createElement("td",{style:E},m.toFixed(2)))}),o.createElement("tr",{style:{backgroundColor:"#efefef",fontWeight:"bold"}},o.createElement("td",{style:b},"Total"),o.createElement("td",{style:E},y.demandTax.toFixed(2)),o.createElement("td",{style:E},y.demandInterest.toFixed(2)),o.createElement("td",{style:E},y.demandPenalty.toFixed(2)),o.createElement("td",{style:E},y.collectionTax.toFixed(2)),o.createElement("td",{style:E},y.collectionInterest.toFixed(2)),o.createElement("td",{style:E},y.collectionPenalty.toFixed(2)),o.createElement("td",{style:E},y.balanceTax.toFixed(2)),o.createElement("td",{style:E},y.balanceInterest.toFixed(2)),o.createElement("td",{style:E},y.balancePenalty.toFixed(2)))))));var _},NewNDCStepFormEmployee:()=>{const e=r.useHistory(),{t:a}=l.useTranslation(),u=i.useDispatch(),[s,c]=n.useState(null),d=i.useSelector(e=>e.ndc.NDCForm).step,m=Digit.ULBService.getCurrentTenantId(),v=window.location.pathname.split("/").pop(),{data:f}=Digit.Hooks.ndc.useSearchEmployeeApplication({applicationNo:v},m);return n.useEffect(()=>{null!=f&&f.Applications.length&&u(J("responseData",null==f?void 0:f.Applications))},[f]),n.useEffect(()=>{const t=e.listen(()=>{u({type:"RESET_NDC_FORM"})});return()=>t()},[e,u]),o.createElement("div",{className:"card"},o.createElement(t.CardHeader,{className:"ndc-emp-step-form",divider:!0},a("ndc_header_application")),o.createElement(Z,{stepsList:gn,onSubmit:()=>{},step:d,setStep:e=>{u(ee(e))}}),s&&o.createElement(t.Toast,{error:s.key,label:a(s.label),onClose:()=>{c(null)},isDleteBtn:"true"}))},NewNDCStepFormOneEmployee:e=>{var r;let{config:l,onGoNext:a,onBackClick:u,t:d}=e;const m=i.useDispatch(),[v,f]=n.useState(!1),[p,h]=n.useState(""),[g,y]=n.useState(!1),E=i.useSelector(e=>e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[l.key]?e.ndc.NDCForm.formData[l.key]:{}),b=(i.useSelector(e=>{var t,n;return null===(t=e.ndc.NDCForm)||void 0===t||null===(n=t.formData)||void 0===n?void 0:n.apiData}),i.useSelector(e=>e.ndc.NDCForm.formData||{})),N=window.localStorage.getItem("Employee.tenant-id");return o.createElement(o.Fragment,null,o.createElement(t.FormComposer,{defaultValues:E,config:l.currStepConfig,onSubmit:function(e){var t,n,o,r,l;const i=function(e){var t,n,o,r,l;const i=[],a=[],u=(null==e?void 0:e.cpt)||{},s=(null==u?void 0:u.details)||{},c=(null==e?void 0:e.PropertyDetails)||{},m=(null==e?void 0:e.NDCReason)||{};return null!=e&&null!==(t=e.cpt)&&void 0!==t&&t.dues||a.push(d("NDC_MESSAGE_PLEASE_CHECK_STATUS_OF_PROPERTY_TAX")+" "+(null==u?void 0:u.id)),(null==e||null===(n=e.cpt)||void 0===n||null===(o=n.dues)||void 0===o?void 0:o.totalAmount)>0&&a.push(d("NDC_MESSAGE_PLEASE_PAY_DUES_OF_PROPERTY_TAX")+" "+(null==u?void 0:u.id)),(null==c||null===(r=c.waterConnection)||void 0===r?void 0:r.length)>0&&c.waterConnection.forEach(e=>{var t,n;null!=e&&null!==(t=e.billData)&&void 0!==t&&t.id&&(null==e||null===(n=e.billData)||void 0===n?void 0:n.totalAmount)>0&&a.push(d("NDC_MESSAGE_PLEASE_PAY_DUES_OF_WATER_CONNECTION")+" "+(null==e?void 0:e.connectionNo))}),(null==c||null===(l=c.sewerageConnection)||void 0===l?void 0:l.length)>0&&c.sewerageConnection.forEach(e=>{var t,n;null!=e&&null!==(t=e.billData)&&void 0!==t&&t.id&&(null==e||null===(n=e.billData)||void 0===n?void 0:n.totalAmount)>0&&a.push(d("NDC_MESSAGE_PLEASE_PAY_DUES_OF_SEWERAGE_CONNECTION")+" "+(null==e?void 0:e.connectionNo))}),null!=u&&u.id||i.push(d("NDC_MESSAGE_PROPERTY_ID")),s&&0!==Object.keys(s).length||i.push(d("NDC_MESSAGE_PLEASE_SEARCH_PROPERTY_ID")),null!=c&&c.firstName||i.push(d("NDC_MESSAGE_FIRST_NAME")),null!=c&&c.mobileNumber||i.push(d("NDC_MESSAGE_MOBILE_NUMBER")),null!=c&&c.address||i.push(d("NDC_MESSAGE_ADDRESS")),null!=c&&c.email||i.push(d("NDC_MESSAGE_EMAIL")),null!=m&&m.code||i.push(d("NDC_MESSAGE_NDC_REASON")),null!=c&&c.firstName&&!/^[A-Za-z\s]+$/.test(c.firstName)&&a.push(d("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED")),null!=c&&c.email&&!/^(?!\.)(?!.*\.\.)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/.test(c.email)&&a.push(d("NDC_MESSAGE_EMAIL_INVALID_FORMAT")),null!=c&&c.mobileNumber&&!/^[6-9]\d{9}$/.test(c.mobileNumber)&&a.push(d("NDC_MESSAGE_MOBILE_NUMBER_MUST_BE_A_VALID_TEN_DIGIT_INDIAN_NUMBER")),[...i,...a]}(E);if(i.length>0)return h(""+i[0]),f(!0),void setTimeout(()=>{f(!1)},3e3);null!=b&&null!==(t=b.apiData)&&void 0!==t&&null!==(n=t.Applications)&&void 0!==n&&null!==(o=n[0])&&void 0!==o&&o.applicationNo||null!=b&&null!==(r=b.responseData)&&void 0!==r&&null!==(l=r[0])&&void 0!==l&&l.applicationNo?a():function(e){try{var t,n,o,r,l,i,u,d,v;y(!0);const C=(null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info)||{},w=null==C?void 0:C.uuid,A=((null==e||null===(n=e.cpt)||void 0===n||null===(o=n.details)||void 0===o?void 0:o.owners)||[]).map(t=>{var n,o,r,l,i;let a=c(t,yn);var u;return(null==a||null===(n=a.name)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.toLowerCase())===(null==e||null===(r=e.PropertyDetails)||void 0===r||null===(l=r.firstName)||void 0===l||null===(i=l.trim())||void 0===i?void 0:i.toLowerCase())?s({},a,{emailId:null==e||null===(u=e.PropertyDetails)||void 0===u?void 0:u.email,isPrimaryOwner:!0}):a}),T=[];var f;if(((null==e||null===(r=e.PropertyDetails)||void 0===r?void 0:r.waterConnection)||[]).forEach(t=>{var n,o,r,l,i,a;T.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:w,businessService:"WS",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),((null==e||null===(l=e.PropertyDetails)||void 0===l?void 0:l.sewerageConnection)||[]).forEach(t=>{var n,o,r,l,i,a;T.push({uuid:null==t||null===(n=t.billData)||void 0===n?void 0:n.id,applicantId:w,businessService:"SW",consumerCode:null==t?void 0:t.connectionNo,additionalDetails:{propertyAddress:null==e||null===(o=e.PropertyDetails)||void 0===o?void 0:o.address,propertyType:null==e||null===(r=e.cpt)||void 0===r||null===(l=r.details)||void 0===l?void 0:l.usageCategory},dueAmount:(null==t||null===(i=t.billData)||void 0===i?void 0:i.totalAmount)||0,status:null==t||null===(a=t.billData)||void 0===a?void 0:a.status})}),null!=e&&null!==(i=e.PropertyDetails)&&void 0!==i&&i.tlNumber&&T.push({businessService:"TL",consumerCode:null==e||null===(f=e.PropertyDetails)||void 0===f?void 0:f.tlNumber}),null!=e&&null!==(u=e.PropertyDetails)&&void 0!==u&&null!==(d=u.propertyBillData)&&void 0!==d&&d.billData){var p,h,g,E,b,_,S,D;const t=null==e||null===(p=e.PropertyDetails)||void 0===p||null===(h=p.propertyBillData)||void 0===h?void 0:h.billData;T.push({uuid:null==t?void 0:t.id,applicantId:w,businessService:"PT",consumerCode:null==e||null===(g=e.cpt)||void 0===g?void 0:g.id,additionalDetails:{propertyAddress:null==e||null===(E=e.PropertyDetails)||void 0===E?void 0:E.address,propertyType:null==e||null===(b=e.cpt)||void 0===b||null===(_=b.details)||void 0===_?void 0:_.usageCategory,reason:null==e||null===(S=e.NDCReason)||void 0===S?void 0:S.reason,remarks:null==e||null===(D=e.PropertyDetails)||void 0===D?void 0:D.remarks},dueAmount:(null==t?void 0:t.totalAmount)||0,status:null==t?void 0:t.status})}const O={Applications:[{tenantId:N,owners:A,NdcDetails:T,Documents:[],active:!0,reason:null==e||null===(v=e.NDCReason)||void 0===v?void 0:v.code,workflow:{action:"INITIATE"}}]};Promise.resolve(ae(function(){return Promise.resolve(Digit.NDCService.NDCcreate({tenantId:N,details:O})).then(function(e){var t;return y(!1),"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(m(J("apiData",e)),a(),{isSuccess:!0,response:e}):{isSuccess:!1,response:e}})},function(){y(!1)}))}catch(e){return Promise.reject(e)}}(e),a()},onFormValueChange:function(e,t){_.isEqual(t,E)||m(J(l.key,t))},label:d(""+(null==l||null===(r=l.texts)||void 0===r?void 0:r.submitBarLabel)),currentStep:l.currStepNumber,onBackClick:function(e){u(l.key,e)}}),g&&o.createElement(Qe,{page:!0}),v&&o.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{f(!1),h("")}}))},NewNDCStepFormTwoEmployee:e=>{let{config:r,onGoNext:l,onBackClick:a,t:u}=e;const s=i.useSelector(e=>e.ndc.NDCForm.formData&&e.ndc.NDCForm.formData[r.key]?e.ndc.NDCForm.formData[r.key]:{}),c=i.useDispatch(),d=Digit.ULBService.getStateId(),[m,v]=n.useState(!1),[f,p]=n.useState(""),{isLoading:h,data:g}=Digit.Hooks.pt.usePropertyMDMS(d,"NDC",["Documents"]);return o.createElement(o.Fragment,null,o.createElement(t.FormComposer,{defaultValues:s,config:r.currStepConfig,onSubmit:function(e){console.log("Data in step "+r.currStepNumber+" is: \n",e);const t=function(e){if(!h){var t,n;const o=(null==g||null===(t=g.NDC)||void 0===t?void 0:t.Documents)||[],r=(null==e||null===(n=e.documents)||void 0===n?void 0:n.documents)||[],l=o.filter(e=>e.required).map(e=>e.code),i=r.map(e=>e.documentType);return console.log("DocumentsObject",l),l.filter(e=>!i.includes(e))}}(e);if(t.length>0)return p(""+u("NDC_MESSAGE_"+t[0].replace(".","_").toUpperCase())),v(!0),void setTimeout(()=>{v(!1)},3e3);l()},onFormValueChange:function(e,t){_.isEqual(t,s)||c(J(r.key,t))},label:u(""+r.texts.submitBarLabel),currentStep:r.currStepNumber,onBackClick:function(e){a(r.key,e)}}),m&&o.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:f,onClose:()=>{v(!1),p("")}}))},NDCNewFormSummaryStepThreeEmployee:e=>{let{config:t,onBackClick:n}=e;const l=i.useDispatch(),a=r.useHistory(),u=window.localStorage.getItem("CITIZEN.CITY"),d=(i.useSelector(e=>e.ndc.NDCForm.formData||{}),i.useSelector(e=>e.ndc.NDCForm.formData||{}));return console.log("formData",d),o.createElement(o.Fragment,null,o.createElement(pn,{formData:d,goNext:function(e){try{console.log("yeah",e),console.log("formData",d);const t=null==e?void 0:e.action,n=ae(function(){return Promise.resolve(function(e,t){try{console.log("coming here btw");const n=function(e,t){var n,o,r,l,i,a,u,m,v;Digit.UserService.getUser(),console.log("checkFormData",d);const f=null===(n=(null==e||null===(o=e.apiData)||void 0===o||null===(r=o.Applications)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.owners)||[])||void 0===n?void 0:n.map(e=>c(e,En)),p=(null==d||null===(i=d.responseData)||void 0===i?void 0:i[0])||(null==d||null===(a=d.apiData)||void 0===a||null===(u=a.Applications)||void 0===u?void 0:u[0])||{},h=s({},p,{workflow:s({},null==p?void 0:p.workflow,{action:t}),owners:f,NdcDetails:null==p?void 0:p.NdcDetails,Documents:[]});return((null==e||null===(m=e.DocummentDetails)||void 0===m||null===(v=m.documents)||void 0===v?void 0:v.documents)||[]).forEach(e=>{h.Documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.fileStoreId})}),{Applications:[h]}}(e,t);return Promise.resolve(Digit.NDCService.NDCUpdate({tenantId:u,details:n})).then(function(e){var t;return l({type:"RESET_NDC_FORM"}),"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?{isSuccess:!0,response:e}:{isSuccess:!1,response:e}})}catch(e){return Promise.reject(e)}}(d,t)).then(function(e){var t,n,o;null!=e&&e.isSuccess?a.push("/digit-ui/employee/ndc/response/"+(null==e||null===(t=e.response)||void 0===t||null===(n=t.Applications)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.applicationNo)):console.error("Submission failed, not moving to next step.",null==e?void 0:e.response)})},function(e){alert("Error: "+(null==e?void 0:e.message))});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onGoBack:e=>{console.log("here",e),n(t.key,e)}}))},MyApplications:e=>{const{t:i}=l.useTranslation(),a=(Digit.UserService.getUser(),window.localStorage.getItem("CITIZEN.CITY")),{isLoading:u,data:s}=Digit.Hooks.ndc.useSearchApplication({},a),[c,d]=n.useState(1);if(u)return o.createElement(t.Loader,null);const m=(null==s?void 0:s.data)||[],v=Math.ceil(m.length/5),f=5*c,p=m.slice(f-5,f);return console.log("currentApplications",p),o.createElement(o.Fragment,null,o.createElement(t.Header,null,i("TL_MY_APPLICATIONS_HEADER")),p.map((e,n)=>{var l,u,s,c,d,m,v;const f=(null==e||null===(l=e.Applications)||void 0===l?void 0:l.owners)||[],p=null==f||null===(u=f.map(e=>null==e?void 0:e.name))||void 0===u||null===(s=u.filter(Boolean))||void 0===s?void 0:s.join(", ");return o.createElement("div",{key:"card-"+n},o.createElement(t.Card,null,o.createElement(t.KeyNote,{keyValue:i("BPA_APPLICATION_NUMBER_LABEL"),note:i(null==e||null===(c=e.Applications)||void 0===c?void 0:c.applicationNo)}),o.createElement(t.KeyNote,{keyValue:i("TL_LOCALIZATION_OWNER_NAME"),note:i(p)}),o.createElement(t.KeyNote,{keyValue:i("TL_HOME_SEARCH_RESULTS_APP_STATUS_LABEL"),note:i(null==e?void 0:e.TL_HOME_SEARCH_RESULTS_APP_STATUS_LABEL)}),o.createElement("div",{className:"action-button-myapplication"},o.createElement(r.Link,{to:"/digit-ui/citizen/ndc/search/application-overview/"+(null==e||null===(d=e.Applications)||void 0===d?void 0:d.applicationNo)},o.createElement(t.SubmitBar,{label:i("CS_VIEW_DETAILS")})),"PENDINGPAYMENT"===(null==e||null===(m=e.Applications)||void 0===m?void 0:m.applicationStatus)&&o.createElement(r.Link,{to:"/digit-ui/citizen/payment/collect/NDC/"+(null==e||null===(v=e.Applications)||void 0===v?void 0:v.applicationNo)+"/"+a+"?tenantId="+a},o.createElement(t.SubmitBar,{label:i("CS_APPLICATION_DETAILS_MAKE_PAYMENT")})))))}),!m.length&&o.createElement("p",{className:"ndc-application-list"},i("PTR_NO_APPLICATION_FOUND_MSG")),m.length>5&&o.createElement("div",{className:"ndc-application-overview-custom"},o.createElement("button",{disabled:1===c,onClick:()=>d(e=>e-1),style:{cursor:1===c?"not-allowed":"pointer"}},"← Prev"),o.createElement("span",null,"Page ",c," of ",v),o.createElement("button",{disabled:c===v,onClick:()=>d(e=>e+1),style:{cursor:c===v?"not-allowed":"pointer"}},"Next →")),o.createElement("p",{className:"ndc-application-list"},i("PTR_TEXT_NOT_ABLE_TO_FIND_THE_APPLICATION")," ",o.createElement("span",{className:"link",style:{display:"block"}},o.createElement(r.Link,{to:"/digit-ui/citizen/ndc/new-application"},i("NDC_COMMON_CLICK_HERE_TO_REGISTER_NEW_APPLICATION")))))},NDCResponseCitizen:e=>{var n,i,a;const{state:u}=e.location,{t:s}=l.useTranslation(),c=r.useHistory(),d=null==u||null===(n=u.data)||void 0===n||null===(i=n.Noc)||void 0===i?void 0:i[0],m=window.localStorage.getItem("CITIZEN.CITY"),v=((null==c||null===(a=c.location)||void 0===a?void 0:a.pathname)||"").split("/").pop();return o.createElement("div",null,o.createElement(t.Card,null,o.createElement(t.Banner,{message:"NDC Application Submitted Successfully",applicationNumber:v,info:"REJECTED"==(null==d?void 0:d.applicationStatus)?"":s("NDC_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==d?void 0:d.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),o.createElement(t.ActionBar,{className:"ndc-action-bar"},o.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{c.push("/digit-ui/citizen")}}),o.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_NDC"),onSubmit:()=>{c.push("/digit-ui/citizen/ndc-home")}}),o.createElement(t.SubmitBar,{label:s("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:()=>{c.push("/digit-ui/citizen/payment/collect/NDC/"+v+"/"+m+"?tenantId="+m)}}))))},CitizenApplicationOverview:()=>{var e,i,a,u,c,d,m,f,p,h,g,y,E,b,_,N,S,D,C;const{id:w}=r.useParams(),{t:A}=l.useTranslation(),T=r.useHistory(),O=window.localStorage.getItem("CITIZEN.CITY"),P=null==O?void 0:O.split(".")[0],[I,x]=n.useState({}),[R,L]=n.useState(null),[F,M]=n.useState(null),[k,B]=n.useState([]),[U,j]=n.useState({}),[W,z]=n.useState(!1),[H,V]=n.useState(!1),{isLoading:q,data:Y}=(window.Digit.Utils.browser.isMobile(),Digit.Hooks.pt.usePropertyMDMS(P,"NDC",["Documents"]),Digit.Hooks.ndc.useSearchEmployeeApplication({applicationNo:w},O)),G=Digit.Hooks.useWorkflowDetails({tenantId:O,id:w,moduleCode:"ndc-services"});n.useEffect(()=>{if(G){var e,t,n;console.log("workflowDetails here",G);const o=null==G||null===(e=G.data)||void 0===e||null===(t=e.processInstances)||void 0===t?void 0:t.find(e=>"APPROVE"===(null==e?void 0:e.action)),r=(null==o||null===(n=o.assigner)||void 0===n?void 0:n.name)||"NA";M(r)}},[G]);const $=v(O,F);console.log("approver for ndc",F),console.log("officerData",$);const{data:K}=Digit.Hooks.useStore.getInitData(),{tenants:X}=K||{};let Z=Digit.UserService.getUser();if(n.useRef(),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};Z=null==t?void 0:t.value}null===(e=Z)||void 0===e||null===(i=e.info)||void 0===i||null===(a=i.roles)||void 0===a||a.map(e=>e.code);const Q=e=>{const t=new Set;return e.filter(e=>!t.has(e.uuid)&&(t.add(e.uuid),!0))};n.useEffect(()=>{var e;const t=null==Y||null===(e=Y.Applications)||void 0===e?void 0:e[0];if(console.log("ndcObject",t),t){var n,o,r;const e=(null==t||null===(n=t.owners)||void 0===n?void 0:n.find(e=>null==e?void 0:e.isPrimaryOwner))||(null==t||null===(o=t.owners)||void 0===o?void 0:o[0]),l={name:null==e?void 0:e.name,mobile:null==e?void 0:e.mobileNumber,email:null==e?void 0:e.emailId,address:null==e?void 0:e.permanentAddress,applicationNo:null==t?void 0:t.applicationNo},i=Q((null==t?void 0:t.Documents)||[]),a=null===(r=Q((null==t?void 0:t.NdcDetails)||[]))||void 0===r?void 0:r.map(e=>{var t;return{businessService:"WS"===(null==e?void 0:e.businessService)?"NDC_WATER_SERVICE_CONNECTION":"SW"===(null==e?void 0:e.businessService)?"NDC_SEWERAGE_SERVICE_CONNECTION":"PT"===(null==e?void 0:e.businessService)?"NDC_PROPERTY_TAX":null==e?void 0:e.businessService,consumerCode:(null==e?void 0:e.consumerCode)||"",status:(null==e?void 0:e.status)||"",dueAmount:(null==e?void 0:e.dueAmount)||0,propertyType:(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.propertyType)||""}});j({applicantData:l,Documents:i,NdcDetails:a})}},[null==Y?void 0:Y.Applications]),n.useEffect(()=>{Y&&(V(!0),x(s({},Y,{applicationDetails:[{title:"NOC_DETAILS_SUMMARY_LABEL"}]})),V(!1))},[Y]);const[J,ee]=n.useState(null);n.useEffect(()=>{if(U){var e,t;console.log("here");const n=null==U||null===(e=U.NdcDetails)||void 0===e?void 0:e.filter(e=>"NDC_PROPERTY_TAX"==(null==e?void 0:e.businessService));console.log("checkProperty",n),ee(null==n||null===(t=n[0])||void 0===t?void 0:t.consumerCode)}},[U]);const{isLoading:te,data:ne}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:J},tenantId:O},{filters:{propertyIds:J},tenantId:O,enabled:!!J,privacy:Digit.Utils.getPrivacyObject()});let oe,re;var le,ie,ue,ce,de,me;if(!te&&(null==ne||null===(u=ne.Properties)||void 0===u?void 0:u.length)>0&&(oe=ne.Properties[0].address,re=[null===(le=oe)||void 0===le?void 0:le.doorNo,null===(ie=oe)||void 0===ie?void 0:ie.buildingName,null===(ue=oe)||void 0===ue?void 0:ue.street,null===(ce=oe)||void 0===ce||null===(de=ce.locality)||void 0===de?void 0:de.name,null===(me=oe)||void 0===me?void 0:me.city].filter(Boolean).join(", ")),q||H)return o.createElement(Qe,null);console.log("propertyDetailsFetch",ne),console.log("displayData?.applicantData",U);const ve=(null==ne||null===(c=ne.Properties)||void 0===c||null===(d=c[0])||void 0===d?void 0:d.owners)||[],fe=null==ve||null===(m=ve.map(e=>null==e?void 0:e.name))||void 0===m||null===(f=m.filter(Boolean))||void 0===f?void 0:f.join(", ");return console.log("applicationDetails?.[0]",null==Y||null===(p=Y.Applications)||void 0===p?void 0:p[0]),o.createElement("div",{className:"employee-main-application-details"},o.createElement("div",{className:"ndc-application-overview"},o.createElement("div",{style:{display:"flex",justifyContent:"end",alignItems:"center",padding:"16px"}},"APPROVED"===(null==Y||null===(h=Y.Applications)||void 0===h||null===(g=h[0])||void 0===g?void 0:g.applicationStatus)&&o.createElement(t.LinkButton,{className:"downLoadButton",label:A("DOWNLOAD_CERTIFICATE"),onClick:function(){try{const e=function(e,t){try{var n=ae(function(){var e,t,n;function o(){console.log("acknowledgementData",u),setTimeout(()=>{Digit.Utils.pdf.generateNDC(u)},0)}z(!0);const r=Y,l=((null==ne||null===(e=ne.Properties)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.owners)||[]).map(e=>null==e?void 0:e.name).filter(Boolean);r.propertyOwnerNames=l,console.log("propertyOwnerNames",l);const i=null==X?void 0:X.find(e=>{var t,n;return(null==e?void 0:e.code)===(null==r||null===(t=r.Applications)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.tenantId)});console.log("tenantInfo",i);const a=null==i||null===(n=i.city)||void 0===n?void 0:n.ulbType;let u;const s=function(){if($)return Promise.resolve(it(r,re,i,A,F,a,$)).then(function(e){u=e})}();return s&&s.then?s.then(o):o()},function(e){console.error("Error generating acknowledgement:",e)})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(z(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})),("INITIATED"==(null==Y||null===(y=Y.Applications)||void 0===y||null===(E=y[0])||void 0===E?void 0:E.applicationStatus)||"CITIZENACTIONREQUIRED"==(null==Y||null===(b=Y.Applications)||void 0===b||null===(_=b[0])||void 0===_?void 0:_.applicationStatus))&&o.createElement(t.ActionBar,null,o.createElement(t.SubmitBar,{label:A("COMMON_EDIT"),onSubmit:()=>{var e,t;const n=null==Y||null===(e=Y.Applications)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.applicationNo;T.push("/digit-ui/citizen/ndc/new-application/"+n)}}))),o.createElement(t.Card,{className:"ndc_card_main"},o.createElement(t.CardSubHeader,{className:"ndc_label"},A("NDC_APPLICATION_DETAILS_OVERVIEW")),o.createElement(t.StatusTable,null,o.createElement(t.Row,{label:A("Name"),text:fe}),(null==U?void 0:U.applicantData)&&(null===(N=Object.entries(null==U?void 0:U.applicantData))||void 0===N||null===(S=N.filter(e=>{let[t]=e;return"name"!==t}))||void 0===S?void 0:S.map(e=>{let[n,r]=e;return o.createElement(t.Row,{key:n,label:A(""+(null==n?void 0:n.toUpperCase())),text:Array.isArray(r)?r.map(e=>A("object"==typeof e?(null==e?void 0:e.code)||"N/A":e||"N/A")).join(", "):A("object"==typeof r?(null==r?void 0:r.code)||"N/A":r||"N/A")})})))),o.createElement(t.Card,{className:"ndc_card_main"},o.createElement(t.CardSubHeader,{className:"ndc_label"},A("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")),null==U||null===(D=U.NdcDetails)||void 0===D?void 0:D.map((e,r)=>{var l,i,a,u,s,c,d,m,v,f,p,h,g,y,E,b,_,N,S,D,C,w,T,O,P,I,x,R,L,F,M,k,B,U,j;console.log("detail",e);const W=e.dueAmount>0;return o.createElement("div",{className:"ndc-application-overview-table",key:r},o.createElement(t.StatusTable,null,o.createElement(t.Row,{label:A("NDC_BUSINESS_SERVICE"),text:A(""+e.businessService)||e.businessService}),o.createElement(t.Row,{label:A("NDC_CONSUMER_CODE"),text:e.consumerCode||"N/A"}),o.createElement("div",{style:{background:W?"red":"none",color:W?"white":"black",paddingTop:W?"8px":"0",paddingLeft:W?"10px":"0"}},o.createElement(t.Row,{rowContainerStyle:{backgroundColor:W?"red":"none"},label:A("NDC_DUE_AMOUNT"),text:(null===(l=e.dueAmount)||void 0===l?void 0:l.toString())||"0"})),o.createElement(t.Row,{label:A("NDC_PROPERTY_TYPE"),text:A(e.propertyType)||e.propertyType}),"NDC_PROPERTY_TAX"==(null==e?void 0:e.businessService)&&(null==ne?void 0:ne.Properties)&&o.createElement(n.Fragment,null,o.createElement(t.Row,{label:A("CHB_DISCOUNT_REASON"),text:A(""+("OTHERS"===(null==Y||null===(i=Y.Applications)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.reason)?null==Y||null===(u=Y.Applications)||void 0===u||null===(s=u[0])||void 0===s||null===(c=s.NdcDetails)||void 0===c||null===(d=c.find(e=>"PT"===(null==e?void 0:e.businessService)))||void 0===d||null===(m=d.additionalDetails)||void 0===m?void 0:m.reason:null==Y||null===(v=Y.Applications)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.reason))}),o.createElement(t.Row,{label:A("City"),text:(null==ne||null===(p=ne.Properties)||void 0===p||null===(h=p[0])||void 0===h||null===(g=h.address)||void 0===g?void 0:g.city)||"N/A"}),o.createElement(t.Row,{label:A("House No"),text:(null==ne||null===(y=ne.Properties)||void 0===y||null===(E=y[0])||void 0===E||null===(b=E.address)||void 0===b?void 0:b.doorNo)||"N/A"}),o.createElement(t.Row,{label:A("Colony Name"),text:(null==ne||null===(_=ne.Properties)||void 0===_||null===(N=_[0])||void 0===N||null===(S=N.address)||void 0===S?void 0:S.buildingName)||"N/A"}),o.createElement(t.Row,{label:A("Street Name"),text:(null==ne||null===(D=ne.Properties)||void 0===D||null===(C=D[0])||void 0===C||null===(w=C.address)||void 0===w?void 0:w.street)||"N/A"}),o.createElement(t.Row,{label:A("Pincode"),text:(null==ne||null===(T=ne.Properties)||void 0===T||null===(O=T[0])||void 0===O||null===(P=O.address)||void 0===P?void 0:P.pincode)||"N/A"}),o.createElement(t.Row,{label:A("Survey Id/UID"),text:(null==ne||null===(I=ne.Properties)||void 0===I||null===(x=I[0])||void 0===x?void 0:x.surveyId)||"N/A"}),o.createElement(t.Row,{label:A("Year of creation of Property"),text:null==ne||null===(R=ne.Properties)||void 0===R||null===(L=R[0])||void 0===L||null===(F=L.additionalDetails)||void 0===F?void 0:F.yearConstruction}),o.createElement(t.Row,{label:A("Remarks"),text:(null==Y||null===(M=Y.Applications)||void 0===M||null===(k=M[0])||void 0===k||null===(B=k.NdcDetails)||void 0===B||null===(U=B.find(e=>"PT"===(null==e?void 0:e.businessService)))||void 0===U||null===(j=U.additionalDetails)||void 0===j?void 0:j.remarks)||"N/A"}))))})),o.createElement(t.Card,{className:"ndc_card_main"},o.createElement(t.CardSubHeader,{className:"ndc_label"},A("NDC_APPLICATION_DOCUMENTS_OVERVIEW")),o.createElement("div",null,Array.isArray(null==U?void 0:U.Documents)&&(null==U||null===(C=U.Documents)||void 0===C?void 0:C.length)>0?o.createElement(se,{value:{workflowDocs:null==U?void 0:U.Documents}}):o.createElement("div",null,A("TL_NO_DOCUMENTS_MSG")))),o.createElement(lt,{workflowDetails:G,t:A}),(q||H||te||W)&&o.createElement(Qe,{page:!0}))}};exports.NDCReducers=()=>u.combineReducers({NDCForm:_n}),exports.initNDCComponents=()=>{Object.entries(Nn).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|