@djb25/digit-ui-module-commonpt 1.0.0
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/README.md +77 -0
- package/dist/index.js +10 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
# digit-ui-module-commonpt
|
|
3
|
+
|
|
4
|
+
## Install
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npm install --save @upyog/digit-ui-module-commonpt
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Limitation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
This Package is more specific to DIGIT-UI's can be used across mission's
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
After adding the dependency make sure you have this dependency in
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
frontend/micro-ui/web/package.json
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
"@upyog/digit-ui-module-commonpt":"^1.5.0",
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
then navigate to App.js
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
frontend/micro-ui/web/src/App.js
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
```jsx
|
|
36
|
+
/** add this import **/
|
|
37
|
+
|
|
38
|
+
import { initcommonptComponents } from "@upyog/digit-ui-module-commonpt";
|
|
39
|
+
|
|
40
|
+
/** inside enabledModules add this new module key **/
|
|
41
|
+
|
|
42
|
+
const enabledModules = ["commonpt"];
|
|
43
|
+
|
|
44
|
+
/** inside init Function call this function **/
|
|
45
|
+
|
|
46
|
+
const initDigitUI = () => {
|
|
47
|
+
initcommonptComponents();
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Changelog
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
1.7.1 UPYOG Base version
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Contributors
|
|
61
|
+
|
|
62
|
+
[jagankumar-egov] [Tulika-eGov] [vamshikrishnakole-wtt-egov]
|
|
63
|
+
|
|
64
|
+
## Documentation
|
|
65
|
+
|
|
66
|
+
Documentation Site (https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui)
|
|
67
|
+
|
|
68
|
+
## Maintainer
|
|
69
|
+
|
|
70
|
+
- [jagankumar-egov](https://www.github.com/jagankumar-egov)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Published from DIGIT Frontend
|
|
74
|
+
DIGIT Frontend Repo (https://github.com/upyog/UPYOG/tree/develop)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+

|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var e,t=require("@djb25/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,o=require("react-i18next"),r=require("react-router-dom"),a=require("react-query"),u=require("react-hook-form");function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function s(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}const c=[{head:"PT_ASSEMBLY_DET",body:[{type:"component",route:"property-type",isMandatory:!0,component:"CPTPropertyAssemblyDetails",texts:{headerCaption:"",header:"PT_ASSEMBLY_DET",cardText:"",submitBarLabel:"PT_COMMONS_NEXT"},nextStep:{COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY:"landarea",COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY:"PtUnits",COMMON_PROPTYPE_VACANT:"area"},key:"assemblyDet",withoutLabel:!0}]},{head:"PT_LOCATION_DETAILS",body:[{type:"component",route:"property-type",isMandatory:!0,component:"CPTPropertyLocationDetails",texts:{headerCaption:"",header:"PT_LOCATION_DETAILS",cardText:"",submitBarLabel:"PT_COMMONS_NEXT"},nextStep:{COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY:"landarea",COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY:"PtUnits",COMMON_PROPTYPE_VACANT:"area"},key:"locationDet",withoutLabel:!0}]},{head:"PT_OWNERSHIP_DETAILS",body:[{type:"component",route:"institutional-owner-address",isMandatory:!0,component:"CPTPropertyOwnerDetails",texts:{headerCaption:"PT_OWNERS_DETAILS",header:"PT_OWNERS_ADDRESS",cardText:"",submitBarLabel:"PT_COMMON_NEXT"},key:"owners",withoutLabel:!0,nextStep:"institutional-proof-of-identity",hideInEmployee:!0}]}];var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function v(e,t){return e(t={exports:{}},t.exports),t.exports}var m=v(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",r="[object Array]",a="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",v="[object Map]",m="[object Number]",f="[object Object]",E="[object RegExp]",y="[object Set]",_="[object String]",g="[object Symbol]",h="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",P="[object Int16Array]",N="[object Int32Array]",I="[object Uint8Array]",O="[object Uint16Array]",D="[object Uint32Array]",w=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,F=RegExp(x.source),k=RegExp(M.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,V=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(z.source),K=/^\s+/,q=/\s/,G=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,X=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,re=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,de=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\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",pe="["+ce+"]",ve="["+se+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+ce+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ye="\\ud83c[\\udffb-\\udfff]",_e="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",Te="(?:"+Se+"|"+Ee+")",Ce="(?:"+ve+"|"+ye+")?",Ae="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[_e,ge,he].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",Pe="(?:"+["[\\u2700-\\u27bf]",ge,he].join("|")+")"+Ae,Ne="(?:"+[_e+ve+"?",ve,ge,he,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),Oe=RegExp(ve,"g"),De=RegExp(ye+"(?="+ye+")|"+Ne+Ae,"g"),we=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,Se,"$"].join("|")+")",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,Se+be,"$"].join("|")+")",Se+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Pe].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xe=["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"],Me=-1,Fe={};Fe[T]=Fe[C]=Fe[A]=Fe[P]=Fe[N]=Fe[I]=Fe["[object Uint8ClampedArray]"]=Fe[O]=Fe[D]=!0,Fe[i]=Fe[r]=Fe[S]=Fe[a]=Fe[b]=Fe[u]=Fe[d]=Fe[s]=Fe[v]=Fe[m]=Fe[f]=Fe[E]=Fe[y]=Fe[_]=Fe[h]=!1;var ke={};ke[i]=ke[r]=ke[S]=ke[b]=ke[a]=ke[u]=ke[T]=ke[C]=ke[A]=ke[P]=ke[N]=ke[v]=ke[m]=ke[f]=ke[E]=ke[y]=ke[_]=ke[g]=ke[I]=ke["[object Uint8ClampedArray]"]=ke[O]=ke[D]=!0,ke[d]=ke[s]=ke[h]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,je=parseInt,He="object"==typeof p&&p&&p.Object===Object&&p,We="object"==typeof self&&self&&self.Object===Object&&self,Ve=He||We||Function("return this")(),ze=t&&!t.nodeType&&t,Ye=ze&&e&&!e.nodeType&&e,Ke=Ye&&Ye.exports===ze,qe=Ke&&He.process,Ge=function(){try{return Ye&&Ye.require&&Ye.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),$e=Ge&&Ge.isArrayBuffer,Ze=Ge&&Ge.isDate,Xe=Ge&&Ge.isMap,Je=Ge&&Ge.isRegExp,Qe=Ge&&Ge.isSet,et=Ge&&Ge.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,l){for(var o=-1,i=null==e?0:e.length;++o<i;){var r=e[o];t(l,r,n(r),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function rt(e,t){for(var n=-1,l=null==e?0:e.length,o=0,i=[];++n<l;){var r=e[n];t(r,n,e)&&(i[o++]=r)}return i}function at(e,t){return!(null==e||!e.length)&&yt(e,t,0)>-1}function ut(e,t,n){for(var l=-1,o=null==e?0:e.length;++l<o;)if(n(t,e[l]))return!0;return!1}function dt(e,t){for(var n=-1,l=null==e?0:e.length,o=Array(l);++n<l;)o[n]=t(e[n],n,e);return o}function st(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e}function ct(e,t,n,l){var o=-1,i=null==e?0:e.length;for(l&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function pt(e,t,n,l){var o=null==e?0:e.length;for(l&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function vt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var mt=St("length");function ft(e,t,n){var l;return n(e,function(e,n,o){if(t(e,n,o))return l=n,!1}),l}function Et(e,t,n,l){for(var o=e.length,i=n+(l?1:-1);l?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function yt(e,t,n){return t==t?function(e,t,n){for(var l=n-1,o=e.length;++l<o;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,gt,n)}function _t(e,t,n,l){for(var o=n-1,i=e.length;++o<i;)if(l(e[o],t))return o;return-1}function gt(e){return e!=e}function ht(e,t){var n=null==e?0:e.length;return n?Ct(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function Tt(e,t,n,l,o){return o(e,function(e,o,i){n=l?(l=!1,e):t(n,e,o,i)}),n}function Ct(e,t){for(var n,l=-1,o=e.length;++l<o;){var i=t(e[l]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function At(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Pt(e){return e?e.slice(0,zt(e)+1).replace(K,""):e}function Nt(e){return function(t){return e(t)}}function It(e,t){return dt(t,function(t){return e[t]})}function Ot(e,t){return e.has(t)}function Dt(e,t){for(var n=-1,l=e.length;++n<l&&yt(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&&yt(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Lt=bt({"À":"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"}),xt=bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Mt(e){return"\\"+Be[e]}function Ft(e){return Re.test(e)}function kt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Bt(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,o=e.length,i=0,r=[];++n<o;){var a=e[n];a!==t&&a!==l||(e[n]=l,r[i++]=n)}return r}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Wt(e){return Ft(e)?function(e){for(var t=De.lastIndex=0;De.test(e);)++t;return t}(e):mt(e)}function Vt(e){return Ft(e)?function(e){return e.match(De)||[]}(e):function(e){return e.split("")}(e)}function zt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Yt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Kt=function e(t){var p,q=(t=null==t?Ve:Kt.defaults(Ve.Object(),t,Kt.pick(Ve,xe))).Array,se=t.Date,ce=t.Error,pe=t.Function,ve=t.Math,me=t.Object,fe=t.RegExp,Ee=t.String,ye=t.TypeError,_e=q.prototype,ge=me.prototype,he=t["__core-js_shared__"],Se=pe.prototype.toString,be=ge.hasOwnProperty,Te=0,Ce=(p=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||""))?"Symbol(src)_1."+p:"",Ae=ge.toString,Pe=Se.call(me),Ne=Ve._,De=fe("^"+Se.call(be).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=Ke?t.Buffer:void 0,Be=t.Symbol,He=t.Uint8Array,We=Re?Re.allocUnsafe:void 0,ze=Bt(me.getPrototypeOf,me),Ye=me.create,qe=ge.propertyIsEnumerable,Ge=_e.splice,mt=Be?Be.isConcatSpreadable:void 0,bt=Be?Be.iterator:void 0,qt=Be?Be.toStringTag:void 0,Gt=function(){try{var e=Qo(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==Ve.clearTimeout&&t.clearTimeout,Zt=se&&se.now!==Ve.Date.now&&se.now,Xt=t.setTimeout!==Ve.setTimeout&&t.setTimeout,Jt=ve.ceil,Qt=ve.floor,en=me.getOwnPropertySymbols,tn=Re?Re.isBuffer:void 0,nn=t.isFinite,ln=_e.join,on=Bt(me.keys,me),rn=ve.max,an=ve.min,un=se.now,dn=t.parseInt,sn=ve.random,cn=_e.reverse,pn=Qo(t,"DataView"),vn=Qo(t,"Map"),mn=Qo(t,"Promise"),fn=Qo(t,"Set"),En=Qo(t,"WeakMap"),yn=Qo(me,"create"),_n=En&&new En,gn={},hn=Ii(pn),Sn=Ii(vn),bn=Ii(mn),Tn=Ii(fn),Cn=Ii(En),An=Be?Be.prototype:void 0,Pn=An?An.valueOf:void 0,Nn=An?An.toString:void 0;function In(e){if(Yr(e)&&!xr(e)&&!(e instanceof Rn)){if(e instanceof wn)return e;if(be.call(e,"__wrapped__"))return Oi(e)}return new wn(e)}var On=function(){function e(){}return function(t){if(!zr(t))return{};if(Ye)return Ye(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Dn(){}function wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Rn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Mn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Mn;++t<n;)this.add(e[t])}function kn(e){var t=this.__data__=new xn(e);this.size=t.size}function Bn(e,t){var n=xr(e),l=!n&&Lr(e),o=!n&&!l&&Br(e),i=!n&&!l&&!o&&Qr(e),r=n||l||o||i,a=r?At(e.length,Ee):[],u=a.length;for(var d in e)!t&&!be.call(e,d)||r&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ri(d,u))||a.push(d);return a}function Un(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function jn(e,t){return Ti(yo(e),$n(t,0,e.length))}function Hn(e){return Ti(yo(e))}function Wn(e,t,n){(void 0!==n&&!Dr(e[t],n)||void 0===n&&!(t in e))&&qn(e,t,n)}function Vn(e,t,n){var l=e[t];be.call(e,t)&&Dr(l,n)&&(void 0!==n||t in e)||qn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(Dr(e[n][0],t))return n;return-1}function Yn(e,t,n,l){return el(e,function(e,o,i){t(l,e,n(e),i)}),l}function Kn(e,t){return e&&_o(t,Sa(t),e)}function qn(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,l=t.length,o=q(l),i=null==e;++n<l;)o[n]=i?void 0:Ea(e,t[n]);return o}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 Zn(e,t,n,l,o,r){var d,p=1&t,h=2&t,w=4&t;if(n&&(d=o?n(e,l,o,r):n(e)),void 0!==d)return d;if(!zr(e))return e;var R=xr(e);if(R){if(d=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&be.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!p)return yo(e,d)}else{var L=ni(e),x=L==s||L==c;if(Br(e))return co(e,p);if(L==f||L==i||x&&!o){if(d=h||x?{}:oi(e),!p)return h?function(e,t){return _o(e,ti(e),t)}(e,function(e,t){return e&&_o(t,ba(t),e)}(d,e)):function(e,t){return _o(e,ei(e),t)}(e,Kn(d,e))}else{if(!ke[L])return o?e:{};d=function(e,t,n){var l=e.constructor;switch(t){case S:return po(e);case a:case u:return new l(+e);case b:return function(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case C:case A:case P:case N:case I:case"[object Uint8ClampedArray]":case O:case D:return vo(e,n);case v:return new l;case m:case _:return new l(e);case E:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case y:return new l;case g:return Pn?me(Pn.call(e)):{}}}(e,L,p)}}r||(r=new kn);var M=r.get(e);if(M)return M;r.set(e,d),Zr(e)?e.forEach(function(l){d.add(Zn(l,t,n,l,e,r))}):Kr(e)&&e.forEach(function(l,o){d.set(o,Zn(l,t,n,o,e,r))});var F=R?void 0:(w?h?Ko:Yo:h?ba:Sa)(e);return lt(F||e,function(l,o){F&&(l=e[o=l]),Vn(d,o,Zn(l,t,n,o,e,r))}),d}function Xn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var o=n[l],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function Jn(e,t,l){if("function"!=typeof e)throw new ye(n);return gi(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var o=-1,i=at,r=!0,a=e.length,u=[],d=t.length;if(!a)return u;n&&(t=dt(t,Nt(n))),l?(i=ut,r=!1):t.length>=200&&(i=Ot,r=!1,t=new Fn(t));e:for(;++o<a;){var s=e[o],c=null==n?s:n(s);if(s=l||0!==s?s:0,r&&c==c){for(var p=d;p--;)if(t[p]===c)continue e;u.push(s)}else i(t,c,l)||u.push(s)}return u}In.templateSettings={escape:B,evaluate:U,interpolate:j,variable:"",imports:{_:In}},(In.prototype=Dn.prototype).constructor=In,(wn.prototype=On(Dn.prototype)).constructor=wn,(Rn.prototype=On(Dn.prototype)).constructor=Rn,Ln.prototype.clear=function(){this.__data__=yn?yn(null):{},this.size=0},Ln.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ln.prototype.get=function(e){var t=this.__data__;if(yn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},Ln.prototype.has=function(e){var t=this.__data__;return yn?void 0!==t[e]:be.call(t,e)},Ln.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yn&&void 0===t?"__lodash_hash_undefined__":t,this},xn.prototype.clear=function(){this.__data__=[],this.size=0},xn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():Ge.call(t,n,1),--this.size,0))},xn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},xn.prototype.has=function(e){return zn(this.__data__,e)>-1},xn.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Mn.prototype.clear=function(){this.size=0,this.__data__={hash:new Ln,map:new(vn||xn),string:new Ln}},Mn.prototype.delete=function(e){var t=Xo(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return Xo(this,e).get(e)},Mn.prototype.has=function(e){return Xo(this,e).has(e)},Mn.prototype.set=function(e,t){var n=Xo(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?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)},kn.prototype.clear=function(){this.__data__=new xn,this.size=0},kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},kn.prototype.get=function(e){return this.__data__.get(e)},kn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof xn){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Mn(l)}return n.set(e,t),this.size=n.size,this};var el=So(ul),tl=So(dl,!0);function nl(e,t){var n=!0;return el(e,function(e,l,o){return n=!!t(e,l,o)}),n}function ll(e,t,n){for(var l=-1,o=e.length;++l<o;){var i=e[l],r=t(i);if(null!=r&&(void 0===a?r==r&&!Jr(r):n(r,a)))var a=r,u=i}return u}function ol(e,t){var n=[];return el(e,function(e,l,o){t(e,l,o)&&n.push(e)}),n}function il(e,t,n,l,o){var i=-1,r=e.length;for(n||(n=ii),o||(o=[]);++i<r;){var a=e[i];t>0&&n(a)?t>1?il(a,t-1,n,l,o):st(o,a):l||(o[o.length]=a)}return o}var rl=bo(),al=bo(!0);function ul(e,t){return e&&rl(e,t,Sa)}function dl(e,t){return e&&al(e,t,Sa)}function sl(e,t){return rt(t,function(t){return Hr(e[t])})}function cl(e,t){for(var n=0,l=(t=ro(t,e)).length;null!=e&&n<l;)e=e[Ni(t[n++])];return n&&n==l?e:void 0}function pl(e,t,n){var l=t(e);return xr(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":qt&&qt in me(e)?function(e){var t=be.call(e,qt),n=e[qt];try{e[qt]=void 0;var l=!0}catch(e){}var o=Ae.call(e);return l&&(t?e[qt]=n:delete e[qt]),o}(e):function(e){return Ae.call(e)}(e)}function ml(e,t){return e>t}function fl(e,t){return null!=e&&be.call(e,t)}function El(e,t){return null!=e&&t in me(e)}function yl(e,t,n){for(var l=n?ut:at,o=e[0].length,i=e.length,r=i,a=q(i),u=Infinity,d=[];r--;){var s=e[r];r&&t&&(s=dt(s,Nt(t))),u=an(s.length,u),a[r]=!n&&(t||o>=120&&s.length>=120)?new Fn(r&&s):void 0}s=e[0];var c=-1,p=a[0];e:for(;++c<o&&d.length<u;){var v=s[c],m=t?t(v):v;if(v=n||0!==v?v:0,!(p?Ot(p,m):l(d,m,n))){for(r=i;--r;){var f=a[r];if(!(f?Ot(f,m):l(e[r],m,n)))continue e}p&&p.push(m),d.push(v)}}return d}function _l(e,t,n){var l=null==(e=fi(e,t=ro(t,e)))?e:e[Ni(ji(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return Yr(e)&&vl(e)==i}function hl(e,t,n,l,o){return e===t||(null==e||null==t||!Yr(e)&&!Yr(t)?e!=e&&t!=t:function(e,t,n,l,o,s){var c=xr(e),p=xr(t),h=c?r:ni(e),T=p?r:ni(t),C=(h=h==i?f:h)==f,A=(T=T==i?f:T)==f,P=h==T;if(P&&Br(e)){if(!Br(t))return!1;c=!0,C=!1}if(P&&!C)return s||(s=new kn),c||Qr(e)?Vo(e,t,n,l,o,s):function(e,t,n,l,o,i,r){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!i(new He(e),new He(t)));case a:case u:case m:return Dr(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case _:return e==t+"";case v:var s=kt;case y:if(s||(s=jt),e.size!=t.size&&!(1&l))return!1;var c=r.get(e);if(c)return c==t;l|=2,r.set(e,t);var p=Vo(s(e),s(t),l,o,i,r);return r.delete(e),p;case g:if(Pn)return Pn.call(e)==Pn.call(t)}return!1}(e,t,h,n,l,o,s);if(!(1&n)){var N=C&&be.call(e,"__wrapped__"),I=A&&be.call(t,"__wrapped__");if(N||I){var O=N?e.value():e,D=I?t.value():t;return s||(s=new kn),o(O,D,n,l,s)}}return!!P&&(s||(s=new kn),function(e,t,n,l,o,i){var r=1&n,a=Yo(e),u=a.length;if(u!=Yo(t).length&&!r)return!1;for(var d=u;d--;){var s=a[d];if(!(r?s in t:be.call(t,s)))return!1}var c=i.get(e),p=i.get(t);if(c&&p)return c==t&&p==e;var v=!0;i.set(e,t),i.set(t,e);for(var m=r;++d<u;){var f=e[s=a[d]],E=t[s];if(l)var y=r?l(E,f,s,t,e,i):l(f,E,s,e,t,i);if(!(void 0===y?f===E||o(f,E,n,l,i):y)){v=!1;break}m||(m="constructor"==s)}if(v&&!m){var _=e.constructor,g=t.constructor;_==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof g&&g instanceof g||(v=!1)}return i.delete(e),i.delete(t),v}(e,t,n,l,o,s))}(e,t,n,l,hl,o))}function Sl(e,t,n,l){var o=n.length,i=o,r=!l;if(null==e)return!i;for(e=me(e);o--;){var a=n[o];if(r&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){var u=(a=n[o])[0],d=e[u],s=a[1];if(r&&a[2]){if(void 0===d&&!(u in e))return!1}else{var c=new kn;if(l)var p=l(d,s,u,e,t,c);if(!(void 0===p?hl(s,d,3,l,c):p))return!1}}return!0}function bl(e){return!(!zr(e)||(t=e,Ce&&Ce in t))&&(Hr(e)?De:oe).test(Ii(e));var t}function Tl(e){return"function"==typeof e?e:null==e?qa:"object"==typeof e?xr(e)?Il(e[0],e[1]):Nl(e):nu(e)}function Cl(e){if(!ci(e))return on(e);var t=[];for(var n in me(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Al(e,t){return e<t}function Pl(e,t){var n=-1,l=Fr(e)?q(e.length):[];return el(e,function(e,o,i){l[++n]=t(e,o,i)}),l}function Nl(e){var t=Jo(e);return 1==t.length&&t[0][2]?vi(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Il(e,t){return ui(e)&&pi(t)?vi(Ni(e),t):function(n){var l=Ea(n,e);return void 0===l&&l===t?ya(n,e):hl(t,l,3)}}function Ol(e,t,n,l,o){e!==t&&rl(t,function(i,r){if(o||(o=new kn),zr(i))!function(e,t,n,l,o,i,r){var a=yi(e,n),u=yi(t,n),d=r.get(u);if(d)Wn(e,n,d);else{var s=i?i(a,u,n+"",e,t,r):void 0,c=void 0===s;if(c){var p=xr(u),v=!p&&Br(u),m=!p&&!v&&Qr(u);s=u,p||v||m?xr(a)?s=a:kr(a)?s=yo(a):v?(c=!1,s=co(u,!0)):m?(c=!1,s=vo(u,!0)):s=[]:Gr(u)||Lr(u)?(s=a,Lr(a)?s=aa(a):zr(a)&&!Hr(a)||(s=oi(u))):c=!1}c&&(r.set(u,s),o(s,u,l,i,r),r.delete(u)),Wn(e,n,s)}}(e,t,r,n,Ol,l,o);else{var a=l?l(yi(e,r),i,r+"",e,t,o):void 0;void 0===a&&(a=i),Wn(e,r,a)}},ba)}function Dl(e,t){var n=e.length;if(n)return ri(t+=t<0?n:0,n)?e[t]:void 0}function wl(e,t,n){t=t.length?dt(t,function(e){return xr(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[qa];var l=-1;return t=dt(t,Nt(Zo())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,o=e.criteria,i=t.criteria,r=o.length,a=n.length;++l<r;){var u=mo(o[l],i[l]);if(u)return l>=a?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Pl(e,function(e,n,o){return{criteria:dt(t,function(t){return t(e)}),index:++l,value:e}}))}function Rl(e,t,n){for(var l=-1,o=t.length,i={};++l<o;){var r=t[l],a=cl(e,r);n(a,r)&&jl(i,ro(r,e),a)}return i}function Ll(e,t,n,l){var o=l?_t:yt,i=-1,r=t.length,a=e;for(e===t&&(t=yo(t)),n&&(a=dt(e,Nt(n)));++i<r;)for(var u=0,d=t[i],s=n?n(d):d;(u=o(a,s,u,l))>-1;)a!==e&&Ge.call(a,u,1),Ge.call(e,u,1);return e}function xl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var o=t[n];if(n==l||o!==i){var i=o;ri(o)?Ge.call(e,o,1):Jl(e,o)}}return e}function Ml(e,t){return e+Qt(sn()*(t-e+1))}function Fl(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 kl(e,t){return hi(mi(e,t,qa),e+"")}function Bl(e){return Un(Da(e))}function Ul(e,t){var n=Da(e);return Ti(n,$n(t,0,n.length))}function jl(e,t,n,l){if(!zr(e))return e;for(var o=-1,i=(t=ro(t,e)).length,r=i-1,a=e;null!=a&&++o<i;){var u=Ni(t[o]),d=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=r){var s=a[u];void 0===(d=l?l(s,u,a):void 0)&&(d=zr(s)?s:ri(t[o+1])?[]:{})}Vn(a,u,d),a=a[u]}return e}var Hl=_n?function(e,t){return _n.set(e,t),e}:qa,Wl=Gt?function(e,t){return Gt(e,"toString",{configurable:!0,enumerable:!1,value:za(t),writable:!0})}:qa;function Vl(e){return Ti(Da(e))}function zl(e,t,n){var l=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=q(o);++l<o;)i[l]=e[l+t];return i}function Yl(e,t){var n;return el(e,function(e,l,o){return!(n=t(e,l,o))}),!!n}function Kl(e,t,n){var l=0,o=null==e?l:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;l<o;){var i=l+o>>>1,r=e[i];null!==r&&!Jr(r)&&(n?r<=t:r<t)?l=i+1:o=i}return o}return ql(e,t,qa,n)}function ql(e,t,n,l){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var r=(t=n(t))!=t,a=null===t,u=Jr(t),d=void 0===t;o<i;){var s=Qt((o+i)/2),c=n(e[s]),p=void 0!==c,v=null===c,m=c==c,f=Jr(c);if(r)var E=l||m;else E=d?m&&(l||p):a?m&&p&&(l||!v):u?m&&p&&!v&&(l||!f):!v&&!f&&(l?c<=t:c<t);E?o=s+1:i=s}return an(i,4294967294)}function Gl(e,t){for(var n=-1,l=e.length,o=0,i=[];++n<l;){var r=e[n],a=t?t(r):r;if(!n||!Dr(a,u)){var u=a;i[o++]=0===r?0:r}}return i}function $l(e){return"number"==typeof e?e:Jr(e)?NaN:+e}function Zl(e){if("string"==typeof e)return e;if(xr(e))return dt(e,Zl)+"";if(Jr(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xl(e,t,n){var l=-1,o=at,i=e.length,r=!0,a=[],u=a;if(n)r=!1,o=ut;else if(i>=200){var d=t?null:ko(e);if(d)return jt(d);r=!1,o=Ot,u=new Fn}else u=t?[]:a;e:for(;++l<i;){var s=e[l],c=t?t(s):s;if(s=n||0!==s?s:0,r&&c==c){for(var p=u.length;p--;)if(u[p]===c)continue e;t&&u.push(c),a.push(s)}else o(u,c,n)||(u!==a&&u.push(c),a.push(s))}return a}function Jl(e,t){return null==(e=fi(e,t=ro(t,e)))||delete e[Ni(ji(t))]}function Ql(e,t,n,l){return jl(e,t,n(cl(e,t)),l)}function eo(e,t,n,l){for(var o=e.length,i=l?o:-1;(l?i--:++i<o)&&t(e[i],i,e););return n?zl(e,l?0:i,l?i+1:o):zl(e,l?i+1:0,l?o:i)}function to(e,t){var n=e;return n instanceof Rn&&(n=n.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function no(e,t,n){var l=e.length;if(l<2)return l?Xl(e[0]):[];for(var o=-1,i=q(l);++o<l;)for(var r=e[o],a=-1;++a<l;)a!=o&&(i[o]=Qn(i[o]||r,e[a],t,n));return Xl(il(i,1),t,n)}function lo(e,t,n){for(var l=-1,o=e.length,i=t.length,r={};++l<o;)n(r,e[l],l<i?t[l]:void 0);return r}function oo(e){return kr(e)?e:[]}function io(e){return"function"==typeof e?e:qa}function ro(e,t){return xr(e)?e:ui(e,t)?[e]:Pi(ua(e))}var ao=kl;function uo(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var so=$t||function(e){return Ve.clearTimeout(e)};function co(e,t){if(t)return e.slice();var n=e.length,l=We?We(n):new e.constructor(n);return e.copy(l),l}function po(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function vo(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mo(e,t){if(e!==t){var n=void 0!==e,l=null===e,o=e==e,i=Jr(e),r=void 0!==t,a=null===t,u=t==t,d=Jr(t);if(!a&&!d&&!i&&e>t||i&&r&&u&&!a&&!d||l&&r&&u||!n&&u||!o)return 1;if(!l&&!i&&!d&&e<t||d&&n&&o&&!l&&!i||a&&n&&o||!r&&o||!u)return-1}return 0}function fo(e,t,n,l){for(var o=-1,i=e.length,r=n.length,a=-1,u=t.length,d=rn(i-r,0),s=q(u+d),c=!l;++a<u;)s[a]=t[a];for(;++o<r;)(c||o<i)&&(s[n[o]]=e[o]);for(;d--;)s[a++]=e[o++];return s}function Eo(e,t,n,l){for(var o=-1,i=e.length,r=-1,a=n.length,u=-1,d=t.length,s=rn(i-a,0),c=q(s+d),p=!l;++o<s;)c[o]=e[o];for(var v=o;++u<d;)c[v+u]=t[u];for(;++r<a;)(p||o<i)&&(c[v+n[r]]=e[o++]);return c}function yo(e,t){var n=-1,l=e.length;for(t||(t=q(l));++n<l;)t[n]=e[n];return t}function _o(e,t,n,l){var o=!n;n||(n={});for(var i=-1,r=t.length;++i<r;){var a=t[i],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),o?qn(n,a,u):Vn(n,a,u)}return n}function go(e,t){return function(n,l){var o=xr(n)?nt:Yn,i=t?t():{};return o(n,e,Zo(l,2),i)}}function ho(e){return kl(function(t,n){var l=-1,o=n.length,i=o>1?n[o-1]:void 0,r=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,r&&ai(n[0],n[1],r)&&(i=o<3?void 0:i,o=1),t=me(t);++l<o;){var a=n[l];a&&e(t,a,l,i)}return t})}function So(e,t){return function(n,l){if(null==n)return n;if(!Fr(n))return e(n,l);for(var o=n.length,i=t?o:-1,r=me(n);(t?i--:++i<o)&&!1!==l(r[i],i,r););return n}}function bo(e){return function(t,n,l){for(var o=-1,i=me(t),r=l(t),a=r.length;a--;){var u=r[e?a:++o];if(!1===n(i[u],u,i))break}return t}}function To(e){return function(t){var n=Ft(t=ua(t))?Vt(t):void 0,l=n?n[0]:t.charAt(0),o=n?uo(n,1).join(""):t.slice(1);return l[e]()+o}}function Co(e){return function(t){return ct(Ha(La(t).replace(Ie,"")),e,"")}}function Ao(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=On(e.prototype),l=e.apply(n,t);return zr(l)?l:n}}function Po(e){return function(t,n,l){var o=me(t);if(!Fr(t)){var i=Zo(n,3);t=Sa(t),n=function(e){return i(o[e],e,o)}}var r=e(t,n,l);return r>-1?o[i?t[r]:r]:void 0}}function No(e){return zo(function(t){var l=t.length,o=l,i=wn.prototype.thru;for(e&&t.reverse();o--;){var r=t[o];if("function"!=typeof r)throw new ye(n);if(i&&!a&&"wrapper"==Go(r))var a=new wn([],!0)}for(o=a?o:l;++o<l;){var u=Go(r=t[o]),d="wrapper"==u?qo(r):void 0;a=d&&di(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?a[Go(d[0])].apply(a,d[3]):1==r.length&&di(r)?a[u]():a.thru(r)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&xr(n))return a.plant(n).value();for(var o=0,i=l?t[o].apply(this,e):n;++o<l;)i=t[o].call(this,i);return i}})}function Io(e,t,n,l,o,i,r,a,u,d){var s=128&t,c=1&t,p=2&t,v=24&t,m=512&t,f=p?void 0:Ao(e);return function E(){for(var y=arguments.length,_=q(y),g=y;g--;)_[g]=arguments[g];if(v)var h=$o(E),S=Rt(_,h);if(l&&(_=fo(_,l,o,v)),i&&(_=Eo(_,i,r,v)),y-=S,v&&y<d){var b=Ut(_,h);return Mo(e,t,Io,E.placeholder,n,_,b,a,u,d-y)}var T=c?n:this,C=p?T[e]:e;return y=_.length,a?_=Ei(_,a):m&&y>1&&_.reverse(),s&&u<y&&(_.length=u),this&&this!==Ve&&this instanceof E&&(C=f||Ao(C)),C.apply(T,_)}}function Oo(e,t){return function(n,l){return function(e,t,n,l){return ul(e,function(e,o,i){t(l,n(e),o,i)}),l}(n,e,t(l),{})}}function Do(e,t){return function(n,l){var o;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(o=n),void 0!==l){if(void 0===o)return l;"string"==typeof n||"string"==typeof l?(n=Zl(n),l=Zl(l)):(n=$l(n),l=$l(l)),o=e(n,l)}return o}}function wo(e){return zo(function(t){return t=dt(t,Nt(Zo())),kl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ro(e,t){var n=(t=void 0===t?" ":Zl(t)).length;if(n<2)return n?Fl(t,e):t;var l=Fl(t,Jt(e/Wt(t)));return Ft(t)?uo(Vt(l),0,e).join(""):l.slice(0,e)}function Lo(e){return function(t,n,l){return l&&"number"!=typeof l&&ai(t,n,l)&&(n=l=void 0),t=la(t),void 0===n?(n=t,t=0):n=la(n),function(e,t,n,l){for(var o=-1,i=rn(Jt((t-e)/(n||1)),0),r=q(i);i--;)r[l?i:++o]=e,e+=n;return r}(t,n,l=void 0===l?t<n?1:-1:la(l),e)}}function xo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ra(t),n=ra(n)),e(t,n)}}function Mo(e,t,n,l,o,i,r,a,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,o,s?i:void 0,s?r:void 0,s?void 0:i,s?void 0:r,a,u,d],p=n.apply(void 0,c);return di(e)&&_i(p,c),p.placeholder=l,Si(p,e,t)}function Fo(e){var t=ve[e];return function(e,n){if(e=ra(e),(n=null==n?0:an(oa(n),292))&&nn(e)){var l=(ua(e)+"e").split("e");return+((l=(ua(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var ko=fn&&1/jt(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Ja;function Bo(e){return function(t){var n=ni(t);return n==v?kt(t):n==y?Ht(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Uo(e,t,o,i,r,a,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new ye(n);var c=i?i.length:0;if(c||(t&=-97,i=r=void 0),u=void 0===u?u:rn(oa(u),0),d=void 0===d?d:oa(d),c-=r?r.length:0,64&t){var p=i,v=r;i=r=void 0}var m=s?void 0:qo(e),f=[e,t,o,i,r,p,v,a,u,d];if(m&&function(e,t){var n=e[1],o=t[1],i=n|o;if(!(i<131||128==o&&8==n||128==o&&256==n&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==n))return e;1&o&&(e[2]=t[2],i|=1&n?0:4);var r=t[3];if(r){var a=e[3];e[3]=a?fo(a,r,t[4]):r,e[4]=a?Ut(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?Eo(a,r,t[6]):r,e[6]=a?Ut(e[5],l):t[6]),(r=t[7])&&(e[7]=r),128&o&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(f,m),e=f[0],t=f[1],o=f[2],i=f[3],r=f[4],!(d=f[9]=void 0===f[9]?s?0:e.length:rn(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Ao(e);return function o(){for(var i=arguments.length,r=q(i),a=i,u=$o(o);a--;)r[a]=arguments[a];var d=i<3&&r[0]!==u&&r[i-1]!==u?[]:Ut(r,u);if((i-=d.length)<n)return Mo(e,t,Io,o.placeholder,void 0,r,d,void 0,void 0,n-i);var s=this&&this!==Ve&&this instanceof o?l:e;return tt(s,this,r)}}(e,t,d):32!=t&&33!=t||r.length?Io.apply(void 0,f):function(e,t,n,l){var o=1&t,i=Ao(e);return function t(){for(var r=-1,a=arguments.length,u=-1,d=l.length,s=q(d+a),c=this&&this!==Ve&&this instanceof t?i:e;++u<d;)s[u]=l[u];for(;a--;)s[u++]=arguments[++r];return tt(c,o?n:this,s)}}(e,t,o,i);else var E=function(e,t,n){var l=1&t,o=Ao(e);return function t(){var i=this&&this!==Ve&&this instanceof t?o:e;return i.apply(l?n:this,arguments)}}(e,t,o);return Si((m?Hl:_i)(E,f),e,t)}function jo(e,t,n,l){return void 0===e||Dr(e,ge[n])&&!be.call(l,n)?t:e}function Ho(e,t,n,l,o,i){return zr(e)&&zr(t)&&(i.set(t,e),Ol(e,t,void 0,Ho,i),i.delete(t)),e}function Wo(e){return Gr(e)?void 0:e}function Vo(e,t,n,l,o,i){var r=1&n,a=e.length,u=t.length;if(a!=u&&!(r&&u>a))return!1;var d=i.get(e),s=i.get(t);if(d&&s)return d==t&&s==e;var c=-1,p=!0,v=2&n?new Fn:void 0;for(i.set(e,t),i.set(t,e);++c<a;){var m=e[c],f=t[c];if(l)var E=r?l(f,m,c,t,e,i):l(m,f,c,e,t,i);if(void 0!==E){if(E)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!Ot(v,t)&&(m===e||o(m,e,n,l,i)))return v.push(t)})){p=!1;break}}else if(m!==f&&!o(m,f,n,l,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function zo(e){return hi(mi(e,void 0,Mi),e+"")}function Yo(e){return pl(e,Sa,ei)}function Ko(e){return pl(e,ba,ti)}var qo=_n?function(e){return _n.get(e)}:Ja;function Go(e){for(var t=e.name+"",n=gn[t],l=be.call(gn,t)?n.length:0;l--;){var o=n[l],i=o.func;if(null==i||i==e)return o.name}return t}function $o(e){return(be.call(In,"placeholder")?In:e).placeholder}function Zo(){var e=In.iteratee||Ga;return e=e===Ga?Tl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xo(e,t){var n,l,o=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Jo(e){for(var t=Sa(e),n=t.length;n--;){var l=t[n],o=e[l];t[n]=[l,o,pi(o)]}return t}function Qo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var ei=en?function(e){return null==e?[]:(e=me(e),rt(en(e),function(t){return qe.call(e,t)}))}:iu,ti=en?function(e){for(var t=[];e;)st(t,ei(e)),e=ze(e);return t}:iu,ni=vl;function li(e,t,n){for(var l=-1,o=(t=ro(t,e)).length,i=!1;++l<o;){var r=Ni(t[l]);if(!(i=null!=e&&n(e,r)))break;e=e[r]}return i||++l!=o?i:!!(o=null==e?0:e.length)&&Vr(o)&&ri(r,o)&&(xr(e)||Lr(e))}function oi(e){return"function"!=typeof e.constructor||ci(e)?{}:On(ze(e))}function ii(e){return xr(e)||Lr(e)||!!(mt&&e&&e[mt])}function ri(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function ai(e,t,n){if(!zr(n))return!1;var l=typeof t;return!!("number"==l?Fr(n)&&ri(t,n.length):"string"==l&&t in n)&&Dr(n[t],e)}function ui(e,t){if(xr(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Jr(e))||W.test(e)||!H.test(e)||null!=t&&e in me(t)}function di(e){var t=Go(e),n=In[t];if("function"!=typeof n||!(t in Rn.prototype))return!1;if(e===n)return!0;var l=qo(n);return!!l&&e===l[0]}(pn&&ni(new pn(new ArrayBuffer(1)))!=b||vn&&ni(new vn)!=v||mn&&"[object Promise]"!=ni(mn.resolve())||fn&&ni(new fn)!=y||En&&ni(new En)!=h)&&(ni=function(e){var t=vl(e),n=t==f?e.constructor:void 0,l=n?Ii(n):"";if(l)switch(l){case hn:return b;case Sn:return v;case bn:return"[object Promise]";case Tn:return y;case Cn:return h}return t});var si=he?Hr:ru;function ci(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function pi(e){return e==e&&!zr(e)}function vi(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mi(e,t,n){return t=rn(void 0===t?e.length-1:t,0),function(){for(var l=arguments,o=-1,i=rn(l.length-t,0),r=q(i);++o<i;)r[o]=l[t+o];o=-1;for(var a=q(t+1);++o<t;)a[o]=l[o];return a[t]=n(r),tt(e,this,a)}}function fi(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function Ei(e,t){for(var n=e.length,l=an(t.length,n),o=yo(e);l--;){var i=t[l];e[l]=ri(i,n)?o[i]:void 0}return e}function yi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _i=bi(Hl),gi=Xt||function(e,t){return Ve.setTimeout(e,t)},hi=bi(Wl);function Si(e,t,n){var l=t+"";return hi(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(G,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(o,function(n){var l="_."+n[0];t&n[1]&&!at(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match($);return t?t[1].split(Z):[]}(l),n)))}function bi(e){var t=0,n=0;return function(){var l=un(),o=16-(l-n);if(n=l,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ti(e,t){var n=-1,l=e.length,o=l-1;for(t=void 0===t?l:t;++n<t;){var i=Ml(n,o),r=e[i];e[i]=e[n],e[n]=r}return e.length=t,e}var Ci,Ai,Pi=(Ci=Cr(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(V,function(e,n,l,o){t.push(l?o.replace(Q,"$1"):n||e)}),t},function(e){return 500===Ai.size&&Ai.clear(),e}),Ai=Ci.cache,Ci);function Ni(e){if("string"==typeof e||Jr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ii(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Oi(e){if(e instanceof Rn)return e.clone();var t=new wn(e.__wrapped__,e.__chain__);return t.__actions__=yo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Di=kl(function(e,t){return kr(e)?Qn(e,il(t,1,kr,!0)):[]}),wi=kl(function(e,t){var n=ji(t);return kr(n)&&(n=void 0),kr(e)?Qn(e,il(t,1,kr,!0),Zo(n,2)):[]}),Ri=kl(function(e,t){var n=ji(t);return kr(n)&&(n=void 0),kr(e)?Qn(e,il(t,1,kr,!0),void 0,n):[]});function Li(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:oa(n);return o<0&&(o=rn(l+o,0)),Et(e,Zo(t,3),o)}function xi(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l-1;return void 0!==n&&(o=oa(n),o=n<0?rn(l+o,0):an(o,l-1)),Et(e,Zo(t,3),o,!0)}function Mi(e){return null!=e&&e.length?il(e,1):[]}function Fi(e){return e&&e.length?e[0]:void 0}var ki=kl(function(e){var t=dt(e,oo);return t.length&&t[0]===e[0]?yl(t):[]}),Bi=kl(function(e){var t=ji(e),n=dt(e,oo);return t===ji(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?yl(n,Zo(t,2)):[]}),Ui=kl(function(e){var t=ji(e),n=dt(e,oo);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?yl(n,void 0,t):[]});function ji(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Hi=kl(Wi);function Wi(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var Vi=zo(function(e,t){var n=null==e?0:e.length,l=Gn(e,t);return xl(e,dt(t,function(e){return ri(e,n)?+e:e}).sort(mo)),l});function zi(e){return null==e?e:cn.call(e)}var Yi=kl(function(e){return Xl(il(e,1,kr,!0))}),Ki=kl(function(e){var t=ji(e);return kr(t)&&(t=void 0),Xl(il(e,1,kr,!0),Zo(t,2))}),qi=kl(function(e){var t=ji(e);return t="function"==typeof t?t:void 0,Xl(il(e,1,kr,!0),void 0,t)});function Gi(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(kr(e))return t=rn(e.length,t),!0}),At(t,function(t){return dt(e,St(t))})}function $i(e,t){if(!e||!e.length)return[];var n=Gi(e);return null==t?n:dt(n,function(e){return tt(t,void 0,e)})}var Zi=kl(function(e,t){return kr(e)?Qn(e,t):[]}),Xi=kl(function(e){return no(rt(e,kr))}),Ji=kl(function(e){var t=ji(e);return kr(t)&&(t=void 0),no(rt(e,kr),Zo(t,2))}),Qi=kl(function(e){var t=ji(e);return t="function"==typeof t?t:void 0,no(rt(e,kr),void 0,t)}),er=kl(Gi),tr=kl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,$i(e,n)});function nr(e){var t=In(e);return t.__chain__=!0,t}function lr(e,t){return t(e)}var or=zo(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,o=function(t){return Gn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof Rn&&ri(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:lr,args:[o],thisArg:void 0}),new wn(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),ir=go(function(e,t,n){be.call(e,n)?++e[n]:qn(e,n,1)}),rr=Po(Li),ar=Po(xi);function ur(e,t){return(xr(e)?lt:el)(e,Zo(t,3))}function dr(e,t){return(xr(e)?ot:tl)(e,Zo(t,3))}var sr=go(function(e,t,n){be.call(e,n)?e[n].push(t):qn(e,n,[t])}),cr=kl(function(e,t,n){var l=-1,o="function"==typeof t,i=Fr(e)?q(e.length):[];return el(e,function(e){i[++l]=o?tt(t,e,n):_l(e,t,n)}),i}),pr=go(function(e,t,n){qn(e,n,t)});function vr(e,t){return(xr(e)?dt:Pl)(e,Zo(t,3))}var mr=go(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fr=kl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ai(e,t[0],t[1])?t=[]:n>2&&ai(t[0],t[1],t[2])&&(t=[t[0]]),wl(e,il(t,1),[])}),Er=Zt||function(){return Ve.Date.now()};function yr(e,t,n){return t=n?void 0:t,Uo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _r(e,t){var l;if("function"!=typeof t)throw new ye(n);return e=oa(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var gr=kl(function(e,t,n){var l=1;if(n.length){var o=Ut(n,$o(gr));l|=32}return Uo(e,l,t,n,o)}),hr=kl(function(e,t,n){var l=3;if(n.length){var o=Ut(n,$o(hr));l|=32}return Uo(t,l,e,n,o)});function Sr(e,t,l){var o,i,r,a,u,d,s=0,c=!1,p=!1,v=!0;if("function"!=typeof e)throw new ye(n);function m(t){var n=o,l=i;return o=i=void 0,s=t,a=e.apply(l,n)}function f(e){return s=e,u=gi(y,t),c?m(e):a}function E(e){var n=e-d;return void 0===d||n>=t||n<0||p&&e-s>=r}function y(){var e=Er();if(E(e))return _(e);u=gi(y,function(e){var n=t-(e-d);return p?an(n,r-(e-s)):n}(e))}function _(e){return u=void 0,v&&o?m(e):(o=i=void 0,a)}function g(){var e=Er(),n=E(e);if(o=arguments,i=this,d=e,n){if(void 0===u)return f(d);if(p)return so(u),u=gi(y,t),m(d)}return void 0===u&&(u=gi(y,t)),a}return t=ra(t)||0,zr(l)&&(c=!!l.leading,r=(p="maxWait"in l)?rn(ra(l.maxWait)||0,t):r,v="trailing"in l?!!l.trailing:v),g.cancel=function(){void 0!==u&&so(u),s=0,o=d=i=u=void 0},g.flush=function(){return void 0===u?a:_(Er())},g}var br=kl(function(e,t){return Jn(e,1,t)}),Tr=kl(function(e,t,n){return Jn(e,ra(t)||0,n)});function Cr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ye(n);var l=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=l.cache;if(i.has(o))return i.get(o);var r=e.apply(this,n);return l.cache=i.set(o,r)||i,r};return l.cache=new(Cr.Cache||Mn),l}function Ar(e){if("function"!=typeof e)throw new ye(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)}}Cr.Cache=Mn;var Pr=ao(function(e,t){var n=(t=1==t.length&&xr(t[0])?dt(t[0],Nt(Zo())):dt(il(t,1),Nt(Zo()))).length;return kl(function(l){for(var o=-1,i=an(l.length,n);++o<i;)l[o]=t[o].call(this,l[o]);return tt(e,this,l)})}),Nr=kl(function(e,t){return Uo(e,32,void 0,t,Ut(t,$o(Nr)))}),Ir=kl(function(e,t){return Uo(e,64,void 0,t,Ut(t,$o(Ir)))}),Or=zo(function(e,t){return Uo(e,256,void 0,void 0,void 0,t)});function Dr(e,t){return e===t||e!=e&&t!=t}var wr=xo(ml),Rr=xo(function(e,t){return e>=t}),Lr=gl(function(){return arguments}())?gl:function(e){return Yr(e)&&be.call(e,"callee")&&!qe.call(e,"callee")},xr=q.isArray,Mr=$e?Nt($e):function(e){return Yr(e)&&vl(e)==S};function Fr(e){return null!=e&&Vr(e.length)&&!Hr(e)}function kr(e){return Yr(e)&&Fr(e)}var Br=tn||ru,Ur=Ze?Nt(Ze):function(e){return Yr(e)&&vl(e)==u};function jr(e){if(!Yr(e))return!1;var t=vl(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Gr(e)}function Hr(e){if(!zr(e))return!1;var t=vl(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wr(e){return"number"==typeof e&&e==oa(e)}function Vr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function zr(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Yr(e){return null!=e&&"object"==typeof e}var Kr=Xe?Nt(Xe):function(e){return Yr(e)&&ni(e)==v};function qr(e){return"number"==typeof e||Yr(e)&&vl(e)==m}function Gr(e){if(!Yr(e)||vl(e)!=f)return!1;var t=ze(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==Pe}var $r=Je?Nt(Je):function(e){return Yr(e)&&vl(e)==E},Zr=Qe?Nt(Qe):function(e){return Yr(e)&&ni(e)==y};function Xr(e){return"string"==typeof e||!xr(e)&&Yr(e)&&vl(e)==_}function Jr(e){return"symbol"==typeof e||Yr(e)&&vl(e)==g}var Qr=et?Nt(et):function(e){return Yr(e)&&Vr(e.length)&&!!Fe[vl(e)]},ea=xo(Al),ta=xo(function(e,t){return e<=t});function na(e){if(!e)return[];if(Fr(e))return Xr(e)?Vt(e):yo(e);if(bt&&e[bt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[bt]());var t=ni(e);return(t==v?kt:t==y?jt:Da)(e)}function la(e){return e?(e=ra(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function oa(e){var t=la(e),n=t%1;return t==t?n?t-n:t:0}function ia(e){return e?$n(oa(e),0,4294967295):0}function ra(e){if("number"==typeof e)return e;if(Jr(e))return NaN;if(zr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=zr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Pt(e);var n=le.test(e);return n||ie.test(e)?je(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function aa(e){return _o(e,ba(e))}function ua(e){return null==e?"":Zl(e)}var da=ho(function(e,t){if(ci(t)||Fr(t))_o(t,Sa(t),e);else for(var n in t)be.call(t,n)&&Vn(e,n,t[n])}),sa=ho(function(e,t){_o(t,ba(t),e)}),ca=ho(function(e,t,n,l){_o(t,ba(t),e,l)}),pa=ho(function(e,t,n,l){_o(t,Sa(t),e,l)}),va=zo(Gn),ma=kl(function(e,t){e=me(e);var n=-1,l=t.length,o=l>2?t[2]:void 0;for(o&&ai(t[0],t[1],o)&&(l=1);++n<l;)for(var i=t[n],r=ba(i),a=-1,u=r.length;++a<u;){var d=r[a],s=e[d];(void 0===s||Dr(s,ge[d])&&!be.call(e,d))&&(e[d]=i[d])}return e}),fa=kl(function(e){return e.push(void 0,Ho),tt(Ca,void 0,e)});function Ea(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function ya(e,t){return null!=e&&li(e,t,El)}var _a=Oo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},za(qa)),ga=Oo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Zo),ha=kl(_l);function Sa(e){return Fr(e)?Bn(e):Cl(e)}function ba(e){return Fr(e)?Bn(e,!0):function(e){if(!zr(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=ci(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Ta=ho(function(e,t,n){Ol(e,t,n)}),Ca=ho(function(e,t,n,l){Ol(e,t,n,l)}),Aa=zo(function(e,t){var n={};if(null==e)return n;var l=!1;t=dt(t,function(t){return t=ro(t,e),l||(l=t.length>1),t}),_o(e,Ko(e),n),l&&(n=Zn(n,7,Wo));for(var o=t.length;o--;)Jl(n,t[o]);return n}),Pa=zo(function(e,t){return null==e?{}:function(e,t){return Rl(e,t,function(t,n){return ya(e,n)})}(e,t)});function Na(e,t){if(null==e)return{};var n=dt(Ko(e),function(e){return[e]});return t=Zo(t),Rl(e,n,function(e,n){return t(e,n[0])})}var Ia=Bo(Sa),Oa=Bo(ba);function Da(e){return null==e?[]:It(e,Sa(e))}var wa=Co(function(e,t,n){return t=t.toLowerCase(),e+(n?Ra(t):t)});function Ra(e){return ja(ua(e).toLowerCase())}function La(e){return(e=ua(e))&&e.replace(ae,Lt).replace(Oe,"")}var xa=Co(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ma=Co(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fa=To("toLowerCase"),ka=Co(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ba=Co(function(e,t,n){return e+(n?" ":"")+ja(t)}),Ua=Co(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),ja=To("toUpperCase");function Ha(e,t,n){return e=ua(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Wa=kl(function(e,t){try{return tt(e,void 0,t)}catch(e){return jr(e)?e:new ce(e)}}),Va=zo(function(e,t){return lt(t,function(t){t=Ni(t),qn(e,t,gr(e[t],e))}),e});function za(e){return function(){return e}}var Ya=No(),Ka=No(!0);function qa(e){return e}function Ga(e){return Tl("function"==typeof e?e:Zn(e,1))}var $a=kl(function(e,t){return function(n){return _l(n,e,t)}}),Za=kl(function(e,t){return function(n){return _l(e,n,t)}});function Xa(e,t,n){var l=Sa(t),o=sl(t,l);null!=n||zr(t)&&(o.length||!l.length)||(n=t,t=e,e=this,o=sl(t,Sa(t)));var i=!(zr(n)&&"chain"in n&&!n.chain),r=Hr(e);return lt(o,function(n){var l=t[n];e[n]=l,r&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=yo(this.__actions__);return o.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Ja(){}var Qa=wo(dt),eu=wo(it),tu=wo(vt);function nu(e){return ui(e)?St(Ni(e)):function(e){return function(t){return cl(t,e)}}(e)}var lu=Lo(),ou=Lo(!0);function iu(){return[]}function ru(){return!1}var au,uu=Do(function(e,t){return e+t},0),du=Fo("ceil"),su=Do(function(e,t){return e/t},1),cu=Fo("floor"),pu=Do(function(e,t){return e*t},1),vu=Fo("round"),mu=Do(function(e,t){return e-t},0);return In.after=function(e,t){if("function"!=typeof t)throw new ye(n);return e=oa(e),function(){if(--e<1)return t.apply(this,arguments)}},In.ary=yr,In.assign=da,In.assignIn=sa,In.assignInWith=ca,In.assignWith=pa,In.at=va,In.before=_r,In.bind=gr,In.bindAll=Va,In.bindKey=hr,In.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return xr(e)?e:[e]},In.chain=nr,In.chunk=function(e,t,n){t=(n?ai(e,t,n):void 0===t)?1:rn(oa(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var o=0,i=0,r=q(Jt(l/t));o<l;)r[i++]=zl(e,o,o+=t);return r},In.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,o=[];++t<n;){var i=e[t];i&&(o[l++]=i)}return o},In.concat=function(){var e=arguments.length;if(!e)return[];for(var t=q(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(xr(n)?yo(n):[n],il(t,1))},In.cond=function(e){var t=null==e?0:e.length,l=Zo();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new ye(n);return[l(e[0]),e[1]]}):[],kl(function(n){for(var l=-1;++l<t;){var o=e[l];if(tt(o[0],this,n))return tt(o[1],this,n)}})},In.conforms=function(e){return function(e){var t=Sa(e);return function(n){return Xn(n,e,t)}}(Zn(e,1))},In.constant=za,In.countBy=ir,In.create=function(e,t){var n=On(e);return null==t?n:Kn(n,t)},In.curry=function e(t,n,l){var o=Uo(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},In.curryRight=function e(t,n,l){var o=Uo(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return o.placeholder=e.placeholder,o},In.debounce=Sr,In.defaults=ma,In.defaultsDeep=fa,In.defer=br,In.delay=Tr,In.difference=Di,In.differenceBy=wi,In.differenceWith=Ri,In.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:oa(t))<0?0:t,l):[]},In.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:oa(t)))<0?0:t):[]},In.dropRightWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3),!0,!0):[]},In.dropWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3),!0):[]},In.fill=function(e,t,n,l){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ai(e,t,n)&&(n=0,l=o),function(e,t,n,l){var o=e.length;for((n=oa(n))<0&&(n=-n>o?0:o+n),(l=void 0===l||l>o?o:oa(l))<0&&(l+=o),l=n>l?0:ia(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},In.filter=function(e,t){return(xr(e)?rt:ol)(e,Zo(t,3))},In.flatMap=function(e,t){return il(vr(e,t),1)},In.flatMapDeep=function(e,t){return il(vr(e,t),1/0)},In.flatMapDepth=function(e,t,n){return n=void 0===n?1:oa(n),il(vr(e,t),n)},In.flatten=Mi,In.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},In.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:oa(t)):[]},In.flip=function(e){return Uo(e,512)},In.flow=Ya,In.flowRight=Ka,In.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var o=e[t];l[o[0]]=o[1]}return l},In.functions=function(e){return null==e?[]:sl(e,Sa(e))},In.functionsIn=function(e){return null==e?[]:sl(e,ba(e))},In.groupBy=sr,In.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},In.intersection=ki,In.intersectionBy=Bi,In.intersectionWith=Ui,In.invert=_a,In.invertBy=ga,In.invokeMap=cr,In.iteratee=Ga,In.keyBy=pr,In.keys=Sa,In.keysIn=ba,In.map=vr,In.mapKeys=function(e,t){var n={};return t=Zo(t,3),ul(e,function(e,l,o){qn(n,t(e,l,o),e)}),n},In.mapValues=function(e,t){var n={};return t=Zo(t,3),ul(e,function(e,l,o){qn(n,l,t(e,l,o))}),n},In.matches=function(e){return Nl(Zn(e,1))},In.matchesProperty=function(e,t){return Il(e,Zn(t,1))},In.memoize=Cr,In.merge=Ta,In.mergeWith=Ca,In.method=$a,In.methodOf=Za,In.mixin=Xa,In.negate=Ar,In.nthArg=function(e){return e=oa(e),kl(function(t){return Dl(t,e)})},In.omit=Aa,In.omitBy=function(e,t){return Na(e,Ar(Zo(t)))},In.once=function(e){return _r(2,e)},In.orderBy=function(e,t,n,l){return null==e?[]:(xr(t)||(t=null==t?[]:[t]),xr(n=l?void 0:n)||(n=null==n?[]:[n]),wl(e,t,n))},In.over=Qa,In.overArgs=Pr,In.overEvery=eu,In.overSome=tu,In.partial=Nr,In.partialRight=Ir,In.partition=mr,In.pick=Pa,In.pickBy=Na,In.property=nu,In.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},In.pull=Hi,In.pullAll=Wi,In.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,Zo(n,2)):e},In.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,void 0,n):e},In.pullAt=Vi,In.range=lu,In.rangeRight=ou,In.rearg=Or,In.reject=function(e,t){return(xr(e)?rt:ol)(e,Ar(Zo(t,3)))},In.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,o=[],i=e.length;for(t=Zo(t,3);++l<i;){var r=e[l];t(r,l,e)&&(n.push(r),o.push(l))}return xl(e,o),n},In.rest=function(e,t){if("function"!=typeof e)throw new ye(n);return kl(e,t=void 0===t?t:oa(t))},In.reverse=zi,In.sampleSize=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:oa(t),(xr(e)?jn:Ul)(e,t)},In.set=function(e,t,n){return null==e?e:jl(e,t,n)},In.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:jl(e,t,n,l)},In.shuffle=function(e){return(xr(e)?Hn:Vl)(e)},In.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ai(e,t,n)?(t=0,n=l):(t=null==t?0:oa(t),n=void 0===n?l:oa(n)),zl(e,t,n)):[]},In.sortBy=fr,In.sortedUniq=function(e){return e&&e.length?Gl(e):[]},In.sortedUniqBy=function(e,t){return e&&e.length?Gl(e,Zo(t,2)):[]},In.split=function(e,t,n){return n&&"number"!=typeof n&&ai(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ua(e))&&("string"==typeof t||null!=t&&!$r(t))&&!(t=Zl(t))&&Ft(e)?uo(Vt(e),0,n):e.split(t,n):[]},In.spread=function(e,t){if("function"!=typeof e)throw new ye(n);return t=null==t?0:rn(oa(t),0),kl(function(n){var l=n[t],o=uo(n,0,t);return l&&st(o,l),tt(e,this,o)})},In.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},In.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:oa(t))<0?0:t):[]},In.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:oa(t)))<0?0:t,l):[]},In.takeRightWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3),!1,!0):[]},In.takeWhile=function(e,t){return e&&e.length?eo(e,Zo(t,3)):[]},In.tap=function(e,t){return t(e),e},In.throttle=function(e,t,l){var o=!0,i=!0;if("function"!=typeof e)throw new ye(n);return zr(l)&&(o="leading"in l?!!l.leading:o,i="trailing"in l?!!l.trailing:i),Sr(e,t,{leading:o,maxWait:t,trailing:i})},In.thru=lr,In.toArray=na,In.toPairs=Ia,In.toPairsIn=Oa,In.toPath=function(e){return xr(e)?dt(e,Ni):Jr(e)?[e]:yo(Pi(ua(e)))},In.toPlainObject=aa,In.transform=function(e,t,n){var l=xr(e),o=l||Br(e)||Qr(e);if(t=Zo(t,4),null==n){var i=e&&e.constructor;n=o?l?new i:[]:zr(e)&&Hr(i)?On(ze(e)):{}}return(o?lt:ul)(e,function(e,l,o){return t(n,e,l,o)}),n},In.unary=function(e){return yr(e,1)},In.union=Yi,In.unionBy=Ki,In.unionWith=qi,In.uniq=function(e){return e&&e.length?Xl(e):[]},In.uniqBy=function(e,t){return e&&e.length?Xl(e,Zo(t,2)):[]},In.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xl(e,void 0,t):[]},In.unset=function(e,t){return null==e||Jl(e,t)},In.unzip=Gi,In.unzipWith=$i,In.update=function(e,t,n){return null==e?e:Ql(e,t,io(n))},In.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,t,io(n),l)},In.values=Da,In.valuesIn=function(e){return null==e?[]:It(e,ba(e))},In.without=Zi,In.words=Ha,In.wrap=function(e,t){return Nr(io(t),e)},In.xor=Xi,In.xorBy=Ji,In.xorWith=Qi,In.zip=er,In.zipObject=function(e,t){return lo(e||[],t||[],Vn)},In.zipObjectDeep=function(e,t){return lo(e||[],t||[],jl)},In.zipWith=tr,In.entries=Ia,In.entriesIn=Oa,In.extend=sa,In.extendWith=ca,Xa(In,In),In.add=uu,In.attempt=Wa,In.camelCase=wa,In.capitalize=Ra,In.ceil=du,In.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ra(n))==n?n:0),void 0!==t&&(t=(t=ra(t))==t?t:0),$n(ra(e),t,n)},In.clone=function(e){return Zn(e,4)},In.cloneDeep=function(e){return Zn(e,5)},In.cloneDeepWith=function(e,t){return Zn(e,5,t="function"==typeof t?t:void 0)},In.cloneWith=function(e,t){return Zn(e,4,t="function"==typeof t?t:void 0)},In.conformsTo=function(e,t){return null==t||Xn(e,t,Sa(t))},In.deburr=La,In.defaultTo=function(e,t){return null==e||e!=e?t:e},In.divide=su,In.endsWith=function(e,t,n){e=ua(e),t=Zl(t);var l=e.length,o=n=void 0===n?l:$n(oa(n),0,l);return(n-=t.length)>=0&&e.slice(n,o)==t},In.eq=Dr,In.escape=function(e){return(e=ua(e))&&k.test(e)?e.replace(M,xt):e},In.escapeRegExp=function(e){return(e=ua(e))&&Y.test(e)?e.replace(z,"\\$&"):e},In.every=function(e,t,n){var l=xr(e)?it:nl;return n&&ai(e,t,n)&&(t=void 0),l(e,Zo(t,3))},In.find=rr,In.findIndex=Li,In.findKey=function(e,t){return ft(e,Zo(t,3),ul)},In.findLast=ar,In.findLastIndex=xi,In.findLastKey=function(e,t){return ft(e,Zo(t,3),dl)},In.floor=cu,In.forEach=ur,In.forEachRight=dr,In.forIn=function(e,t){return null==e?e:rl(e,Zo(t,3),ba)},In.forInRight=function(e,t){return null==e?e:al(e,Zo(t,3),ba)},In.forOwn=function(e,t){return e&&ul(e,Zo(t,3))},In.forOwnRight=function(e,t){return e&&dl(e,Zo(t,3))},In.get=Ea,In.gt=wr,In.gte=Rr,In.has=function(e,t){return null!=e&&li(e,t,fl)},In.hasIn=ya,In.head=Fi,In.identity=qa,In.includes=function(e,t,n,l){e=Fr(e)?e:Da(e),n=n&&!l?oa(n):0;var o=e.length;return n<0&&(n=rn(o+n,0)),Xr(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&yt(e,t,n)>-1},In.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=null==n?0:oa(n);return o<0&&(o=rn(l+o,0)),yt(e,t,o)},In.inRange=function(e,t,n){return t=la(t),void 0===n?(n=t,t=0):n=la(n),function(e,t,n){return e>=an(t,n)&&e<rn(t,n)}(e=ra(e),t,n)},In.invoke=ha,In.isArguments=Lr,In.isArray=xr,In.isArrayBuffer=Mr,In.isArrayLike=Fr,In.isArrayLikeObject=kr,In.isBoolean=function(e){return!0===e||!1===e||Yr(e)&&vl(e)==a},In.isBuffer=Br,In.isDate=Ur,In.isElement=function(e){return Yr(e)&&1===e.nodeType&&!Gr(e)},In.isEmpty=function(e){if(null==e)return!0;if(Fr(e)&&(xr(e)||"string"==typeof e||"function"==typeof e.splice||Br(e)||Qr(e)||Lr(e)))return!e.length;var t=ni(e);if(t==v||t==y)return!e.size;if(ci(e))return!Cl(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},In.isEqual=function(e,t){return hl(e,t)},In.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?hl(e,t,void 0,n):!!l},In.isError=jr,In.isFinite=function(e){return"number"==typeof e&&nn(e)},In.isFunction=Hr,In.isInteger=Wr,In.isLength=Vr,In.isMap=Kr,In.isMatch=function(e,t){return e===t||Sl(e,t,Jo(t))},In.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Jo(t),n)},In.isNaN=function(e){return qr(e)&&e!=+e},In.isNative=function(e){if(si(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return bl(e)},In.isNil=function(e){return null==e},In.isNull=function(e){return null===e},In.isNumber=qr,In.isObject=zr,In.isObjectLike=Yr,In.isPlainObject=Gr,In.isRegExp=$r,In.isSafeInteger=function(e){return Wr(e)&&e>=-9007199254740991&&e<=9007199254740991},In.isSet=Zr,In.isString=Xr,In.isSymbol=Jr,In.isTypedArray=Qr,In.isUndefined=function(e){return void 0===e},In.isWeakMap=function(e){return Yr(e)&&ni(e)==h},In.isWeakSet=function(e){return Yr(e)&&"[object WeakSet]"==vl(e)},In.join=function(e,t){return null==e?"":ln.call(e,t)},In.kebabCase=xa,In.last=ji,In.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var o=l;return void 0!==n&&(o=(o=oa(n))<0?rn(l+o,0):an(o,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,o):Et(e,gt,o,!0)},In.lowerCase=Ma,In.lowerFirst=Fa,In.lt=ea,In.lte=ta,In.max=function(e){return e&&e.length?ll(e,qa,ml):void 0},In.maxBy=function(e,t){return e&&e.length?ll(e,Zo(t,2),ml):void 0},In.mean=function(e){return ht(e,qa)},In.meanBy=function(e,t){return ht(e,Zo(t,2))},In.min=function(e){return e&&e.length?ll(e,qa,Al):void 0},In.minBy=function(e,t){return e&&e.length?ll(e,Zo(t,2),Al):void 0},In.stubArray=iu,In.stubFalse=ru,In.stubObject=function(){return{}},In.stubString=function(){return""},In.stubTrue=function(){return!0},In.multiply=pu,In.nth=function(e,t){return e&&e.length?Dl(e,oa(t)):void 0},In.noConflict=function(){return Ve._===this&&(Ve._=Ne),this},In.noop=Ja,In.now=Er,In.pad=function(e,t,n){e=ua(e);var l=(t=oa(t))?Wt(e):0;if(!t||l>=t)return e;var o=(t-l)/2;return Ro(Qt(o),n)+e+Ro(Jt(o),n)},In.padEnd=function(e,t,n){e=ua(e);var l=(t=oa(t))?Wt(e):0;return t&&l<t?e+Ro(t-l,n):e},In.padStart=function(e,t,n){e=ua(e);var l=(t=oa(t))?Wt(e):0;return t&&l<t?Ro(t-l,n)+e:e},In.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),dn(ua(e).replace(K,""),t||0)},In.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ai(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=la(e),void 0===t?(t=e,e=0):t=la(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var o=sn();return an(e+o*(t-e+Ue("1e-"+((o+"").length-1))),t)}return Ml(e,t)},In.reduce=function(e,t,n){var l=xr(e)?ct:Tt,o=arguments.length<3;return l(e,Zo(t,4),n,o,el)},In.reduceRight=function(e,t,n){var l=xr(e)?pt:Tt,o=arguments.length<3;return l(e,Zo(t,4),n,o,tl)},In.repeat=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:oa(t),Fl(ua(e),t)},In.replace=function(){var e=arguments,t=ua(e[0]);return e.length<3?t:t.replace(e[1],e[2])},In.result=function(e,t,n){var l=-1,o=(t=ro(t,e)).length;for(o||(o=1,e=void 0);++l<o;){var i=null==e?void 0:e[Ni(t[l])];void 0===i&&(l=o,i=n),e=Hr(i)?i.call(e):i}return e},In.round=vu,In.runInContext=e,In.sample=function(e){return(xr(e)?Un:Bl)(e)},In.size=function(e){if(null==e)return 0;if(Fr(e))return Xr(e)?Wt(e):e.length;var t=ni(e);return t==v||t==y?e.size:Cl(e).length},In.snakeCase=ka,In.some=function(e,t,n){var l=xr(e)?vt:Yl;return n&&ai(e,t,n)&&(t=void 0),l(e,Zo(t,3))},In.sortedIndex=function(e,t){return Kl(e,t)},In.sortedIndexBy=function(e,t,n){return ql(e,t,Zo(n,2))},In.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Kl(e,t);if(l<n&&Dr(e[l],t))return l}return-1},In.sortedLastIndex=function(e,t){return Kl(e,t,!0)},In.sortedLastIndexBy=function(e,t,n){return ql(e,t,Zo(n,2),!0)},In.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Kl(e,t,!0)-1;if(Dr(e[n],t))return n}return-1},In.startCase=Ba,In.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:$n(oa(n),0,e.length),t=Zl(t),e.slice(n,n+t.length)==t},In.subtract=mu,In.sum=function(e){return e&&e.length?Ct(e,qa):0},In.sumBy=function(e,t){return e&&e.length?Ct(e,Zo(t,2)):0},In.template=function(e,t,n){var l=In.templateSettings;n&&ai(e,t,n)&&(t=void 0),e=ua(e),t=ca({},t,l,jo);var o,i,r=ca({},t.imports,l.imports,jo),a=Sa(r),u=It(r,a),d=0,s=t.interpolate||ue,c="__p += '",p=fe((t.escape||ue).source+"|"+s.source+"|"+(s===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(p,function(t,n,l,r,a,u){return l||(l=r),c+=e.slice(d,u).replace(de,Mt),n&&(o=!0,c+="' +\n__e("+n+") +\n'"),a&&(i=!0,c+="';\n"+a+";\n__p += '"),l&&(c+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var m=be.call(t,"variable")&&t.variable;if(m){if(J.test(m))throw new ce("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(i?c.replace(w,""):c).replace(R,"$1").replace(L,"$1;"),c="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var f=Wa(function(){return pe(a,v+"return "+c).apply(void 0,u)});if(f.source=c,jr(f))throw f;return f},In.times=function(e,t){if((e=oa(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var o=At(l,t=Zo(t));++n<e;)t(n);return o},In.toFinite=la,In.toInteger=oa,In.toLength=ia,In.toLower=function(e){return ua(e).toLowerCase()},In.toNumber=ra,In.toSafeInteger=function(e){return e?$n(oa(e),-9007199254740991,9007199254740991):0===e?e:0},In.toString=ua,In.toUpper=function(e){return ua(e).toUpperCase()},In.trim=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return Pt(e);if(!e||!(t=Zl(t)))return e;var l=Vt(e),o=Vt(t);return uo(l,Dt(l,o),wt(l,o)+1).join("")},In.trimEnd=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.slice(0,zt(e)+1);if(!e||!(t=Zl(t)))return e;var l=Vt(e);return uo(l,0,wt(l,Vt(t))+1).join("")},In.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(K,"");if(!e||!(t=Zl(t)))return e;var l=Vt(e);return uo(l,Dt(l,Vt(t))).join("")},In.truncate=function(e,t){var n=30,l="...";if(zr(t)){var o="separator"in t?t.separator:o;n="length"in t?oa(t.length):n,l="omission"in t?Zl(t.omission):l}var i=(e=ua(e)).length;if(Ft(e)){var r=Vt(e);i=r.length}if(n>=i)return e;var a=n-Wt(l);if(a<1)return l;var u=r?uo(r,0,a).join(""):e.slice(0,a);if(void 0===o)return u+l;if(r&&(a+=u.length-a),$r(o)){if(e.slice(a).search(o)){var d,s=u;for(o.global||(o=fe(o.source,ua(te.exec(o))+"g")),o.lastIndex=0;d=o.exec(s);)var c=d.index;u=u.slice(0,void 0===c?a:c)}}else if(e.indexOf(Zl(o),a)!=a){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+l},In.unescape=function(e){return(e=ua(e))&&F.test(e)?e.replace(x,Yt):e},In.uniqueId=function(e){var t=++Te;return ua(e)+t},In.upperCase=Ua,In.upperFirst=ja,In.each=ur,In.eachRight=dr,In.first=Fi,Xa(In,(au={},ul(In,function(e,t){be.call(In.prototype,t)||(au[t]=e)}),au),{chain:!1}),In.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){In[e].placeholder=In}),lt(["drop","take"],function(e,t){Rn.prototype[e]=function(n){n=void 0===n?1:rn(oa(n),0);var l=this.__filtered__&&!t?new Rn(this):this.clone();return l.__filtered__?l.__takeCount__=an(n,l.__takeCount__):l.__views__.push({size:an(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},Rn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;Rn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Zo(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Rn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Rn.prototype[e]=function(){return this.__filtered__?new Rn(this):this[n](1)}}),Rn.prototype.compact=function(){return this.filter(qa)},Rn.prototype.find=function(e){return this.filter(e).head()},Rn.prototype.findLast=function(e){return this.reverse().find(e)},Rn.prototype.invokeMap=kl(function(e,t){return"function"==typeof e?new Rn(this):this.map(function(n){return _l(n,e,t)})}),Rn.prototype.reject=function(e){return this.filter(Ar(Zo(e)))},Rn.prototype.slice=function(e,t){e=oa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Rn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=oa(t))<0?n.dropRight(-t):n.take(t-e)),n)},Rn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Rn.prototype.toArray=function(){return this.take(4294967295)},ul(Rn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),o=In[l?"take"+("last"==t?"Right":""):t],i=l||/^find/.test(t);o&&(In.prototype[t]=function(){var t=this.__wrapped__,r=l?[1]:arguments,a=t instanceof Rn,u=r[0],d=a||xr(t),s=function(e){var t=o.apply(In,st([e],r));return l&&c?t[0]:t};d&&n&&"function"==typeof u&&1!=u.length&&(a=d=!1);var c=this.__chain__,p=!!this.__actions__.length,v=i&&!c,m=a&&!p;if(!i&&d){t=m?t:new Rn(this);var f=e.apply(t,r);return f.__actions__.push({func:lr,args:[s],thisArg:void 0}),new wn(f,c)}return v&&m?e.apply(this,r):(f=this.thru(s),v?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);In.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var o=this.value();return t.apply(xr(o)?o:[],e)}return this[n](function(n){return t.apply(xr(n)?n:[],e)})}}),ul(Rn.prototype,function(e,t){var n=In[t];if(n){var l=n.name+"";be.call(gn,l)||(gn[l]=[]),gn[l].push({name:t,func:n})}}),gn[Io(void 0,2).name]=[{name:"wrapper",func:void 0}],Rn.prototype.clone=function(){var e=new Rn(this.__wrapped__);return e.__actions__=yo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=yo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=yo(this.__views__),e},Rn.prototype.reverse=function(){if(this.__filtered__){var e=new Rn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Rn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=xr(e),l=t<0,o=n?e.length:0,i=function(e,t,n){for(var l=-1,o=n.length;++l<o;){var i=n[l],r=i.size;switch(i.type){case"drop":e+=r;break;case"dropRight":t-=r;break;case"take":t=an(t,e+r);break;case"takeRight":e=rn(e,t-r)}}return{start:e,end:t}}(0,o,this.__views__),r=i.start,a=i.end,u=a-r,d=l?a:r-1,s=this.__iteratees__,c=s.length,p=0,v=an(u,this.__takeCount__);if(!n||!l&&o==u&&v==u)return to(e,this.__actions__);var m=[];e:for(;u--&&p<v;){for(var f=-1,E=e[d+=t];++f<c;){var y=s[f],_=y.type,g=(0,y.iteratee)(E);if(2==_)E=g;else if(!g){if(1==_)continue e;break e}}m[p++]=E}return m},In.prototype.at=or,In.prototype.chain=function(){return nr(this)},In.prototype.commit=function(){return new wn(this.value(),this.__chain__)},In.prototype.next=function(){void 0===this.__values__&&(this.__values__=na(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},In.prototype.plant=function(e){for(var t,n=this;n instanceof Dn;){var l=Oi(n);l.__index__=0,l.__values__=void 0,t?o.__wrapped__=l:t=l;var o=l;n=n.__wrapped__}return o.__wrapped__=e,t},In.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Rn){var t=e;return this.__actions__.length&&(t=new Rn(this)),(t=t.reverse()).__actions__.push({func:lr,args:[zi],thisArg:void 0}),new wn(t,this.__chain__)}return this.thru(zi)},In.prototype.toJSON=In.prototype.valueOf=In.prototype.value=function(){return to(this.__wrapped__,this.__actions__)},In.prototype.first=In.prototype.head,bt&&(In.prototype[bt]=function(){return this}),In}();Ye?((Ye.exports=Kt)._=Kt,ze._=Kt):Ve._=Kt}).call(p)});const f=e=>{var i;let{config:a,onSelect:u,value:s,userType:p,redirectUrl:v}=e;const[f,E]=n.useState(null),{t:y}=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.pt.useTenants(),o.useTranslation()),_=r.useLocation(),[g,h]=n.useState(!1),S=d({},s),b=r.useHistory(),T=r.useRouteMatch();sessionStorage.setItem("VisitedCommonPTSearch",!0),sessionStorage.setItem("VisitedLightCreate",!0);const C=window.Digit.Utils.browser.isMobile();let A=null===(i=Digit.Hooks.pt.useTenants())||void 0===i?void 0:i.sort((e,t)=>{var n,l;return null==e||null===(n=e.i18nKey)||void 0===n||null===(l=n.localeCompare)||void 0===l?void 0:l.call(n,null==t?void 0:t.i18nKey)});window.location.href.includes("obps")&&(A=Digit.SessionStorage.get("OBPS_TENANTS")),window.location.href.includes("fsm")&&(A=Digit.SessionStorage.get("FSM_TENANTS"));const[P,N]=n.useState(""),[I,O]=n.useState("");let D="employee"!=p&&((null==a?void 0:a.isSkipEnabled)||sessionStorage.getItem("skipenabled"));const[w,R,L]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[x,M,F]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{}),{isLoading:k}=Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(),"PropertyTax","CommonFieldsConfig");return n.useEffect(()=>{R(!1),F()},[]),k?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginLeft:"12px"}},l.createElement(t.Header,{styles:window.location.href.includes("citizen")?{paddingLeft:"0px",marginLeft:"0px"}:{}},y((()=>{var e,t,n;let l=window.location.href,o=null==l||null===(e=l.split("="))||void 0===e||null===(t=e[1])||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n[3];return y(o?"ES_COMMON_CREATE_PROPERTY_HEADER_"+(null==o?void 0:o.toUpperCase()):"ES_COMMON_CREATE_PROPERTY_HEADER")})()))),l.createElement(t.FormComposer,{onSkip:()=>{u("isSkip",!0)},showSkip:D,skipStyle:C?{}:{textAlign:"right",marginRight:"55px"},sectionHeadStyle:{marginBottom:"16px"},onSubmit:function(){try{var e,t,n,l,o,i,r,a,s;return(null!=P&&null!==(e=P.owners)&&void 0!==e&&null!==(t=e.ownershipCategory)&&void 0!==t&&t.includes("MULTIPLEOWNERS")||null!=P&&null!==(n=P.owners)&&void 0!==n&&null!==(l=n[0])&&void 0!==l&&null!==(o=l.ownershipCategory)&&void 0!==o&&null!==(i=o.code)&&void 0!==i&&i.includes("MULTIPLEOWNERS"))&&1==(null==P||null===(r=P.owners)||void 0===r?void 0:r.length)?E({key:!0,label:"PT_COMMON_ONE_MORE_OWNER_INFROMATION_REQUIRED"}):u?u("cptNewProperty",{property:P}):"employee"===p?b.push(T.path+"/save-property?redirectToUrl="+v,{data:P,prevState:d({},null==_?void 0:_.state)}):b.replace("/digit-ui/citizen/commonPt/property/citizen-otp",{mobileNumber:null==P||null===(a=P.owners)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.mobileNumber,redirectBackTo:"/digit-ui/citizen/commonPt/property/new-application/save-property",redirectData:P}),Promise.resolve()}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,config:c,label:y("SUBMIT"),isDisabled:!g,defaultValues:S,onFormValueChange:(e,t,n)=>{m.isEqual(t,P)||N(t),t.assemblyDet&&t.locationDet&&t.owners&&!Object.keys(null==n?void 0:n.errors).length?h(!0):h(!1)}}),f&&l.createElement(t.Toast,{error:f.key,label:y(f.label),onClose:()=>{E(null)}}))},E=e=>{var t,n;let{locationDet:l}=e,o={city:null==l||null===(t=l.cityCode)||void 0===t?void 0:t.name,doorNo:null==l?void 0:l.houseDoorNo,street:null==l?void 0:l.buildingColonyName,landmark:null==l?void 0:l.landmarkName,locality:{code:(null==l||null===(n=l.locality)||void 0===n?void 0:n.code)||"NA"}};return e.address=o,e},y=e=>{var t,n;const{locationDet:l,owners:o}=e;let i={},r=[],a=[];var u,d,s,c,p,v,m,f,E,y,_,g,h,S,b;return e.ownershipCategory=null==e||null===(t=e.owners)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.ownershipCategory,e.ownershipCategory.includes("INSTITUTIONALPRIVATE")||e.ownershipCategory.includes("INSTITUTIONALGOVERNMENT")?(i.designation=null==o||null===(u=o[0])||void 0===u?void 0:u.designation,i.name=null==o||null===(d=o[0])||void 0===d?void 0:d.institutionName,i.type=null==o||null===(s=o[0])||void 0===s||null===(c=s.institutionType)||void 0===c||null===(p=c.code)||void 0===p||null===(v=p.split("."))||void 0===v?void 0:v[1],i.landlineNumber=null==o||null===(m=o[0])||void 0===m?void 0:m.altContactNumber,i.tenantId=null==l||null===(f=l.cityCode)||void 0===f?void 0:f.code,r.push({altContactNumber:null==o||null===(E=o[0])||void 0===E?void 0:E.altContactNumber,permanentAddress:null==o||null===(y=o[0])||void 0===y?void 0:y.permanentAddress,correspondenceAddress:null==o||null===(_=o[0])||void 0===_?void 0:_.permanentAddress,sameAsPropertyAddress:(null==o||null===(g=o[0])||void 0===g?void 0:g.isCorrespondenceAddress)||(null==o||null===(h=o[0])||void 0===h?void 0:h.isCoresAddr),mobileNumber:null==o||null===(S=o[0])||void 0===S?void 0:S.mobileNumber,name:null==o||null===(b=o[0])||void 0===b?void 0:b.name,ownerType:"NONE",status:"ACTIVE",documents:a}),e.institution=i,e.owners=r):(o.map(e=>{var t,n,l,i;r.push({emailId:null==e?void 0:e.emailId,fatherOrHusbandName:null==e?void 0:e.fatherOrHusbandName,gender:null==e||null===(t=e.gender)||void 0===t?void 0:t.value,sameAsPropertyAddress:(null==e?void 0:e.isCorrespondenceAddress)||(null==o||null===(n=o[0])||void 0===n?void 0:n.isCoresAddr),mobileNumber:null==e?void 0:e.mobileNumber,name:null==e?void 0:e.name,ownerType:(null==e||null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",permanentAddress:null==e?void 0:e.permanentAddress,relationship:null==e||null===(i=e.relationship)||void 0===i?void 0:i.code,documents:a})}),e.owners=r),e},g=e=>{var t,n,l;return"RESIDENTIAL"==(null==e||null===(t=e.isResdential)||void 0===t?void 0:t.code)?null==e||null===(n=e.isResdential)||void 0===n?void 0:n.code:null==e||null===(l=e.usageCategory)||void 0===l?void 0:l.code},h=e=>{var t;let n={};const{assemblyDet:l}=e;return n={propertyType:null==l||null===(t=l.BuildingType)||void 0===t?void 0:t.code,usageCategory:g(l),landArea:parseInt(null==l?void 0:l.floorarea),superBuiltUpArea:parseInt(null==l?void 0:l.constructionArea)},e.propertyDetails=n,e},S=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e},b=e=>{const{t:t}=o.useTranslation();return e.isSuccess?window.location.href.includes("edit-application")?t("CS_PROPERTY_UPDATE_APPLICATION_SUCCESS"):window.location.href.includes("employee")?t("CS_NEW_PROPERTY_APPLICATION_CREATED_SUCCESS"):t("CS_NEW_PROPERTY_APPLICATION_SUBMITTED_SUCCESS"):e.isLoading?window.location.href.includes("edit-application")?t("CS_PROPERTY_UPDATE_APPLICATION_PENDING"):t("CS_PROPERTY_APPLICATION_PENDING"):e.isSuccess?void 0:window.location.href.includes("edit-application")?t("CS_PROPERTY_UPDATE_APPLICATION_FAILED"):t("CS_PROPERTY_APPLICATION_FAILED")},T={padding:"4px 0px",justifyContent:"space-between"},C=e=>{var n;return l.createElement(t.Banner,{message:b(e),applicationNumber:null===(n=e.data)||void 0===n?void 0:n.Properties[0].acknowldgementNumber,info:e.isSuccess?e.t("PT_APPLICATION_NO"):"",successful:e.isSuccess})},A=e=>{var i,a,u,s,c,p,v,m,f,_,g,S;let{onSuccess:b,onSelect:A,formData:P,redirectUrl:N,userType:I}=e;const{t:O}=o.useTranslation(),D=r.useLocation(),w=Digit.ULBService.getStateId(),R=Digit.ULBService.getCurrentTenantId(),L=r.useHistory();let x=null==D||null===(i=D.state)||void 0===i?void 0:i.data;var M;A&&(x=null==P||null===(M=P.cptNewProperty)||void 0===M?void 0:M.property);let F=!1,{data:k}=Digit.Hooks.pt.useMDMS(w,"PropertyTax","PTWorkflow");((null==k||null===(a=k.PropertyTax)||void 0===a?void 0:a.PTWorkfow)||[]).forEach(e=>{e.enable&&e.businessService.includes("WNS")&&(F=!0)});const B=Digit.Hooks.pt.usePropertyAPI(null!==(u=x)&&void 0!==u&&null!==(s=u.locationDet)&&void 0!==s&&s.city?null===(c=x.locationDet)||void 0===c||null===(p=c.city)||void 0===p?void 0:p.code:R,!0),U=Digit.Hooks.pt.usePropertyAPI(null!==(v=x)&&void 0!==v&&null!==(m=v.locationDet)&&void 0!==m&&m.city?null===(f=x.locationDet)||void 0===f||null===(_=f.city)||void 0===_?void 0:_.code:R,!1);return Digit.Hooks.useStore.getInitData(),n.useEffect(()=>{try{var e,t,n,l;let o="employee"===I?R:null===(e=x)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.cityCode)||void 0===n?void 0:n.code;x.tenantId=o;let i=function(e){var t,n,l,o,i,r;void 0===e&&(e={});let a=e.PropertyType,u=null===(t=e)||void 0===t||null===(n=t.owners)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.ownershipCategory;e=y(e),e=E(e);const s={Property:d({tenantId:(e=h(e)).tenantId,address:e.address,propertyType:a},e.propertyDetails,{ownershipCategory:u,usageCategory:null===(o=e)||void 0===o||null===(i=o.assemblyDet)||void 0===i||null===(r=i.usageCategoryMajor)||void 0===r?void 0:r.code,owners:[...e.owners.map((e,t)=>{var n,l,o,i;return d({},e,{additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:Object.keys(e.documents).map(t=>{const{documentType:n,fileStoreId:l}=e.documents[t];return{documentType:n.code,fileStoreId:l}}),gender:null===(n=e.gender)||void 0===n?void 0:n.code,ownerType:(null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",relationship:null===(o=e.relationship)||void 0===o?void 0:o.code,inistitutetype:null==e||null===(i=e.inistitutetype)||void 0===i?void 0:i.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"})})],noOfFloors:1,additionalDetails:{isRainwaterHarvesting:!1,owners:[...e.owners.map((e,t)=>{var n,l,o,i;return d({},e,{additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:Object.keys(e.documents).map(t=>{const{documentType:n,fileStoreId:l}=e.documents[t];return{documentType:n.code,fileStoreId:l}}),gender:null===(n=e.gender)||void 0===n?void 0:n.code,ownerType:(null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",relationship:null===(o=e.relationship)||void 0===o?void 0:o.code,inistitutetype:null==e||null===(i=e.inistitutetype)||void 0===i?void 0:i.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"})})]},creationReason:"CREATE",source:"MUNICIPAL_RECORDS",channel:"SYSTEM"})};var c;return(u.includes("INSTITUTIONALPRIVATE")||u.includes("INSTITUTIONALGOVERNMENT"))&&(s.Property.institution=null===(c=e)||void 0===c?void 0:c.institution),s}(x);i.Property.tenantId=(null==i||null===(l=i.Property)||void 0===l?void 0:l.tenantId)||o,B.mutate(i,{onSuccess:b}),F||B.isLoading&&B.isIdle||B.isSuccess&&setTimeout(()=>{if(N){var e,t,n;L.push(N+"?propertyId="+(null==B||null===(e=B.data)||void 0===e||null===(t=e.Properties[0])||void 0===t?void 0:t.propertyId)+"&tenantId="+i.Property.tenantId,d({},null==D||null===(n=D.state)||void 0===n?void 0:n.prevState));const l=null!=N&&N.includes("employee/tl")?1600:300;setTimeout(()=>window.scrollTo(0,l),400)}},3e3)}catch(e){}},[]),n.useEffect(()=>{var e,t,n;let l="employee"===I?R:null===(e=x)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.code;B.isSuccess&&setTimeout(()=>{if(N){var e,t,n;L.push(N+"?propertyId="+(null==B||null===(e=B.data)||void 0===e||null===(t=e.Properties[0])||void 0===t?void 0:t.propertyId)+"&tenantId="+l,d({},null==D||null===(n=D.state)||void 0===n?void 0:n.prevState));const o=null!=N&&N.includes("employee/tl")?1600:300;setTimeout(()=>window.scrollTo(0,o),400)}},3e3)},[B]),n.useEffect(()=>{if(B.isSuccess&&F)try{var e,t,n,l;let o="employee"===I?R:null===(e=x)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.code;x.tenantId=o;let i=function(e){var t,n,l,o;void 0===e&&(e={});let i=e.PropertyType;e=y(e),e=E(e);const r={Property:d({id:(e=h(e)).id,accountId:e.accountId,acknowldgementNumber:e.acknowldgementNumber,propertyId:e.propertyId,status:e.status||"INWORKFLOW",tenantId:e.tenantId,address:e.address,propertyType:i,ownershipCategory:null===(t=e)||void 0===t?void 0:t.ownershipCategory,owners:[...e.owners.map((e,t)=>{var n,l,o,i;return d({},e,{additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:Object.keys(e.documents).map(t=>{const{documentType:n,fileStoreId:l}=e.documents[t];return{documentType:n.code,fileStoreId:l}}),gender:null===(n=e.gender)||void 0===n?void 0:n.code,ownerType:(null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",relationship:null===(o=e.relationship)||void 0===o?void 0:o.code,inistitutetype:null==e||null===(i=e.inistitutetype)||void 0===i?void 0:i.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"})})],noOfFloors:1,additionalDetails:{isRainwaterHarvesting:!1,owners:[...e.owners.map((e,t)=>{var n,l,o,i;return d({},e,{additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:Object.keys(e.documents).map(t=>{const{documentType:n,fileStoreId:l}=e.documents[t];return{documentType:n.code,fileStoreId:l}}),gender:null===(n=e.gender)||void 0===n?void 0:n.code,ownerType:(null===(l=e.ownerType)||void 0===l?void 0:l.code)||"NONE",relationship:null===(o=e.relationship)||void 0===o?void 0:o.code,inistitutetype:null==e||null===(i=e.inistitutetype)||void 0===i?void 0:i.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"})})]}},e.propertyDetails,{creationReason:getCreationReason(e),source:"MUNICIPAL_RECORDS",channel:"CITIZEN",workflow:getWorkflow(e)})};let a=JSON.parse(sessionStorage.getItem("propertyInitialObject"));if(checkArrayLength(null==a?void 0:a.units)&&checkIsAnArray(null===(n=r.Property)||void 0===n?void 0:n.units)&&null!==(l=e)&&void 0!==l&&l.isEditProperty){var u;a.units=a.units.filter(e=>e.active);let e=a.units.map(e=>d({},e,{active:!1}));null===(u=r.Property)||void 0===u||u.units.push(...e)}return checkArrayLength(null==a?void 0:a.owners)&&checkIsAnArray(null===(o=r.Property)||void 0===o?void 0:o.owners)&&(r.Property.owners=[...a.owners]),null!=a&&a.auditDetails&&(r.Property.auditDetails=d({},a.auditDetails)),r}(x);i.Property.tenantId=(null==i||null===(l=i.Property)||void 0===l?void 0:l.tenantId)||o,U.mutate(i,{onSuccess:b}),U.isSuccess&&setTimeout(()=>{if(N){var e,t,n,l,o;L.push(N+"?propertyId="+(null==U||null===(e=U.data)||void 0===e||null===(t=e.Properties[0])||void 0===t?void 0:t.propertyId)+"&tenantId="+(null==U||null===(n=U.data)||void 0===n||null===(l=n.Properties[0])||void 0===l?void 0:l.tenantId),d({},null==D||null===(o=D.state)||void 0===o?void 0:o.prevState));const i=null!=N&&N.includes("employee/tl")?1600:300;setTimeout(()=>window.scrollTo(0,i),400)}},3e3)}catch(e){}},[B.isSuccess]),B.isLoading||B.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(C,{t:O,data:B.data,isSuccess:B.isSuccess,isLoading:B.isIdle||B.isLoading}),B.isSuccess&&l.createElement(t.CardText,null,window.location.href.includes("employee")?O("CS_CREATE_PROPERTY_SUCCESS_EMP_RESPONSE"):O("CS_CREATE_PROPERTY_SUCCESS_CITIZEN_RESPONSE")),!B.isSuccess&&l.createElement(t.CardText,null,O("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement(t.StatusTable,null,B.isSuccess&&l.createElement(t.Row,{rowContainerStyle:T,last:!0,label:O("PT_COMMON_TABLE_COL_PT_ID"),text:null==B||null===(g=B.data)||void 0===g||null===(S=g.Properties[0])||void 0===S?void 0:S.propertyId,textStyle:{whiteSpace:"pre",width:"200%"}})),B.isSuccess&&window.location.href.includes("/citizen/")&&l.createElement(t.SubmitBar,A?{label:O("CS_COMMON_PROCEED"),onSubmit:()=>{var e,t,n;A&&B.isSuccess&&(sessionStorage.setItem("Digit_OBPS_PT",JSON.stringify(null==B||null===(e=B.data)||void 0===e?void 0:e.Properties[0])),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(null==B||null===(t=B.data)||void 0===t?void 0:t.Properties[0])),A("cpt",{details:null==B||null===(n=B.data)||void 0===n?void 0:n.Properties[0]}))}}:{label:O("CS_COMMON_PROCEED"),onSubmit:()=>{var e,t,n,l,o;N&&L.push(N+"?propertyId="+(null==U||null===(e=U.data)||void 0===e||null===(t=e.Properties[0])||void 0===t?void 0:t.propertyId)+"&tenantId="+(null==U||null===(n=U.data)||void 0===n||null===(l=n.Properties[0])||void 0===l?void 0:l.tenantId),d({},null==D||null===(o=D.state)||void 0===o?void 0:o.prevState))}}))},P=e=>{const n=a.useQueryClient(),i=r.useRouteMatch(),u=(o.useTranslation(),r.useLocation(),r.useHistory()),d=Digit.ULBService.getStateId(),[s,c,p]=Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY",{});let{isLoading:v}=Digit.Hooks.pt.useMDMS(d,"PropertyTax","CommonFieldsConfig");const m=r.useLocation().search,E=new URLSearchParams(m).get("redirectUrl");return v?l.createElement(t.Loader,null):l.createElement(r.Switch,null,l.createElement(r.Route,{exact:!0,path:""+i.path},l.createElement(f,{onSubmit:function(){try{return u.push(i.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:s,userType:"citizen"})),l.createElement(r.Route,{exact:!0,path:i.path+"/save-property"},l.createElement(A,{data:s,onSuccess:()=>{p(),n.invalidateQueries("PT_CREATE_PROPERTY")},redirectUrl:E,userType:"citizen"})))},N=[{texts:{header:"SEARCH_PROPERTY",submitButtonLabel:"PT_HOME_SEARCH_RESULTS_BUTTON_SEARCH",text:""},inputs:[{label:"PT_OWNER_MOB_NO_LABEL",type:"mobileNumber",name:"mobileNumber",validation:{pattern:{value:/[6789][0-9]{9}/,message:"CORE_COMMON_MOBILE_ERROR"}},error:"CORE_COMMON_MOBILE_ERROR"},{label:"PT_PROPERTY_ID",description:"CS_PROPERTY_ID_FORMAT_MUST_BE",type:"text",name:"propertyIds",error:"ERR_INVALID_PROPERTY_ID",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}||[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}||[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},{label:"PT_PROPERTY_ADDRESS_OLDPID",type:"text",name:"oldPropertyId",error:"ERR_INVALID_PROPERTY_ID",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}|[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},{label:"PT_COMMON_PAYEE_NAME",type:"text",name:"name",validation:{pattern:{value:"^[a-zA-Z ]+$",message:"PAYMENT_INVALID_NAME"}},error:"PAYMENT_INVALID_NAME"},{label:"PT_DOOR_NUM_LABEL",type:"text",name:"doorNumber",validation:{pattern:{value:"[A-Za-z0-9#,/ -()]{1,63}",message:"ERR_INVALID_DOOR_NO"}},error:"ERR_INVALID_DOOR_NO"}]}];
|
|
2
|
+
/** @license React v16.13.1
|
|
3
|
+
* react-is.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
var I="function"==typeof Symbol&&Symbol.for,O=I?Symbol.for("react.element"):60103,D=I?Symbol.for("react.portal"):60106,w=I?Symbol.for("react.fragment"):60107,R=I?Symbol.for("react.strict_mode"):60108,L=I?Symbol.for("react.profiler"):60114,x=I?Symbol.for("react.provider"):60109,M=I?Symbol.for("react.context"):60110,F=I?Symbol.for("react.async_mode"):60111,k=I?Symbol.for("react.concurrent_mode"):60111,B=I?Symbol.for("react.forward_ref"):60112,U=I?Symbol.for("react.suspense"):60113,j=I?Symbol.for("react.suspense_list"):60120,H=I?Symbol.for("react.memo"):60115,W=I?Symbol.for("react.lazy"):60116,V=I?Symbol.for("react.block"):60121,z=I?Symbol.for("react.fundamental"):60117,Y=I?Symbol.for("react.responder"):60118,K=I?Symbol.for("react.scope"):60119;function q(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case O:switch(e=e.type){case F:case k:case w:case L:case R:case U:return e;default:switch(e=e&&e.$$typeof){case M:case B:case W:case H:case x:return e;default:return t}}case D:return t}}}function G(e){return q(e)===k}var $={AsyncMode:F,ConcurrentMode:k,ContextConsumer:M,ContextProvider:x,Element:O,ForwardRef:B,Fragment:w,Lazy:W,Memo:H,Portal:D,Profiler:L,StrictMode:R,Suspense:U,isAsyncMode:function(e){return G(e)||q(e)===F},isConcurrentMode:G,isContextConsumer:function(e){return q(e)===M},isContextProvider:function(e){return q(e)===x},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===O},isForwardRef:function(e){return q(e)===B},isFragment:function(e){return q(e)===w},isLazy:function(e){return q(e)===W},isMemo:function(e){return q(e)===H},isPortal:function(e){return q(e)===D},isProfiler:function(e){return q(e)===L},isStrictMode:function(e){return q(e)===R},isSuspense:function(e){return q(e)===U},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===w||e===k||e===L||e===R||e===U||e===j||"object"==typeof e&&null!==e&&(e.$$typeof===W||e.$$typeof===H||e.$$typeof===x||e.$$typeof===M||e.$$typeof===B||e.$$typeof===z||e.$$typeof===Y||e.$$typeof===K||e.$$typeof===V)},typeOf:q},Z=v(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,l=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,E=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var v=e.type;switch(v){case d:case s:case o:case r:case i:case p:return v;default:var E=v&&v.$$typeof;switch(E){case u:case c:case f:case m:case a:return E;default:return t}}case l:return t}}}var S=s,b=u,T=a,C=n,A=c,P=o,N=f,I=m,O=l,D=r,w=i,R=p,L=!1;function x(e){return h(e)===s}t.AsyncMode=d,t.ConcurrentMode=S,t.ContextConsumer=b,t.ContextProvider=T,t.Element=C,t.ForwardRef=A,t.Fragment=P,t.Lazy=N,t.Memo=I,t.Portal=O,t.Profiler=D,t.StrictMode=w,t.Suspense=R,t.isAsyncMode=function(e){return L||(L=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),x(e)||h(e)===d},t.isConcurrentMode=x,t.isContextConsumer=function(e){return h(e)===u},t.isContextProvider=function(e){return h(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return h(e)===c},t.isFragment=function(e){return h(e)===o},t.isLazy=function(e){return h(e)===f},t.isMemo=function(e){return h(e)===m},t.isPortal=function(e){return h(e)===l},t.isProfiler=function(e){return h(e)===r},t.isStrictMode=function(e){return h(e)===i},t.isSuspense=function(e){return h(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===r||e===i||e===p||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===m||e.$$typeof===a||e.$$typeof===u||e.$$typeof===c||e.$$typeof===y||e.$$typeof===_||e.$$typeof===g||e.$$typeof===E)},t.typeOf=h}()}),X=v(function(e){e.exports="production"===process.env.NODE_ENV?$:Z}),J=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;function te(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var ne=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(e){l[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},l)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,o=te(e),i=1;i<arguments.length;i++){for(var r in n=Object(arguments[i]))Q.call(n,r)&&(o[r]=n[r]);if(J){l=J(n);for(var a=0;a<l.length;a++)ee.call(n,l[a])&&(o[l[a]]=n[l[a]])}}return o},le="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",oe=Function.call.bind(Object.prototype.hasOwnProperty),ie=function(){};if("production"!==process.env.NODE_ENV){var re=le,ae={},ue=oe;ie=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function de(e,t,n,l,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(ue(e,i)){var r;try{if("function"!=typeof e[i]){var a=Error((l||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}r=e[i](t,i,l,n,null,re)}catch(e){r=e}if(!r||r instanceof Error||ie((l||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof r+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),r instanceof Error&&!(r.message in ae)){ae[r.message]=!0;var u=o?o():"";ie("Failed "+n+" type: "+r.message+(null!=u?u:""))}}}de.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(ae={})};var se=de,ce=function(){};function pe(){return null}function ve(){}function me(){}"production"!==process.env.NODE_ENV&&(ce=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),me.resetWarningCache=ve;var fe=v(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l={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:r(pe),arrayOf:function(e){return r(function(t,n,l,o,r){if("function"!=typeof e)return new i("Property `"+r+"` of component `"+l+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new i("Invalid "+o+" `"+r+"` of type `"+s(a)+"` supplied to `"+l+"`, expected an array.");for(var u=0;u<a.length;u++){var d=e(a,u,l,o,r+"["+u+"]",le);if(d instanceof Error)return d}return null})},element:r(function(t,n,l,o,r){var a=t[n];return e(a)?null:new i("Invalid "+o+" `"+r+"` of type `"+s(a)+"` supplied to `"+l+"`, expected a single ReactElement.")}),elementType:r(function(e,t,n,l,o){var r=e[t];return X.isValidElementType(r)?null:new i("Invalid "+l+" `"+o+"` of type `"+s(r)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return r(function(t,n,l,o,r){var a;return t[n]instanceof e?null:new i("Invalid "+o+" `"+r+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+l+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:r(function(e,t,n,l,o){return d(e[t])?null:new i("Invalid "+l+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return r(function(t,n,l,o,r){if("function"!=typeof e)return new i("Property `"+r+"` of component `"+l+"` has invalid PropType notation inside objectOf.");var a=t[n],u=s(a);if("object"!==u)return new i("Invalid "+o+" `"+r+"` of type `"+u+"` supplied to `"+l+"`, expected an object.");for(var d in a)if(oe(a,d)){var c=e(a,d,l,o,r+"."+d,le);if(c instanceof Error)return c}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&ce(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),pe;function t(t,n,l,r,a){for(var u=t[n],d=0;d<e.length;d++)if(o(u,e[d]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===c(t)?String(t):t});return new i("Invalid "+r+" `"+a+"` of value `"+String(u)+"` supplied to `"+l+"`, expected one of "+s+".")}return r(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&ce("Invalid argument supplied to oneOfType, expected an instance of array."),pe;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return ce("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(n)+" at index "+t+"."),pe}return r(function(t,n,l,o,r){for(var a=[],u=0;u<e.length;u++){var d=(0,e[u])(t,n,l,o,r,le);if(null==d)return null;d.data&&oe(d.data,"expectedType")&&a.push(d.data.expectedType)}return new i("Invalid "+o+" `"+r+"` supplied to `"+l+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return r(function(t,n,l,o,r){var a=t[n],d=s(a);if("object"!==d)return new i("Invalid "+o+" `"+r+"` of type `"+d+"` supplied to `"+l+"`, expected `object`.");for(var p in e){var v=e[p];if("function"!=typeof v)return u(l,o,r,p,c(v));var m=v(a,p,l,o,r+"."+p,le);if(m)return m}return null})},exact:function(e){return r(function(t,n,l,o,r){var a=t[n],d=s(a);if("object"!==d)return new i("Invalid "+o+" `"+r+"` of type `"+d+"` supplied to `"+l+"`, expected `object`.");var p=ne({},t[n],e);for(var v in p){var m=e[v];if(oe(e,v)&&"function"!=typeof m)return u(l,o,r,v,c(m));if(!m)return new i("Invalid "+o+" `"+r+"` key `"+v+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=m(a,v,l,o,r+"."+v,le);if(f)return f}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function r(e){function t(t,n,l,o,r,a,u){if(o=o||"<<anonymous>>",a=a||l,u!==le){var d=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 d.name="Invariant Violation",d}return null==n[l]?t?new i(null===n[l]?"The "+r+" `"+a+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+r+" `"+a+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,l,o,r,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return r(function(t,n,l,o,r,a){var u=t[n];return s(u)!==e?new i("Invalid "+o+" `"+r+"` of type `"+c(u)+"` supplied to `"+l+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,l,o){return new i((e||"React class")+": "+t+" type `"+n+"."+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function d(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(d);if(null===t||e(t))return!0;var l=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!l)return!1;var o,i=l.call(t);if(l!==t.entries){for(;!(o=i.next()).done;)if(!d(o.value))return!1}else for(;!(o=i.next()).done;){var r=o.value;if(r&&!d(r[1]))return!1}return!0;default:return!1}}function s(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function c(e){if(null==e)return""+e;var t=s(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function p(e){var t=c(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,l.checkPropTypes=se,l.resetWarningCache=se.resetWarningCache,l.PropTypes=l,l}(X.isElement):function(){function e(e,t,n,l,o,i){if(i!==le){var r=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw r.name="Invariant Violation",r}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:me,resetWarningCache:ve};return n.PropTypes=n,n}()});const Ee={description:"PT_SEARCH_OR_DESC",descriptionStyles:{fontWeight:"300",color:"#505A5F",marginTop:"0px",textAlign:"center",marginBottom:"20px",maxWidth:"540px"}},ye=e=>{var i,a,u,s,c,p,v;let{config:f,onSelect:E,redirectToUrl:y}=e;const{t:_}=o.useTranslation(),g=r.useHistory(),{action:h=0}=Digit.Hooks.useQueryParams(),[S,b]=n.useState({}),[T,C]=n.useState(null);sessionStorage.setItem("VisitedCommonPTSearch",!0),sessionStorage.setItem("VisitedLightCreate",!1);let A=null===(i=Digit.Hooks.pt.useTenants())||void 0===i?void 0:i.sort((e,t)=>{var n,l;return null==e||null===(n=e.i18nKey)||void 0===n||null===(l=n.localeCompare)||void 0===l?void 0:l.call(n,null==t?void 0:t.i18nKey)});A=A||(null===(a=Digit.Hooks.tl.useTenants())||void 0===a?void 0:a.sort((e,t)=>{var n,l;return null==e||null===(n=e.i18nKey)||void 0===n||null===(l=n.localeCompare)||void 0===l?void 0:l.call(n,null==t?void 0:t.i18nKey)})),window.location.href.includes("obps")?A=Digit.SessionStorage.get("OBPS_TENANTS"):window.location.href.includes("fsm")&&(A=[{i18nKey:"TENANT_TENANTS_PG_CITYA",code:"pg.citya",name:"City A",description:"City A",pincode:[143001,143002,143003,143004,143005],logoId:"https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",imageId:null,domainUrl:"https://www.upyog.niua.org",type:"CITY",twitterUrl:null,facebookUrl:null,emailId:"citya@gmail.com",OfficeTimings:{"Mon - Fri":"9.00 AM - 6.00 PM"},city:{name:"City A",localName:null,districtCode:"CITYA",districtName:null,districtTenantCode:"pg.citya",regionName:null,ulbGrade:"Municipal Corporation",longitude:75.5761829,latitude:31.3260152,shapeFileLocation:null,captcha:null,code:"1013",ddrName:"DDR A"},address:"City A Municipal Corporation",contactNumber:"001-2345876"},{i18nKey:"TENANT_TENANTS_PG_CITYB",code:"pg.cityb",name:"City B",description:null,pincode:[143006,143007,143008,143009,143010],logoId:"https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",imageId:null,domainUrl:"https://www.upyog.niua.org",type:"CITY",twitterUrl:null,facebookUrl:null,emailId:"cityb@gmail.com",OfficeTimings:{"Mon - Fri":"9.00 AM - 6.00 PM",Sat:"9.00 AM - 12.00 PM"},city:{name:"City B",localName:null,districtCode:"CITYB",districtName:null,districtTenantCode:"pg.cityb",regionName:null,ulbGrade:"Municipal Corporation",longitude:74.8722642,latitude:31.6339793,shapeFileLocation:null,captcha:null,code:"107",ddrName:"DDR B"},address:"City B Municipal Corporation Address",contactNumber:"0978-7645345",helpLineNumber:"0654-8734567"},{i18nKey:"TENANT_TENANTS_PG_CITYC",code:"pg.cityc",name:"City C",description:null,logoId:"https://in-egov-assets.s3.ap-south-1.amazonaws.com/in.citya/logo.png",imageId:null,domainUrl:"https://www.upyog.niua.org",type:"CITY",twitterUrl:null,facebookUrl:null,emailId:"cityc@gmail.com",OfficeTimings:{"Mon - Fri":"9.00 AM - 6.00 PM",Sat:"9.00 AM - 12.00 PM"},city:{name:"City C",localName:null,districtCode:"CITYC",districtName:null,districtTenantCode:"pg.cityc",regionName:null,ulbGrade:"Municipal Corporation",longitude:73.8722642,latitude:31.6339793,shapeFileLocation:null,captcha:null,code:"108",ddrName:"DDR C"},address:"City C Municipal Corporation Address",contactNumber:"0978-7645345",helpLineNumber:"0654-8734567"}]),console.log("allCities",A);const[P,N]=n.useState(),[I,O]=n.useState(),[D,w]=n.useState(!1);let R=window.Digit.Utils.browser.isMobile();const{data:L,isLoading:x,error:M}=Digit.Hooks.pt.usePropertySearchWithDue({tenantId:null==S?void 0:S.city,filters:null==S?void 0:S.filters,auth:!0,configs:{enabled:Object.keys(S).length>0,retry:!1,retryOnMount:!1,staleTime:Infinity}});n.useEffect(()=>{var e,t,n;(null==S||null===(e=S.filters)||void 0===e||!e.mobileNumber||1!=(null===(t=Object.values(null==S?void 0:S.filters))||void 0===t||null===(n=t.filter(e=>void 0!==e))||void 0===n?void 0:n.length))&&(null==L?void 0:L.Properties.length)>0&&null!=F&&F.maxResultValidation&&(null==L?void 0:L.Properties.length)>(null==F?void 0:F.maxPropertyResult)&&!D&&C({error:!0,warning:!0,label:"ERR_PLEASE_REFINED_UR_SEARCH"})},[L]),n.useEffect(()=>{T&&"ERR_PLEASE_REFINED_UR_SEARCH"!==(null==T?void 0:T.label)&&"NO_PROPERTIES_FOUND"!==(null==T?void 0:T.label)&&C(null)},[h,x]),n.useEffect(()=>{var e;!x&&L&&S&&(null==L||null===(e=L.Properties)||void 0===e?void 0:e.length)<=0&&C({error:!0,warning:!0,label:"NO_PROPERTIES_FOUND"})},[null==L||null===(u=L.Properties)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.propertyId,x]),n.useLayoutEffect(()=>{const e=()=>{let t=document.querySelector("div.action-bar-wrap");t?(t.style.position="static",t.style.padding="8px 0",t.style.boxShadow="none",t.style.marginBottom="16px",t.style.textAlign="left",t.style.zIndex="0"):setTimeout(()=>{e()},100)};e()},[]);const{data:F,isLoading:k}=Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(),"DIGIT-UI","HelpText",{select:e=>{var t,n,l;return null==e||null===(t=e["DIGIT-UI"])||void 0===t||null===(n=t.HelpText)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.PT}}),[B,U,j,H,W]=f.inputs,V=[{body:[{type:"custom",populators:{name:"addParam",defaultValue:{code:0,name:_("PT_KNOW_PTID")},customProps:{t:_,isMandatory:!0,optionsKey:"name",options:[{code:0,name:_("PT_KNOW_PTID")},{code:1,name:_("PT_SEARCH_DOOR_NO")}]},component:(e,n)=>l.createElement(t.RadioButtons,d({},n,{selectedOption:e.value,onSelect:t=>{null==e||e.setValue("city",{}),null==e||e.setValue("locality",{}),null==e||e.setValue("mobileNumber",""),null==e||e.setValue("propertyIds",""),null==e||e.setValue("doorNumber",""),null==e||e.setValue("oldPropertyId",""),null==e||e.setValue("name",""),g.replace(g.location.pathname+"?action="+(0==h?1:0))}}))}},{label:"PT_SELECT_CITY",isMandatory:!0,type:"custom",populators:{name:"city",defaultValue:null,rules:{required:!0},customProps:{t:_,isMandatory:!0,option:[...A],optionKey:"i18nKey"},component:(e,n)=>l.createElement(t.Dropdown,d({},n,{selected:e.value,select:t=>{t.code!==P&&e.setValue("locality",null),e.onChange(t)}}))}},{label:_("PT_PROVIDE_ONE_MORE_PARAM"),isInsideBox:!0,placementinbox:0,isSectionText:!0},d({label:B.label,type:B.type,populators:{defaultValue:"",name:B.name,validation:null==B?void 0:B.validation}},Ee,{isMandatory:!1,isInsideBox:!0,placementinbox:1}),d({label:"",labelChildren:l.createElement("div",{className:"tooltip"},l.createElement("div",{style:{display:"flex",gap:"0 4px"}},l.createElement("h2",null,_(U.label)),l.createElement(t.InfoBannerIcon,{fill:"#0b0c0c"}),l.createElement("span",{className:"tooltiptext",style:{position:"absolute",width:"72%",marginLeft:"50%",fontSize:"medium"}},_(U.description)+" PG-PT-xxxx-xxxxxx"))),type:U.type,populators:{name:U.name,defaultValue:"",validation:null==U?void 0:U.validation}},Ee,{isMandatory:!1,isInsideBox:!0,placementinbox:1}),{label:j.label,type:j.type,populators:{name:j.name,defaultValue:"",validation:null==j?void 0:j.validation},isMandatory:!1,isInsideBox:!0,placementinbox:2}],body1:[{type:"custom",populators:{name:"addParam1",defaultValue:{code:1,name:_("PT_SEARCH_DOOR_NO")},customProps:{t:_,isMandatory:!0,optionsKey:"name",options:[{code:0,name:_("PT_KNOW_PTID")},{code:1,name:_("PT_SEARCH_DOOR_NO")}]},component:(e,n)=>l.createElement(t.RadioButtons,d({},n,{selectedOption:e.value,onSelect:t=>{null==e||e.setValue("city",{}),null==e||e.setValue("locality",{}),null==e||e.setValue("mobileNumber",""),null==e||e.setValue("propertyIds",""),null==e||e.setValue("doorNumber",""),null==e||e.setValue("oldPropertyId",""),null==e||e.setValue("name",""),g.replace(g.location.pathname+"?action="+(0==h?1:0))}}))}},{label:"PT_SELECT_CITY",isMandatory:!0,type:"custom",populators:{name:"city",defaultValue:null,rules:{required:!0},customProps:{t:_,isMandatory:!0,option:[...A],optionKey:"i18nKey"},component:(e,n)=>l.createElement(t.Dropdown,d({},n,{selected:e.value,select:t=>{var n,l;Digit.LocalizationService.getLocale({modules:["rainmaker-"+(null==e||null===(n=e.value)||void 0===n?void 0:n.code)],locale:Digit.StoreData.getCurrentLanguage(),tenantId:""+(null==e||null===(l=e.value)||void 0===l?void 0:l.code)}),t.code!==P&&e.setValue("locality",null),e.onChange(t)}}))}},{label:"PT_SELECT_LOCALITY",type:"custom",isMandatory:!0,populators:{name:"locality",defaultValue:"",rules:{required:!0},customProps:{},component:(e,n)=>l.createElement(t.Localities,{selectLocality:t=>{e.onChange(t)},tenantId:P,boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10",maxHeight:"300px"},selected:null==I?void 0:I.locality,disable:!P,disableLoader:!0})}},{label:_("PT_PROVIDE_ONE_MORE_PARAM"),isInsideBox:!0,placementinbox:0,isSectionText:!0},{label:W.label,type:W.type,populators:{defaultValue:"",name:W.name,validation:null==W?void 0:W.validation},isMandatory:!1,isInsideBox:!0,placementinbox:1},{label:H.label,type:H.type,populators:{defaultValue:"",name:H.name,validation:null==H?void 0:H.validation},isMandatory:!1,isInsideBox:!0,placementinbox:2}]}];if(k)return l.createElement(t.Loader,null);let z=!(null!=F&&F.maxResultValidation&&(null==S||null===(c=S.filters)||void 0===c||!c.mobileNumber||1!=(null===(p=Object.values(null==S?void 0:S.filters))||void 0===p||null===(v=p.filter(e=>void 0!==e))||void 0===v?void 0:v.length)))||(null==L?void 0:L.Properties.length)<(null==F?void 0:F.maxPropertyResult)&&(null==T||null!==T&&!(null!=T&&T.error));if(L&&!x&&!M&&z){var Y,K,q,G,$;let e={};if(e=d({},S.filters,{city:S.city}),(null==S||null===(Y=S.filters)||void 0===Y||!Y.mobileNumber||1!=(null===(K=Object.values(null==S?void 0:S.filters))||void 0===K||null===(q=K.filter(e=>void 0!==e))||void 0===q?void 0:q.length))&&null!=F&&F.ptSearchCount&&null!=S&&null!==(G=S.filters)&&void 0!==G&&G.locality&&x&&null!=x&&null!==($=x.Properties)&&void 0!==$&&$.length&&x.Properties.length>(null==F?void 0:F.ptSearchCount))!T&&C({error:!0,label:"PT_MODIFY_SEARCH_CRITERIA"});else if("MUTATION"===f.action)E(f.key,e,null,null,null,{queryParams:d({},e)});else if(y||window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search"))g.push("/digit-ui/citizen/commonPt/property/search-results?"+Object.keys(e).map(t=>t+"="+e[t]).join("&")+(y?"&redirectToUrl="+y:""));else{var Z,X,J,Q,ee,te,ne,le,oe,ie;let t={};t=0==h?{city:null===(Z=e)||void 0===Z?void 0:Z.city,mobileNumber:(null===(X=e)||void 0===X?void 0:X.mobileNumber)||"",propertyIds:(null===(J=e)||void 0===J?void 0:J.propertyIds)||"",oldPropertyIds:(null===(Q=e)||void 0===Q?void 0:Q.oldPropertyIds)||"",locality:"",doorNo:"",name:""}:{city:null===(ee=e)||void 0===ee?void 0:ee.city,locality:(null===(te=e)||void 0===te?void 0:te.locality)||"",doorNo:(null===(ne=e)||void 0===ne?void 0:ne.doorNumber)||(null===(le=e)||void 0===le?void 0:le.doorNo)||"",name:(null===(oe=e)||void 0===oe?void 0:oe.name)||"",mobileNumber:"",propertyIds:"",oldPropertyIds:""},!x&&(null==L||null===(ie=L.Properties)||void 0===ie?void 0:ie.length)>0&&E("cptSearchQuery",t,null,null,null,{queryParams:d({},t)})}}var re,ae,ue,de;return M&&!T&&C({error:!0,label:(null==M||null===(re=M.response)||void 0===re||null===(ae=re.data)||void 0===ae||null===(ue=ae.Errors)||void 0===ue||null===(de=ue[0])||void 0===de?void 0:de.code)||M}),1==h&&(V[0].body=[...V[0].body1]),l.createElement("div",{style:{marginTop:"16px",marginBottom:"16px",backgroundColor:"white",maxWidth:"960px"}},l.createElement(t.FormComposer,{onSubmit:function(e){try{var t,n;if(null!=F&&F.maxResultValidation&&(null==L?void 0:L.Properties.length)>0&&(null==L?void 0:L.Properties.length)>(null==F?void 0:F.maxPropertyResult)&&D)return w(!0),Promise.resolve();if(null==e||null===(t=e.city)||void 0===t||!t.code)return C({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(0==h){var l,o,i,r,a,u,s,c,p,v,m,f,E,y,_;if(!(null!=e&&e.mobileNumber||null!=e&&e.propertyIds||null!=e&&e.oldPropertyId))return C({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(null!=e&&e.mobileNumber&&(null===(l=e.mobileNumber)||void 0===l||!l.match(null==B||null===(o=B.validation)||void 0===o||null===(i=o.pattern)||void 0===i?void 0:i.value)))return C({error:!0,label:null==B||null===(v=B.validation)||void 0===v||null===(m=v.pattern)||void 0===m?void 0:m.message}),Promise.resolve();if(null!=e&&e.propertyIds&&(null===(r=e.propertyIds)||void 0===r||!r.match(null==U||null===(a=U.validation)||void 0===a||null===(u=a.pattern)||void 0===u?void 0:u.value)))return C({error:!0,label:null==U||null===(f=U.validation)||void 0===f||null===(E=f.pattern)||void 0===E?void 0:E.message}),Promise.resolve();if(null!=e&&e.oldPropertyId&&(null===(s=e.oldPropertyId)||void 0===s||!s.match(null==j||null===(c=j.validation)||void 0===c||null===(p=c.pattern)||void 0===p?void 0:p.value)))return C({error:!0,label:null==j||null===(y=j.validation)||void 0===y||null===(_=y.pattern)||void 0===_?void 0:_.message}),Promise.resolve()}else{var g,S,A,P,N,I,O,R,x,M,k;if(null==e||null===(g=e.locality)||void 0===g||!g.code)return C({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(!(null!=e&&e.doorNumber||null!=e&&e.name))return C({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(null!=e&&e.name&&(null===(S=e.name)||void 0===S||!S.match(null==H||null===(A=H.validation)||void 0===A||null===(P=A.pattern)||void 0===P?void 0:P.value)))return C({error:!0,label:null==H||null===(R=H.validation)||void 0===R||null===(x=R.pattern)||void 0===x?void 0:x.message}),Promise.resolve();if(null!=e&&e.doorNumber&&(null===(N=e.doorNumber)||void 0===N||!N.match(null==W||null===(I=W.validation)||void 0===I||null===(O=I.pattern)||void 0===O?void 0:O.value)))return C({error:!0,label:null==W||null===(M=W.validation)||void 0===M||null===(k=M.pattern)||void 0===k?void 0:k.message}),Promise.resolve()}"ERR_PLEASE_REFINED_UR_SEARCH"===(null==T?void 0:T.label)&&"NO_PROPERTIES_FOUND"===(null==T?void 0:T.label)||C(null),null!=e&&e.doorNumber&&""!==(null==e?void 0:e.doorNumber)&&""!==(null==e?void 0:e.propertyIds)&&(e.propertyIds="");let Z=Object.keys(e).filter(t=>e[t]).reduce((t,n)=>d({},t,{[n]:"object"==typeof e[n]?e[n].code:e[n]}),{}),X=Z.city;var V,z,Y;if(Z.doorNo=Z.doorNumber||(null===(n=Z)||void 0===n?void 0:n.doorNo),delete Z.addParam,delete Z.addParam1,delete Z.city,"0"===h)Z={oldPropertyId:null===(V=Z)||void 0===V?void 0:V.oldPropertyId,mobileNumber:null===(z=Z)||void 0===z?void 0:z.mobileNumber,propertyIds:null===(Y=Z)||void 0===Y?void 0:Y.propertyIds};else if("1"===h){var K,q,G,$;Z={name:null===(K=Z)||void 0===K?void 0:K.name,doorNo:(null===(q=Z)||void 0===q?void 0:q.doorNumber)||(null===(G=Z)||void 0===G?void 0:G.doorNo),locality:null===($=Z)||void 0===$?void 0:$.locality}}return b({city:X,filters:Z}),Promise.resolve()}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,config:V,label:f.texts.submitButtonLabel,heading:_(f.texts.header),text:_(f.texts.text),headingStyle:{fontSize:"32px",marginBottom:"16px",fontFamily:"Roboto Condensed,sans-serif"},onFormValueChange:(e,t,n)=>{const l=(null==t?void 0:t.city)||A[0];console.log("citycity",l),N(l.code),(null==l?void 0:l.code)!==P&&N(null==l?void 0:l.code),m.isEqual(t,I)||O(t)},cardStyle:{marginBottom:"0",maxWidth:"960px"}}),l.createElement("div",{style:{display:"flex"}},window.location.href.includes("/obps/bpa/")?l.createElement("span",{className:"link",style:R?{display:"flex",justifyContent:"center",paddingBottom:"16px"}:{display:"flex",justifyContent:"left",paddingBottom:"16px",marginLeft:"45px"}},l.createElement(r.Link,{to:"/digit-ui/citizen/obps/bpa/building_plan_scrutiny/new_construction/location"},_("CORE_COMMON_SKIP_CONTINUE"))):l.createElement("span",{className:"link",style:R?{display:"flex",justifyContent:"center",paddingBottom:"16px"}:{display:"flex",justifyContent:"left",paddingBottom:"16px",marginLeft:"45px"}},l.createElement(r.Link,{to:window.location.href.includes("/ws/")?"/digit-ui/citizen/ws/create-application/create-property":window.location.href.includes("/tl/tradelicence/")?"/digit-ui/citizen/tl/tradelicence/new-application/create-property":window.location.href.includes("/fsm/")?"/digit-ui/citizen/fsm/new-application/create-property":"/digit-ui/citizen/commonpt/property/new-application"},_("CPT_REG_NEW_PROPERTY")))),T&&l.createElement(t.Toast,{isDleteBtn:!0,error:T.error,warning:T.warning,label:_(T.label),onClose:()=>{C(null)}}))};ye.propTypes={loginParams:fe.any},ye.defaultProps={loginParams:null};const _e=e=>{let{onSelect:t}=e;const{t:i}=o.useTranslation(),{path:a}=r.useRouteMatch(),u=r.useLocation().search,s=new URLSearchParams(u).get("redirectToUrl"),c=n.useMemo(()=>N.map(e=>{const t={};for(const n in e.texts)t[n]=i(e.texts[n]);return d({},e,{texts:t})},[N]));return l.createElement(r.Switch,null,l.createElement(r.Route,{path:""+a,exact:!0},l.createElement(ye,{config:c[0],onSelect:t,redirectToUrl:s})))},ge=[{texts:{header:"CS_SEARCH_RESULTS",actionButtonLabel:"PT_COMMONS_SELECT_PLACEHOLDER"},labels:[{label:"PT_DUES_ARE_PENDING",key:"total_due",noteStyle:{fontSize:"24px",fontWeight:"bold"},notePrefix:"₹ "},{label:"TL_PROPERTY_ID",key:"property_id"},{label:"PT_OWNERS_NAME",key:"owner_name"},{label:"PT_COMMON_COL_ADDRESS",key:"property_address"},{label:"PT_COMMON_TABLE_COL_STATUS_LABEL",key:"status"}]}];function he(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 Se={type:"login"},be=e=>{var i,a,u,s,c,p,v;let{template:f,header:E,actionButtonLabel:y,onSelect:_,clearParams:g=(()=>{}),stateCode:h,redirectToUrl:S,searchQuery:b}=e;const{t:T}=o.useTranslation(),C=n.useRef(),{mobileNumber:A,propertyIds:P,oldPropertyIds:N,locality:I,city:O,doorNo:D,name:w,PToffset:R}=Digit.Hooks.useQueryParams(),L={},[x,M]=n.useState(!1),F=Digit.ComponentRegistryService.getComponent("WSInfoLabel");let k,B,U=R;isNaN(parseInt(U))?k=5:(B=U,k=parseInt(U)+5);let j=isNaN(parseInt(U))?{limit:"5",sortOrder:"ASC",sortBy:"createdTime",offset:"0"}:{limit:"5",sortOrder:"ASC",sortBy:"createdTime",offset:B};Digit.Hooks.useClickOutside(C,()=>{M(!1)},x),(A||b&&b.mobileNumber)&&(L.mobileNumber=A||(null==b?void 0:b.mobileNumber)),(P||b&&b.propertyIds)&&(L.propertyIds=P||(null==b?void 0:b.propertyIds)),(N||b&&b.oldPropertyIds)&&(L.oldPropertyIds=N||(null==b?void 0:b.oldPropertyIds)),(I||b&&b.locality)&&(L.locality=I||(null==b?void 0:b.locality)),(D||b&&b.doorNo)&&(L.doorNo=D||(null==b?void 0:b.doorNo)),(w||b&&b.name)&&(L.name=w||(null==b?void 0:b.name)),(I||b&&b.locality)&&(L.limit=j.limit,L.sortOrder=j.sortOrder,L.sortBy=j.sortBy,L.offset=j.offset);const[H,W,V]=Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS",null),[z,Y,K]=Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS_LAST_PATH",null),q=(r.useRouteMatch(),Digit.Hooks.useQueryParams());n.useEffect(()=>{W([]),g(),Y("")},[]);const G=Digit.ULBService.getCurrentTenantId(),$=O||(null==b?void 0:b.city),Z=Digit.Hooks.pt.usePropertySearch($?{tenantId:$,filters:L,auth:!0}:{filters:L,auth:!0},{privacy:Digit.Utils.getPrivacyObject()}),X=null==Z||null===(i=Z.data)||void 0===i||null===(a=i.Properties)||void 0===a?void 0:a.map(e=>e.propertyId).join(",");console.log("result",Z);const J=Digit.Hooks.useFetchBillsForBuissnessService(d({businessService:"PT"},A?{mobileNumber:A,consumerCode:X}:{consumerCode:X},{tenantId:$}),{enabled:!!X,retry:!1}),Q=r.useHistory();if(J.isLoading||Z.isLoading)return l.createElement(t.Loader,null);if(Z.error||!X)return l.createElement("div",{style:{height:"150px"}},l.createElement(t.Card,{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},T("CS_PT_NO_PROPERTIES_FOUND")));const ee={};null==J||null===(u=J.data)||void 0===u||null===(s=u.Bill)||void 0===s||s.forEach(e=>{null!=e&&e.consumerCode&&(ee[null==e?void 0:e.consumerCode]={total_due:null==e?void 0:e.totalAmount,bil_due__date:new Date(null==e?void 0:e.billDate).toDateString()})});const te=null==Z||null===(c=Z.data)||void 0===c||null===(p=c.Properties)||void 0===p?void 0:p.filter(e=>"ACTIVE"===e.status);console.log("arrarr",te);const ne=null==te?void 0:te.map(e=>{var t,n,l,o,i,r,a,u;let d=(null==e?void 0:e.address)||{};return{property_id:null==e?void 0:e.propertyId,owner_name:null===(t=((null==e?void 0:e.owners)||[]).sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}))||void 0===t||null===(n=t[0])||void 0===n?void 0:n.name,property_address:[d.doorNo||"",d.buildingName||"",d.street||"",T("TENANTS_MOHALLA_"+(null===(l=d.locality)||void 0===l?void 0:l.code))||"",T(d.tenantId)||""].filter(e=>e).join(", "),total_due:(null===(o=ee[null==e?void 0:e.propertyId])||void 0===o?void 0:o.total_due)||0,bil_due__date:(null===(i=ee[null==e?void 0:e.propertyId])||void 0===i?void 0:i.bil_due__date)||T("N/A"),status:T(e.status),owner_mobile:null===(r=((null==e?void 0:e.owners)||[])[0])||void 0===r?void 0:r.mobileNumber,address:null==e?void 0:e.address,owners:e.owners,propertyDetails:e,privacy:{property_address:{uuid:null==e||null===(a=e.owners)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==e?void 0:e.tenantId,propertyIds:null==e?void 0:e.propertyId},jsonPath:"Properties[0].address.street",isArray:!1,d:e=>(m.get(e,"Properties[0].address.doorNo")?m.get(e,"Properties[0].address.doorNo")+", ":"")+(m.get(e,"Properties[0].address.street")?m.get(e,"Properties[0].address.street")+", ":"")+(m.get(e,"Properties[0].address.landmark")?""+m.get(e,"Properties[0].address.landmark"):"")}}}}}),le=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||"/digit-ui/citizen";return l.createElement("div",{className:"static",style:{marginTop:"16px"}},l.createElement("div",{className:"static-wrapper"},E&&l.createElement(t.Header,{style:{marginLeft:"8px"}},T(E)," (",null==ne?void 0:ne.length,")"),l.createElement(F,{t:T}),l.createElement(t.ResponseComposer,{data:ne,template:f,actionButtonLabel:y,onSubmit:function(e){try{return sessionStorage.setItem("Digit_OBPS_PT",JSON.stringify(e)),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(e)),Promise.resolve(function(){if(!_){const t={mobileNumber:null==e?void 0:e.owner_mobile,tenantId:h,userType:Digit.UserService.getType()};return Promise.resolve(function(e){return Promise.resolve(he(function(){return Promise.resolve(Digit.UserService.sendOtp(e,h)).then(function(e){return[e,null]})},function(e){return[null,e]}))}({otp:d({},t,Se)})).then(function(n){let[l,o]=n;if(o)Q.push("/digit-ui/citizen/",{from:le(location.state,q),data:t});else{let t="/digit-ui/citizen/commonPt/property/link-success/"+e.property_id;S&&(t=S+"?propertyId="+e.property_id+"&tenantId="+G),Q.replace("/digit-ui/citizen/commonPt/property/citizen-otp",{from:le(location.state,q),mobileNumber:e.owner_mobile,redirectBackTo:t})}})}_("cptId",{id:e.property_id})}())}catch(e){return Promise.reject(e)}}})),x?l.createElement(t.Modal,{hideSubmit:!0,isDisabled:!1,popupStyles:{width:"319px",height:"250px",margin:"auto"},formId:"modal-action"},l.createElement("div",{ref:C},l.createElement(t.KeyNote,{keyValue:T("PT_AMOUNT_DUE"),note:"₹ "+(null==x||null===(v=x.total_due)||void 0===v?void 0:v.toLocaleString("en-IN")),noteStyle:{fontSize:"24px",fontWeight:"bold"}}),l.createElement("p",null,T("PT_YOU_HAVE")+" ₹ "+(null==x?void 0:x.total_due.toLocaleString("en-IN"))+" "+T("PT_PENDING_AMOUNT")+" "+T("PT_INORDER_TO_TRANSFER")),l.createElement(t.SubmitBar,{submit:!1,onSubmit:()=>{Q.push("/digit-ui/citizen/payment/my-bills/PT/"+x.property_id,{tenantId:G})},style:{marginTop:"14px",width:"100%"},label:T("PT_PROCEED_PAYMENT")}))):null,!(null!=ne&&ne.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},T("PT_NO_PROP_FOUND_MSG")),0!==(null==ne?void 0:ne.length)&&(5==(null==ne?void 0:ne.length)||50==(null==ne?void 0:ne.length))&&(I||b&&b.locality)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},T("PT_LOAD_MORE_MSG")," ",l.createElement("span",{className:"link"},l.createElement(r.Link,{to:"/digit-ui/citizen/pt/property/search-results?mobileNumber="+(A||b.mobileNumber?A||(null==b?void 0:b.mobileNumber):"")+"&propertyIds="+(P||null!=b&&b.propertyIds?P||(null==b?void 0:b.propertyIds):"")+"&oldPropertyIds="+(N||null!=b&&b.oldPropertyIds?N||(null==b?void 0:b.oldPropertyIds):"")+"&doorNo="+(D||null!=b&&b.doorNo?D||(null==b?void 0:b.doorNo):"")+"&name="+(w||null!=b&&b.name?w||(null==b?void 0:b.name):"")+"&city="+(O||"")+"&locality="+(I||null!=b&&b.locality?I||(null==b?void 0:b.locality):"")+"&PToffset="+k},T("PT_COMMON_CLICK_HERE"))))))};be.propTypes={template:fe.any,header:fe.string,actionButtonLabel:fe.string},be.defaultProps={template:[],header:null,actionButtonLabel:null};const Te=[{texts:{header:"CS_LOGIN_PROVIDE_MOBILE_NUMBER",cardText:"CS_LOGIN_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOB_NO",validation:{required:!0,minLength:10,maxLength:10}}]},{texts:{header:"CS_LOGIN_OTP",cardText:"CS_LOGIN_OTP_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"}},{texts:{header:"CS_LOGIN_PROVIDE_NAME",cardText:"CS_LOGIN_NAME_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_NAME",type:"text",name:"name",error:"CORE_COMMON_NAME_VALIDMSG",validation:{required:!0,minLength:1,pattern:/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i}}]}],Ce=e=>{const{config:t,onSelect:i,clearParams:a,formData:u,stateCode:s}=e,{t:c}=o.useTranslation(),{path:p}=r.useRouteMatch(),v=r.useLocation().search,m=new URLSearchParams(v).get("redirectToUrl");let f=ge;const E=n.useMemo(()=>{var e;return null==f||null===(e=f.map)||void 0===e?void 0:e.call(f,e=>{const t={};for(const n in e.texts)t[n]=c(e.texts[n]);return d({},e,{texts:t})})},[f]);return l.createElement(r.Switch,null,l.createElement(r.Route,{path:""+p,exact:!0},l.createElement(be,{template:E[0].labels,header:E[0].texts.header,actionButtonLabel:E[0].texts.actionButtonLabel,t:c,isMutation:"MUTATION"===(null==t?void 0:t.action),onSelect:i,config:t,clearParams:a,stateCode:s,redirectToUrl:m,searchQuery:null==u?void 0:u.cptSearchQuery})))},Ae=e=>{let{onSelect:i}=e;const{t:a}=o.useTranslation(),{propertyIds:u}=r.useParams(),d=r.useHistory(),{data:s}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:u}},{filters:{propertyIds:u}}),[c,p]=n.useState(()=>(null==s?void 0:s.Properties[0])||" ");return n.useEffect(()=>{s&&p(null==s?void 0:s.Properties[0])},[s]),l.createElement(l.Fragment,null,l.createElement(t.Header,null,a("PT_PROPERTY_DETAILS")),l.createElement("div",null,l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("PT_PROPERTY_PTUID"),text:""+(c.propertyId||a("CS_NA")),textStyle:{whiteSpace:"pre"}})),l.createElement(t.SubmitBar,i?{submit:!1,label:a("CS_COMMONS_NEXT"),onSubmit:()=>{i&&i("propertyId",u)}}:{submit:!1,label:a("PT_PROPERTY_CREATE"),onSubmit:()=>d.push("/digit-ui/citizen/commonPt/property/new-application")}))))},Pe=e=>{let{config:o,otp:i,onOtpChange:r,onResend:a,onSelect:u,t:d,error:s,userType:c="citizen"}=e;const[p,v]=n.useState(30);!function(e,t){const l=n.useRef();n.useEffect(()=>{l.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){l.current()},t);return()=>clearInterval(e)}},[t])}(()=>{v(p-1)},p>0?1e3:null);const m=()=>{a(),v(2)};return"employee"===c?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:r,value:i}),p>0?l.createElement(t.CardText,null,d("CS_RESEND_ANOTHER_OTP")+" "+p+" "+d("CS_RESEND_SECONDS")):l.createElement("p",{className:"card-text-button",onClick:m},d("CS_RESEND_OTP")),!s&&l.createElement(t.CardLabelError,null,d("CS_INVALID_OTP"))):l.createElement(t.FormStep,{onSelect:u,config:o,t:d,isDisabled:6!==(null==i?void 0:i.length)},l.createElement(t.OTPInput,{length:6,onChange:r,value:i}),p>0?l.createElement(t.CardText,null,d("CS_RESEND_ANOTHER_OTP")+" "+p+" "+d("CS_RESEND_SECONDS")):l.createElement("p",{className:"card-text-button",onClick:m},d("CS_RESEND_OTP")),!s&&l.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")))},Ne=["ResponseInfo","UserRequest"],Ie=e=>{const{t:t}=o.useTranslation(),i=(r.useRouteMatch(),r.useLocation()),a=r.useHistory(),[u,c]=n.useState({mobileNumber:i.state.mobileNumber,otp:""}),[p,v]=n.useState(!0),m=()=>Digit.UserService.getType(),f=n.useMemo(()=>Te.map(e=>{const n={};for(const l in e.texts)n[l]=t(e.texts[l]);return d({},e,{texts:n})},[Te]));return l.createElement(Pe,{config:d({},f[1],{texts:d({},f[1].texts,{cardText:f[1].texts.cardText+" "+(u.mobileNumber||"")})}),onOtpChange:e=>{c(d({},u,{otp:e}))},onResend:function(){try{const{mobileNumber:t}=u,n={mobileNumber:t,tenantId:e.stateCode,userType:m()};return Promise.resolve(sendOtp({otp:d({},n,TYPE_LOGIN)})).then(function(){})}catch(e){return Promise.reject(e)}},onSelect:function(){try{const t=he(function(){v(!0);const{mobileNumber:t,otp:n}=u,l={username:t,password:n,tenantId:e.stateCode,userType:m()};return Promise.resolve(Digit.UserService.authenticate(l)).then(function(e){var t,n,l;s(e,Ne),null!==(t=i.state)&&void 0!==t&&t.redirectBackTo?a.replace(null===(n=i.state)||void 0===n?void 0:n.redirectBackTo,{data:null===(l=i.state)||void 0===l?void 0:l.redirectData}):a.replace("digit-ui/citizen/")})},function(){v(!1)});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},otp:u.otp,error:p,t:t})};function Oe(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 De=e=>l.createElement("h1",{className:"heading-m"},e.label),we=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Re=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(we,null)),Le=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v,moduleCode:m}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:y,data:_}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[g,h]=n.useState({}),[S,b]=n.useState({}),[T,C]=n.useState([]),[A,P]=n.useState(null),[N,I]=n.useState(null),[O,D]=n.useState(null),[w,R]=n.useState(null),[L,x]=n.useState([]),[M,F]=n.useState(null),[k,B]=n.useState(!1);function U(e){I(e.target.files[0])}return n.useEffect(()=>{var e;_&&_["egf-master"]&&x(null===(e=_["egf-master"])||void 0===e?void 0:e.FinancialYear)},[_]),n.useEffect(()=>{var e;C(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)R(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Oe(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",N,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?D(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):R(r("CS_FILE_UPLOAD_ERROR"))})},function(){R(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)}}()},[N]),n.useEffect(()=>{a&&h(null!=a&&a.showFinancialYearsModal?(e=>{let{t:n,action:o,financialYears:i,selectedFinancialYear:r,setSelectedFinancialYear:a}=e;return{label:{heading:"WF_"+o.action+"_APPLICATION",submit:"WF_PT.CREATE_"+o.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:i,optionsKey:"name",onSelect:a,selectedOption:r})}]}]}})({t:r,action:a,financialYears:L,selectedFinancialYear:M,setSelectedFinancialYear:F}):(e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:o(p||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:o("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("ES_PT_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:o("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:T,selectedApprover:A,setSelectedApprover:P,selectFile:U,uploadedFile:O,setUploadedFile:D,businessService:v}))},[a,T,L,M,O]),a&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(De,{label:r(g.label.heading)}),headerBarEnd:l.createElement(Re,{onClick:s}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!M:E||(null==a?void 0:a.docUploadRequired)&&!O,formId:"modal-action"},y?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==a?void 0:a.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};p.creationReason="STATUS",c({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:d({},p,{workflow:t})})}else if(null!=a&&a.showFinancialYearsModal)c({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==M?void 0:M.name,propertyId:null==p?void 0:p.propertyId,tenantId:u,source:null==p?void 0:p.source,channel:null==p?void 0:p.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:m};t.assignes=null!=a&&a.isTerminateState||!A?[]:[A],O&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:O}]),c({Property:d({},p,{workflow:t})})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},xe=e=>l.createElement("h1",{className:"heading-m"},e.label),Me=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Fe=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Me,null)),ke=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[y,_]=n.useState({}),[g,h]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,P]=n.useState(null),[N,I]=n.useState(null),[O,D]=n.useState(null),[w,R]=n.useState([]),[L,x]=n.useState(null);function M(e){P(e.target.files[0])}return n.useEffect(()=>{var e;E&&E["egf-master"]&&R(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]),n.useEffect(()=>{var e;b(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{D(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)D(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Oe(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",A,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(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===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):D(r("CS_FILE_UPLOAD_ERROR"))})},function(){D(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)}}()},[A]),n.useEffect(()=>{a&&_((e=>{let{t:n,action:o,approvers:i,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,p=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(p=!1),o.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:p?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:M,uploadedFile:N,setUploadedFile:I,businessService:v}))},[a,S,w,L,N]),a&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement(xe,{label:r(y.label.heading)}),headerBarEnd:l.createElement(Fe,{onClick:s}),actionCancelLabel:r(y.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(y.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:y.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p=d({},p,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null}),c({Licenses:[p]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Be=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Ue=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),je=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ue,null)),He=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[E,y]=n.useState({}),[_,g]=n.useState({}),[h,S]=n.useState([]),[b,T]=n.useState({}),[C,A]=n.useState(null),[P,N]=n.useState(null),[I,O]=n.useState(null),D=!!Digit.Utils.browser.isMobile();function w(e){A(e.target.files[0])}return n.useEffect(()=>{var e;S(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))O(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=Oe(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{a&&y((e=>{let{t:n,action:o,approvers:i,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:p}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==o?void 0:o.action)&&(v=!1),o.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:r,action:a,approvers:h,selectedApprover:b,setSelectedApprover:T,selectFile:w,uploadedFile:P,setUploadedFile:N,businessService:v,error:I}))},[a,h,P,I]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Be,{label:r(E.label.heading)}),headerBarEnd:l.createElement(je,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:D?{width:"720px"}:{},style:D?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:D?{paddingLeft:"5px"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p=d({},p,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:P}]:null}),c({Licenses:[p]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},We=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Ve=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),ze=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ve,null)),Ye=e=>{var o,i,r,u,s,c,p,v,m,f,E,y;let{t:_,action:g,tenantId:h,closeModal:S,submitAction:b,applicationDetails:T,applicationData:C,businessService:A,workflowDetails:P}=e;Digit.Hooks.obps.useObpsAPI(null!==(o=C)&&void 0!==o&&null!==(i=o.landInfo)&&void 0!==i&&null!==(r=i.address)&&void 0!==r&&r.city?null===(u=C)||void 0===u||null===(s=u.landInfo)||void 0===s||null===(c=s.address)||void 0===c?void 0:c.city:h,!1);const{data:N,isLoading:I}=Digit.Hooks.useEmployeeSearch(h,{roles:null==P||null===(p=P.data)||void 0===p||null===(v=p.initialActionState)||void 0===v||null===(m=v.nextActions)||void 0===m||null===(f=m.filter(e=>(null==e?void 0:e.action)==(null==g?void 0:g.action)))||void 0===f||null===(E=f[0])||void 0===E||null===(y=E.assigneeRoles)||void 0===y?void 0:y.map(e=>({code:e})),isActive:!0},{enabled:!(null!=g&&g.isTerminateState)}),[O,D]=(a.useQueryClient(),n.useState({})),[w,R]=n.useState({}),[L,x]=n.useState([]),[M,F]=n.useState({}),[k,B]=n.useState(null),[U,j]=n.useState(null),[H,W]=n.useState(null),[V,z]=n.useState(null),Y=!!Digit.Utils.browser.isMobile();function K(e){B(e.target.files[0])}n.useEffect(()=>{var e;x(null==N||null===(e=N.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[N]),n.useEffect(()=>{!function(){try{W(null);const e=function(){if(k){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(k.size>=5242880)W(_("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=k&&k.type&&!e.test(null==k?void 0:k.type))W(_("NOT_SUPPORTED_FILE_TYPE"));else{const e=Oe(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",k,Digit.ULBService.getStateId()||(null==h?void 0:h.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?j(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):W(_("CS_FILE_UPLOAD_ERROR"))})},function(){W(_("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[k]);const q=e=>{let t=[];return e&&e.map((e,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},G=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},$=e=>{var t,n;let l=[],o=[];var i,r;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(o=null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(r=l)||void 0===r?void 0:r.length)>0&&l.map((e,t)=>{o.push({docs:q(e.Documents),date:e.InspectionDate,questions:G(e),time:null==e?void 0:e.InspectionTime})}),o=o.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...o]},Z=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,o,i,r,a;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(o=l.values)||void 0===o?void 0:o.length)>0&&(n=[...n,...null==e||null===(i=e.uploadedDocuments)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.values]),(null==e||null===(a=e.newUploadedDocs)||void 0===a?void 0:a.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},X=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),n=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==n?n.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return n.useEffect(()=>{g&&D((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v,error:m}=e,f=!1;return"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"SKIP_PAYMENT"!=i.action&&"SEND_BACK_TO_CITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(f=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:i.isTerminateState||f?null:o(p||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||f?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:_,action:g,approvers:L,selectedApprover:M,setSelectedApprover:F,selectFile:K,uploadedFile:U,setUploadedFile:j,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:H}))},[g,L,V,U,H]),g&&O.form?l.createElement(t.Modal,{headerBarMain:l.createElement(We,{label:_(O.label.heading)}),headerBarEnd:l.createElement(ze,{onClick:S}),actionCancelLabel:_(O.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:_(O.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:Y?{width:"720px"}:{},style:Y?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:Y?{paddingLeft:"5px"}:{}},I?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:O.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,o,i,r;C=d({},C,{documents:Z(),additionalDetails:d({},null===(t=C)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:$(C),pendingapproval:X()}),workflow:{action:null==g?void 0:g.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:null!=M&&M.uuid?[null==M?void 0:M.uuid]:null,assignes:null!=M&&M.uuid?[null==M?void 0:M.uuid]:null,varificationDocuments:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==k?void 0:k.name,fileStoreId:U}]:null},action:null==g?void 0:g.action,comment:null==e?void 0:e.comments,assignee:null!=M&&M.uuid?[null==M?void 0:M.uuid]:null,wfDocuments:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==k?void 0:k.name,fileStoreId:U}]:null});const a=null==T||null===(o=T.nocData)||void 0===o?void 0:o.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:d({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let u={sourceRefId:null==a||null===(i=a[0])||void 0===i||null===(r=i.Noc)||void 0===r?void 0:r.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(h,u)).then(function(e){var t;let n=!0,l=!0;null==e||null===(t=e.Noc)||void 0===t||t.map(e=>{var t,o,i,r,a;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"REJECTED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"VOIDED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())||1!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let o=[];a&&a.map(e=>{var t,i,r,a,u,d,s,c,p,v,m,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(i=t.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(r=e.Noc)||void 0===r||null===(a=r.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(d=u.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(c=s.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"VOIDED"!=(null==e||null===(p=e.Noc)||void 0===p||null===(v=p.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&o.push(e)}),b({BPA:C},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:w,formId:"modal-action"})):l.createElement(t.Loader,null)},Ke=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),qe=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Ge=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(qe,null)),$e=e=>{var o,i;let{t:u,action:s,tenantId:c,closeModal:p,submitAction:v,applicationData:m,businessService:f}=e;const{data:E,isLoading:y}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(o=s.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[_,g]=(a.useQueryClient(),n.useState({})),[h,S]=n.useState({}),[b,T]=n.useState([]),[C,A]=n.useState({}),[P,N]=n.useState(null),[I,O]=n.useState(null),[D,w]=n.useState(null),R=!!Digit.Utils.browser.isMobile();function L(e){N(e.target.files[0])}return r.useHistory(),n.useEffect(()=>{var e;T(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(P){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(P.size>=5242880)w(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=P&&P.type&&!e.test(null==P?void 0:P.type))w(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=Oe(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",P,Digit.ULBService.getStateId()||(null==c?void 0:c.split(".")[0]))).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):w(u("CS_FILE_UPLOAD_ERROR"))})},function(){w(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[P]),n.useEffect(()=>{s&&g((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v,error:m}=e,f=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(f=!0);let E=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(E=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||E?null:o(p||"WF_ROLE_"+(null===(n=i.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:i.isTerminateState||E?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:u,action:s,approvers:b,selectedApprover:C,setSelectedApprover:A,selectFile:L,uploadedFile:I,setUploadedFile:O,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:D}))},[s,b,I,D]),s&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ke,{label:u(_.label.heading)}),headerBarEnd:l.createElement(Ge,{onClick:p}),actionCancelLabel:u(_.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:u(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:R?{width:"720px"}:{},style:R?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:R?{paddingLeft:"5px"}:{}},y?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let o=JSON.parse(sessionStorage.getItem("NewNOCDocs")),i=(null===(t=m)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=m)||void 0===l?void 0:l.documents]:[];o.map((e,t)=>{i.push(e)}),m=d({},m,{workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,documents:I?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:I}]:null},documents:i}),v({Noc:m},!1,{isNoc:!0})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)};var Ze=function(e,t){return e===t||e!=e&&t!=t},Xe=function(e,t){for(var n=e.length;n--;)if(Ze(e[n][0],t))return n;return-1},Je=Array.prototype.splice;function Qe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Qe.prototype.clear=function(){this.__data__=[],this.size=0},Qe.prototype.delete=function(e){var t=this.__data__,n=Xe(t,e);return!(n<0||(n==t.length-1?t.pop():Je.call(t,n,1),--this.size,0))},Qe.prototype.get=function(e){var t=this.__data__,n=Xe(t,e);return n<0?void 0:t[n][1]},Qe.prototype.has=function(e){return Xe(this.__data__,e)>-1},Qe.prototype.set=function(e,t){var n=this.__data__,l=Xe(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var et,tt=Qe,nt="object"==typeof p&&p&&p.Object===Object&&p,lt="object"==typeof self&&self&&self.Object===Object&&self,ot=nt||lt||Function("return this")(),it=ot.Symbol,rt=Object.prototype,at=rt.hasOwnProperty,ut=rt.toString,dt=it?it.toStringTag:void 0,st=Object.prototype.toString,ct=it?it.toStringTag:void 0,pt=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ct&&ct in Object(e)?function(e){var t=at.call(e,dt),n=e[dt];try{e[dt]=void 0;var l=!0}catch(e){}var o=ut.call(e);return l&&(t?e[dt]=n:delete e[dt]),o}(e):function(e){return st.call(e)}(e)},vt=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},mt=function(e){if(!vt(e))return!1;var t=pt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ft=ot["__core-js_shared__"],Et=(et=/[^.]+$/.exec(ft&&ft.keys&&ft.keys.IE_PROTO||""))?"Symbol(src)_1."+et:"",yt=Function.prototype.toString,_t=function(e){if(null!=e){try{return yt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},gt=/^\[object .+?Constructor\]$/,ht=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),St=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!vt(e)||(t=e,Et&&Et in t))&&(mt(e)?ht:gt).test(_t(e));var t}(n)?n:void 0},bt=St(ot,"Map"),Tt=St(Object,"create"),Ct=Object.prototype.hasOwnProperty,At=Object.prototype.hasOwnProperty;function Pt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Pt.prototype.clear=function(){this.__data__=Tt?Tt(null):{},this.size=0},Pt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Pt.prototype.get=function(e){var t=this.__data__;if(Tt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ct.call(t,e)?t[e]:void 0},Pt.prototype.has=function(e){var t=this.__data__;return Tt?void 0!==t[e]:At.call(t,e)},Pt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Tt&&void 0===t?"__lodash_hash_undefined__":t,this};var Nt=Pt,It=function(e,t){var n,l,o=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function Ot(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Ot.prototype.clear=function(){this.size=0,this.__data__={hash:new Nt,map:new(bt||tt),string:new Nt}},Ot.prototype.delete=function(e){var t=It(this,e).delete(e);return this.size-=t?1:0,t},Ot.prototype.get=function(e){return It(this,e).get(e)},Ot.prototype.has=function(e){return It(this,e).has(e)},Ot.prototype.set=function(e,t){var n=It(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Dt=Ot;function wt(e){var t=this.__data__=new tt(e);this.size=t.size}wt.prototype.clear=function(){this.__data__=new tt,this.size=0},wt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},wt.prototype.get=function(e){return this.__data__.get(e)},wt.prototype.has=function(e){return this.__data__.has(e)},wt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof tt){var l=n.__data__;if(!bt||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Dt(l)}return n.set(e,t),this.size=n.size,this};var Rt=wt,Lt=function(){try{var e=St(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),xt=function(e,t,n){"__proto__"==t&&Lt?Lt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Mt=Object.prototype.hasOwnProperty,Ft=function(e,t,n){var l=e[t];Mt.call(e,t)&&Ze(l,n)&&(void 0!==n||t in e)||xt(e,t,n)},kt=function(e,t,n,l){var o=!n;n||(n={});for(var i=-1,r=t.length;++i<r;){var a=t[i],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),o?xt(n,a,u):Ft(n,a,u)}return n},Bt=function(e){return null!=e&&"object"==typeof e},Ut=function(e){return Bt(e)&&"[object Arguments]"==pt(e)},jt=Object.prototype,Ht=jt.hasOwnProperty,Wt=jt.propertyIsEnumerable,Vt=Ut(function(){return arguments}())?Ut:function(e){return Bt(e)&&Ht.call(e,"callee")&&!Wt.call(e,"callee")},zt=Array.isArray,Yt=function(){return!1},Kt=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?ot.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||Yt}),qt=/^(?:0|[1-9]\d*)$/,Gt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&qt.test(e))&&e>-1&&e%1==0&&e<t},$t=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Zt={};Zt["[object Float32Array]"]=Zt["[object Float64Array]"]=Zt["[object Int8Array]"]=Zt["[object Int16Array]"]=Zt["[object Int32Array]"]=Zt["[object Uint8Array]"]=Zt["[object Uint8ClampedArray]"]=Zt["[object Uint16Array]"]=Zt["[object Uint32Array]"]=!0,Zt["[object Arguments]"]=Zt["[object Array]"]=Zt["[object ArrayBuffer]"]=Zt["[object Boolean]"]=Zt["[object DataView]"]=Zt["[object Date]"]=Zt["[object Error]"]=Zt["[object Function]"]=Zt["[object Map]"]=Zt["[object Number]"]=Zt["[object Object]"]=Zt["[object RegExp]"]=Zt["[object Set]"]=Zt["[object String]"]=Zt["[object WeakMap]"]=!1;var Xt=function(e){return function(t){return e(t)}},Jt=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n&&nt.process,i=function(){try{return l&&l.require&&l.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),Qt=Jt&&Jt.isTypedArray,en=Qt?Xt(Qt):function(e){return Bt(e)&&$t(e.length)&&!!Zt[pt(e)]},tn=Object.prototype.hasOwnProperty,nn=function(e,t){var n=zt(e),l=!n&&Vt(e),o=!n&&!l&&Kt(e),i=!n&&!l&&!o&&en(e),r=n||l||o||i,a=r?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=a.length;for(var d in e)!t&&!tn.call(e,d)||r&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Gt(d,u))||a.push(d);return a},ln=Object.prototype,on=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ln)},rn=function(e,t){return function(n){return e(t(n))}},an=rn(Object.keys,Object),un=Object.prototype.hasOwnProperty,dn=function(e){return null!=e&&$t(e.length)&&!mt(e)},sn=function(e){return dn(e)?nn(e):function(e){if(!on(e))return an(e);var t=[];for(var n in Object(e))un.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},cn=Object.prototype.hasOwnProperty,pn=function(e){return dn(e)?nn(e,!0):function(e){if(!vt(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=on(e),n=[];for(var l in e)("constructor"!=l||!t&&cn.call(e,l))&&n.push(l);return n}(e)},vn=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?ot.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=i?i(n):new e.constructor(n);return e.copy(l),l}}),mn=function(){return[]},fn=Object.prototype.propertyIsEnumerable,En=Object.getOwnPropertySymbols,yn=En?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,o=null==t?0:t.length,i=0,r=[];++l<o;){var a=t[l];fn.call(e,a)&&(r[i++]=a)}return r}(En(e)))}:mn,_n=function(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e},gn=rn(Object.getPrototypeOf,Object),hn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)_n(t,yn(e)),e=gn(e);return t}:mn,Sn=function(e,t,n){var l=t(e);return zt(e)?l:_n(l,n(e))},bn=function(e){return Sn(e,sn,yn)},Tn=function(e){return Sn(e,pn,hn)},Cn=St(ot,"DataView"),An=St(ot,"Promise"),Pn=St(ot,"Set"),Nn=St(ot,"WeakMap"),In=_t(Cn),On=_t(bt),Dn=_t(An),wn=_t(Pn),Rn=_t(Nn),Ln=pt;(Cn&&"[object DataView]"!=Ln(new Cn(new ArrayBuffer(1)))||bt&&"[object Map]"!=Ln(new bt)||An&&"[object Promise]"!=Ln(An.resolve())||Pn&&"[object Set]"!=Ln(new Pn)||Nn&&"[object WeakMap]"!=Ln(new Nn))&&(Ln=function(e){var t=pt(e),n="[object Object]"==t?e.constructor:void 0,l=n?_t(n):"";if(l)switch(l){case In:return"[object DataView]";case On:return"[object Map]";case Dn:return"[object Promise]";case wn:return"[object Set]";case Rn:return"[object WeakMap]"}return t});var xn=Ln,Mn=Object.prototype.hasOwnProperty,Fn=ot.Uint8Array,kn=function(e){var t=new e.constructor(e.byteLength);return new Fn(t).set(new Fn(e)),t},Bn=/\w*$/,Un=it?it.prototype:void 0,jn=Un?Un.valueOf:void 0,Hn=Object.create,Wn=function(){function e(){}return function(t){if(!vt(t))return{};if(Hn)return Hn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Vn=Jt&&Jt.isMap,zn=Vn?Xt(Vn):function(e){return Bt(e)&&"[object Map]"==xn(e)},Yn=Jt&&Jt.isSet,Kn=Yn?Xt(Yn):function(e){return Bt(e)&&"[object Set]"==xn(e)},qn={};qn["[object Arguments]"]=qn["[object Array]"]=qn["[object ArrayBuffer]"]=qn["[object DataView]"]=qn["[object Boolean]"]=qn["[object Date]"]=qn["[object Float32Array]"]=qn["[object Float64Array]"]=qn["[object Int8Array]"]=qn["[object Int16Array]"]=qn["[object Int32Array]"]=qn["[object Map]"]=qn["[object Number]"]=qn["[object Object]"]=qn["[object RegExp]"]=qn["[object Set]"]=qn["[object String]"]=qn["[object Symbol]"]=qn["[object Uint8Array]"]=qn["[object Uint8ClampedArray]"]=qn["[object Uint16Array]"]=qn["[object Uint32Array]"]=!0,qn["[object Error]"]=qn["[object Function]"]=qn["[object WeakMap]"]=!1;var Gn=function e(t,n,l,o,i,r){var a,u=1&n,d=2&n,s=4&n;if(l&&(a=i?l(t,o,i,r):l(t)),void 0!==a)return a;if(!vt(t))return t;var c=zt(t);if(c){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Mn.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,a)}else{var p=xn(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(Kt(t))return vn(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!i){if(a=d||v?{}:function(e){return"function"!=typeof e.constructor||on(e)?{}:Wn(gn(e))}(t),!u)return d?function(e,t){return kt(e,hn(e),t)}(t,function(e,t){return e&&kt(t,pn(t),e)}(a,t)):function(e,t){return kt(e,yn(e),t)}(t,function(e,t){return e&&kt(t,sn(t),e)}(a,t))}else{if(!qn[p])return i?t:{};a=function(e,t,n){var l,o,i=e.constructor;switch(t){case"[object ArrayBuffer]":return kn(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var n=t?kn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?kn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(o=new(l=e).constructor(l.source,Bn.exec(l))).lastIndex=l.lastIndex,o;case"[object Set]":return new i;case"[object Symbol]":return jn?Object(jn.call(e)):{}}}(t,p,u)}}r||(r=new Rt);var m=r.get(t);if(m)return m;r.set(t,a),Kn(t)?t.forEach(function(o){a.add(e(o,n,l,o,t,r))}):zn(t)&&t.forEach(function(o,i){a.set(i,e(o,n,l,i,t,r))});var f=c?void 0:(s?d?Tn:bn:d?pn:sn)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(o,i){f&&(o=t[i=o]),Ft(a,i,e(o,n,l,i,t,r))}),a},$n=function(e){return Gn(e,5)};const Zn=e=>l.createElement("h1",{className:"heading-m"},e.label),Xn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Jn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Xn,null)),Qn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},el=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[E,y]=n.useState({}),[_,g]=n.useState({}),[h,S]=n.useState([]),[b,T]=n.useState({}),[C,A]=n.useState(null),[P,N]=n.useState(null),[I,O]=n.useState(null),D=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function R(e){A(e.target.files[0])}return n.useEffect(()=>{var e;S(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))O(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=Oe(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),O(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{var e,n,o,i;"DisconnectWSConnection"==(null===(e=p)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(o=p)||void 0===o||null===(i=o.processInstance)||void 0===i?void 0:i.businessService)?a&&y((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:p,businessService:v,error:m}=e,f=!0,E=!1;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==i?void 0:i.action)||"RESUBMIT_APPLICATION"==(null==i?void 0:i.action))&&(f=!1),i.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(E=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?o("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a}):null},E&&{label:o("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,d({onChange:e.onChange,date:e.value},n))}:null},{label:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{p(null)},message:c?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:h,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:P,setUploadedFile:N,businessService:v,error:I})):a&&y((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:p,error:v}=e,m=!0;return(null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==i?void 0:i.action))&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==p?void 0:p.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?o("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a}):null},{label:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:h,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:P,setUploadedFile:N,businessService:v,error:I}))},[a,h,P,I]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Zn,{label:r(E.label.heading)}),headerBarEnd:l.createElement(Jn,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:D&&w?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,o,i,r,s,v,m,f;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var E,y,_,g,h,S,T,A,N;const t=d({},null===(E=p)||void 0===E||null===(y=E.billAmendmentDetails)||void 0===y?void 0:y.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=d({},null===(_=p)||void 0===_?void 0:_.billAmendmentDetails,{workflow:{businessId:null===(g=p)||void 0===g||null===(h=g.billAmendmentDetails)||void 0===h?void 0:h.amendmentId,action:null==a?void 0:a.action,tenantId:u,businessService:null!==(S=p)&&void 0!==S&&null!==(T=S.applicationType)&&void 0!==T&&T.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(A=p)&&void 0!==A&&null!==(N=A.applicationType)&&void 0!==N&&N.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:P}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:P}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:P}]:[]}});c({AmendmentUpdate:n})}else{if(p=d({},p,{action:null==a?void 0:a.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:[],assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],wfDocuments:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:P}]:null,processInstance:d({},null===(n=p)||void 0===n?void 0:n.processInstance,{action:null==a?void 0:a.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:P}]:[]})}),null!=e&&e.date&&null!==(l=p)&&void 0!==l&&null!==(o=l.applicationType)&&void 0!==o&&o.includes("DISCONNECT")){const t=$n(null==e?void 0:e.date);p.disconnectionExecutionDate=Qn(t)}else if(null!=e&&e.date){const t=$n(null==e?void 0:e.date);p.connectionExecutionDate=Qn(t)}var I;if("DisconnectWSConnection"==(null===(i=p)||void 0===i||null===(r=i.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(s=p)||void 0===s||null===(v=s.processInstance)||void 0===v?void 0:v.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(I=p)||void 0===I?void 0:I.serviceType)?c({WaterConnection:p,disconnectRequest:!0}):c({SewerageConnection:p,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(m=p)||void 0===m?void 0:m.applicationType))c({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=p)||void 0===f?void 0:f.applicationType))c({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!0});else{var O,D,w,R,L,x,M,F,k,B,U,j,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenalty&&(p.additionalDetails.adhocPenalty=parseInt(null==t||null===(D=t.value)||void 0===D?void 0:D.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyComment)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyReason)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebate)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebateComment)||""),null!=t&&null!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(p.additionalDetails.adhocRebateReason=(null==t||null===(j=t.value)||void 0===j?void 0:j.adhocRebateReason)||""),"WATER"==(null===(H=p)||void 0===H?void 0:H.serviceType)?c({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!1}):c({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},tl=e=>l.createElement("h1",{className:"heading-m"},e.label),nl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),ll=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(nl,null)),ol=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v,moduleCode:m}=e;console.log("applicationData",p);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[E,y]=n.useState({}),[_,g]=n.useState({}),[h,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[P,N]=n.useState(null),[I,O]=n.useState(null),[D,w]=n.useState(!1);function R(e){A(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Oe(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(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)}}()},[C]),n.useEffect(()=>{a&&y((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,businessService:u}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==o?void 0:o.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:n("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_PTR_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},showHint:!0,hintText:n("PTR_ATTACH_RESTRICTIONS_SIZE"),message:r?"1 "+n("ES_PTR_ACTION_FILEUPLOADED"):n("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:h,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:P,setUploadedFile:N,businessService:v}))},[a,h,P]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(tl,{label:r(E.label.heading)}),headerBarEnd:l.createElement(ll,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};P&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:P}]),c({PetRegistrationApplications:[d({},p,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},il=e=>l.createElement("h1",{className:"heading-m"},e.label),rl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),al=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(rl,null)),ul=e=>{var o,i,a;let{t:u,action:s,tenantId:c,closeModal:p,submitAction:v,applicationData:m,businessService:f,moduleCode:E}=e;const{data:y}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(o=s.roles)||void 0===o||null===(i=o[0])||void 0===i||null===(a=i.map)||void 0===a?void 0:a.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),_=r.useHistory(),[g,h]=n.useState({}),[S,b]=n.useState({}),[T,C]=n.useState([]),[A,P]=n.useState(null),[N,I]=n.useState(null);return n.useEffect(()=>{var e;C(null==y||null===(e=y.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[y]),n.useEffect(()=>{"INITIATED"===(null==s?void 0:s.state)?_.push("/digit-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):h((e=>{let{t:t,action:n,businessService:l}=e;return console.log("njhsegfdhjsbedwfdwe",n),{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:s,approvers:T,selectedApprover:A,setSelectedApprover:P,uploadedFile:N,setUploadedFile:I,businessService:f}))},[s,T,N]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(il,{label:u(g.label.heading)}),headerBarEnd:l.createElement(al,{onClick:p}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:u(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};N&&(t.documents=[]),v({Asset:d({},m,{workflow:t})})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},dl=e=>l.createElement("h1",{className:"heading-m"},e.label),sl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),cl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(sl,null)),pl=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v,moduleCode:m}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[E,y]=n.useState({}),[_,g]=n.useState({}),[h,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[P,N]=n.useState(null),[I,O]=n.useState(null),[D,w]=n.useState(!1);function R(e){A(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Oe(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,u)).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(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)}}()},[C]),n.useEffect(()=>{a&&y((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a}=e;return{label:{heading:"CHB_"+(null==o?void 0:o.action),submit:"CHB_"+(null==o?void 0:o.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("ES_CHB_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},message:r?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:h,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:P,setUploadedFile:N,businessService:v}))},[a,h,P]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dl,{label:r(E.label.heading)}),headerBarEnd:l.createElement(cl,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:m};P&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:P}]),c({hallsBookingApplication:d({},p,{workflow:t})})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},vl=e=>l.createElement("h1",{className:"heading-m"},e.label),ml=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),fl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ml,null)),El=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v,moduleCode:m}=e;console.log("snjdskbjdfbjskfjkbs",a);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[E,y]=n.useState({}),[_,g]=n.useState({}),[h,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[P,N]=n.useState(null),[I,O]=n.useState(null),[D,w]=n.useState(null),[R,L]=n.useState(!1);function x(e){N(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(P){const e=function(){if(P.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Oe(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",P,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(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]),n.useEffect(()=>{a&&y((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,businessService:u}=e;console.log("action",o);const d=(new Date).toISOString().split("T")[0];return console.log("todayedsta ::",d),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==o?void 0:o.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==o?void 0:o.state)?{label:n("EW_PICKUP_DATE"),type:"date",isMandatory:!0,populators:{name:"date",min:(new Date).toISOString().split("T")[0],max:new Date(Date.now()+6048e5).toISOString().split("T")[0]}}:"null","REQUESTCOMPLETED"===(null==o?void 0:o.state)?{label:n("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==o?void 0:o.state)?{label:n("ES_EW_ACTION_FINALAMOUNT"),type:"text",isMandatory:!0,populators:{name:"finalAmount"}}:"null",{label:n("ES_EW_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_EW_PHOTO")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},showHint:!0,hintText:n("EW_ATTACH_RESTRICTIONS_SIZE"),message:r?"1 "+n("ES_EW_ACTION_FILEUPLOADED"):n("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:h,selectedApprover:b,setSelectedApprover:T,selectFile:x,uploadedFile:I,setUploadedFile:O,businessService:v}))},[a,h,I]),console.log("conggg",E),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(vl,{label:r(E.label.heading)}),headerBarEnd:l.createElement(fl,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};console.log("applicationData",e),I&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==P?void 0:P.name,filestoreId:I},{}]),p.pickUpDate=null==e?void 0:e.date,p.transactionId=null==e?void 0:e.transactionId,p.finalAmount=null==e?void 0:e.finalAmount,c({EwasteApplication:[d({},p,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},yl=e=>l.createElement("h1",{className:"heading-m"},e.label),_l=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),gl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_l,null)),hl=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v,moduleCode:m}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(o=a.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:null==a?void 0:a.isTerminateState}),[E,y]=n.useState({}),[_,g]=n.useState({}),[h,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[P,N]=n.useState(null),[I,O]=n.useState(null),[D,w]=n.useState(!1);function R(e){w(!0),A(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)O(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=Oe(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(r("CS_FILE_UPLOAD_ERROR"))})}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(w(!1),e)throw t;return t});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)}}()},[C]),console.log("actyhdesh,jhfsefsef",a,p),n.useEffect(()=>{y((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const p=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"SV_"+(null==o?void 0:o.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==o?void 0:o.action)||"REJECT"===(null==o?void 0:o.action)||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:s,selected:d})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:i,onDelete:()=>{a(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):r?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:r,action:a,approvers:h,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:P,setUploadedFile:N,businessService:v,isUploading:D}))},[a,h,P]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(yl,{label:r(E.label.heading)}),headerBarEnd:l.createElement(gl,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m,assignes:"SENDBACKTOCITIZEN"===(null==a?void 0:a.action)?[null==p||null===(t=p.auditDetails)||void 0===t?void 0:t.createdBy]:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null};P&&(n.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:P}]),c({streetVendingDetail:d({},p,{workflow:n})})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Sl=e=>l.createElement("h1",{className:"heading-m"},e.label),bl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),Tl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(bl,null)),Cl=e=>{var o,i,r,a;let{t:u,action:s,tenantId:c,closeModal:p,submitAction:v,applicationData:m,businessService:f,moduleCode:E}=e;const{data:y}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(o=s.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),{data:_}=Digit.Hooks.fsm.useVendorSearch({tenantId:c,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)}});let g=[];null==_||null===(r=_.vendor)||void 0===r||r.map(e=>{var t;"WT"===(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.description)&&g.push({code:null==e?void 0:e.name,name:null==e?void 0:e.name,i18nKey:null==e?void 0:e.name,vendorId:null==e?void 0:e.id})});const{data:h}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:c,config:{enabled:"DELIVERY_PENDING"===(null==s?void 0:s.state)}});let S=[];null==h||null===(a=h.vehicle)||void 0===a||a.map(e=>{S.push({code:null==e?void 0:e.registrationNumber,name:null==e?void 0:e.registrationNumber,i18nKey:null==e?void 0:e.registrationNumber,tankerCapacity:null==e?void 0:e.tankCapacity,vehicleId:null==e?void 0:e.id})});const[b,T]=n.useState({}),[C,A]=n.useState({}),[P,N]=n.useState([]),[I,O]=n.useState(null),[D,w]=n.useState(null),[R,L]=n.useState(null),[x,M]=n.useState(null),[F,k]=n.useState(null);function B(e){O(e.target.files[0])}return n.useEffect(()=>{var e;N(null==y||null===(e=y.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[y]),n.useEffect(()=>{!function(){try{L(null);const e=function(){if(I){const e=function(){if(I.size>=5242880)L(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Oe(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",I,c)).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):L(u("CS_FILE_UPLOAD_ERROR"))})},function(){L(u("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)}}()},[I]),n.useEffect(()=>{s&&T((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,selectedVendor:u,setSelectedVendor:d,vendorDescription:s,vehicleDescription:c,selectVehicle:p,setSelectVehicle:v}=e;return{label:{heading:"RS_"+(null==o?void 0:o.action),submit:"RS_"+(null==o?void 0:o.action),cancel:"CS_COMMON_BACK"},form:[{body:[{label:n("ES_RS_ACTION_COMMENTS")+" *",type:"textarea",populators:{name:"comments",validation:{required:!0}}},"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==o?void 0:o.state)?{label:n("RS_ASSIGN"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:s,t:n,optionKey:"i18nKey",select:d,selected:u})}:"null","DELIVERY_PENDING"===(null==o?void 0:o.state)?{label:n("RS_REGISTRATION_NUMBER"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:c,t:n,optionKey:"i18nKey",select:v,selected:p})}:"null",{label:n("ES_RS_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{a(null)},message:r?"1 "+n("CS_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:u,action:s,selectFile:B,uploadedFile:D,setUploadedFile:w,selectedVendor:x,setSelectedVendor:M,vendorDescription:_?g:void 0,vehicleDescription:h?S:void 0,selectVehicle:F,setSelectVehicle:k}))},[s,P,D,_,F,h]),s&&b.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Sl,{label:u(b.label.heading)}),headerBarEnd:l.createElement(Tl,{onClick:p}),actionCancelLabel:u(b.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:u(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:b.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comments:null==e?void 0:e.comments,businessService:f,moduleName:E};D&&(t.documents=[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:D}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)&&(m.vendorId=null==x?void 0:x.vendorId),"DELIVERY_PENDING"===(null==s?void 0:s.state)&&(m.vehicleId=null==F?void 0:F.vehicleId);let n="watertanker"===f?{waterTankerBookingDetail:d({},m,{workflow:t})}:{mobileToiletBookingDetail:d({},m,{workflow:t})};v(n)},defaultValues:C,formId:"modal-action"})):l.createElement(t.Loader,null)},Al=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Le,e):null!=e&&e.businessService.includes("ptr")?l.createElement(ol,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")||null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(ke,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(He,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Ye,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement($e,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(el,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(ul,e):null!=e&&e.businessService.includes("ewst")?l.createElement(El,e):null!=e&&e.businessService.includes("booking-refund")?l.createElement(pl,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(hl,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")?l.createElement(Cl,e):void 0;function Pl(e){let{documents:n,svgStyles:i={},isSendBackFlow:r=!1,isHrLine:a=!1,titleStyles:u}=e;const{t:d}=o.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!s&&(null==n?void 0:n.map((e,o)=>{var i;return l.createElement(l.Fragment,{key:o},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var o;return l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",color:"#505A5F"}},d(null==e?void 0:e.title)),r?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),a&&(null==n?void 0:n.length)!=o+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),s&&(null==n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=i&&i.minWidth?null==i?void 0:i.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+d(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Nl=e=>{var t,o;let{t:i,formData:r,applicationData:a,docs:u,bpaActionsDetails:d}=e;const s=(null==a?void 0:a.status)||"",c=(null==d||null===(t=d.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[v,m]=n.useState((null==r||null===(o=r.documents)||void 0===o?void 0:o.documents)||[]),[f,E]=n.useState(null),[y,_]=n.useState([]),[g,h]=n.useState(!0),[S,b]=n.useState(!1),[T,C]=n.useState(!1),{isLoading:A,data:P}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:N,data:I}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let o=[];var i,r;null!=P&&null!==(e=P.BPA)&&void 0!==e&&e.DocTypeMapping&&(o=null==P||null===(i=P.BPA)||void 0===i||null===(r=i.DocTypeMapping)||void 0===r?void 0:r.filter(e=>{var t,n;return e.WFState==(null==a?void 0:a.status)?null==a?void 0:a.status:e.RiskType==(null==a?void 0:a.riskType)&&e.ServiceType==(null==a||null===(t=a.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==a||null===(n=a.additionalDetails)||void 0===n?void 0:n.applicationType)}));let d=[];null===(t=o)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,o;let i=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==I||null===(t=I["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,i.length);i===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(o=l.values)||void 0===o||o.map(t=>{var n,l;i===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),_(d)},[!A,!N]),n.useEffect(()=>{let e=0;y.map(t=>{let n=!1;v.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),h("0"!=e&&0!=e||!(v.length>0))},[v,S]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[a,d]),l.createElement("div",null,null==y?void 0:y.map((e,t)=>l.createElement("div",null,l.createElement(Il,{key:t,index:t,document:e,t:i,error:f,setError:E,setDocuments:m,documents:v,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:y,checkEnablingDocs:T}))))};function Il(e){var o,i;let{t:r,document:a,setDocuments:u,documents:s,index:c,bpaTaxDocuments:p,checkEnablingDocs:v}=e;const m=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],f=Digit.ULBService.getStateId(),[E,y]=n.useState(m?d({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{}),[_,g]=n.useState(null),[h,S]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[b,T]=n.useState([]);return n.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==h?void 0:h.length)||null===h?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==h),{documentType:null==E?void 0:E.code,fileStoreId:h,documentUid:h,fileName:(null==_?void 0:_.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[h,E]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=E&&E.code&&a.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),p[c]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(p)))}catch(e){Promise.reject(e)}},[b,E]),n.useEffect(()=>{},[_]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+r(null==a?void 0:a.code)),(null==a||null===(i=a.uploadedDocuments)||void 0===i?void 0:i.length)&&l.createElement(Pl,{documents:null==a?void 0:a.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),v?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=a&&a.required?r(null==a?void 0:a.code)+"* ":""+r(null==a?void 0:a.code)),l.createElement(t.Dropdown,{className:"form-field",t:r,isMandatory:!1,option:null==a?void 0:a.dropdownData,selected:E,optionKey:"i18nKey",select:e=>y(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);0!==Object.keys(n).length&&T(l),function(e){e&&g(e.file)}(l[l.length-1])})(0,e),t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Ol(e){let{fiReport:n,isCitizen:i=!1}=e;const{t:r}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+r("BPA_FI_REPORT")),n.map((e,o)=>{var i,a,u,d,s,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+r("BPA_FI_REPORT"):r("BPA_FI_REPORT")+" - "+(o+1)),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(i=e.date)||void 0===i?void 0:i.split("-")[2])+"/"+(null===(a=e.date)||void 0===a?void 0:a.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(d=e.questions)||void 0===d?void 0:d.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+r(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Pl,{documents:(c=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==c?void 0:c.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function Dl(e){let{t:o,document:i,setNocDocuments:r,setError:a,nocDocuments:u}=e;const d=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==i?void 0:i.code)})[0],s=Digit.ULBService.getStateId(),[c,p]=n.useState(),[v,m]=n.useState(null),[f,E]=n.useState(()=>(null==d?void 0:d.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=i&&null!==(e=i.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&r(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==i||null===(t=i.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==i||null===(t=i.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==v?void 0:v.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)a(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))a(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=Oe(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):a(o("CS_FILE_UPLOAD_ERROR"))})},function(){a(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=i&&i.required?o("TL_BUTTON_UPLOAD FILE")+"*":""+o("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);!function(e){e&&m(e.file)}(n[n.length-1])})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const wl=e=>{var o;let{t:i,noc:r,docs:a,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==d?void 0:d.status)||"",m=(null==c||null===(o=c.data)||void 0===o?void 0:o.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:y}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[_,g]=n.useState([]),[h,S]=n.useState([]),[b,T]=n.useState(!1),[C,A]=Digit.Hooks.useSessionStorage(null==r?void 0:r.nocType,[]),[P,N]=n.useState(null),I=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;g(null==y||null===(e=y["common-masters"])||void 0===e?void 0:e.DocumentType)},[y]),n.useEffect(()=>{var e,t,n;let l,o=[];var i,a,s,c;l=u?null==f||null===(i=f.NOC)||void 0===i||null===(a=i.DocumentTypeMapping)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.applicationType)===(null==r?void 0:r.applicationType)&&(null==e?void 0:e.nocType)===(null==r?void 0:r.nocType)):null==E||null===(s=E.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,n;return e.WFState==(null==d?void 0:d.status)&&e.RiskType==(null==d?void 0:d.riskType)&&e.ServiceType==(null==d||null===(t=d.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==d||null===(n=d.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==r?void 0:r.additionalDetails,applicationStatus:null==r?void 0:r.applicationStatus,appNumberLink:null==r?void 0:r.applicationNo,nocNo:null==r?void 0:r.nocNo},o.push(l[0].docTypes[0]));let p=[];o&&o.length>0&&(o.map(e=>{let t=e.documentType;e.dropdownData=[],null==_||_.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),p.push(e)}),S(p))},[f,_]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===v&&(null==m?void 0:m.length)>0)},[d,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:I?""+i("BPA_"+(null==r?void 0:r.nocType)+"_HEADER"):i("BPA_"+(null==r?void 0:r.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:I?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:I?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Pl,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==h?void 0:h.map((e,t)=>l.createElement(Dl,{key:t,document:e,t:i,error:P,setError:N,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},Rl=e=>{let{permissions:o,t:i}=e;const[r,a,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==o?void 0:o.map(e=>({label:e,checked:!1}))),[s,c,p]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},i("BPA_PERMIT_CONDITIONS")),null==r?void 0:r.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:v?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;a(()=>null==r?void 0:r.map((e,t)=>n===t?d({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==s?void 0:s.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{c(()=>null==s?void 0:s.map((n,l)=>{var o;return t===l?{label:null==e||null===(o=e.target)||void 0===o?void 0:o.value}:n}))})(e,n),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:i("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),c([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{c([...s,{label:""}])}}))};function Ll(e){let{documents:i,svgStyles:r={},isSendBackFlow:a=!1}=e;const{t:u}=o.useTranslation(),[d,s]=n.useState(()=>[]),[c,p]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let t=[];null==i||i.forEach((e,n,l)=>{t=[...t,...e.values?e.values:[]]}),s(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[i]),n.useEffect(()=>{var e;null!=d&&d.length&&"BillAmend"===(null==i||null===(e=i[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(d,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[d]);const v=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),m=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!m&&(null==i?void 0:i.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:v?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o,i;return l.createElement("a",{target:"_",href:null===(o=c[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:v?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),a?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),m&&(null==i?void 0:i.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement("a",{target:"_",href:null===(o=c[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],style:{minWidth:null!=r&&r.minWidth?null==r?void 0:r.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},""+u(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function xl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:i}=n,{t:r}=o.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:r("ES_PT_TITLE_TAX_HEADS"),text:r("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,n)=>l.createElement(t.Row,{key:r(e.taxHeadCode),label:r(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:r("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Ml(e){let{floors:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var o;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},i(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title),text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Fl(e){let{owners:n}=e,i={};i=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:r}=o.useTranslation(),a=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},s={position:"relative",padding:"8px"},c={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(a)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(a)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u=d({},u,{maxWidth:"950px"}),u=d({},u,{maxWidth:"950px"}),c={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},i.map((e,n)=>{var o;return l.createElement("div",{key:r(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(a)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(a)>1?r(null==e?void 0:e.title)+" "+(n+1):r(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:s},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:r(e.title),label:r(e.title),text:l.createElement("img",{src:r(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:r(e.title),label:""+r(e.title),text:r(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:c}))}))))})))}const kl=e=>{var i,r,a;let{scrutinyDetails:u,paymentsList:d=[]}=e;const{t:s}=o.useTranslation(),c=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},s(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?s(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void s("NA");return l.createElement(n.Fragment,null,!(null!=u&&u.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==u||null===(i=u.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?c(e)+" "+s(null==e?void 0:e.isUnit):s("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen",wordBreak:"break-all"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red",wordBreak:"break-all"}:{wordBreak:"break-all"},key:""+e.title,label:""+s(""+e.title),text:c(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},s(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},s(null==e?void 0:e.title))),null==u||null===(r=u.permit)||void 0===r?void 0:r.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),l.createElement("div",null,null==u||null===(a=u.scruntinyDetails)||void 0===a?void 0:a.map((e,o)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+s(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},s(null==e?void 0:e.text))))))))},Bl=e=>{var i,r,a,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:p}=o.useTranslation(),v=window.Digit.Utils.browser.isMobile(),m=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},E=n.useMemo(()=>m.map(e=>({Header:p(""+e.name),accessor:f(e.id),id:e.id})));function y(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,o,i,r,a,u,d;n.push({Floor:p("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:p(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(o=e.occupancies)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.builtUpArea,FloorArea:(null===(r=e.occupancies)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),n}function _(e){var t;let n=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var o,i;let t=null===(o=n[e])||void 0===o||null===(i=o.usageCategory)||void 0===i?void 0:i.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+p("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==s||null===(i=s.values)||void 0===i?void 0:i.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},p(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+p(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(r=s.subOccupancyTableDetails)||void 0===r||null===(a=r[0])||void 0===a||null===(u=a.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,n)=>{var o,i,r,a,u;return l.createElement("div",{key:n,style:(null==s||null===(o=s.subOccupancyTableDetails)||void 0===o||null===(i=o[0])||void 0===i||null===(r=i.value)||void 0===r||null===(a=r.planDetail)||void 0===a||null===(u=a.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},p("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+p("BPA_SUB_OCCUPANCY_LABEL"),text:_(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:y(e),columns:E,getCellProps:e=>({style:{}})})))})))},Ul=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},jl=e=>{var n,i,r;let{data:a,OpenImage:u,privacy:d={}}=e;const{t:s}=o.useTranslation();return l.createElement("div",null,a.date&&l.createElement("p",null,a.date),l.createElement("p",null,a.name),a.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:a.mobileNumber,privacy:d}),l.createElement("p",null," ")),a.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+a.source.toUpperCase())),a.comment&&l.createElement(Ul,{otherComment:null==a?void 0:a.otherComment,headComment:null==a?void 0:a.comment}),null!=a&&a.wfComment?l.createElement("div",null,null==a||null===(n=a.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==a||null===(i=a.thumbnailsToShow)||void 0===i||null===(r=i.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==a?void 0:a.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==a?void 0:a.thumbnailsToShow)}})):null)};function Hl(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"N/A",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Wl(e){let{units:n}=e;const{t:i}=o.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var o;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var o;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"NA",last:n===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const Vl=e=>{var i,r,a,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation();let c=(p=location.search)?(/^[?#]/.test(p)?p.slice(1):p).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var p;const v=null==c?void 0:c.mode;var{connectionDetails:m,plumberDetails:f,roadCuttingDetails:E,activationDetails:y}=(null==d?void 0:d.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==d||null===(i=d.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==m?void 0:m.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==d||null===(r=d.additionalDetails)||void 0===r?void 0:r.plumberDetails)&&"MODIFY"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==d||null===(a=d.additionalDetails)||void 0===a?void 0:a.roadCuttingDetails)&&"MODIFY"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map(e=>{var n;return l.createElement("div",{style:(null==E?void 0:E.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))})))),(null==d||null===(u=d.additionalDetails)||void 0===u?void 0:u.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==y?void 0:y.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},zl=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],Yl=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],Kl=e=>{var i,r,a,u;let{wsAdditionalDetails:s}=e;const{t:c}=o.useTranslation(),[p,v,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,y]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==s||null===(i=s.additionalDetails)||void 0===i||!i.isPaid),[h,S]=n.useState(!1),[b,T]=n.useState(p||{}),[C,A]=n.useState(null),[P,N]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[I,O]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),D=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(D,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const o=d({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==p||null===(n=p.billDetails)||void 0===n?void 0:n.length)>0){var i,r,a,u,c,m,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(i=p.billDetails)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(a=p.billDetails)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(c=p.billDetails)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.taxAmount)}];O(e),N(null==p||null===(f=p.billDetails)||void 0===f?void 0:f[0])}else v(o),T(o)},[]);let w={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),L=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),x=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(L,null)),M=function(e,t,n){void 0===t&&(t=!1);let l=d({},b);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var o,i;const t=0==(null==n||null===(o=n.target)||void 0===o?void 0:o.value)?1:Math.sign(null==n||null===(i=n.target)||void 0===i?void 0:i.value)||-1;l[e]=1==t?n.target.value:""}T(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},I&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==I?void 0:I.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+c("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==P?void 0:P.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+c("CS_INBOX_STATUS_FILTER"),text:c(g?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:g?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(r=s.additionalDetails)&&void 0!==r&&r.isAdhocRebate?l.createElement("div",{onClick:e=>{S(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,h&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(x,{onClick:()=>{T(p),S(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{T(p),S(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,o;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(o=l.data)||void 0===o?void 0:o.totalAmount))A({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,r,a,u,p,m,f,y,g,h;const e=null==s||null===(i=s.additionalDetails)||void 0===i||null===(r=i.appDetails)||void 0===r?void 0:r.applicationNo,t=null==s||null===(a=s.additionalDetails)||void 0===a||null===(u=a.appDetails)||void 0===u?void 0:u.tenantId,n=d({},null==s||null===(p=s.additionalDetails)||void 0===p||null===(m=p.appDetails)||void 0===m?void 0:m.additionalDetails,b);s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(f=s.additionalDetails)||void 0===f||null===(y=f.appDetails)||void 0===y?void 0:y.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let o="WATER"==(null==s||null===(g=s.additionalDetails)||void 0===g||null===(h=g.appDetails)||void 0===h?void 0:h.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,o).then((e,t)=>{var n,l,o,i,r,a,u,d,s,c,p,m,f,y,g;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(o=l.taxHeadEstimates)||void 0===o?void 0:o.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(y=f[0])||void 0===y||null===(g=y.taxHeadEstimates)||void 0===g||g.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(i=e.Calculation)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.taxHeadEstimates,"category");const h=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(a=e.Calculation)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(c=e.Calculation)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.taxAmount}];E($n(e.Calculation[0])),N(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),O(h),b.billDetails=null==e?void 0:e.Calculation,v(b),S(!1)}).catch(e=>{var t,n,l,o,i,r;A({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(l=n.Errors[0])&&void 0!==l&&l.message?c(""+(null==e||null===(o=e.response)||void 0===o||null===(i=o.data)||void 0===i||null===(r=i.Errors[0])||void 0===r?void 0:r.code)):c("PT_COMMON_ADD_REBATE_PENALITY")})})}else A({isError:!1,isWarning:!0,key:"warning",message:c("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:zl,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"PT_OTHERS"===(null==b||null===(a=b.adhocPenaltyReason_data)||void 0===a?void 0:a.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>M("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>M("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_REBATE")),l.createElement(t.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Yl,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"PT_OTHERS"===(null==b||null===(u=b.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>M("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,d({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>M("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:c(null==C?void 0:C.message),onClose:()=>{A(!1)},isDleteBtn:!0})))},ql=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:d({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},Gl=e=>{let{t:n,userType:o=!1,infoBannerLabel:i="",infoClickLable:r="",infoClickInfoLabel:a="",infoClickInfoLabel1:u=""}=e;o=o||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:d?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(i))),n(r)+" ",l.createElement(ql,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},$l=e=>{var i,r,a,u,d,s,c;let{wsAdditionalDetails:p}=e;const{t:v}=o.useTranslation(),[m,f]=n.useState(!1),[E,y]=n.useState({}),_=e=>l.createElement("h1",{className:"heading-m"},e.label),g=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),h=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(g,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=p&&null!==(i=p.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=p.additionalDetails.data||{};const n=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),l=n?JSON.parse(n):{};null!=l&&null!==(e=l.value)&&void 0!==e&&e.totalAmount&&(t=null==l?void 0:l.value),y(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(t.Modal,{headerBarMain:l.createElement(_,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(h,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==E||null===(r=E.billSlabData)||void 0===r||null===(a=r.FEE)||void 0===a?void 0:a.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(d=u.CHARGES)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(s=E.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Zl={root:{width:"100%",marginTop:"2px",overflowX:"auto",boxShadow:"none"},table:{minWidth:700,backgroundColor:"rgba(250, 250, 250, var(--bg-opacity))"},cell:{maxWidth:"7em",minWidth:"1em",border:"1px solid #e8e7e6",padding:"4px 5px",fontSize:"0.8em",textAlign:"left",lineHeight:"1.5em"},cellHeader:{overflow:"hidden",textOverflow:"ellipsis"},cellLeft:{},cellRight:{}},Xl=e=>{let{className:t="table",headers:n=[],values:i=[],arrears:r=0}=e;const{t:a}=o.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Zl.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Zl.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:d({},Zl.cell,Zl.cellLeft,Zl.cellHeader)},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:d({},Zl.cell,n.length==t+1?Zl.cellRight:{},Zl.cellHeader),key:t},a(e))))),l.createElement("tbody",null,Object.values(i).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:d({},Zl.cell,Zl.cellLeft),component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,o)=>l.createElement("td",{style:d({},Zl.cell,{textAlign:"left"},n.length==o+1?Zl.cellRight:{},{whiteSpace:"pre"}),key:o,numeric:!0},o>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:d({},Zl.cell,Zl.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:d({},Zl.cell,Zl.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},r):t==n.length-2?l.createElement("td",{style:d({},Zl.cell,{textAlign:"left"}),key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Zl.cell,key:t,numeric:!0})))))))},Jl={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},Ql=e=>{var t,i,r;let{bill:a={}}=e;const{t:u}=o.useTranslation();let d={},s=(null==a||null===(t=a.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(i=s)||void 0===i?void 0:i.reduce((e,t,n)=>0===n?e:e+t.amount,0))||0;let p="₹ "+((null==c||null===(r=c.toFixed)||void 0===r?void 0:r.call(c,0))||Number(0).toFixed(0));s.shift(),s.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let o={};const{billAccountDetails:i=[]}=e;return i.map(e=>{o[e.taxHeadCode]={value:e.amount,order:e.order}}),o.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},o.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},o.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},o}(e);d[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?"FY"+(n.getYear()+1900)+"-"+(l.getYear()-100):n.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let v={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{v[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let m=[];m=Object.keys(v),m.sort((e,t)=>v[e]-v[t]);const[f,E]=n.useState(!1);return 0==c||c<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Jl.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Xl,{headers:[...m],values:d,arrears:p}),!f&&l.createElement("div",{style:Jl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Jl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},eo=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),to=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(eo,null)),no=e=>{let{t:n,closeModal:o}=e;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const i=r.useHistory();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement(e=>l.createElement("h1",{className:"heading-m"},e.label),{label:"SV_WANT_TO_EDIT"}),headerBarEnd:l.createElement(to,{onClick:o}),actionCancelLabel:n("CS_COMMON_BACK"),actionCancelOnSubmit:o,hideSubmit:!0,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},l.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},l.createElement(t.SubmitBar,{label:n("SV_YES_PROCEED_WITH_APPLICATION"),onSubmit:()=>{i.push("renew-application/info")}}),l.createElement(t.SubmitBar,{label:n("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),i.push("renew-application/check/makePayment")}})))))};function lo(e){var i,a,u,d,s,c,p,v,m,f,E,y,g,h,S;let{applicationDetails:b,workflowDetails:T,isDataLoading:C,applicationData:A,timelineStatusPrefix:P,showTimeLine:N=!0,statusAttribute:I="status",paymentsList:O,oldValue:D,isInfoLabel:w=!1}=e;const{t:R}=o.useTranslation(),L=(r.useHistory(),r.useLocation()),[x,M]=n.useState(!1),[F,k]=n.useState(null);new URLSearchParams(L.search);let{id:B}=r.useParams();const U=null==b||null===(i=b.applicationData)||void 0===i?void 0:i.owners;function j(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("ownersSequences:- ",U);const[H,W]=n.useState({}),[V,z]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==A?void 0:A.status)||V.loading||V.loaded||V.canLoad||z({loading:!1,loaded:!1,canLoad:!0}),null==V||!V.canLoad||V.loading||V.loaded||(z({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(o){function i(){n(r),l({loading:!1,loaded:!0,canLoad:!0})}let r={};const a=function(n){if((null==o||null===(n=o.Assessments)||void 0===n?void 0:n.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){r=e})}();return a&&a.then?a.then(i):i()})}catch(e){return Promise.reject(e)}}((null==A?void 0:A.tenantId)||tenantId,null==A?void 0:A.propertyId,W,z));const Y=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},K=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var o;const e={date:Y(null==A||null===(o=A.auditDetails)||void 0===o?void 0:o.createdTime),source:(null==A?void 0:A.channel)||""};return l.createElement(jl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var i,r,a,u,d,s,c,p,v,m,f,E,y,g,h,S,T,C;const o={uuid:null==e||null===(i=e.assignes)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==b?void 0:b.tenantId,businessIds:null==b?void 0:b.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},P=n[t-1],N={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.name,mobileNumber:(null==A||null===(s=A.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.uuid)&&null!=A&&null!==(f=A.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(y=E[0])&&void 0!==y&&y.mobileNumber?null==A||null===(g=A.processInstance)||void 0===g||null===(h=g.assignes)||void 0===h||null===(S=h[0])||void 0===S?void 0:S.mobileNumber:null==e||null===(T=e.assignes)||void 0===T||null===(C=T[0])||void 0===C?void 0:C.mobileNumber,comment:R(null==e?void 0:e.comment),wfComment:P?P.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(jl,{data:N,OpenImage:j,privacy:o})}{var P,N,I,O,D;const t={date:Y(null==A||null===(P=A.auditDetails)||void 0===P?void 0:P.lastModifiedTime),name:null==e||null===(N=e.assignes)||void 0===N||null===(I=N[0])||void 0===I?void 0:I.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(O=e.assignes)||void 0===O||null===(D=O[0])||void 0===D?void 0:D.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(jl,{data:t,OpenImage:j})}},q=(e,t)=>e?t?e:R(e):R("NA"),G=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),$=window.location.href.includes("employee/noc"),Z=window.location.href.includes("employee/obps"),X=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||G?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),J=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?q(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+R(null==e?void 0:e.isUnit):R("N/A"):null!=e&&e.value?q(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):R("N/A"),[Q,ee]=n.useState(!1);return l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},w?l.createElement(Gl,{t:R,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==b||null===(a=b.applicationDetails)||void 0===a?void 0:a.map((e,n)=>{var o,i,a,u,d,s,c,p,v,m,f,E,y,_,g,h,S,C,A,P,N,I,w,L,x,F,U,j,W,V,z,Y,K,q,Q,ee,te,ne,le;return l.createElement(l.Fragment,{key:n},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:G?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==n||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==n&&G?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},$?""+R(e.title):R(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},R(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",borderCollapse:"collapse",border:"1px solid black"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"}},R(e)))),null==e?void 0:e.tableRows.map((n,o)=>l.createElement("tr",null,n.map((n,i)=>Array.isArray(n)&&n.length>1&&!0===e.isMaintenance?l.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:i},l.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"5px"}},n.map((e,n)=>l.createElement("a",{key:n,onClick:()=>{Digit.UploadServices.Filefetch([e.fileStoreId],Digit.ULBService.getStateId()).then(e=>{var t,n,l;console.log("Response of file:",e);const o=null==e||null===(t=e.data)||void 0===t||null===(n=t.fileStoreIds)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.url;if(o){const e=o.split(",")[0];e?window.open(e,"_blank"):console.error("No valid URL found to open!")}else console.error("URL is missing in the response!")}).catch(e=>{console.error("Error fetching file:",e)})},rel:"noopener noreferrer",style:{marginRight:"5px",display:"inline-block",cursor:"pointer"}},l.createElement(t.PDFSvg,{style:{width:"25px",height:"25px"}}))))):l.createElement("td",{key:i,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},console.log("Comming Maintainaince data row:- ",n.data),n&&!0===n.editButton?l.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},l.createElement(r.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+B,state:{data:n.data}}},l.createElement("button",null," ",l.createElement(t.EditIcon,null)," ")),l.createElement("div",{key:o,onClick:()=>(k(n.data),void M(!0)),style:{cursor:"pointer"}},l.createElement(t.ViewsIcon,null))):R(n)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||G?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,o)=>{var i,a,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:R(n.title),label:R(n.title),text:l.createElement("img",{src:R(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:R(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(r.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},R(null==n?void 0:n.title)))):$||Z?""+R(n.title):R(n.title),text:l.createElement("div",null,l.createElement(r.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:o===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:X(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+R(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:R(n.title),label:R(n.title),text:J(n),last:o===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:X(),labelStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"},textStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Ql,{bill:null===(a=H.Bill)||void 0===a?void 0:a[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.inspectionReport)&&l.createElement(kl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:O}),(null==b||null===(a=b.applicationData)||void 0===a||null===(u=a.additionalDetails)||void 0===u||null===(d=u.fieldinspection_pending)||void 0===d?void 0:d.length)>0&&(null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.fiReport)&&l.createElement(Ol,{fiReport:null==b||null===(c=b.applicationData)||void 0===c||null===(p=c.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.floors)&&l.createElement(Ml,{floors:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.owners)&&l.createElement(Fl,{owners:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners}),(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.units)&&l.createElement(Wl,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.accessories)&&l.createElement(Hl,{units:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.accessories}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.permissions)&&(null==T||null===(C=T.data)||void 0===C||null===(A=C.nextActions)||void 0===A?void 0:A.length)>0&&l.createElement(Rl,{applicationData:null==b?void 0:b.applicationData,t:R,permissions:null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.permissions}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.obpsDocuments)&&l.createElement(Nl,{t:R,applicationData:null==b?void 0:b.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T}),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(wl,{t:R,isNoc:!0,NOCdata:e.values,applicationData:null==b?void 0:b.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:T}),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.scruntinyDetails)&&l.createElement(kl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.buildingExtractionDetails)&&l.createElement(kl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&l.createElement(Bl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==b?void 0:b.applicationData}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl)&&l.createElement(Pl,{documents:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documents)&&l.createElement(Ll,{documents:null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.documents}),(null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.taxHeadEstimatesCalculation)&&l.createElement(xl,{taxHeadEstimatesCalculation:null==e||null===(Y=e.additionalDetails)||void 0===Y?void 0:Y.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Vl,{wsAdditionalDetails:e,oldValue:D}),(null==e||null===(K=e.additionalDetails)||void 0===K?void 0:K.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(r.Link,{to:null==e||null===(q=e.additionalDetails)||void 0===q||null===(Q=q.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(Kl,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement($l,{wsAdditionalDetails:e,workflowDetails:T}))}),N&&(null==T||null===(u=T.data)||void 0===u||null===(d=u.timeline)||void 0===d?void 0:d.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==T?void 0:T.isLoading)||C)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!C&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},R("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=T&&null!==(s=T.data)&&void 0!==s&&s.timeline&&1===(null==T||null===(c=T.data)||void 0===c||null===(p=c.timeline)||void 0===p?void 0:p.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:R(""+P+(null==T||null===(v=T.data)||void 0===v||null===(m=v.timeline[0])||void 0===m?void 0:m.state)),customChild:K(null==T||null===(f=T.data)||void 0===f?void 0:f.timeline[0],null==T||null===(E=T.data)||void 0===E?void 0:E.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==T||null===(y=T.data)||void 0===y?void 0:y.timeline)&&(null==T||null===(g=T.data)||void 0===g?void 0:g.timeline.slice(0,Q?null==T?void 0:T.data.timeline.length:2).map((e,n,o)=>{var i;let r="";var a,u,d,s,c,p;return window.location.href.includes("/obps/")&&(r=null!=T&&null!==(a=T.data)&&void 0!==a&&null!==(u=a.timeline[n-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=T&&null!==(s=T.data)&&void 0!==s&&null!==(c=s.timeline[n-1])&&void 0!==c&&null!==(p=c.state)&&void 0!==p&&p.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:R(""+P+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[I])+r),customChild:K(e,n,null==T||null===(i=T.data)||void 0===i?void 0:i.timeline)}))}))),(null==T||null===(h=T.data)||void 0===h||null===(S=h.timeline)||void 0===S?void 0:S.length)>2&&l.createElement(t.LinkButton,{label:R(Q?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{ee(e=>!e)}})))),l.createElement("div",null,x&&l.createElement(no,{t:R,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function oo(e){var n,o,i,r,a,u,d,s,c,p,v,m,f,E,y,_,g,h;let{t:S,showToast:b,closeToast:T,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var A;let e="";switch(null==b||null===(A=b.action)||void 0===A?void 0:A.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:S("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(d=b.error)||void 0===d?void 0:d.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:S("ES_"+C+"_"+(null==b||null===(c=b.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:e,onClose:T}))}if(null!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var P;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?S(e[1]):S(e[0]),n};let n="";switch(null==b||null===(P=b.action)||void 0===P?void 0:P.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(y=b.error)||void 0===y?void 0:y.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.message:S("ES_"+C+"_"+(null==b||null===(h=b.action)||void 0===h?void 0:h.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:T}))}{var N,I;const e="error"===(null==b?void 0:b.key)?null==b||null===(N=b.error)||void 0===N?void 0:N.message:"ES_"+C+"_"+(null==b||null===(I=b.action)||void 0===I?void 0:I.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:S(e),onClose:T}))}}function io(e){var i,r,a,u,s,c,p,v,m,f,E,y,_,g,h,S,b,T,C;let{workflowDetails:A,displayMenu:P,onActionSelect:N,setDisplayMenu:I,businessService:O,forcedActionPrefix:D,ActionBarStyle:w={},MenuStyle:R={},isAction:L,applicationDetails:x}=e;const{t:M}=o.useTranslation();let F=Digit.UserService.getUser();const k=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):{};F=null==t?void 0:t.value}const B=null===(i=F)||void 0===i||null===(r=i.info)||void 0===r||null===(a=r.roles)||void 0===a?void 0:a.map(e=>e.code);let U=!1,j=!1,H=(null==A||null===(u=A.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==A||null===(p=A.data)||void 0===p||null===(v=p.nextActions)||void 0===v?void 0:v.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(k,()=>{I(!1)},P),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==H?void 0:H.length)||null!=H&&null!==(m=H[0])&&void 0!==m&&null!==(f=m.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==H?void 0:H.length)?(j=!1,U=!0):(null==H?void 0:H.length)>0&&(j=!0,U=!1);const W=Digit.SessionStorage.get("User"),V=null==W||null===(E=W.info)||void 0===E?void 0:E.uuid,z=null==x||null===(y=x.applicationData)||void 0===y||null===(_=y.auditDetails)||void 0===_?void 0:_.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=A&&A.isLoading)&&j&&!U&&!L&&l.createElement(t.ActionBar,{style:d({},w)},P&&(null!=A&&null!==(g=A.data)&&void 0!==g&&null!==(h=g.actionState)&&void 0!==h&&h.nextActions||null!=A&&null!==(S=A.data)&&void 0!==S&&S.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:D||"WF_EMPLOYEE_"+(null==O?void 0:O.toUpperCase()),options:H,optionKey:"action",t:M,onSelect:N,style:R}):null,"ewst"===O?z===V||null==z?l.createElement(t.SubmitBar,{ref:k,label:M("WF_TAKE_ACTION"),onSubmit:()=>I(!P)}):l.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+M("EW_ALERT_ANOTHER_VENDOR")):l.createElement(t.SubmitBar,{ref:k,label:M("WF_TAKE_ACTION"),onSubmit:()=>I(!P)})),!(null!=A&&A.isLoading)&&!j&&U&&!L&&l.createElement(t.ActionBar,{style:d({},w)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==H||null===(b=H[0])||void 0===b?void 0:b.action,value:null==H||null===(T=H[0])||void 0===T?void 0:T.action,onClick:e=>{N((null==H?void 0:H[0])||{})}},M((D||"WF_EMPLOYEE_"+(null==O?void 0:O.toUpperCase()))+"_"+(null==H||null===(C=H[0])||void 0===C?void 0:C.action)))))}const ro=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.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"})),ao=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ro,null));function uo(e){let{action:n,closeWarningPopup:i}=e;const{t:r}=o.useTranslation(),a=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},r("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(ao,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:a?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,r("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",r("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+r("PT_AMOUNT_DUE"),text:"₹"+r(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:r("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:r("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const so=e=>{var i;const u=Digit.ULBService.getCurrentTenantId(),s=Digit.ULBService.getStateId(),{t:c}=o.useTranslation(),p=r.useHistory();let{id:v}=r.useParams();const[m,f]=n.useState(!1),[E,y]=n.useState(null),[_,g]=n.useState(!1),[h,S]=n.useState(!1),[b,T]=n.useState(!1),{applicationDetails:C,showToast:A,setShowToast:P,isLoading:N,isDataLoading:I,applicationData:O,mutate:D,nocMutation:w,workflowDetails:R,id:L,businessService:x,closeToast:M,moduleCode:F,timelineStatusPrefix:k,forcedActionPrefix:B,statusAttribute:U,ActionBarStyle:j,MenuStyle:H,paymentsList:W,showTimeLine:V=!0,oldValue:z,isInfoLabel:Y=!1,clearDataDetails:K,isAction:q=!1}=e;n.useEffect(()=>{A&&R.revalidate()},[A]);const G=a.useQueryClient(),$=()=>{y(null),g(!1)};return N||h?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,N?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(lo,{applicationDetails:C,id:L,workflowDetails:R,isDataLoading:I,applicationData:O,businessService:x,timelineStatusPrefix:k,statusAttribute:U,paymentsList:W,showTimeLine:V,oldValue:z,isInfoLabel:Y}),_?l.createElement(Al,{t:c,action:E,tenantId:u,state:s,id:v,applicationDetails:C,applicationData:null==C?void 0:C.applicationData,closeModal:$,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const o=function(o,i,r,a,u,s,v,m,f,y,_,g){if(0!=(null==e||null===(o=e.Property)||void 0===o||null===(i=o.workflow)||void 0===i||null===(r=i.comment)||void 0===r?void 0:r.length)&&0!=(null==e||null===(a=e.Licenses)||void 0===a||null===(u=a[0])||void 0===u||null===(s=u.comment)||void 0===s?void 0:s.length)&&0!=(null==e||null===(v=e.WaterConnection)||void 0===v||null===(m=v.comment)||void 0===m?void 0:m.length)&&0!=(null==e||null===(f=e.SewerageConnection)||void 0===f||null===(y=f.comment)||void 0===y?void 0:y.length)&&0!=(null==e||null===(_=e.BPA)||void 0===_||null===(g=_.comment)||void 0===g?void 0:g.length)){function h(t){if(l)return t;D&&(S(!0),D(e,{onError:(e,t)=>{S(!1),P({key:"error",error:e}),setTimeout(M,5e3)},onSuccess:(e,t)=>{var l,o,i,r,a,u,d,s,v,m,f,y;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),S(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=E,p.replace("/digit-ui/employee/obps/response",{data:e})),null!==(o=n)&&void 0!==o&&o.isStakeholder&&(e.selectedAction=E,p.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(i=n)&&void 0!==i&&i.isNoc&&p.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(r=e.Amendments)||void 0===r?void 0:r.length)>0?null!=t&&null!==(a=t.AmendmentUpdate)&&void 0!==a&&null!==(u=a.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?P({key:"success",label:c("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(s=d.workflow)&&void 0!==s&&s.action.includes("RE-SUBMIT")?P({key:"success",label:c("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(m=v.workflow)&&void 0!==m&&m.action.includes("APPROVE")?P({key:"success",label:c("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(y=f.workflow)&&void 0!==y&&y.action.includes("REJECT")&&P({key:"success",label:c("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(P({key:"success",action:E}),K&&setTimeout(K,3e3),setTimeout(M,5e3),G.clear(),G.refetchQueries("APPLICATION_SEARCH"))}})),$()}S(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(d({},e)));const o=function(){if(!1!==t&&w){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==w?void 0:w.mutateAsync(e)),o=Oe(function(){return S(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,o,i,r,a,u,d,s,p,v,m;S(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(o=n.Errors)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.code?c(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(s=e.response)||void 0===s||null===(p=s.data)||void 0===p||null===(v=p.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;$(),P({key:"error",error:{message:f}}),setTimeout(M,5e3),l=!0});if(o&&o.then)return o.then(function(){})}}();return o&&o.then?o.then(h):h(o)}alert("Please fill in the comments before submitting")}();return Promise.resolve(o&&o.then?o.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==R||null===(i=R.data)||void 0===i?void 0:i.timeline,businessService:x,workflowDetails:R,moduleCode:F}):null,b?l.createElement(uo,{action:E,workflowDetails:R,businessService:x,isWarningPop:b,closeWarningPopup:()=>{T(!1)}}):null,l.createElement(oo,{t:c,showToast:A,closeToast:M,businessService:x}),l.createElement(io,{isAction:q,workflowDetails:R,displayMenu:m,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)P({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(M,5e3);else if(null!=e&&e.isWarningPopUp)T(!0);else if(null!=e&&e.redirectionUrll){var t,n,l,o,i;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))p.push(""+(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.pathname),JSON.stringify({data:null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.state,url:""+(null===(i=location)||void 0===i?void 0:i.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.action)){var r,a;p.push(""+(null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.pathname),{data:null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.state})}else{var u;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(u=e.redirectionUrll)||void 0===u?void 0:u.pathname))}}else if(null!=e&&e.redirectionUrl){var s,c;p.push({pathname:null===(s=e.redirectionUrl)||void 0===s?void 0:s.pathname,state:d({},null===(c=e.redirectionUrl)||void 0===c?void 0:c.state)})}else g(!0);y(e),f(!1)},setDisplayMenu:f,businessService:x,forcedActionPrefix:B,ActionBarStyle:j,MenuStyle:H,applicationDetails:C})))},co=()=>{var e;const{t:i}=o.useTranslation(),{propertyId:a,tenantId:u,redirectToUrl:s}=Digit.Hooks.useQueryParams(),{isLoading:c,data:p}=Digit.Hooks.pt.useGenericViewProperty(i,u,a,{}),{state:v}=r.useLocation(),m=r.useHistory();return n.useEffect(()=>{"true"===sessionStorage.getItem("isCreateEnabledEmployee")?(sessionStorage.removeItem("isCreateEnabledEmployee"),m.replace("/digit-ui/employee")):sessionStorage.removeItem("isCreateEnabledEmployee")}),l.createElement("div",null,l.createElement("div",null,l.createElement(t.Header,null,i("PT_PROPERTY_INFO_HEADER"))),l.createElement(so,{applicationDetails:p,isLoading:c,isDataLoading:c,workflowDetails:{},applicationData:null==p?void 0:p.applicationData,moduleCode:"PT"}),window.location.href.includes("redirectToUrl")&&"INACTIVE"!==(null==p||null===(e=p.applicationData)||void 0===e?void 0:e.status)&&l.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement("div",null,l.createElement(t.SubmitBar,{label:i("PT_ADD_PROPERTY_TO_APP"),onSubmit:()=>(()=>{var e,t,n,l,o,i,r;const c=null!=s&&s.includes("employee/tl")?1600:300;return setTimeout(()=>window.scrollTo(0,c),400),m.push(s+"?propertyId="+a+"&tenantId="+((null==p?void 0:p.tenantId)||u)+("PENDING_FOR_FIELD_INSPECTION"===(null==v||null===(e=v.data)||void 0===e||null===(t=e.applicationDetails)||void 0===t?void 0:t.applicationStatus)?"&applicationNumber="+(null==v||null===(n=v.data)||void 0===n||null===(l=n.applicationDetails)||void 0===l?void 0:l.applicationNo)+"&service="+(null==v||null===(o=v.data)||void 0===o||null===(i=o.applicationDetails)||void 0===i||null===(r=i.applicationData)||void 0===r?void 0:r.serviceType):""),d({},v))})()}))))},po=["path","url"],vo=e=>{let{stateCode:n}=e;const o=r.useRouteMatch(),{path:i}=o;return s(o,po),l.createElement("span",{className:"pt-citizen",style:{width:"100%"}},l.createElement(r.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,null,"Back"),l.createElement(r.Route,{path:i+"/property/citizen-search",component:_e}),l.createElement(r.Route,{path:i+"/property/search-results"},l.createElement(Ce,{stateCode:n})),l.createElement(r.Route,{path:i+"/property/citizen-otp"},l.createElement(Ie,{stateCode:n})," "),l.createElement(t.PrivateRoute,{path:i+"/property/link-success/:propertyIds",component:Ae}),l.createElement(t.PrivateRoute,{path:i+"/property/new-application",component:P}),l.createElement(t.PrivateRoute,{path:i+"/view-property",component:()=>l.createElement(co,null)}))))},mo=e=>{o.useTranslation();const n=a.useQueryClient(),i=r.useRouteMatch(),u=(r.useLocation(),r.useHistory()),d=Digit.ULBService.getStateId(),[s,c,p]=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY",{}));let{isLoading:v}=Digit.Hooks.pt.useMDMS(d,"PropertyTax","CommonFieldsConfig");const m=r.useLocation().search,E=new URLSearchParams(m).get("redirectToUrl");return v?l.createElement(t.Loader,null):l.createElement(r.Switch,null,l.createElement(r.Route,{exact:!0,path:""+i.path},l.createElement(f,{onSubmit:function(){try{return u.push(i.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:s,redirectUrl:E,userType:"employee"})),l.createElement(r.Route,{exact:!0,path:i.path+"/save-property"},l.createElement(A,{data:s,onSuccess:()=>{p(),n.invalidateQueries("PT_CREATE_PROPERTY")},redirectUrl:E,userType:"employee"})))},fo={searchId:{propertyIds:{type:"text",label:"PT_PROPERTY_UNIQUE_ID",placeHolder:"PT_PROPERTY_UNIQUE_ID_PLACEHOLDER",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}|[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},oldPropertyId:{type:"text",label:"PT_EXISTING_PROPERTY_ID",placeholder:"PT_EXISTING_PROPERTY_ID_PLACEHOLDER",validation:{pattern:{value:"[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}|[A-Za-z]{2}-[A-Za-z]{2}-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}",message:"ERR_INVALID_PROPERTY_ID"}}},mobileNumber:{type:"number",label:"PT_HOME_SEARCH_RESULTS_OWN_MOB_LABEL",componentInFront:"+91",placeHolder:"PT_HOME_SEARCH_RESULTS_OWN_MOB_PLACEHOLDER",validation:{minLength:{value:10,message:"CORE_COMMON_MOBILE_ERROR"},maxLength:{value:10,message:"CORE_COMMON_MOBILE_ERROR"},pattern:{value:/[6789][0-9]{9}/,message:"CORE_COMMON_MOBILE_ERROR"}}}},searchDetail:{locality:{type:"custom",label:"PT_SEARCH_LOCALITY",placeHolder:"PT_SEARCH_LOCALITY_PLACEHOLDER",validation:{required:"PTLOCALITYMANDATORY"},customComponent:t.Localities,customCompProps:{boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10"},disableLoader:!0}},doorNo:{type:"text",label:"PT_SEARCHPROPERTY_TABEL_DOOR_NO",placeHolder:"PT_SEARCH_DOOR_NO_PLACEHOLDER",validation:{pattern:{value:"[A-Za-z0-9#,/ -()]{1,63}",message:"ERR_INVALID_DOOR_NO"}}},name:{type:"text",label:"PT_SEARCHPROPERTY_TABEL_OWNERNAME",placeHolder:"PT_SEARCH_OWNER_NAME_PLACEHOLDER",validation:{minLength:{value:3,message:"PT_MIN_3CHAR"},pattern:{value:"^[a-zA-Z ]+$",message:"PAYMENT_INVALID_NAME"}}}}},Eo={propertyIds:"",mobileNumber:"",oldPropertyId:"",locality:"",name:"",doorNo:""},yo=e=>{const{t:i}=o.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[u,s]=n.useState({}),[c,p]=n.useState(Eo),[v,m]=n.useState("searchId"),[f,E]=n.useState(null),y=r.useLocation().search,_=new URLSearchParams(y).get("redirectToUrl"),g=n.memo(Digit.ComponentRegistryService.getComponent("CPTPropertySearchForm")),h=n.memo(Digit.ComponentRegistryService.getComponent("CPTPropertySearchResults")),{data:S,isLoading:b}=Digit.Hooks.pt.useMDMS(Digit.ULBService.getStateId(),"DIGIT-UI","HelpText",{select:e=>{var t,n,l;return null==e||null===(t=e["DIGIT-UI"])||void 0===t||null===(n=t.HelpText)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.PT}});n.useEffect(()=>{1==sessionStorage.getItem("searchDetailValue")&&"searchId"===v&&m("searchDetail")},[v]);const T=n.useCallback(()=>{p(Eo),s({}),E(null)}),C=n.useCallback(e=>{p(e),Object.keys(e).filter(t=>e[t]&&"object"!=typeof e[t]).length>0?(s(Object.keys(e).filter(t=>e[t]).reduce((t,n)=>d({},t,{[n]:"object"==typeof e[n]?e[n].code:e[n]}),{})),E(null)):E({warning:!0,label:"ERR_PT_FILL_VALID_FIELDS"})});return b?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,i("SEARCH_PROPERTY")),l.createElement(g,{t:i,payload:c,searchBy:v,setSearchBy:m,PTSearchFields:fo,tenantId:a,onSubmit:C,onReset:T}),Object.keys(u).length>0&&l.createElement(h,{t:i,showToast:f,setShowToast:E,tenantId:a,payload:u,ptSearchConfig:d({},S),redirectToUrl:_}),f&&l.createElement(t.Toast,{error:f.error,warning:f.warning,label:i(f.label),onClose:()=>{E(null)}}))},_o=e=>{let{path:n,url:i,userType:a}=e;const{t:u}=o.useTranslation(),s=r.useLocation(),c=new URLSearchParams(r.useLocation().search).get("propertyId"),p=new URLSearchParams(r.useLocation().search).get("tenantId"),v=r.useLocation().search,m=new URLSearchParams(v).get("redirectToUrl"),f=new URLSearchParams(v).get("from")||"",E=[{path:"/digit-ui/employee",content:u("ES_COMMON_HOME"),show:!0},{path:{pathname:c?m+"?propertyId="+c+"&tenantId="+p:m,state:d({},s.state)},content:m?(e=>e.includes("employee/tl/new-application")?u("ES_TITLE_NEW_TRADE_LICESE_APPLICATION"):e.includes("employee/ws/new-application")?u("ES_COMMON_WS_NEW_CONNECTION"):e.includes("employee/ws/modify-application")?u("WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL"):u("WF_EMPLOYEE_NEWTL_RENEWAL_SUBMIT_BUTTON"))(m):f&&u(f)||"NONE",show:(m||f)&&!0,isBack:f&&!0,isredirected:!0},{path:"/digit-ui/employee/dss/drilldown",content:s.pathname.includes("/commonpt/search")?u("SEARCH_PROPERTY"):s.pathname.includes("/view-property")?u("PT_PROPERTY_INFORMATION"):u("PT_NEW_PROPERTY"),show:!0}],y=window.location.href.includes("/employee/commonpt/new-application");return l.createElement(r.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},l.createElement("div",{style:y?{marginLeft:"12px"}:{}},l.createElement(t.BreadCrumb,{crumbs:E})),l.createElement(t.PrivateRoute,{exact:!0,path:n+"/",component:()=>l.createElement(Ao,{matchPath:n,userType:a})}),l.createElement(t.PrivateRoute,{path:n+"/new-application",component:()=>l.createElement(mo,{parentUrl:i})}),l.createElement(t.PrivateRoute,{path:n+"/search",component:()=>l.createElement(yo,null)}),l.createElement(t.PrivateRoute,{path:n+"/view-property",component:()=>l.createElement(co,null)}))))},go=e=>l.createElement("div",{className:"w-fullwidth PropertySearchFormSwitcher"},e.keys.map(t=>l.createElement("span",{key:t,className:e.searchBy===t?"selected":"non-selected",onClick:()=>{"searchDetail"===t&&!sessionStorage.getItem("searchDetailValue")&&sessionStorage.setItem("searchDetailValue",1),"searchId"===t&&1==sessionStorage.getItem("searchDetailValue")&&sessionStorage.setItem("searchDetailValue",2),e.onSwitch(t),e.onReset()}},e.t("PT_SEARCH_BY_"+(null==t?void 0:t.toUpperCase()))))),ho=e=>l.createElement("span",{className:"cell-text"},e);let So=[];const bo=e=>{let{currentStep:n=1,flow:i=""}=e;const{t:r}=o.useTranslation(),a=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":So=[];break;case"WS":So=["WS_COMMON_PROPERTY_DETAILS","WS_COMMON_CONNECTION_DETAIL","WS_COMMON_DOCUMENT_DETAILS","WS_COMMON_SUMMARY"];break;case"TL":So=["TL_COMMON_TR_DETAILS","TL_LOCATION_AND_OWNER_DETAILS","TL_DOCUMENT_DETAIL","TL_COMMON_SUMMARY"];default:So=[]}})(i),l.createElement("div",{className:"timeline-container",style:a?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},So.map((e,o,i)=>l.createElement("div",{className:"timeline-checkpoint",key:o},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(o<=n-1&&"active")},o<n-1?l.createElement(t.TickMark,null):o+1),l.createElement("span",{className:"secondary-color"},r(e))),o<i.length-1&&l.createElement("span",{className:"line "+(o<n-1&&"active")}))))},To={CPTPropertySearchForm:e=>{let{tenantId:o,t:i,onSubmit:r,onReset:a,searchBy:s,PTSearchFields:c,setSearchBy:p,payload:v}=e;const{register:m,control:f,handleSubmit:E,watch:y,getValues:_,formState:g}=u.useForm({defaultValues:d({},v)}),h=y(),S=(null==c?void 0:c[s])||{};return n.useEffect(()=>{"true"===sessionStorage.getItem("isCreateEnabledEmployee")?(sessionStorage.removeItem("isCreateEnabledEmployee"),history.replace("/digit-ui/employee")):sessionStorage.removeItem("isCreateEnabledEmployee")}),l.createElement("div",{className:"PropertySearchForm"},l.createElement(t.SearchForm,{onSubmit:r,handleSubmit:E},l.createElement(go,{keys:Object.keys(c||{}),searchBy:s,onReset:a,t:i,onSwitch:p}),S&&Object.keys(S).map(e=>{var n,r,a;let s=S[e],c=(null==s?void 0:s.validation)||{};return l.createElement(t.SearchField,{key:e},l.createElement("label",null,i(null==s?void 0:s.label),null!=s&&null!==(n=s.validation)&&void 0!==n&&n.required?"*":""),"custom"===(null==s?void 0:s.type)?l.createElement(u.Controller,{name:e,defaultValue:null==h?void 0:h[e],rules:s.validation,control:f,render:(t,n)=>l.createElement(s.customComponent,d({selectLocality:e=>{t.onChange(e)},tenantId:o,selected:null==h?void 0:h[e]},s.customCompProps))}):l.createElement("div",{className:"field-container"},null!=s&&s.componentInFront?l.createElement("span",{className:"employee-card-input employee-card-input--front",style:{flex:"none"}},null==s?void 0:s.componentInFront):null,l.createElement(t.TextInput,{name:e,type:null==s?void 0:s.type,inputRef:m(d({value:_(e),shouldUnregister:!0},c))})),l.createElement(t.CardLabelError,{style:{marginTop:"-10px",marginBottom:"-10px"}},i(null==g||null===(r=g.errors)||void 0===r||null===(a=r[e])||void 0===a?void 0:a.message)))}),l.createElement("div",{className:"pt-search-action"},l.createElement(t.SearchField,{className:"pt-search-action-reset"},l.createElement("p",{onClick:()=>{a({})}},i("ES_COMMON_CLEAR_ALL"))),l.createElement(t.SearchField,{className:"pt-search-action-submit"},l.createElement(t.SubmitBar,{label:i("ES_COMMON_SEARCH"),submit:!0})))))},CPTPropertySearchResults:e=>{var o,i;let{tenantId:a,t:u,payload:s,showToast:c,setShowToast:p,ptSearchConfig:v,redirectToUrl:m}=e;const f=r.useHistory(),{state:E}=r.useLocation(),y=r.useLocation().search,_=new URLSearchParams(y).get("propertyId");let g=window.location.href.includes("&")?window.location.href.substring(window.location.href.indexOf("&")+1,window.location.href.length):"";const[h,S]=n.useState(d({},s)),{data:b,isLoading:T,error:C}=Digit.Hooks.pt.usePropertySearchWithDue({tenantId:a,filters:h,configs:{enabled:Object.keys(s).length>0,retry:!1,retryOnMount:!1,staleTime:Infinity}}),A=n.useMemo(()=>[{Header:u("PT_COMMON_TABLE_COL_PT_ID"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement("span",{onClick:()=>{f.push("/digit-ui/employee/commonpt/view-property?propertyId="+t.original.propertyId+"&tenantId="+a+"&redirectToUrl="+m,d({},E))}},t.original.propertyId)))}},{Header:u("PT_COMMON_TABLE_COL_OWNER_NAME"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return ho(t.original.owners.sort((e,t)=>e.additionalDetails.ownerSequence-t.additionalDetails.ownerSequence).map(e=>e.name).join(",")||"")}},{Header:u("ES_INBOX_LOCALITY"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return ho(u(t.original.locality)||"")}},{Header:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),Cell:e=>{var t;let{row:n}=e;return ho(u((null==n||null===(t=n.original)||void 0===t?void 0:t.status)||"NA"))},disableSortBy:!0},{Header:u("PT_AMOUNT_DUE"),Cell:e=>{var t,n;let{row:l}=e;return ho(null!=l&&null!==(t=l.original)&&void 0!==t&&t.due?"₹ "+(null==l||null===(n=l.original)||void 0===n?void 0:n.due):u("PT_NA"))},disableSortBy:!0},{Header:u("ES_SEARCH_ACTION"),disableSortBy:!0,Cell:e=>{var t;let{row:n}=e;return l.createElement("div",null,"INACTIVE"!==(null==n||null===(t=n.original)||void 0===t?void 0:t.status)?l.createElement("span",{className:"link"},m?l.createElement("span",{onClick:()=>{f.push(g?m+"?"+(null==g?void 0:g.replace(_,n.original.propertyId)):m+"?propertyId="+n.original.propertyId+"&tenantId="+a,d({},E));const e=null!=m&&m.includes("employee/tl")?1600:300;setTimeout(()=>window.scrollTo(0,e),400)}},u("CPT_SELECT_PROPERTY")):null):u("PT_NA"))}}],[]);let P=window.Digit.Utils.browser.isMobile();if(T)return c&&p(null),l.createElement(t.Loader,null);var N,I,O,D;if(C)return!c&&p({error:!0,label:(null==C||null===(N=C.response)||void 0===N||null===(I=N.data)||void 0===I||null===(O=I.Errors)||void 0===O||null===(D=O[0])||void 0===D?void 0:D.code)||C}),null;const w=n.memo(Digit.ComponentRegistryService.getComponent("PTEmptyResultInbox")),R=Object.values((null==b?void 0:b.FormattedData)||{})||[];return null!=v&&v.ptSearchCount&&s.locality&&R&&R.length>(null==v?void 0:v.ptSearchCount)?(!c&&p({error:!0,label:"PT_MODIFY_SEARCH_CRITERIA"}),null):l.createElement(l.Fragment,null,0===(null==b||null===(o=b.Properties)||void 0===o?void 0:o.length)?l.createElement(w,{data:!0}):P?l.createElement(t.DetailsCard,{data:function(e){var t;return void 0===e&&(e=[]),null===(t=e)||void 0===t?void 0:t.map(e=>{const t={};return A.forEach(n=>{n.Cell&&(t[n.Header]=n.Cell({row:{original:e}}))}),t})}(R),t:u}):l.createElement(t.Table,{t:u,data:R,totalRecords:null==b||null===(i=b.Properties)||void 0===i?void 0:i.length,columns:A,getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),manualPagination:!1,disableSort:!0}))},CPTSearchProperty:_e,CPTPropertyAssemblyDetails:e=>{var o,r,a,s,c,p,v,f;let{t:E,config:y,onSelect:_,userType:g,formData:h,formState:b,setError:T,clearErrors:C}=e;const[A,P]=l.useState(d({},h.assemblyDet,{BuildingType:null==h?void 0:h.PropertyType,floorarea:null==h?void 0:h.landArea,constructionArea:null==h?void 0:h.constructionArea,usageCategoryMajor:null!=h&&h.usageCategoryMajor&&"NONRESIDENTIAL.OTHERS"===(null==h||null===(o=h.usageCategoryMajor)||void 0===o?void 0:o.code)?{code:""+(null==h||null===(r=h.usageCategoryMajor)||void 0===r?void 0:r.code),i18nKey:"PROPERTYTAX_BILLING_SLAB_OTHERS"}:null==h?void 0:h.usageCategoryMajor})),[N,I]=l.useState(""),O=Digit.ULBService.getStateId(),[D,w]=n.useState(!1),R=window.Digit.Utils.browser.isMobile();let L=[];const{data:x={}}=Digit.Hooks.pt.usePropertyMDMS(O,"PropertyTax","PTPropertyType")||{};L=null==x||null===(a=x.PropertyTax)||void 0===a?void 0:a.PropertyType;const{data:M={}}=Digit.Hooks.pt.usePropertyMDMS(O,"PropertyTax","UsageCategory")||{};let F=[];function k(e){var t,n;if("employee"===g)return null==e||null===(t=e.filter(e=>"VACANT"===e.code||e.code.split(".").length>1))||void 0===t||null===(n=t.map(e=>({i18nKey:"COMMON_PROPTYPE_"+S(null==e?void 0:e.code,".","_"),code:null==e?void 0:e.code})))||void 0===n?void 0:n.sort((e,t)=>e.i18nKey.split("_").pop().localeCompare(t.i18nKey.split("_").pop()));if(Array.isArray(e)&&e.length>0)for(i=0;i<e.length;i++)1!=i&&4!=i&&Array.isArray(e)&&e.length>0&&menu.push({i18nKey:"COMMON_PROPTYPE_"+S(e[i].code,".","_"),code:e[i].code});return menu.sort((e,t)=>e.i18nKey.split("_").pop().localeCompare(t.i18nKey.split("_").pop())),menu}function B(e){var t;if("employee"===g)return null==e||null===(t=e.filter(e=>(null==e?void 0:e.code.split(".").length)<=2&&"NONRESIDENTIAL"!==e.code))||void 0===t?void 0:t.map(e=>{const t=null==e?void 0:e.code.split(".");return 2==t.length?{i18nKey:"PROPERTYTAX_BILLING_SLAB_"+t[1],code:null==e?void 0:e.code}:{i18nKey:"PROPERTYTAX_BILLING_SLAB_"+(null==e?void 0:e.code),code:null==e?void 0:e.code}});for(i=0;i<10;i++)Array.isArray(e)&&e.length>0&&"NONRESIDENTIAL"==e[i].code.split(".")[0]&&2==e[i].code.split(".").length&&menu.push({i18nKey:"PROPERTYTAX_BILLING_SLAB_"+e[i].code.split(".")[1],code:e[i].code});return menu}F=(null==M||null===(s=M.PropertyTax)||void 0===s?void 0:s.UsageCategory)||[];const{control:U,formState:{errors:j,touched:H},trigger:W,watch:V,clearErrors:z}=u.useForm(),Y=V(),K={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.useEffect(()=>{let e=!1;const t={};Object.keys(A).forEach(e=>{t[e]=null==Y?void 0:Y[e]}),m.isEqual(t,A)||Object.keys(A).forEach(t=>{A[t]?(e=!1,z(t)):e=!0}),e?T(null==y?void 0:y.key,{type:j}):C(null==y?void 0:y.key),W(),w(e),_(null==y?void 0:y.key,A)},[A]),l.useEffect(()=>{var e;Object.keys(j).length&&!m.isEqual((null===(e=b.errors[y.key])||void 0===e?void 0:e.type)||{},j)?T(y.key,{type:j}):!Object.keys(j).length&&b.errors[y.key]&&D&&C(y.key)},[j]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,E("PT_PROP_TYPE")+"*"),l.createElement("div",{class:"form-field"},l.createElement(u.Controller,{name:"BuildingType",control:U,defaultValue:null==A?void 0:A.BuildingType,rules:{required:E("REQUIRED_FIELD")},key:null==y?void 0:y.key,render:e=>{var n,o;return l.createElement(t.Dropdown,{selected:1===(null===(n=k(L))||void 0===n?void 0:n.length)?k(L)[0]:null==A?void 0:A.BuildingType,disable:1===(null===(o=k(L))||void 0===o?void 0:o.length),option:k(L),autoFocus:"BuildingType"===N,select:t=>{e.onChange(t),P(d({},A,{BuildingType:t})),I("BuildingType")},optionKey:"i18nKey",onBlur:null==e?void 0:e.onBlur,t:E})}}))),l.createElement(t.CardLabelError,{style:K},null!=H&&H.BuildingType?null==j||null===(c=j.BuildingType)||void 0===c?void 0:c.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,E("PT_TOT_LAND_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"floorarea",control:U,defaultValue:null==A?void 0:A.floorarea,rules:{required:E("REQUIRED_FIELD"),validate:e=>!!/^([0-9]){0,8}$/i.test(e)||E("PT_TOT_LAND_AREA_ERROR_MESSAGE")},key:null==y?void 0:y.key,render:e=>l.createElement(t.TextInput,{t:E,type:"number",isMandatory:!1,optionKey:"i18nKey",name:"totLandArea",value:null==e?void 0:e.value,autoFocus:"floorarea"===N,onChange:t=>{null==e||e.onChange(t.target.value),P(d({},A,{floorarea:t.target.value})),I("floorarea")},onBlur:null==e?void 0:e.onBlur})}))),l.createElement(t.CardLabelError,{style:K},null!=H&&H.floorarea?null==j||null===(p=j.floorarea)||void 0===p?void 0:p.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,E("PT_TOT_CONSTRUCTION_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"constructionArea",control:U,defaultValue:null==A?void 0:A.constructionArea,key:null==y?void 0:y.key,rules:{required:E("REQUIRED_FIELD"),validate:e=>!!(/^([0-9]){0,8}$/i.test(e)&&null!=A&&A.floorarea&&parseInt(e)<parseInt(null==A?void 0:A.floorarea))||E("PT_TOT_CONSTRUCTION_AREA_ERROR_MESSAGE")},render:e=>l.createElement(t.TextInput,{t:E,type:"number",isMandatory:!1,optionKey:"i18nKey",name:"totConstructionArea",value:null==e?void 0:e.value,autoFocus:"constructionArea"===N,onChange:t=>{null==e||e.onChange(t.target.value),I("constructionArea"),P(d({},A,{constructionArea:t.target.value}))},onBlur:null==e?void 0:e.onBlur})}))),l.createElement(t.CardLabelError,{style:R?d({},K,{marginLeft:"0px"}):d({},K)},null!=H&&H.constructionArea?null==j||null===(v=j.constructionArea)||void 0===v?void 0:v.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,E("PT_ASSESMENT_INFO_USAGE_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"usageCategoryMajor",defaultValue:null==A?void 0:A.usageCategoryMajor,rules:{required:E("REQUIRED_FIELD")},control:U,key:null==y?void 0:y.key,render:e=>{var n;return l.createElement(t.Dropdown,{selected:null==e?void 0:e.value,disable:1===(null===(n=B(F))||void 0===n?void 0:n.length),option:B(F),autoFocus:"usageCategoryMajor"===N,select:t=>{null==e||e.onChange(t),I("usageCategoryMajor"),P(d({},A,{usageCategoryMajor:t}))},optionKey:"i18nKey",onBlur:null==e?void 0:e.onBlur,t:E})}}))),l.createElement(t.CardLabelError,{style:K},null!=H&&H.usageCategoryMajor?null==j||null===(f=j.usageCategoryMajor)||void 0===f?void 0:f.message:""))},CPTPropertyLocationDetails:e=>{var n,o,i,r,a,s;let{t:c,config:p,onSelect:v,userType:f,formData:E,formState:y,setError:_,clearErrors:g}=e,h={},S=Digit.Hooks.pt.useTenants()?Digit.Hooks.pt.useTenants():Digit.Hooks.tl.useTenants();window.location.href.includes("obps")&&(S=Digit.SessionStorage.get("OBPS_TENANTS")),window.location.href.includes("fsm")&&(S=Digit.SessionStorage.get("FSM_TENANTS"),console.log("allc",S));const b=null===(n=Digit.UserService.getUser())||void 0===n?void 0:n.info;f="EMPLOYEE"==(null==b?void 0:b.type)?"employee":"citizen";const T=null==b?void 0:b.tenantId,C="TENANT_TENANTS_"+(null==b?void 0:b.tenantId.replace(".","_").toUpperCase()),A="employee"===f?{code:T,name:c(C),i18nKey:C}:null,[P,N]=l.useState(d({},null==E?void 0:E.locationDet,{cityCode:A,locality:null==E?void 0:E.locality,houseDoorNo:null==E?void 0:E.houseDoorNo,buildingColonyName:null==E?void 0:E.buildingColonyName,landmarkName:null==E?void 0:E.landmarkName})),[I,O]=l.useState(!1),{control:D,formState:{errors:w,touched:R},trigger:L,watch:x,clearErrors:M}=u.useForm(),F=x();l.useEffect(()=>{let e=!1;const t={};Object.keys(P).forEach(e=>{t[e]=null==F?void 0:F[e]}),m.isEqual(t,P)||Object.keys(P).forEach(t=>{P[t]?(e=!1,M(t)):e=!0}),e?_(null==p?void 0:p.key,{type:w}):g(null==p?void 0:p.key),L(),O(e),v(null==p?void 0:p.key,P)},[P]),l.useEffect(()=>{var e;Object.keys(w).length&&!m.isEqual((null===(e=y.errors[p.key])||void 0===e?void 0:e.type)||{},w)?_(p.key,{type:w}):!Object.keys(w).length&&y.errors[p.key]&&I&&g(p.key)},[w]);const k={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,c("PT_PROP_CITY")+"*"),l.createElement(u.Controller,{name:"",defaultValue:null==P?void 0:P.cityCode,control:D,rules:{required:c("REQUIRED_FIELD")},render:e=>{let{value:n,onBlur:o,onChange:i}=e;return l.createElement(t.Dropdown,{className:"form-field",selected:n,disable:"employee"===f,option:S.sort((e,t)=>e.name>t.name?1:t.name>e.name?-1:0),select:e=>{i(e),N(d({},P,{cityCode:e}))},optionKey:"code",onBlur:o,t:c})}})),l.createElement(t.CardLabelError,{style:k},null!=R&&R.cityCode?null==w||null===(o=w.cityCode)||void 0===o?void 0:o.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,c("PT_PROP_LOCALITY")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"locality",defaultValue:null==P?void 0:P.locality,control:D,rules:{required:c("REQUIRED_FIELD")},render:e=>{var n,o;let{value:i,onBlur:r,onChange:a}=e;return l.createElement(t.Localities,{selectLocality:e=>{a(e),N(d({},P,{locality:e}))},tenantId:null==P||null===(n=P.cityCode)||void 0===n?void 0:n.code,boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10"},selected:i,disable:!(null!=P&&null!==(o=P.cityCode)&&void 0!==o&&o.code),disableLoader:!0,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:k},null!=R&&R.locality?null==w||null===(i=w.locality)||void 0===i?void 0:i.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,c("PT_HOUSE_DOOR_NO")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"houseDoorNo",defaultValue:null==P?void 0:P.houseDoorNo,control:D,rules:{required:c("REQUIRED_FIELD"),validate:e=>!!/^([a-zA-Z0-9 !@#$%^&*()_+\-={};':\\\\|,.<>/?]){1,64}$/i.test(e)||c("PT_HOUSE_DOOR_NO_ERROR_MESSAGE")},render:e=>{let{value:n,onBlur:o,onChange:i}=e;return l.createElement(t.TextInput,d({t:c,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseDoorNo",value:n,onChange:e=>{i(e.target.value),N(d({},P,{houseDoorNo:e.target.value}))},onBlur:o},h={pattern:"^([a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]){1,64}$",title:c("PT_HOUSE_DOOR_NO_ERROR_MESSAGE")}))}}))),l.createElement(t.CardLabelError,{style:k},null!=R&&R.houseDoorNo?null==w||null===(r=w.houseDoorNo)||void 0===r?void 0:r.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,c("PT_PROPERTY_ADDRESS_STREET_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"buildingColonyName",defaultValue:null==P?void 0:P.buildingColonyName,control:D,rules:{required:c("REQUIRED_FIELD")},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return l.createElement(t.TextInput,{t:c,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"buildingColonyName",value:n,onChange:e=>{o(e.target.value),N(d({},P,{buildingColonyName:e.target.value}))},onBlur:i})}}))),l.createElement(t.CardLabelError,{style:k},null!=R&&R.buildingColonyName?null==w||null===(a=w.buildingColonyName)||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+c("PT_LANDMARK_NAME")),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{name:"landmarkName",defaultValue:null==P?void 0:P.landmarkName,control:D,rules:{},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return l.createElement(t.TextInput,{t:c,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"landmarkName",value:n,onChange:e=>{o(e.target.value),N(d({},P,{landmarkName:e.target.value}))},onBlur:i})}}))),l.createElement(t.CardLabelError,{style:k},null!=R&&R.landmarkName?null==w||null===(s=w.landmarkName)||void 0===s?void 0:s.message:""))},CPTPropertyOwnerDetails:e=>{var o,i,a,s,c,p,v,f,E,y,_,g,h,S;let{t:b,config:T,onSelect:C,userType:A,formData:P,formState:N,setError:I,clearErrors:O}=e;const{pathname:D}=r.useLocation(),w=D.includes("/modify-application/"),R=D.includes("/property-mutation/"),L=window.Digit.Utils.browser.isMobile(),[x,M]=l.useState(""),[F,k]=l.useState([d({},P.owners&&P.owners[0],{name:P.owners&&P.owners[0]&&P.owners[0].name||(null==P||null===(o=P.owners)||void 0===o?void 0:o.name)||"",gender:P.owners&&P.owners[0]&&P.owners[0].gender||(null==P||null===(i=P.owners)||void 0===i?void 0:i.gender),mobileNumber:P.owners&&P.owners[0]&&P.owners[0].mobileNumber||(null==P||null===(a=P.owners)||void 0===a?void 0:a.mobileNumber)||"",fatherOrHusbandName:P.owners&&P.owners[0]&&P.owners[0].fatherOrHusbandName||(null==P||null===(s=P.owners)||void 0===s?void 0:s.fatherOrHusbandName)||"",relationship:P.owners&&P.owners[0]&&P.owners[0].relationship||(null==P||null===(c=P.owners)||void 0===c?void 0:c.relationship),ownershipCategory:x,ownerType:P.owners&&P.owners[0]&&(null===(p=P.owners[0])||void 0===p?void 0:p.ownerType)||(null===(v=P.owners)||void 0===v?void 0:v.ownerType),permanentAddress:P.owners&&P.owners[0]&&P.owners[0].permanentAddress||(null==P||null===(f=P.owners)||void 0===f?void 0:f.permanentAddress)||"",email:P.owners&&P.owners[0]&&P.owners[0].email||(null==P||null===(E=P.owners)||void 0===E?void 0:E.emailId)||"",isCoresAddr:!1})]),[B,U]=n.useState(!1),[j,H]=l.useState(!1),W=(null==P?void 0:P.isUpdateProperty)||!1;let V=(null==P?void 0:P.isEditProperty)||!1;const z=Digit.ULBService.getStateId(),{data:Y}=Digit.Hooks.pt.useGenderMDMS(z,"common-masters","GenderType");let K=[];Y&&Y.map(e=>{K.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const{data:q}=Digit.Hooks.tl.useTradeLicenseMDMS(z,"common-masters","TLOwnerTypeWithSubtypes",{userType:A}),{data:G}=Digit.Hooks.pt.usePropertyMDMS(z,"PropertyTax","OwnerType"),{data:$}=Digit.Hooks.pt.usePropertyMDMS(z,"PropertyTax",["OwnerShipCategory"]),[Z,X]=n.useState(null==P||null===(y=P.owners)||void 0===y?void 0:y.isCorrespondenceAddress);function J(e,t){let n="";var l,o;!0===e.target.checked&&(n=((e,t)=>(null!=e&&e.houseDoorNo?(null==e?void 0:e.houseDoorNo)+", ":"")+" "+(null!=e&&e.buildingColonyName?(null==e?void 0:e.buildingColonyName)+", ":"")+(null!=e&&e.landmarkName?(null==e?void 0:e.landmarkName)+", ":"")+t(null==e?void 0:e.locality.i18nkey)+", "+t(null==e?void 0:e.cityCode.i18nKey)+","+(t(null==e?void 0:e.pincode)?""+e.pincode:" "))(R?null==P||null===(l=P.searchResult)||void 0===l||null===(o=l.property)||void 0===o?void 0:o.locationDet:null==P?void 0:P.locationDet,b)),ae("permanentAddress",t,n),ae("isCoresAddr",t,e.target.checked)}const Q=[{name:"HUSBAND",code:"HUSBAND",i18nKey:"PT_RELATION_HUSBAND"},{name:"Father",code:"FATHER",i18nKey:"PT_RELATION_FATHER"}],{control:ee,formState:{errors:te,touched:ne},trigger:le,watch:oe,clearErrors:ie}=u.useForm(),re=oe();n.useEffect(()=>{let e=!1;const t={};F.map(n=>{Object.keys(n).forEach(e=>{t[e]=null==re?void 0:re[e]}),m.isEqual(t,n)||Object.keys(n).forEach(t=>{n[t]?(e=!1,ie(t)):e=!0})}),e?I(null==T?void 0:T.key,{type:te}):O(null==T?void 0:T.key),le(),U(e),C(null==T?void 0:T.key,F.map(e=>d({},e,{ownershipCategory:null==x?void 0:x.value})))},[F]),n.useEffect(()=>{var e;Object.keys(te).length&&!m.isEqual((null===(e=N.errors[T.key])||void 0===e?void 0:e.type)||{},te)?I(T.key,{type:te}):!Object.keys(te).length&&N.errors[T.key]&&B&&O(T.key)},[te]);const ae=function(e,t,n){void 0===e&&(e="name"),void 0===t&&(t=0),void 0===n&&(n=""),k(F.map((l,o)=>(o===t&&(l[e]=n),d({},l))))},ue=n.useMemo(()=>{var e,t;const n=null==x?void 0:x.code,l=null==$||null===(e=$.PropertyTax)||void 0===e||null===(t=e.OwnerShipCategory)||void 0===t?void 0:t.filter(e=>{var t;return(null==e||null===(t=e.code)||void 0===t?void 0:t.split(".")[0])==(null==n?void 0:n.split(".")[0])}),o=null==l?void 0:l.filter(e=>{var t,n;return null==e||null===(t=e.code)||void 0===t||null===(n=t.split("."))||void 0===n?void 0:n[1]});return null==o?void 0:o.map(e=>{var t,n,l,o,i;return(null===(t=e.code)||void 0===t||null===(n=t.split("."))||void 0===n?void 0:n[1])&&d({},e,{i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null===(l=e.code)||void 0===l||null===(o=l.split("."))||void 0===o||null===(i=o[1])||void 0===i?void 0:i.replaceAll(".","_"))})})},[$,null==x?void 0:x.code]),de={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},se=!(null==x||null===(_=x.code)||void 0===_||!_.includes("MULTIPLEOWNERS")),ce=null==x||null===(g=x.code)||void 0===g?void 0:g.includes("INSTITUTIONAL");return l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:""},b("TL_NEW_OWNER_DETAILS_OWNERSHIP_TYPE_LABEL")+"*"),l.createElement(u.Controller,{name:"ownershipCategory",defaultValue:x,control:ee,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return l.createElement(t.Dropdown,{className:"form-field",selected:n,option:q,select:e=>{var t;(null==e||null===(t=e.code)||void 0===t||!t.includes("MULTIPLEOWNERS"))&&(null==F?void 0:F.length)>1&&k([...F.filter((e,t)=>0==t)]),o(e),M(e)},optionKey:"i18nKey",onBlur:i,t:b})}})),null==F?void 0:F.map((e,n)=>{var o,i,r,a,d,s,c,p,v,m,f,E,y,_,g,h,S,T,C,A;return l.createElement("div",{style:{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",boxSizing:"border-box",margin:"16px 0px",padding:"16px 8px"}},L&&se&&F.length>1&&l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement(t.LinkButton,{label:l.createElement(t.DeleteIcon,{style:{bottom:"5px"},fill:1!=F.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{k([...F.filter((e,t)=>t!=n)])}})),ce?l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_INSTITUTION_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"institutionName"+n,name:"institutionName"+n,defaultValue:null==e?void 0:e.institutionName,control:ee,rules:{required:b("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]*$/i.test(e)||b("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"institutionName"+n,value:o,onChange:e=>{i(e.target.value),ae("institutionName",n,e.target.value)},disable:W||V,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["institutionName"+n]?null==te||null===(o=te["institutionName"+n])||void 0===o?void 0:o.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:""},b("PT_INSTITUTION_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"institutionType"+n,name:"institutionType"+n,defaultValue:null==e?void 0:e.institutionType,control:ee,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.Dropdown,{selected:1===(null==ue?void 0:ue.length)?G[0]:o,disable:1===(null==ue?void 0:ue.length)||w,option:ue?ue.sort((e,t)=>e.name.localeCompare(t.name)):[],select:e=>{i(e),ae("institutionType",n,e)},optionKey:"i18nKey",t:b,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["institutionType"+n]?null==te||null===(i=te["institutionType"+n])||void 0===i?void 0:i.message:""),l.createElement(t.CardSectionHeader,null,b("TL_AUTHORIZED_PERSON_DETAILS")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_OWNER_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"name"+n,name:"name"+n,defaultValue:null==e?void 0:e.name,control:ee,rules:{required:b("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]+$/i.test(e)||b("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name"+n,value:o,onChange:e=>{i(e.target.value),ae("name",n,e.target.value)},disable:W||V,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["name"+n]?null==te||null===(r=te["name"+n])||void 0===r?void 0:r.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_LANDLINE_NUMBER_FLOATING_LABEL")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"altContactNumber"+n,name:"altContactNumber"+n,defaultValue:e.altContactNumber,control:ee,rules:{required:b("REQUIRED_FIELD"),validate:e=>!!/^[0-9]{11}$/i.test(e)||b("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.MobileNumber,{type:"text",t:b,maxLength:11,value:o,name:"altContactNumber"+n,onChange:e=>{i(e),ae("altContactNumber",n,e)},disable:W||V,labelStyle:{border:"1px solid #000",borderRight:"none"},onBlur:r})}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["altContactNumber"+n]?null==te||null===(a=te["altContactNumber"+n])||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_MOBILE_NUMBER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"mobileNumber"+n,name:"mobileNumber"+n,defaultValue:e.mobileNumber,control:ee,rules:{required:b("REQUIRED_FIELD"),validate:e=>!!/[6-9]{1}[0-9]{9}/i.test(e)||b("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.MobileNumber,{value:o,name:"mobileNumber"+n,onChange:e=>{i(e),ae("mobileNumber",n,e)},disable:W||V,labelStyle:{border:"1px solid #000",borderRight:"none"},onBlur:r})}})),!L&&l.createElement("div",{style:{display:"flex",justifyContent:"flex-end",width:"20%",alignSelf:"flex-start"}},se&&l.createElement(t.LinkButton,{label:l.createElement(t.DeleteIcon,{style:{bottom:"0px"},fill:1!=F.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{k([...F.filter((e,t)=>t!=n)])}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["mobileNumber"+n]?null==te||null===(d=te["mobileNumber"+n])||void 0===d?void 0:d.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("TL_NEW_DESIG_OWNER_LABEL")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"designation"+n,name:"designation"+n,defaultValue:null==e?void 0:e.designation,control:ee,rules:{required:b("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]*$/i.test(e)||b("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"designation"+n,value:o,onChange:e=>{i(e.target.value),ae("designation",n,e.target.value)},disable:W||V,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["designation"+n]?null==te||null===(s=te["designation"+n])||void 0===s?void 0:s.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_CORRESPONDANCE_ADDRESS")),l.createElement("div",{className:"form-field"},l.createElement(t.TextArea,{isMandatory:!1,optionKey:"i18nKey",t:b,disabled:!0===(null==F||null===(c=F[n])||void 0===c?void 0:c.isCoresAddr),name:"address"+n,onChange:e=>{var t;!0!==(null==F||null===(t=F[n])||void 0===t?void 0:t.isCoresAddr)&&ae("permanentAddress",n,e.target.value)},value:null==F||null===(p=F[n])||void 0===p?void 0:p.permanentAddress}))),l.createElement(t.CheckBox,{className:"form-field",label:""+b("PT_COMMON_SAME_AS_PROPERTY_ADDRESS"),onChange:e=>J(e,n),value:null==F||null===(v=F[n])||void 0===v?void 0:v.isCoresAddr,checked:(null==F||null===(m=F[n])||void 0===m?void 0:m.isCoresAddr)||!1,style:window.location.href.includes("/citizen/")?{paddingTop:"10px"}:{}})):l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_MOBILE_NUMBER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"mobileNumber"+n,name:"mobileNumber"+n,defaultValue:e.mobileNumber,control:ee,rules:{required:b("REQUIRED_FIELD"),validate:e=>!!/[6-9]{1}[0-9]{9}/i.test(e)||b("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.MobileNumber,{value:o,name:"mobileNumber"+n,onChange:e=>{i(e),ae("mobileNumber",n,e)},disable:W||V,labelStyle:{border:"1px solid #000",borderRight:"none"},onBlur:r})}})),!L&&l.createElement("div",{style:{display:"flex",justifyContent:"flex-end",width:"20%",alignSelf:"flex-start"}},se&&l.createElement(t.LinkButton,{label:l.createElement(t.DeleteIcon,{style:{bottom:"0px"},fill:1!=F.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{k([...F.filter((e,t)=>t!=n)])}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["mobileNumber"+n]?null==te||null===(f=te["mobileNumber"+n])||void 0===f?void 0:f.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_OWNER_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"name"+n,name:"name"+n,defaultValue:null==e?void 0:e.name,control:ee,rules:{required:b("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]+$/i.test(e)||b("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name"+n,value:o,onChange:e=>{i(e.target.value),ae("name",n,e.target.value)},disable:W||V,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["name"+n]?null==te||null===(E=te["name"+n])||void 0===E?void 0:E.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_GENDER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"gender"+n,name:"gender"+n,defaultValue:null==e?void 0:e.gender,control:ee,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.RadioOrSelect,{name:"gender"+n,options:K,selectedOption:o,optionKey:"code",onSelect:e=>{i(e),ae("gender",n,e)},t:b,disabled:W||V,isDropDown:!!window.location.href.includes("/employee"),onBlur:r})}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["gender"+n]?null==te||null===(y=te["gender"+n])||void 0===y?void 0:y.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_GUARDIAN_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"fatherOrHusbandName"+n,name:"fatherOrHusbandName"+n,defaultValue:null==e?void 0:e.fatherOrHusbandName,control:ee,rules:{required:b("REQUIRED_FIELD"),validate:e=>!!/^[a-zA-Z ]+$/i.test(e)||b("PT_NAME_ERROR_MESSAGE")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.TextInput,{t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherOrHusbandName"+n,value:o,onChange:e=>{i(e.target.value),ae("fatherOrHusbandName",n,e.target.value)},disable:W||V,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["fatherOrHusbandName"+n]?null==te||null===(_=te["fatherOrHusbandName"+n])||void 0===_?void 0:_.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_RELATIONSHIP")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"relationship"+n,name:"relationship"+n,defaultValue:null==e?void 0:e.relationship,control:ee,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.RadioOrSelect,{name:"relationship"+n,options:Q,selectedOption:o,optionKey:"i18nKey",onSelect:e=>{i(e),ae("relationship",n,e)},t:b,disabled:W||V,isDropDown:!!window.location.href.includes("/employee"),onBlur:r})}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["relationship"+n]?null==te||null===(g=te["relationship"+n])||void 0===g?void 0:g.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:""},b("PT_SPECIAL_APPLICANT_CATEGORY")+"*"),l.createElement("div",{className:"form-field"},l.createElement(u.Controller,{key:"ownerType"+n,name:"ownerType"+n,defaultValue:null==e?void 0:e.ownerType,control:ee,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.Dropdown,{selected:1===(null==G?void 0:G.length)?G[0]:o,disable:1===(null==G?void 0:G.length)||w,option:G?G.sort((e,t)=>e.name.localeCompare(t.name)):[],select:e=>{i(e),ae("ownerType",n,e)},optionKey:"i18nKey",t:b,onBlur:r})}}))),l.createElement(t.CardLabelError,{style:de},null!=ne&&ne["ownerType"+n]?null==te||null===(h=te["ownerType"+n])||void 0===h?void 0:h.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_CORRESPONDANCE_ADDRESS")),l.createElement("div",{className:"form-field"},l.createElement(t.TextArea,{isMandatory:!1,optionKey:"i18nKey",t:b,disabled:!0===(null==F||null===(S=F[n])||void 0===S?void 0:S.isCoresAddr),name:"address"+n,onChange:e=>{var t;!0!==(null==F||null===(t=F[n])||void 0===t?void 0:t.isCoresAddr)&&ae("permanentAddress",n,e.target.value)},value:null==F||null===(T=F[n])||void 0===T?void 0:T.permanentAddress}))),l.createElement(t.CheckBox,{className:"form-field",label:""+b("PT_COMMON_SAME_AS_PROPERTY_ADDRESS"),onChange:e=>J(e,n),value:null==F||null===(C=F[n])||void 0===C?void 0:C.isCoresAddr,checked:(null==F||null===(A=F[n])||void 0===A?void 0:A.isCoresAddr)||!1,style:window.location.href.includes("/citizen/")?{paddingTop:"10px"}:{}})))}),se?l.createElement("div",null,l.createElement("div",{style:{display:"flex",paddingBottom:"15px",color:"#FF8C00"}},l.createElement("button",{type:"button",style:{paddingTop:"10px"},onClick:()=>k(e=>[...e,{name:"",gender:"",mobileNumber:"",fatherOrHusbandName:"",relationship:"",ownershipCategory:x,ownerType:"",permanentAddress:"",email:"",isCoresAddr:!1}])},b("PT_COMMON_ADD_APPLICANT_LABEL"))),l.createElement(t.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-35px"}},b((null===(h=N.errors)||void 0===h||null===(S=h.mulipleOwnerError)||void 0===S?void 0:S.message)||""))):null)},CPTKnowYourProperty:e=>{var o,i;let{t:r,config:a,onSelect:u,formData:s}=e;const[c,p]=n.useState(null===(o=s)||void 0===o||null===(i=o.PropDetails)||void 0===i?void 0:i.KnowProperty);return(window.location.href.includes("/tl/tradelicence/edit-application/")||window.location.href.includes("/renew-trade/"))&&(s=d({},s,JSON.parse(sessionStorage.getItem("EditFormData")))),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(bo,null):null,l.createElement(t.FormStep,{t:r,config:a,onSelect:function(){sessionStorage.setItem("KnowProperty",c.i18nKey),u(a.key,{KnowProperty:c})},onSkip:()=>u(),isDisabled:!c},l.createElement(t.RadioButtons,{t:r,optionsKey:"i18nKey",isMandatory:a.isMandatory,options:[{i18nKey:"TL_COMMON_YES",code:"YES"},{i18nKey:"TL_COMMON_NO",code:"NO"}],selectedOption:c,onSelect:function(e){p(e)}})))},CPTPropertyDetails:e=>{var n,o,i,a,u,s,c,p,v,m,f,E,y,g,h,S,b,T,C,A,P,N,I,O,D,w,R,L,x,M,F,k,B,U,j,H,W,V,z,Y,K,q,G,$,Z,X,J,Q,ee,te,ne,le,oe,ie,re,ae,ue,de,se,ce,pe,ve,me,fe,Ee;let{t:ye,config:_e,onSelect:ge,formData:he}=e;const Se=("YES"===(null===(n=he)||void 0===n||null===(o=n.knowyourproperty)||void 0===o||null===(i=o.KnowProperty)||void 0===i?void 0:i.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(a=he)||void 0===a||null===(u=a.cptSearchQuery)||void 0===u?void 0:u.city:null===(s=he)||void 0===s||null===(c=s.cpt)||void 0===c||null===(p=c.details)||void 0===p?void 0:p.tenantId)||Digit.ULBService.getCitizenCurrentTenant();if(window.location.href.includes("/tl/tradelicence/edit-application/")||window.location.href.includes("/renew-trade/")&&JSON.parse(sessionStorage.getItem("EditFormData"))){let e=JSON.parse(sessionStorage.getItem("EditFormData"));he=d({},he,e)}const{isLoading:be,data:Te}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:null!==(v=he)&&void 0!==v&&null!==(m=v.cptId)&&void 0!==m&&m.id||null!==(f=he)&&void 0!==f&&null!==(E=f.cpt)&&void 0!==E&&null!==(y=E.details)&&void 0!==y&&y.propertyId?"YES"===(null===(g=he)||void 0===g||null===(h=g.knowyourproperty)||void 0===h||null===(S=h.KnowProperty)||void 0===S?void 0:S.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(b=he)||void 0===b||null===(T=b.cptId)||void 0===T?void 0:T.id:null===(C=he)||void 0===C||null===(A=C.cpt)||void 0===A||null===(P=A.details)||void 0===P?void 0:P.propertyId:window.location.href.includes("/tl/tradelicence/edit-application")||window.location.href.includes("/renew-trade/")?null===(N=he)||void 0===N||null===(I=N.tradeLicenseDetail)||void 0===I||null===(O=I.additionalDetail)||void 0===O?void 0:O.propertyId:(null===(D=he)||void 0===D||null===(w=D.cptId)||void 0===w?void 0:w.id)||(null===(R=he)||void 0===R||null===(L=R.cpt)||void 0===L||null===(x=L.details)||void 0===x?void 0:x.propertyId)},tenantId:Se,privacy:Digit.Utils.getPrivacyObject()},{filters:{propertyIds:null!==(M=he)&&void 0!==M&&null!==(F=M.cptId)&&void 0!==F&&F.id||null!==(k=he)&&void 0!==k&&null!==(B=k.cpt)&&void 0!==B&&null!==(U=B.details)&&void 0!==U&&U.propertyId?"YES"===(null===(j=he)||void 0===j||null===(H=j.knowyourproperty)||void 0===H||null===(W=H.KnowProperty)||void 0===W?void 0:W.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(V=he)||void 0===V||null===(z=V.cptId)||void 0===z?void 0:z.id:null===(Y=he)||void 0===Y||null===(K=Y.cpt)||void 0===K||null===(q=K.details)||void 0===q?void 0:q.propertyId:window.location.href.includes("/tl/tradelicence/edit-application")||window.location.href.includes("/renew-trade/")?null===(G=he)||void 0===G||null===($=G.tradeLicenseDetail)||void 0===$||null===(Z=$.additionalDetail)||void 0===Z?void 0:Z.propertyId:(null===(X=he)||void 0===X||null===(J=X.cptId)||void 0===J?void 0:J.id)||(null===(Q=he)||void 0===Q||null===(ee=Q.cpt)||void 0===ee||null===(te=ee.details)||void 0===te?void 0:te.propertyId)},tenantId:Se,privacy:Digit.Utils.getPrivacyObject()}),Ce=()=>{sessionStorage.setItem("cpt",null==Te?void 0:Te.Properties[0]),ge("cpt",{details:null==Te?void 0:Te.Properties[0]})},Ae=Array.isArray(null==Te||null===(ne=Te.Properties)||void 0===ne||null===(le=ne[0])||void 0===le?void 0:le.owners)?null==Te||null===(oe=Te.Properties)||void 0===oe||null===(ie=oe[0])||void 0===ie?void 0:ie.owners.slice().reverse():[];let Pe=[];var Ne,Ie,Oe,De,we,Re,Le,xe,Me,Fe,ke,Be,Ue,je,He,We,Ve,ze,Ye,Ke,qe,Ge,$e,Ze,Xe,Je,Qe,et,tt,nt,lt,ot,it,rt,at;return Te&&null!=Te&&Te.Properties.length&&(null!=Te&&null!==(Ne=Te.Properties[0])&&void 0!==Ne&&null!==(Ie=Ne.address)&&void 0!==Ie&&Ie.doorNo&&Pe.push(null==Te||null===(He=Te.Properties[0])||void 0===He||null===(We=He.address)||void 0===We?void 0:We.doorNo),(null!=Te&&null!==(Oe=Te.Properties[0])&&void 0!==Oe&&null!==(De=Oe.address)&&void 0!==De&&De.street||null!=Te&&null!==(we=Te.Properties[0])&&void 0!==we&&null!==(Re=we.address)&&void 0!==Re&&Re.buildingName)&&Pe.push((null==Te||null===(Ve=Te.Properties[0])||void 0===Ve||null===(ze=Ve.address)||void 0===ze?void 0:ze.street)||(null==Te||null===(Ye=Te.Properties[0])||void 0===Ye||null===(Ke=Ye.address)||void 0===Ke?void 0:Ke.buildingName)),null!=Te&&null!==(Le=Te.Properties[0])&&void 0!==Le&&null!==(xe=Le.address)&&void 0!==xe&&xe.landmark&&Pe.push(null==Te||null===(qe=Te.Properties[0])||void 0===qe||null===(Ge=qe.address)||void 0===Ge?void 0:Ge.landmark),null!=Te&&null!==(Me=Te.Properties[0])&&void 0!==Me&&null!==(Fe=Me.address)&&void 0!==Fe&&null!==(ke=Fe.locality)&&void 0!==ke&&ke.code&&Pe.push(ye(Digit.Utils.pt.getMohallaLocale(null==Te||null===($e=Te.Properties[0])||void 0===$e||null===(Ze=$e.address)||void 0===Ze||null===(Xe=Ze.locality)||void 0===Xe?void 0:Xe.code,null==Te||null===(Je=Te.Properties[0])||void 0===Je?void 0:Je.tenantId))),null!=Te&&null!==(Be=Te.Properties[0])&&void 0!==Be&&Be.tenantId&&Pe.push(ye(Digit.Utils.pt.getCityLocale(null==Te||null===(Qe=Te.Properties[0])||void 0===Qe?void 0:Qe.tenantId))),null!=Te&&null!==(Ue=Te.Properties[0])&&void 0!==Ue&&null!==(je=Ue.address)&&void 0!==je&&je.pincode&&Pe.push(null==Te||null===(et=Te.Properties[0])||void 0===et||null===(tt=et.address)||void 0===tt?void 0:tt.pincode)),be?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(bo,{currentStep:window.location.href.includes("/ws/")?1:2,flow:window.location.href.includes("/ws/")?"WS":"",businessService:"WS"}):null,l.createElement(t.FormStep,{t:ye,config:_e,onSelect:Ce,onSkip:()=>ge()},Te&&(null==Te?void 0:Te.Properties.length)&&l.createElement(l.Fragment,null,l.createElement(t.CardHeader,null,ye("PT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:ye("PROPERTY_ID"),text:null==Te||null===(re=Te.Properties[0])||void 0===re?void 0:re.propertyId}),l.createElement(t.Row,{className:"border-none",label:ye("OWNER_NAME"),text:null==Ae||null===(ae=Ae[0])||void 0===ae?void 0:ae.name}),l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:ye("PROPERTY_ADDRESS"),text:Pe.join(", "),privacy:{uuid:null==Te||null===(ue=Te.Properties)||void 0===ue||null===(de=ue[0])||void 0===de||null===(se=de.owners)||void 0===se||null===(ce=se[0])||void 0===ce?void 0:ce.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==Te||null===(pe=Te.Properties[0])||void 0===pe?void 0:pe.tenantId,propertyIds:null==Te||null===(ve=Te.Properties[0])||void 0===ve?void 0:ve.propertyId},jsonPath:"Properties[0].address.street",d:e=>(_.get(e,"Properties[0].address.doorNo")?_.get(e,"Properties[0].address.doorNo")+", ":"")+(_.get(e,"Properties[0].address.street")?_.get(e,"Properties[0].address.street")+", ":"")+(_.get(e,"Properties[0].address.landmark")?""+_.get(e,"Properties[0].address.landmark"):""),isArray:!1}}}),l.createElement(t.Row,{className:"border-none",label:ye("PT_MUTATION_STATUS"),text:ye(null==Te||null===(me=Te.Properties[0])||void 0===me?void 0:me.status)}),l.createElement("div",{style:{textAlign:"left"}},l.createElement(r.Link,{to:"/digit-ui/citizen/commonpt/view-property?propertyId="+(null==Te||null===(fe=Te.Properties[0])||void 0===fe?void 0:fe.propertyId)+"&tenantId="+(null==Te||null===(Ee=Te.Properties[0])||void 0===Ee?void 0:Ee.tenantId)},l.createElement(t.LinkButton,{style:{textAlign:"left"},label:ye("PT_VIEW_MORE_DETAILS")})),l.createElement(r.Link,{to:window.location.href.includes("/ws/modify-connection/")?"/digit-ui/citizen/ws/modify-connection/"+(null===(nt=he)||void 0===nt?void 0:nt.tenantId)+"/search-property":window.location.href.includes("/ws/edit-application/")?"/digit-ui/citizen/ws/edit-application/"+(null===(lt=he)||void 0===lt?void 0:lt.tenantId)+"/search-property":window.location.href.includes("/ws/")?"/digit-ui/citizen/ws/create-application/search-property":window.location.href.includes("/renew-trade/")?"/digit-ui/citizen/tl/tradelicence/renew-trade/"+(null===(ot=he)||void 0===ot?void 0:ot.applicationNumber)+"/"+(null===(it=he)||void 0===it?void 0:it.tenantId)+"/know-your-property":window.location.href.includes("/edit-application/")?"/digit-ui/citizen/tl/tradelicence/edit-application/"+(null===(rt=he)||void 0===rt?void 0:rt.applicationNumber)+"/"+(null===(at=he)||void 0===at?void 0:at.tenantId)+"/know-your-property":"/digit-ui/citizen/tl/tradelicence/new-application/know-your-property"},l.createElement(t.LinkButton,{style:{textAlign:"left"},label:ye("PT_CHANGE_PROPERTY"),onClick:()=>{sessionStorage.setItem("changePropertySelected","yes"),sessionStorage.setItem("EditFormData",JSON.stringify(he))}})))),l.createElement(t.SubmitBar,{style:{marginTop:"10px"},onSubmit:Ce,label:ye("CS_COMMON_NEXT")}))))},CPTPropertySearchNSummary:e=>{var i,a,u,s,c,p,v,f,E,y,_,g,h;let{config:S,onSelect:b,formData:T}=e;const{t:C}=o.useTranslation(),A=r.useHistory();let{pathname:P,state:N}=r.useLocation();N=N&&("string"==typeof N||N instanceof String)?JSON.parse(N):N;const I=P.includes("/modify-application/"),O=Digit.ULBService.getCurrentTenantId(),D=window.location.href.includes("/employee/tl/new-application"),w=window.location.href.includes("/employee/tl/renew-application-details")||window.location.href.includes("/employee/tl/edit-application-details"),R=r.useLocation().search,L=new URLSearchParams(R).get("propertyId"),[x,M]=n.useState((null==T||null===(i=T.cptId)||void 0===i?void 0:i.id)||("null"!==L?L:"")||""),[F,k]=n.useState("null"!==L?L:""),[B,U]=n.useState(null),j=window.Digit.Utils.browser.isMobile(),H=window.location.href.includes("?")?window.location.href.substring(window.location.href.indexOf("?")+1,window.location.href.length):"",{isLoading:W,error:V,data:z}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:F},tenantId:O},{filters:{propertyIds:F},tenantId:O,enabled:!!F,privacy:Digit.Utils.getPrivacyObject()});if(n.useEffect(()=>{x&&(window.location.href.includes("/renew-application-details/")||window.location.href.includes("/edit-application-details/"))&&k(x)},[x]),n.useEffect(()=>{var e;(0==W&&V&&1==V||0==(null==z||null===(e=z.Properties)||void 0===e?void 0:e.length))&&U({error:!0,label:"PT_ENTER_VALID_PROPERTY_ID"})},[V,z]),n.useEffect(()=>{b("cpt",{details:null==z?void 0:z.Properties[0]}),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(null==z?void 0:z.Properties[0])),localStorage.setItem("pgrProperty",JSON.stringify(null==z?void 0:z.Properties[0]))},[z,P]),I)return l.createElement(l.Fragment,null);const Y=window.location.pathname;let K="";var q,G,$,Z,X;return z&&null!=z&&z.Properties.length&&(K=((e,t)=>(null!=e&&e.doorNo?(null==e?void 0:e.doorNo)+", ":"")+" "+(null!=e&&e.street?(null==e?void 0:e.street)+", ":"")+(null!=e&&e.landmark?(null==e?void 0:e.landmark)+", ":"")+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)?", "+e.pincode:" "))(null==z||null===(q=z.Properties[0])||void 0===q?void 0:q.address,C)),window.location.href.includes("/ws/"),l.createElement(l.Fragment,null,(!window.location.href.includes("/tl/")||!("MOVABLE"===(null==T||null===(a=T.tradedetils)||void 0===a||null===(u=a[0])||void 0===u||null===(s=u.structureType)||void 0===s?void 0:s.code))&&(D||w))&&l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller",style:window.location.href.includes("/ws/")?{fontWeight:"700"}:{}},""+C("PROPERTY_ID")),l.createElement("div",{className:"field",style:{marginTop:"20px",display:"flex"}},l.createElement(t.TextInput,{key:S.key,value:x,onChange:e=>{M(e.target.value),b(S.key,{id:e.target.value})},style:{width:"80%",float:"left",marginRight:"20px"}}),l.createElement("button",{className:"submit-bar",type:"button",style:{color:"white"},onClick:()=>{if(x||U({error:!0,label:"PT_ENTER_PROPERTY_ID_AND_SEARCH"}),k(x),window.location.pathname.includes("/tl/new-application")){A.push("/digit-ui/employee/tl/new-application?propertyId="+x);const e=1600;setTimeout(()=>window.scrollTo(0,e),0)}else window.location.pathname.includes("/ws/new-application")&&A.push("/digit-ui/employee/ws/new-application?propertyId="+x)}},""+C("PT_SEARCH")))),l.createElement("span",{onClick:()=>A.push("/digit-ui/employee/commonpt/search?redirectToUrl="+Y+"&"+H,d({},N))},l.createElement(t.LinkButton,{label:C("CPT_SEARCH_PROPERTY"),style:{color:"#a82227",display:"inline-block"}}))," | ",l.createElement("span",{onClick:()=>A.push("/digit-ui/employee/commonpt/new-application?redirectToUrl="+Y+"&"+H,d({},N))},l.createElement(t.LinkButton,{label:C("CPT_CREATE_PROPERTY"),style:{color:"#a82227",display:"inline-block"}})),z&&null!=z&&z.Properties.length?l.createElement(l.Fragment,null,l.createElement("header",{className:"card-section-header",style:{marginBottom:"5px",marginTop:"20px"}},C("PT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement("div",{style:j?{}:{maxWidth:"60%"}},l.createElement(t.Row,{className:"border-none",labelStyle:j?{width:"40%"}:{},label:C("PROPERTY_ID"),text:null==z||null===(c=z.Properties[0])||void 0===c?void 0:c.propertyId}),l.createElement(t.Row,{className:"border-none",labelStyle:j?{width:"40%"}:{},label:C("OWNER_NAME"),text:(G=null==z?void 0:z.Properties[0],(null===(Z=(null==G||null===($=G.owners)||void 0===$?void 0:$.filter(e=>null==e?void 0:e.active)).sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}))||void 0===Z||null===(X=Z.map(e=>null==e?void 0:e.name))||void 0===X?void 0:X.join(","))||C("NA"))}),l.createElement(t.Row,{className:"border-none",labelStyle:j?{width:"40%"}:{},textStyle:{wordBreak:"break-word"},label:C("PROPERTY_ADDRESS"),text:K,privacy:{uuid:null==z||null===(p=z.Properties[0])||void 0===p||null===(v=p.owners)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==z||null===(E=z.Properties[0])||void 0===E?void 0:E.tenantId,propertyIds:null==z||null===(y=z.Properties[0])||void 0===y?void 0:y.propertyId},jsonPath:"Properties[0].address.street",d:e=>(m.get(e,"Properties[0].address.doorNo")?m.get(e,"Properties[0].address.doorNo")+", ":"")+(m.get(e,"Properties[0].address.street")?m.get(e,"Properties[0].address.street")+", ":"")+(m.get(e,"Properties[0].address.landmark")?""+m.get(e,"Properties[0].address.landmark"):""),isArray:!1}}}))),l.createElement(r.Link,{to:"/digit-ui/employee/commonpt/view-property?propertyId="+x+"&tenantId="+O+"&from="+(null!==(_=window.location.pathname)&&void 0!==_&&_.includes("employee/ws/new-application")?"ES_COMMON_WS_NEW_CONNECTION":null!==(g=window.location.pathname)&&void 0!==g&&g.includes("employee/ws/modify-application")?"WS_MODIFY_CONNECTION_BUTTON":null!==(h=window.location.pathname)&&void 0!==h&&h.includes("employee/tl/new-application")?"ES_TITLE_NEW_TRADE_LICESE_APPLICATION":"WF_EMPLOYEE_NEWTL_RENEWAL_SUBMIT_BUTTON")},l.createElement(t.LinkButton,{label:C("CPT_COMPLETE_PROPERTY_DETAILS"),style:{color:"#a82227",textAlign:"Left"}}))):null,B&&l.createElement(t.Toast,{isDleteBtn:!0,labelstyle:{width:"100%"},error:B.error,warning:B.warning,label:C(B.label),onClose:()=>{U(null)}})))},CPTSearchResults:Ce,CPTCreateProperty:f,CPTAcknowledgement:A},Co=e=>{let{stateCode:t,userType:n,tenants:o}=e;const{path:i,url:a}=r.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"PT",language:u}),Object.entries(To).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("PT_TENANTS",o),"employee"===n?l.createElement(_o,{path:i,url:a,userType:n}):l.createElement(vo,{stateCode:t})},Ao=e=>{let{matchPath:i}=e;const{t:r}=o.useTranslation(),[a,u,d]=Digit.Hooks.useSessionStorage("CPT_CREATE_PROPERTY",{});n.useEffect(()=>{d()},[]);const s=[{link:i+"/property/citizen-search",i18nKey:r("PT_SEARCH_AND_PAY")},{link:i+"/property/new-application",i18nKey:r("PT_CREATE_PROPERTY")}];return l.createElement(t.CitizenHomeCard,{header:r("ACTION_TEST_COMMON_PROPERTY_TAX"),links:s,Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})},Po=d({CommonPTCardTemp:()=>{var e;const{t:n}=o.useTranslation();if(!Digit.Utils.ptAccess())return null;const i={Icon:l.createElement(t.PropertyHouse,null),moduleName:n("ACTION_TEST_COMMON_PROPERTY_TAX"),links:[{label:n("PT_SEARCH_AND_PAY"),link:"/digit-ui/employee/commonpt/search"}]};return!Digit.UserService.hasAccess(["PT_CEMP"])||null!==(e=i.links)&&void 0!==e&&e[1]||i.links.push({label:n("PT_CREATE_PROPERTY"),link:"/digit-ui/employee/commonpt/new-application"}),l.createElement(t.EmployeeModuleCard,i)},CommonPTModule:Co,CommonPTLinksTemp:Ao},To);exports.CommonPTComponents=Po,exports.CommonPTLinks=Ao,exports.CommonPTModule=Co,exports.initCommonPTComponents=()=>{Object.entries(Po).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@djb25/digit-ui-module-commonpt",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Digit PT Light weight Module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.modern.js",
|
|
8
|
+
"source": "src/Module.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"start": "microbundle-crl watch --no-compress --format modern,cjs",
|
|
14
|
+
"build": "microbundle-crl --compress --no-sourcemap --format cjs",
|
|
15
|
+
"prepublish": "yarn build"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"react": "17.0.2",
|
|
19
|
+
"react-router-dom": "5.3.0"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@djb25/digit-ui-react-components": "1.0.0",
|
|
23
|
+
"microbundle-crl": "^0.13.11",
|
|
24
|
+
"lodash.merge": "^4.6.2",
|
|
25
|
+
"react": "17.0.2",
|
|
26
|
+
"react-dom": "17.0.2",
|
|
27
|
+
"react-hook-form": "6.15.8",
|
|
28
|
+
"react-i18next": "11.16.2",
|
|
29
|
+
"react-query": "3.6.1",
|
|
30
|
+
"react-router-dom": "5.3.0"
|
|
31
|
+
}
|
|
32
|
+
}
|